/* ============================================================
   Care im Quartier — Design System & Layout
   Brand-aligned per docs/styleguide.html (Corporate Identity feature 012)
   ============================================================ */

/* --- Brand Token Catalogue --- */
/* Source of truth: docs/styleguide.html §13 + specs/012-corporate-identity/contracts/css-token-api.md */
:root {
    /* Brand palette */
    --ciq-dark-teal: #2F6566;
    --ciq-teal: #51B0A6;
    --ciq-teal-hover: #3D9A90;
    --ciq-teal-light: #9BF8EE;
    --ciq-lime: #B9D933;
    --ciq-lime-hover: #A4C42A;
    --ciq-coral: #E77051;
    --ciq-coral-hover: #D45E3F;
    --ciq-coral-light: #FFACA5;

    /* Neutrals */
    --ciq-black: #000000;
    --ciq-near-black: #181818;
    --ciq-dark-gray: #3E3E3E;
    --ciq-medium-gray: #7C7C7C;
    --ciq-gray: #BABABA;
    --ciq-light-gray: #C5C5C5;
    --ciq-bg: #F8F8F8;
    --ciq-white: #FFFFFF;
    --ciq-border: #E5E7EB;
    --ciq-border-light: #F0F0F0;

    /* Typography */
    --ciq-font-heading: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --ciq-font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;

    /* Layout */
    --ciq-radius-sm: 4px;
    --ciq-radius-md: 6px;
    --ciq-radius-lg: 8px;
    --ciq-radius-xl: 12px;
    --ciq-radius-full: 9999px;
    --ciq-shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --ciq-shadow-md: 0 1px 3px rgba(0,0,0,0.06);
    --ciq-shadow-lg: 0 4px 24px rgba(0,0,0,0.08);
    --ciq-transition: 0.15s ease;
}

/* --- Self-hosted Plus Jakarta Sans (Fontsource v5.2.8, OFL-1.1) --- */
/* See src/Web/wwwroot/fonts/OFL.txt for the licence. No third-party CDN. */
@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/plus-jakarta-sans-400-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/plus-jakarta-sans-400-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/fonts/plus-jakarta-sans-500-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/fonts/plus-jakarta-sans-500-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/fonts/plus-jakarta-sans-600-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/fonts/plus-jakarta-sans-600-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/fonts/plus-jakarta-sans-700-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/fonts/plus-jakarta-sans-700-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url('/fonts/plus-jakarta-sans-800-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url('/fonts/plus-jakarta-sans-800-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--ciq-font-body);
    font-size: 16px;
    line-height: 1.55;
    color: var(--ciq-near-black);
    background-color: var(--ciq-bg);
}

/* --- Typography --- */
h1 { margin: 0 0 1.25rem; font-family: var(--ciq-font-heading); font-size: 1.75rem; font-weight: 800; line-height: 1.3; color: var(--ciq-near-black); }
h2 { margin: 0 0 0.75rem; font-family: var(--ciq-font-heading); font-size: 1.25rem; font-weight: 800; line-height: 1.35; color: var(--ciq-near-black); }
h3 { margin: 0 0 0.5rem; font-family: var(--ciq-font-heading); font-size: 1.05rem; font-weight: 700; line-height: 1.4; color: var(--ciq-dark-gray); }
h4 { margin: 0 0 0.5rem; font-family: var(--ciq-font-heading); font-size: 1rem; font-weight: 700; line-height: 1.4; color: var(--ciq-dark-gray); }

/* --- Layout Shell --- */
.layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.layout-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1.5rem;
    background-color: #fff;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.brand-text {
    font-family: var(--ciq-font-heading);
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--ciq-dark-teal);
}

.header-brand {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
}

.header-quartier {
    color: #666;
    font-weight: 400;
    font-size: 0.95rem;
    margin-left: 0.5rem;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-name {
    font-size: 0.875rem;
    color: #666;
}

.btn-logout {
    background: none;
    border: 1px solid #d1d5db;
    padding: 0.3rem 0.75rem;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.825rem;
    color: #555;
    transition: background-color 0.15s, border-color 0.15s;
}
.btn-logout:hover { background-color: #f3f4f6; border-color: #9ca3af; }

.layout-body {
    display: flex;
    flex: 1;
}

.layout-nav {
    width: 220px;
    min-width: 220px;
    background-color: #fff;
    border-right: 1px solid #e5e7eb;
    padding: 1rem 0;
}

.layout-content {
    flex: 1;
    padding: 1.5rem 2rem;
    max-width: 100%;
    overflow-x: hidden;
}

/* --- Footer (Lastenheft POC-085) --- */
.layout-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background-color: #fff;
    border-top: 1px solid var(--ciq-border);
    color: var(--ciq-medium-gray);
    font-size: 0.825rem;
}
.footer-brand {
    font-family: var(--ciq-font-heading);
    font-weight: 600;
    color: var(--ciq-dark-teal);
}
.footer-sep {
    color: var(--ciq-gray);
}
.footer-link {
    color: var(--ciq-dark-teal);
    text-decoration: none;
    transition: color var(--ciq-transition);
}
.footer-link:hover,
.footer-link:focus {
    color: var(--ciq-teal);
    text-decoration: underline;
}

/* --- Navigation --- */
.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.nav-item { margin: 0; }
.nav-item a {
    display: block;
    padding: 0.45rem 1.5rem;
    color: #444;
    text-decoration: none;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.nav-item a:hover,
.nav-item a.active {
    background-color: rgba(81, 176, 166, 0.1);
    color: var(--ciq-dark-teal);
    border-left-color: var(--ciq-teal);
}

/* --- Page Container --- */
.page-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* --- Page Header --- */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}
.page-header h1 { margin: 0; }
.page-header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

/* --- Section Cards --- */
.section-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.section-card[style*="border:2px"] {
    /* Preserve explicit dialog borders */
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.section-subtitle {
    font-size: 0.95rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 0.75rem;
}

/* --- Meta Info Bar --- */
.meta-bar {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    font-size: 0.825rem;
    color: #888;
    padding: 0.6rem 1rem;
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    margin-bottom: 1.25rem;
}
.meta-bar code {
    font-size: 0.8rem;
    background: #f0f0f0;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
}

/* --- Form Grid --- */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem 1.5rem;
}
@media (max-width: 768px) {
    .form-grid { grid-template-columns: 1fr; }
}

.form-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem 1.5rem;
}
@media (max-width: 768px) {
    .form-grid-3 { grid-template-columns: 1fr; }
}

/* --- Form Group --- */
.form-group {
    margin-bottom: 0;
}
.form-group label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: #444;
}

/* Consistent input styling (for raw HTML inputs alongside Radzen).
   Applies to any bare <input>/<textarea>/<select> inside .form-group
   AND to anything explicitly tagged with .form-control. */
.form-control,
.form-group > input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.form-group > textarea,
.form-group > select {
    width: 100%;
    padding: 0.45rem 0.65rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.9rem;
    font-family: inherit;
    color: #333;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus,
.form-group > input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):focus,
.form-group > textarea:focus,
.form-group > select:focus {
    outline: none;
    border-color: var(--ciq-teal);
    box-shadow: 0 0 0 2px rgba(81, 176, 166, 0.2);
}
.form-control[readonly],
.form-group > input[readonly]:not([type="checkbox"]):not([type="radio"]) {
    background: #f9fafb;
    color: #666;
}

/* --- Action Bar --- */
.action-bar {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.action-bar .btn-danger,
.action-bar [class*="rz-button-danger"] {
    margin-right: auto;
}

/* --- Buttons (raw HTML — for forms that use native <button>) --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.5rem 1.1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    font-family: inherit;
    font-weight: 500;
    text-align: center;
    transition: background-color 0.15s, box-shadow 0.15s;
    line-height: 1.4;
}
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.8rem; }

.btn-primary {
    background-color: var(--ciq-teal);
    color: var(--ciq-white);
}
.btn-primary:hover { background-color: var(--ciq-teal-hover); }
.btn-primary:disabled { background-color: var(--ciq-gray); cursor: not-allowed; }

.btn-secondary {
    background-color: var(--ciq-bg);
    color: var(--ciq-dark-gray);
    border: 1px solid var(--ciq-border);
}
.btn-secondary:hover { background-color: #EDEDED; }

.btn-danger {
    background-color: var(--ciq-coral);
    color: var(--ciq-white);
}
.btn-danger:hover { background-color: var(--ciq-coral-hover); }

.btn-warning {
    background-color: var(--ciq-coral);
    color: var(--ciq-white);
}
.btn-warning:hover { background-color: var(--ciq-coral-hover); }

.btn-success {
    background-color: var(--ciq-lime);
    color: var(--ciq-dark-teal);
}
.btn-success:hover { background-color: var(--ciq-lime-hover); }

.btn-info {
    background-color: var(--ciq-teal);
    color: var(--ciq-white);
}
.btn-info:hover { background-color: var(--ciq-teal-hover); }

/* Full-width login button */
.btn-primary.btn-block { width: 100%; }

/* --- Alerts --- */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    line-height: 1.45;
}
.alert-error {
    background-color: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}
.alert-warning {
    background-color: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}
.alert-success {
    background-color: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}
.alert-danger {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}
.alert-info {
    background-color: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* --- Tables --- */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.table th {
    text-align: left;
    padding: 0.55rem 0.75rem;
    background: var(--ciq-bg);
    border-bottom: 2px solid var(--ciq-teal);
    font-weight: 700;
    color: var(--ciq-dark-teal);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--ciq-border-light);
    vertical-align: middle;
}
.table tbody tr {
    transition: background-color var(--ciq-transition);
}
.table tbody tr:hover {
    background-color: rgba(81, 176, 166, 0.05);
}

/* --- Status Badges (supplement Radzen badges) --- */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.6rem;
    border-radius: var(--ciq-radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.status-badge-teal {
    background-color: rgba(81, 176, 166, 0.15);
    color: var(--ciq-dark-teal);
}
.status-badge-lime {
    background-color: rgba(185, 217, 51, 0.20);
    color: #5A6B15;
}
.status-badge-coral {
    background-color: rgba(231, 112, 81, 0.15);
    color: #A63C1E;
}
.status-badge-gray {
    background-color: rgba(124, 124, 124, 0.15);
    color: var(--ciq-dark-gray);
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: #888;
}
.empty-state p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
}
.empty-state-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.4;
}

/* --- Checkbox Rows --- */
.checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
}
.checkbox-row input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--ciq-teal);
}
.checkbox-row label {
    font-size: 0.875rem;
    cursor: pointer;
}

/* --- Consent Section --- */
.consent-section {
    margin-top: 1.5rem;
    padding: 1.25rem;
    border: 2px solid #22c55e;
    border-radius: 8px;
    background: #f0fdf4;
}
.consent-section h3 {
    color: #166534;
}

/* --- Card (legacy — for compatibility) --- */
.card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

/* --- Dialog Panels --- */
.dialog-panel {
    margin-top: 1rem;
    padding: 1.25rem;
    border-radius: 8px;
    background: #fff;
}
.dialog-panel-danger { border: 2px solid var(--ciq-coral-light); }
.dialog-panel-warning { border: 2px solid #fde68a; }
.dialog-panel-info { border: 2px solid var(--ciq-teal); }
.dialog-panel-success { border: 2px solid #86efac; }

/* --- Preview Panel --- */
.preview-panel {
    padding: 1rem;
    margin-bottom: 1rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--ciq-radius-lg);
}
.preview-panel h4 { margin-top: 0; color: #1e40af; }

/* --- Preview Panel — Brand Info Variant --- */
/* Used by EinwilligungsHistorie when its inline form is open. */
.preview-panel-info {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--ciq-teal-light);
    border: 1px solid var(--ciq-teal);
    border-radius: var(--ciq-radius-md);
}
.preview-panel-info h4 { margin-top: 0; color: var(--ciq-dark-teal); }

/* --- Brand-Aligned Alert Variant --- */
.alert-teal {
    background-color: var(--ciq-teal-light);
    color: var(--ciq-dark-teal);
    border: 1px solid var(--ciq-teal);
}

/* --- Audit Footer --- */
.audit-footer {
    margin-top: 2rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e5e7eb;
    font-size: 0.8rem;
    color: #999;
}
.audit-footer code {
    background: #f3f4f6;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-size: 0.75rem;
}

/* --- Filter Bar --- */
.filter-bar {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.filter-bar label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: #666;
    margin-bottom: 0.2rem;
}
.filter-bar .form-control {
    width: auto;
    min-width: 120px;
}

/* --- Divider --- */
.divider {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 1.5rem 0;
}

/* --- Login Page --- */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
    background: var(--ciq-bg);
}
.login-card {
    background: var(--ciq-white);
    padding: 2.5rem;
    border-radius: var(--ciq-radius-xl);
    box-shadow: var(--ciq-shadow-lg);
    width: 100%;
    max-width: 400px;
}
.login-card h1 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-family: var(--ciq-font-heading);
    font-weight: 800;
    color: var(--ciq-dark-teal);
}
.login-card .form-group {
    margin-bottom: 1rem;
}
.login-card .btn-primary {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.6rem 1.25rem;
    font-size: 0.95rem;
}
.login-card .alert {
    margin-bottom: 1rem;
}

/* --- Money / Tabular Values --- */
.money-value {
    font-variant-numeric: tabular-nums;
    font-family: 'Courier New', Courier, monospace;
    text-align: right;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .layout-body { flex-direction: column; }
    .layout-nav {
        width: 100%;
        min-width: auto;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
        padding: 0.5rem 0;
    }
    .layout-nav .nav-list {
        display: flex;
        flex-wrap: wrap;
        gap: 0;
        padding: 0 0.5rem;
    }
    .layout-nav .nav-item a {
        padding: 0.4rem 0.75rem;
        border-left: none;
        border-bottom: 2px solid transparent;
        font-size: 0.825rem;
    }
    .layout-nav .nav-item a:hover,
    .layout-nav .nav-item a.active {
        border-left: none;
        border-bottom-color: var(--ciq-teal);
    }
    .layout-content { padding: 1rem; }
    .page-header { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
    .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
    .filter-bar { flex-direction: column; align-items: stretch; }
}

/* --- Utility --- */
.text-muted { color: #888; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.5rem !important; }
.mb-2 { margin-bottom: 1rem !important; }
.mb-3 { margin-bottom: 1.5rem !important; }
.mb-4 { margin-bottom: 2rem !important; }
.mt-1 { margin-top: 0.5rem !important; }
.mt-2 { margin-top: 1rem !important; }
.mt-3 { margin-top: 1.5rem !important; }
.gap-sm { gap: 0.5rem; }
.gap-md { gap: 1rem; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }

/* Radzen overrides for consistency */
.rz-card {
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
