@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=Roboto+Mono:wght@400;500&display=swap');
@import url('https://fonts.googleapis.com/icon?family=Material+Icons+Round');

:root {
    --md-sys-color-primary: #1a73e8;
    --md-sys-color-primary-container: #d3e3fd;
    --md-sys-color-on-primary: #ffffff;
    --md-sys-color-on-primary-container: #041e49;
    --md-sys-color-secondary: #535e7a;
    --md-sys-color-secondary-container: #d8e2f9;
    --md-sys-color-on-secondary: #ffffff;
    --md-sys-color-on-secondary-container: #0f1d36;
    --md-sys-color-tertiary: #6b5778;
    --md-sys-color-tertiary-container: #f2daff;
    --md-sys-color-on-tertiary-container: #250f30;
    --md-sys-color-surface: #fefbff;
    --md-sys-color-surface-dim: #dcdbe4;
    --md-sys-color-surface-bright: #fefbff;
    --md-sys-color-surface-variant: #e1e2ec;
    --md-sys-color-surface-container-lowest: #ffffff;
    --md-sys-color-surface-container-low: #f3f3fc;
    --md-sys-color-surface-container: #ededf6;
    --md-sys-color-surface-container-high: #e7e8f0;
    --md-sys-color-surface-container-highest: #e1e2ea;
    --md-sys-color-outline: #74777f;
    --md-sys-color-outline-variant: #c4c6d0;
    --md-sys-color-error: #b3261e;
    --md-sys-color-error-container: #f9dedc;
    --md-sys-color-on-error: #ffffff;
    --md-sys-color-on-error-container: #410e0b;
    --md-sys-color-background: #f8f9ff;
    --md-sys-color-on-background: #1b1b1f;
    --md-sys-color-on-surface: #1b1b1f;
    --md-sys-color-on-surface-variant: #44474f;
    --md-sys-color-inverse-surface: #2f3036;
    --md-sys-color-inverse-on-surface: #f2f0f7;
    --md-sys-color-inverse-primary: #a8c7fa;
    --md-sys-color-scrim: rgba(0,0,0,.32);
    --md-sys-color-shadow: rgba(0,0,0,.3);
    --md-sys-color-success: #146c2e;
    --md-sys-color-success-container: #c3efcd;
    --md-sys-color-on-success-container: #002109;
    --md-sys-color-warning: #7a4f00;
    --md-sys-color-warning-container: #ffddb8;
    --md-sys-color-on-warning-container: #281900;

    --md-ref-typeface-plain: 'Plus Jakarta Sans', 'Google Sans', sans-serif;
    --md-ref-typeface-brand: 'Plus Jakarta Sans', 'Google Sans', sans-serif;

    --md-sys-typescale-display-large: 57px;
    --md-sys-typescale-display-medium: 45px;
    --md-sys-typescale-headline-large: 32px;
    --md-sys-typescale-headline-medium: 28px;
    --md-sys-typescale-headline-small: 24px;
    --md-sys-typescale-title-large: 22px;
    --md-sys-typescale-title-medium: 16px;
    --md-sys-typescale-title-small: 14px;
    --md-sys-typescale-label-large: 14px;
    --md-sys-typescale-label-medium: 12px;
    --md-sys-typescale-label-small: 11px;
    --md-sys-typescale-body-large: 16px;
    --md-sys-typescale-body-medium: 14px;
    --md-sys-typescale-body-small: 12px;

    --nav-width: 280px;
    --topbar-height: 64px;
    --shape-extra-small: 4px;
    --shape-small: 8px;
    --shape-medium: 12px;
    --shape-large: 16px;
    --shape-extra-large: 28px;
    --shape-full: 9999px;

    --elevation-0: none;
    --elevation-1: 0 1px 2px rgba(0,0,0,.08), 0 1px 3px 1px rgba(0,0,0,.05);
    --elevation-2: 0 1px 2px rgba(0,0,0,.08), 0 2px 6px 2px rgba(0,0,0,.06);
    --elevation-3: 0 4px 8px 3px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.08);
    --elevation-4: 0 6px 10px 4px rgba(0,0,0,.06), 0 2px 3px rgba(0,0,0,.08);
    --elevation-5: 0 8px 12px 6px rgba(0,0,0,.06), 0 4px 4px rgba(0,0,0,.08);

    --duration-short1: 50ms;
    --duration-short2: 100ms;
    --duration-short3: 150ms;
    --duration-short4: 200ms;
    --duration-medium1: 250ms;
    --duration-medium2: 300ms;
    --duration-medium3: 350ms;
    --duration-medium4: 400ms;
    --duration-long1: 450ms;
    --duration-long2: 500ms;
    --easing-standard: cubic-bezier(0.2, 0, 0, 1);
    --easing-standard-decel: cubic-bezier(0, 0, 0, 1);
    --easing-standard-accel: cubic-bezier(0.3, 0, 1, 1);
    --easing-emphasized: cubic-bezier(0.2, 0, 0, 1);
    --easing-emphasized-decel: cubic-bezier(0.05, 0.7, 0.1, 1);
    --easing-emphasized-accel: cubic-bezier(0.3, 0, 0.8, 0.15);
}

@media (prefers-color-scheme: dark) {
    :root {
        --md-sys-color-primary: #a8c7fa;
        --md-sys-color-primary-container: #0842a0;
        --md-sys-color-on-primary: #062e6f;
        --md-sys-color-on-primary-container: #d3e3fd;
        --md-sys-color-secondary: #bbc7e4;
        --md-sys-color-secondary-container: #3b4664;
        --md-sys-color-on-secondary: #253150;
        --md-sys-color-on-secondary-container: #d8e2f9;
        --md-sys-color-surface: #131318;
        --md-sys-color-surface-dim: #131318;
        --md-sys-color-surface-variant: #44474f;
        --md-sys-color-surface-container-lowest: #0e0e13;
        --md-sys-color-surface-container-low: #1b1b21;
        --md-sys-color-surface-container: #1f1f25;
        --md-sys-color-surface-container-high: #2a2a30;
        --md-sys-color-surface-container-highest: #35343b;
        --md-sys-color-outline: #8e9099;
        --md-sys-color-outline-variant: #44474f;
        --md-sys-color-error: #ffb4ab;
        --md-sys-color-error-container: #8c1d18;
        --md-sys-color-on-error: #690005;
        --md-sys-color-on-error-container: #f9dedc;
        --md-sys-color-background: #131318;
        --md-sys-color-on-background: #e4e2e9;
        --md-sys-color-on-surface: #e4e2e9;
        --md-sys-color-on-surface-variant: #c4c6d0;
        --md-sys-color-success: #6dd58c;
        --md-sys-color-success-container: #1a4a2a;
        --md-sys-color-on-success-container: #d4f7df;
        --md-sys-color-warning: #ffb95d;
        --md-sys-color-warning-container: #4a2e00;
        --md-sys-color-on-warning-container: #ffe4b5;
    }
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 14px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--md-ref-typeface-plain);
    background: var(--md-sys-color-background);
    color: var(--md-sys-color-on-background);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--md-sys-color-primary);
    text-decoration: none;
    transition: color var(--duration-short3);
}
a:hover { text-decoration: underline; color: var(--md-sys-color-on-primary-container); }

img { max-width: 100%; height: auto; }
code { font-family: 'Roboto Mono', monospace; font-size: 0.9em; background: var(--md-sys-color-surface-container-high); padding: 2px 6px; border-radius: 4px; }
pre { font-family: 'Roboto Mono', monospace; font-size: 12px; }

.material-icons-round {
    font-size: 20px;
    vertical-align: middle;
    user-select: none;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 20;
}

::selection { background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--md-sys-color-outline-variant); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--md-sys-color-outline); }

.app-shell { display: flex; min-height: 100vh; }

.nav-rail {
    width: var(--nav-width);
    background: var(--md-sys-color-surface-container-low);
    border-right: 1px solid var(--md-sys-color-outline-variant);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: transform var(--duration-medium2) var(--easing-emphasized);
    overflow-y: auto;
    overflow-x: hidden;
}

.nav-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    min-height: var(--topbar-height);
    background: var(--md-sys-color-surface-container-low);
    position: sticky;
    top: 0;
    z-index: 1;
}

.nav-logo {
    width: 38px;
    height: 38px;
    background: var(--md-sys-color-primary);
    border-radius: var(--shape-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--md-sys-color-on-primary);
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(26,115,232,.3);
}

.nav-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
    line-height: 1.3;
    letter-spacing: -0.01em;
}
.nav-subtitle {
    font-size: 11px;
    color: var(--md-sys-color-on-surface-variant);
    margin-top: 1px;
    letter-spacing: 0.02em;
}

.nav-section-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--md-sys-color-on-surface-variant);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 20px 24px 6px;
    pointer-events: none;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 16px 0 20px;
    height: 52px;
    color: var(--md-sys-color-on-surface-variant);
    cursor: pointer;
    border-radius: 0;
    font-size: 14px;
    font-weight: 500;
    position: relative;
    text-decoration: none;
    transition: background var(--duration-short3), color var(--duration-short3);
    overflow: hidden;
    letter-spacing: 0.01em;
}

.nav-item:hover {
    background: rgba(26,115,232,.08);
    color: var(--md-sys-color-on-surface);
    text-decoration: none;
}

.nav-item.active {
    background: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 28px;
    background: var(--md-sys-color-primary);
    border-radius: 0 var(--shape-full) var(--shape-full) 0;
}

.nav-item .material-icons-round { font-size: 22px; flex-shrink: 0; }
.nav-item .nav-badge {
    margin-left: auto;
    background: var(--md-sys-color-error);
    color: var(--md-sys-color-on-error);
    font-size: 11px;
    font-weight: 700;
    border-radius: var(--shape-full);
    padding: 1px 7px;
    min-width: 20px;
    text-align: center;
}

.nav-divider {
    height: 1px;
    background: var(--md-sys-color-outline-variant);
    margin: 8px 0;
}

.nav-footer {
    margin-top: auto;
    padding: 12px 16px 16px;
    border-top: 1px solid var(--md-sys-color-outline-variant);
    background: var(--md-sys-color-surface-container-low);
    position: sticky;
    bottom: 0;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--shape-large);
    cursor: pointer;
    transition: background var(--duration-short3);
    color: inherit;
    text-decoration: none;
    overflow: hidden;
}
.nav-user:hover { background: var(--md-sys-color-surface-container-high); text-decoration: none; }

.nav-avatar {
    width: 36px;
    height: 36px;
    background: var(--md-sys-color-primary);
    border-radius: var(--shape-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--md-sys-color-on-primary);
    font-weight: 600;
    font-size: 13px;
    flex-shrink: 0;
    letter-spacing: 0.05em;
}

.nav-user-info { flex: 1; min-width: 0; }
.nav-user-name { font-size: 13px; font-weight: 500; color: var(--md-sys-color-on-surface); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-user-email { font-size: 11px; color: var(--md-sys-color-on-surface-variant); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }

.main-content {
    margin-left: var(--nav-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100vh;
}

.topbar {
    height: var(--topbar-height);
    background: var(--md-sys-color-surface);
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    display: flex;
    align-items: center;
    padding: 0 24px 0 32px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--elevation-1);
}

.topbar-title { font-size: 20px; font-weight: 400; color: var(--md-sys-color-on-surface); line-height: 1.3; }

.page-content {
    padding: 24px 32px 48px;
    flex: 1;
    max-width: 1440px;
    width: 100%;
}

.page-content-narrow { max-width: 800px; }

.section-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--md-sys-color-on-surface);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.card {
    background: var(--md-sys-color-surface);
    border-radius: var(--shape-large);
    border: 1px solid var(--md-sys-color-outline-variant);
    overflow: hidden;
    transition: box-shadow var(--duration-short4);
}

.card-elevated {
    border: none;
    box-shadow: var(--elevation-2);
}

.card-filled {
    background: var(--md-sys-color-surface-container-highest);
    border: none;
}

.card-clickable {
    cursor: pointer;
    transition: box-shadow var(--duration-short4), transform var(--duration-short3);
}
.card-clickable:hover { box-shadow: var(--elevation-3); transform: translateY(-1px); }
.card-clickable:active { transform: translateY(0); }

.card-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.card-header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.card-title { font-size: var(--md-sys-typescale-title-medium); font-weight: 500; color: var(--md-sys-color-on-surface); }
.card-subtitle { font-size: 13px; color: var(--md-sys-color-on-surface-variant); margin-top: 3px; line-height: 1.4; }
.card-body { padding: 24px; }
.card-body.no-pad { padding: 0; }
.card-body.compact { padding: 16px 24px; }
.card-footer {
    padding: 12px 24px;
    border-top: 1px solid var(--md-sys-color-outline-variant);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    background: var(--md-sys-color-surface-container-low);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--shape-large);
    padding: 20px 20px 20px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: box-shadow var(--duration-short4), border-color var(--duration-short3);
    cursor: default;
}

.stat-card:hover { box-shadow: var(--elevation-2); border-color: var(--md-sys-color-primary); }

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--shape-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.stat-icon .material-icons-round { font-size: 26px; }
.stat-icon.blue { background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); }
.stat-icon.green { background: var(--md-sys-color-success-container); color: var(--md-sys-color-on-success-container); }
.stat-icon.red { background: var(--md-sys-color-error-container); color: var(--md-sys-color-on-error-container); }
.stat-icon.amber { background: var(--md-sys-color-warning-container); color: var(--md-sys-color-on-warning-container); }
.stat-icon.purple { background: var(--md-sys-color-tertiary-container); color: var(--md-sys-color-on-tertiary-container); }
.stat-icon.teal { background: #e0f2f1; color: #00695c; }

.stat-info { flex: 1; min-width: 0; }
.stat-value { font-size: 30px; font-weight: 600; line-height: 1; color: var(--md-sys-color-on-surface); letter-spacing: -0.02em; }
.stat-label { font-size: 13px; color: var(--md-sys-color-on-surface-variant); margin-top: 6px; font-weight: 400; }
.stat-delta { font-size: 12px; margin-top: 4px; display: flex; align-items: center; gap: 3px; }
.stat-delta.up { color: var(--md-sys-color-success); }
.stat-delta.down { color: var(--md-sys-color-error); }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: var(--shape-extra-large);
    font-size: var(--md-sys-typescale-label-large);
    font-weight: 500;
    font-family: inherit;
    letter-spacing: 0.01em;
    cursor: pointer;
    border: none;
    outline: none;
    transition: background var(--duration-short3), box-shadow var(--duration-short3), transform var(--duration-short2), color var(--duration-short3);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.btn:hover { text-decoration: none; }
.btn:focus-visible { outline: 3px solid var(--md-sys-color-primary); outline-offset: 2px; }
.btn:active { transform: scale(0.97); }
.btn:disabled, .btn[disabled] { opacity: 0.38; cursor: not-allowed; pointer-events: none; }

.btn-filled { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); box-shadow: var(--elevation-1); }
.btn-filled:hover { background: color-mix(in srgb, var(--md-sys-color-primary), white 8%); box-shadow: var(--elevation-2); }
.btn-filled:active { box-shadow: var(--elevation-1); }

.btn-tonal { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
.btn-tonal:hover { background: color-mix(in srgb, var(--md-sys-color-secondary-container), var(--md-sys-color-on-secondary-container) 8%); box-shadow: var(--elevation-1); }

.btn-outlined { background: transparent; color: var(--md-sys-color-primary); border: 1.5px solid var(--md-sys-color-outline); }
.btn-outlined:hover { background: rgba(26,115,232,.08); border-color: var(--md-sys-color-primary); }

.btn-text { background: transparent; color: var(--md-sys-color-primary); padding: 10px 16px; }
.btn-text:hover { background: rgba(26,115,232,.08); }

.btn-danger { background: var(--md-sys-color-error); color: var(--md-sys-color-on-error); }
.btn-danger:hover { background: color-mix(in srgb, var(--md-sys-color-error), white 8%); box-shadow: var(--elevation-2); }

.btn-success { background: var(--md-sys-color-success); color: white; }
.btn-success:hover { filter: brightness(1.08); box-shadow: var(--elevation-2); }

.btn-sm { padding: 6px 16px; font-size: 13px; }
.btn-xs { padding: 4px 12px; font-size: 12px; }
.btn-lg { padding: 14px 32px; font-size: 16px; }
.btn-icon { padding: 10px; border-radius: var(--shape-full); min-width: 40px; justify-content: center; }
.btn-icon.btn-sm { padding: 7px; min-width: 34px; }

.btn-icon-square { border-radius: var(--shape-small); }

.fab {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 90;
    width: 56px;
    height: 56px;
    border-radius: var(--shape-large);
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: var(--elevation-3);
    transition: box-shadow var(--duration-short3), transform var(--duration-short2);
    overflow: hidden;
    position: relative;
}
.fab:hover { box-shadow: var(--elevation-4); transform: scale(1.05); }
.fab:active { transform: scale(0.95); box-shadow: var(--elevation-2); }

.fab-extended {
    padding: 0 20px 0 16px;
    width: auto;
    height: 56px;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    border-radius: var(--shape-large);
}
.fab-extended .material-icons-round { font-size: 24px; }

.fab-fixed {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 90;
}

.fab-mini {
    width: 40px;
    height: 40px;
    border-radius: var(--shape-medium);
    font-size: 20px;
    box-shadow: var(--elevation-2);
}

.ripple-container { position: relative; overflow: hidden; }

.ripple {
    position: absolute;
    border-radius: var(--shape-full);
    background: currentColor;
    opacity: 0;
    transform: scale(0);
    pointer-events: none;
    animation: ripple-anim var(--duration-long2) var(--easing-standard) forwards;
}

@keyframes ripple-anim {
    0% { transform: scale(0); opacity: 0.24; }
    60% { opacity: 0.12; }
    100% { transform: scale(2.5); opacity: 0; }
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 20px;
}

.form-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--md-sys-color-on-surface);
    line-height: 1.3;
}

.form-hint {
    font-size: 12px;
    color: var(--md-sys-color-on-surface-variant);
    line-height: 1.4;
}

.form-error { font-size: 12px; color: var(--md-sys-color-error); display: flex; align-items: center; gap: 4px; }
.form-error .material-icons-round { font-size: 14px; }

.form-input,
.form-select,
.form-textarea {
    background: var(--md-sys-color-surface);
    border: 1.5px solid var(--md-sys-color-outline);
    border-radius: var(--shape-small);
    padding: 12px 16px;
    font-size: 14px;
    font-family: inherit;
    color: var(--md-sys-color-on-surface);
    transition: border-color var(--duration-short3), box-shadow var(--duration-short3), background var(--duration-short3);
    width: 100%;
    outline: none;
    appearance: none;
    line-height: 1.5;
}

.form-input:hover, .form-select:hover, .form-textarea:hover {
    border-color: var(--md-sys-color-on-surface-variant);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--md-sys-color-primary);
    box-shadow: 0 0 0 3px rgba(26,115,232,.14);
    background: var(--md-sys-color-surface);
}

.form-input.error, .form-select.error, .form-textarea.error {
    border-color: var(--md-sys-color-error);
}
.form-input.error:focus, .form-select.error:focus {
    box-shadow: 0 0 0 3px rgba(179,38,30,.14);
}

.form-textarea { resize: vertical; min-height: 100px; }
.form-select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='%2344474f'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 40px; cursor: pointer; }

.form-group { display: flex; flex-direction: column; gap: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 24px; }

.form-check {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    padding: 4px 0;
}
.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: var(--md-sys-color-primary);
    flex-shrink: 0;
}
.form-check-label { font-size: 14px; color: var(--md-sys-color-on-surface); cursor: pointer; }
.form-check-hint { font-size: 12px; color: var(--md-sys-color-on-surface-variant); margin-top: 2px; }

.switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    gap: 12px;
}
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
    width: 52px;
    height: 28px;
    background: var(--md-sys-color-surface-variant);
    border-radius: var(--shape-full);
    border: 2px solid var(--md-sys-color-outline);
    transition: background var(--duration-short3), border-color var(--duration-short3);
    position: relative;
    flex-shrink: 0;
}
.switch-thumb {
    position: absolute;
    top: 50%;
    left: 3px;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background: var(--md-sys-color-outline);
    border-radius: var(--shape-full);
    transition: left var(--duration-short3) var(--easing-standard), width var(--duration-short3), background var(--duration-short3);
}
.switch input:checked + .switch-track {
    background: var(--md-sys-color-primary);
    border-color: var(--md-sys-color-primary);
}
.switch input:checked + .switch-track .switch-thumb {
    left: calc(100% - 20px);
    width: 24px;
    background: var(--md-sys-color-on-primary);
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--shape-full);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.01em;
    white-space: nowrap;
    transition: background var(--duration-short3);
}
.chip .material-icons-round { font-size: 14px; }

.chip-success { background: var(--md-sys-color-success-container); color: var(--md-sys-color-on-success-container); }
.chip-danger { background: var(--md-sys-color-error-container); color: var(--md-sys-color-on-error-container); }
.chip-warning { background: var(--md-sys-color-warning-container); color: var(--md-sys-color-on-warning-container); }
.chip-neutral { background: var(--md-sys-color-surface-container-high); color: var(--md-sys-color-on-surface-variant); }
.chip-primary { background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); }
.chip-secondary { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
.chip-info { background: #e3f2fd; color: #0d47a1; }

.chip-clickable { cursor: pointer; }
.chip-clickable:hover { filter: brightness(0.95); }
.chip-clickable.active { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); }

.chip-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: inherit;
    opacity: 0.7;
    display: flex;
    align-items: center;
}
.chip-close:hover { opacity: 1; }
.chip-close .material-icons-round { font-size: 16px; }

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: var(--shape-full);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}
.badge-primary { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); }
.badge-error { background: var(--md-sys-color-error); color: var(--md-sys-color-on-error); }

.divider { height: 1px; background: var(--md-sys-color-outline-variant); margin: 16px 0; }
.divider-vertical { width: 1px; background: var(--md-sys-color-outline-variant); margin: 0 16px; align-self: stretch; }

table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

table.data-table thead th {
    background: var(--md-sys-color-surface-container-low);
    font-size: 12px;
    font-weight: 600;
    color: var(--md-sys-color-on-surface-variant);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 12px 16px;
    text-align: left;
    white-space: nowrap;
    border-bottom: 2px solid var(--md-sys-color-outline-variant);
    position: sticky;
    top: 0;
    z-index: 1;
}

table.data-table thead th:first-child { padding-left: 24px; }
table.data-table thead th:last-child { padding-right: 24px; }

table.data-table tbody tr {
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    transition: background var(--duration-short2);
}
table.data-table tbody tr:hover { background: var(--md-sys-color-surface-container-low); }
table.data-table tbody tr:last-child { border-bottom: none; }

table.data-table tbody td {
    padding: 12px 16px;
    vertical-align: middle;
    color: var(--md-sys-color-on-surface);
}
table.data-table tbody td:first-child { padding-left: 24px; }
table.data-table tbody td:last-child { padding-right: 24px; }

table.data-table.striped tbody tr:nth-child(even) { background: var(--md-sys-color-surface-container-lowest); }
table.data-table.striped tbody tr:nth-child(even):hover { background: var(--md-sys-color-surface-container-low); }

.table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.env-card {
    background: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--shape-large);
    padding: 20px 24px;
    display: flex;
    gap: 20px;
    align-items: flex-start;
    transition: box-shadow var(--duration-short4), border-color var(--duration-short3), transform var(--duration-short3);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    position: relative;
}

.env-card:hover {
    box-shadow: var(--elevation-3);
    border-color: var(--md-sys-color-primary);
    text-decoration: none;
    transform: translateY(-2px);
}
.env-card:active { transform: translateY(0); box-shadow: var(--elevation-1); }

.env-icon {
    width: 52px;
    height: 52px;
    background: var(--md-sys-color-primary-container);
    border-radius: var(--shape-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.env-icon .material-icons-round { font-size: 26px; color: var(--md-sys-color-primary); }

.env-info { flex: 1; min-width: 0; }
.env-name { font-size: 16px; font-weight: 500; color: var(--md-sys-color-on-surface); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.env-domain { font-size: 13px; color: var(--md-sys-color-on-surface-variant); margin-top: 3px; }
.env-meta { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.env-stat { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--md-sys-color-on-surface-variant); }
.env-stat .material-icons-round { font-size: 16px; }

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--shape-full);
    display: inline-block;
    flex-shrink: 0;
}
.status-dot.running { background: var(--md-sys-color-primary); animation: pulse-dot 1.5s infinite; }
.status-dot.completed { background: var(--md-sys-color-success); }
.status-dot.error { background: var(--md-sys-color-error); }
.status-dot.pending, .status-dot.partial { background: var(--md-sys-color-outline); }

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    border-radius: var(--shape-full);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.01em;
    white-space: nowrap;
}
.status-badge.running { background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); }
.status-badge.completed { background: var(--md-sys-color-success-container); color: var(--md-sys-color-on-success-container); }
.status-badge.error { background: var(--md-sys-color-error-container); color: var(--md-sys-color-error); }
.status-badge.pending, .status-badge.partial { background: var(--md-sys-color-surface-variant); color: var(--md-sys-color-on-surface-variant); }

.tabs {
    display: flex;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    background: var(--md-sys-color-surface);
    padding: 0 24px;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
    position: sticky;
    top: var(--topbar-height);
    z-index: 40;
    -webkit-overflow-scrolling: touch;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
    padding: 0 20px;
    height: 52px;
    font-size: 14px;
    font-weight: 500;
    color: var(--md-sys-color-on-surface-variant);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: color var(--duration-short3), border-color var(--duration-short3);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    letter-spacing: 0.01em;
    position: relative;
    overflow: hidden;
}
.tab:hover { color: var(--md-sys-color-on-surface); text-decoration: none; background: rgba(0,0,0,.04); }
.tab.active { color: var(--md-sys-color-primary); border-bottom-color: var(--md-sys-color-primary); font-weight: 600; }
.tab .material-icons-round { font-size: 18px; }
.tab-count {
    background: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
    padding: 2px 8px;
    border-radius: var(--shape-full);
    font-size: 11px;
    font-weight: 600;
}
.tab.active .tab-count {
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-primary);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 20px;
    border-radius: var(--shape-medium);
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
    border-left: 4px solid transparent;
}
.alert .material-icons-round { flex-shrink: 0; font-size: 20px; margin-top: 1px; }
.alert-error, .alert-danger { background: var(--md-sys-color-error-container); color: var(--md-sys-color-on-error-container); border-left-color: var(--md-sys-color-error); }
.alert-success { background: var(--md-sys-color-success-container); color: var(--md-sys-color-on-success-container); border-left-color: var(--md-sys-color-success); }
.alert-warning { background: var(--md-sys-color-warning-container); color: var(--md-sys-color-on-warning-container); border-left-color: var(--md-sys-color-warning); }
.alert-info { background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); border-left-color: var(--md-sys-color-primary); }
.alert-neutral { background: var(--md-sys-color-surface-container-high); color: var(--md-sys-color-on-surface); border-left-color: var(--md-sys-color-outline); }
.alert-title { font-weight: 600; margin-bottom: 4px; }
.alert-close { margin-left: auto; padding: 0; background: none; border: none; cursor: pointer; color: inherit; opacity: 0.7; display: flex; }
.alert-close:hover { opacity: 1; }

.dialog-backdrop {
    position: fixed;
    inset: 0;
    background: var(--md-sys-color-scrim);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--duration-medium1) var(--easing-standard);
    backdrop-filter: blur(2px);
}
.dialog-backdrop.open { opacity: 1; pointer-events: all; }

.dialog {
    background: var(--md-sys-color-surface-container-high);
    border-radius: var(--shape-extra-large);
    width: 100%;
    max-width: 560px;
    max-height: calc(100dvh - 48px);
    overflow-y: auto;
    box-shadow: var(--elevation-5);
    transform: scale(0.92) translateY(24px);
    transition: transform var(--duration-medium2) var(--easing-emphasized-decel), opacity var(--duration-medium1);
    opacity: 0;
}
.dialog-backdrop.open .dialog { transform: none; opacity: 1; }

.dialog-header {
    padding: 24px 24px 12px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}
.dialog-icon { width: 24px; height: 24px; color: var(--md-sys-color-secondary); }
.dialog-title { font-size: 24px; font-weight: 400; color: var(--md-sys-color-on-surface); line-height: 1.3; }
.dialog-body { padding: 0 24px 20px; font-size: 14px; color: var(--md-sys-color-on-surface-variant); line-height: 1.6; }
.dialog-body p + p { margin-top: 8px; }
.dialog-divider { height: 1px; background: var(--md-sys-color-outline-variant); margin: 0; }
.dialog-actions {
    padding: 12px 16px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}
.dialog-fullscreen {
    max-width: none;
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
}

.snackbar-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 300;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    min-width: 280px;
    max-width: calc(100vw - 48px);
}

.snackbar {
    background: var(--md-sys-color-inverse-surface);
    color: var(--md-sys-color-inverse-on-surface);
    border-radius: var(--shape-small);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--elevation-3);
    font-size: 14px;
    font-weight: 400;
    pointer-events: all;
    transform: translateY(100%) scale(0.9);
    opacity: 0;
    transition: transform var(--duration-medium2) var(--easing-emphasized-decel), opacity var(--duration-short4);
    min-width: 280px;
    max-width: calc(100vw - 48px);
}
.snackbar.visible { transform: none; opacity: 1; }
.snackbar.hiding { transform: translateY(20px) scale(0.95); opacity: 0; }
.snackbar-message { flex: 1; }
.snackbar-action {
    background: none;
    border: none;
    color: var(--md-sys-color-inverse-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--shape-small);
    letter-spacing: 0.01em;
    transition: background var(--duration-short3);
    white-space: nowrap;
    flex-shrink: 0;
}
.snackbar-action:hover { background: rgba(168,199,250,.12); }
.snackbar-close {
    background: none;
    border: none;
    color: var(--md-sys-color-inverse-on-surface);
    cursor: pointer;
    padding: 4px;
    display: flex;
    opacity: 0.7;
    transition: opacity var(--duration-short3);
    flex-shrink: 0;
}
.snackbar-close:hover { opacity: 1; }
.snackbar-close .material-icons-round { font-size: 18px; }

.tooltip-wrapper { position: relative; display: inline-flex; }
.tooltip {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--md-sys-color-inverse-surface);
    color: var(--md-sys-color-inverse-on-surface);
    padding: 6px 12px;
    border-radius: var(--shape-small);
    font-size: 12px;
    font-weight: 400;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--duration-short3);
    z-index: 500;
    box-shadow: var(--elevation-2);
}
.tooltip-wrapper:hover .tooltip { opacity: 1; }

.tooltip-right .tooltip { left: calc(100% + 6px); bottom: 50%; transform: translateY(50%); }
.tooltip-left .tooltip { right: calc(100% + 6px); left: auto; bottom: 50%; transform: translateY(50%); }

.progress-bar {
    height: 4px;
    background: var(--md-sys-color-surface-variant);
    border-radius: 2px;
    overflow: hidden;
}
.progress-bar-inner {
    height: 100%;
    background: var(--md-sys-color-primary);
    border-radius: 2px;
    transition: width var(--duration-medium2);
}
.progress-bar-inner.indeterminate {
    width: 35% !important;
    animation: indeterminate-bar 1.6s infinite var(--easing-standard);
}
@keyframes indeterminate-bar {
    0% { transform: translateX(-150%); }
    100% { transform: translateX(450%); }
}

.progress-circular {
    display: inline-block;
    width: 40px;
    height: 40px;
    position: relative;
}
.progress-circular-svg { animation: rotate-circular 1.4s linear infinite; }
.progress-circular-track { fill: none; stroke: var(--md-sys-color-surface-variant); stroke-width: 4; }
.progress-circular-fill { fill: none; stroke: var(--md-sys-color-primary); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 80 200; animation: dash-circular 1.4s ease-in-out infinite; }
@keyframes rotate-circular { 0% { transform: rotate(0); } 100% { transform: rotate(360deg); } }
@keyframes dash-circular { 0% { stroke-dasharray: 1 200; stroke-dashoffset: 0; } 50% { stroke-dasharray: 89 200; stroke-dashoffset: -35px; } 100% { stroke-dasharray: 89 200; stroke-dashoffset: -124px; } }

.skeleton {
    background: linear-gradient(90deg, var(--md-sys-color-surface-container) 25%, var(--md-sys-color-surface-container-high) 50%, var(--md-sys-color-surface-container) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--shape-small);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-text:last-child { width: 60%; }
.skeleton-title { height: 22px; margin-bottom: 12px; width: 40%; }
.skeleton-rect { height: 200px; border-radius: var(--shape-large); }

.score-gauge-wrapper {
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 24px;
    background: var(--md-sys-color-surface-container-low);
    border-radius: var(--shape-large);
    margin-bottom: 24px;
}

.score-gauge {
    flex-shrink: 0;
    position: relative;
    width: 140px;
    height: 140px;
}
.score-gauge-svg { transform: rotate(-90deg); }
.score-gauge-track { fill: none; stroke: var(--md-sys-color-surface-container-highest); stroke-width: 12; }
.score-gauge-fill { fill: none; stroke-width: 12; stroke-linecap: round; transition: stroke-dashoffset var(--duration-long2) var(--easing-emphasized-decel); }
.score-gauge-fill.critical { stroke: var(--md-sys-color-error); }
.score-gauge-fill.high { stroke: #ea8600; }
.score-gauge-fill.medium { stroke: #f5c918; }
.score-gauge-fill.good { stroke: var(--md-sys-color-success); }

.score-gauge-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.score-gauge-number { font-size: 36px; font-weight: 700; line-height: 1; color: var(--md-sys-color-on-surface); }
.score-gauge-label { font-size: 12px; color: var(--md-sys-color-on-surface-variant); margin-top: 4px; }

.score-gauge-info { flex: 1; }
.score-gauge-rating { font-size: 22px; font-weight: 600; margin-bottom: 8px; }
.score-gauge-rating.critical { color: var(--md-sys-color-error); }
.score-gauge-rating.high { color: #c77700; }
.score-gauge-rating.medium { color: #a68a00; }
.score-gauge-rating.good { color: var(--md-sys-color-success); }

.score-bar {
    height: 10px;
    background: var(--md-sys-color-surface-container-highest);
    border-radius: var(--shape-full);
    overflow: hidden;
    margin-bottom: 16px;
}
.score-bar-fill {
    height: 100%;
    border-radius: var(--shape-full);
    transition: width 1.2s var(--easing-emphasized-decel);
}
.score-bar-fill.critical { background: linear-gradient(to right, var(--md-sys-color-error), #e53935); }
.score-bar-fill.high { background: linear-gradient(to right, #f57c00, #ffa000); }
.score-bar-fill.medium { background: linear-gradient(to right, #f9a825, #fdd835); }
.score-bar-fill.good { background: linear-gradient(to right, #388e3c, #43a047); }

.issue-summary {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.issue-count {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--shape-medium);
    font-size: 13px;
    font-weight: 500;
}
.issue-count .material-icons-round { font-size: 18px; }
.issue-count.critical { background: var(--md-sys-color-error-container); color: var(--md-sys-color-on-error-container); }
.issue-count.high { background: #fff3e0; color: #b71c1c; }
.issue-count.medium { background: #fffde7; color: #e65100; }
.issue-count.low { background: var(--md-sys-color-success-container); color: var(--md-sys-color-on-success-container); }

.checklist-category {
    margin-bottom: 24px;
}
.checklist-category-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: var(--md-sys-color-surface-container);
    border-radius: var(--shape-medium) var(--shape-medium) 0 0;
    cursor: pointer;
    transition: background var(--duration-short3);
}
.checklist-category-header:hover { background: var(--md-sys-color-surface-container-high); }
.checklist-category-name { font-size: 15px; font-weight: 600; color: var(--md-sys-color-on-surface); flex: 1; }
.checklist-category-count { font-size: 12px; color: var(--md-sys-color-on-surface-variant); }
.checklist-category-toggle { color: var(--md-sys-color-on-surface-variant); transition: transform var(--duration-short4); }
.checklist-category-header.collapsed .checklist-category-toggle { transform: rotate(-90deg); }

.checklist-item {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    align-items: start;
    padding: 14px 20px;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    gap: 16px;
    transition: background var(--duration-short2);
}
.checklist-item:last-child { border-bottom: none; }
.checklist-item:hover { background: var(--md-sys-color-surface-container-low); }
.checklist-item.issue { background: rgba(179,38,30,.04); }

.checklist-item-priority {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding-top: 2px;
}
.priority-dot { width: 10px; height: 10px; border-radius: var(--shape-full); flex-shrink: 0; }
.priority-dot.critical { background: var(--md-sys-color-error); }
.priority-dot.high { background: #e65100; }
.priority-dot.medium { background: #f57f17; }
.priority-dot.low { background: var(--md-sys-color-success); }
.priority-label { font-size: 10px; color: var(--md-sys-color-on-surface-variant); text-transform: uppercase; letter-spacing: 0.05em; }

.checklist-item-content { min-width: 0; }
.checklist-item-name { font-size: 14px; font-weight: 500; color: var(--md-sys-color-on-surface); line-height: 1.4; }
.checklist-item-desc { font-size: 12px; color: var(--md-sys-color-on-surface-variant); margin-top: 4px; line-height: 1.5; }
.checklist-item-rec {
    font-size: 12px;
    color: var(--md-sys-color-on-primary-container);
    background: var(--md-sys-color-primary-container);
    padding: 8px 12px;
    border-radius: var(--shape-small);
    margin-top: 8px;
    line-height: 1.5;
    display: none;
}
.checklist-item.expanded .checklist-item-rec { display: block; }

.checklist-item-status { display: flex; align-items: center; gap: 8px; padding-top: 2px; flex-shrink: 0; }

.status-pass { color: var(--md-sys-color-success); }
.status-fail { color: var(--md-sys-color-error); }
.status-warn { color: var(--md-sys-color-warning); }
.status-manual { color: var(--md-sys-color-on-surface-variant); }
.status-na { color: var(--md-sys-color-outline); }

.checklist-status-chip {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: var(--shape-full);
    letter-spacing: 0.03em;
    white-space: nowrap;
}
.checklist-status-chip.pass { background: var(--md-sys-color-success-container); color: var(--md-sys-color-on-success-container); }
.checklist-status-chip.fail { background: var(--md-sys-color-error-container); color: var(--md-sys-color-on-error-container); }
.checklist-status-chip.warning { background: var(--md-sys-color-warning-container); color: var(--md-sys-color-on-warning-container); }
.checklist-status-chip.manual { background: var(--md-sys-color-surface-container-high); color: var(--md-sys-color-on-surface-variant); }
.checklist-status-chip.na { background: var(--md-sys-color-surface-variant); color: var(--md-sys-color-outline); }

.sync-log {
    background: #1a1a2e;
    border-radius: var(--shape-medium);
    padding: 16px 20px;
    font-family: 'Roboto Mono', monospace;
    font-size: 12px;
    color: #a8d8a8;
    max-height: 300px;
    overflow-y: auto;
    line-height: 1.6;
    scrollbar-width: thin;
    scrollbar-color: #3a3a5a transparent;
}
.sync-log::-webkit-scrollbar { width: 6px; }
.sync-log::-webkit-scrollbar-thumb { background: #3a3a5a; border-radius: 3px; }
.sync-log .log-line { margin-bottom: 2px; }
.sync-log .log-line.error { color: #ff6b6b; }
.sync-log .log-line.warning { color: #ffd166; }
.sync-log .log-line.success { color: #06d6a0; }
.sync-log .log-line.info { color: #74b9ff; }
.sync-log .log-step { color: #a29bfe; font-weight: 500; }
.sync-log .log-ts { color: #636e72; font-size: 11px; }

.login-page {
    min-height: 100dvh;
    background: linear-gradient(150deg, #0f2042 0%, #1557b0 40%, #1a73e8 80%, #4285f4 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 20% 80%, rgba(66,133,244,.3) 0%, transparent 60%),
                radial-gradient(ellipse at 80% 20%, rgba(26,115,232,.25) 0%, transparent 50%);
    pointer-events: none;
}

.login-card {
    background: var(--md-sys-color-surface);
    border-radius: var(--shape-extra-large);
    padding: 48px 44px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 24px 64px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.2);
    position: relative;
    z-index: 1;
    animation: card-appear var(--duration-long2) var(--easing-emphasized-decel);
}

@keyframes card-appear {
    from { opacity: 0; transform: translateY(24px) scale(0.97); }
    to { opacity: 1; transform: none; }
}

.login-logo {
    width: 60px;
    height: 60px;
    background: var(--md-sys-color-primary);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    box-shadow: 0 8px 24px rgba(26,115,232,.4);
}
.login-logo .material-icons-round { font-size: 30px; color: var(--md-sys-color-on-primary); }
.login-title { text-align: center; font-size: 26px; font-weight: 500; margin-bottom: 8px; color: var(--md-sys-color-on-surface); line-height: 1.3; }
.login-subtitle { text-align: center; font-size: 14px; color: var(--md-sys-color-on-surface-variant); margin-bottom: 32px; }

.totp-display {
    background: var(--md-sys-color-surface-container-low);
    border: 1.5px solid var(--md-sys-color-outline-variant);
    border-radius: var(--shape-large);
    padding: 24px;
    text-align: center;
    margin-bottom: 20px;
}
.totp-secret {
    font-family: 'Roboto Mono', monospace;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: var(--md-sys-color-primary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--shape-small);
    transition: background var(--duration-short3);
}
.totp-secret:hover { background: var(--md-sys-color-primary-container); }

.issue-row { background: rgba(179,38,30,.05); }
.issue-row:hover { background: rgba(179,38,30,.08) !important; }
.issue-row td { color: var(--md-sys-color-on-surface); }

.breadcrumb { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--md-sys-color-on-surface-variant); flex-wrap: wrap; }
.breadcrumb a { color: var(--md-sys-color-primary); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { color: var(--md-sys-color-outline-variant); font-size: 18px; user-select: none; }

.empty-state {
    text-align: center;
    padding: 56px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.empty-state .material-icons-round {
    font-size: 72px;
    color: var(--md-sys-color-outline-variant);
    display: block;
    margin-bottom: 16px;
}
.empty-state h3 { font-size: 20px; font-weight: 400; color: var(--md-sys-color-on-surface); margin-bottom: 8px; }
.empty-state p { color: var(--md-sys-color-on-surface-variant); margin-bottom: 24px; max-width: 360px; line-height: 1.6; }

.dropdown {
    position: relative;
    display: inline-block;
}
.dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    background: var(--md-sys-color-surface-container);
    border-radius: var(--shape-large);
    box-shadow: var(--elevation-3);
    min-width: 200px;
    z-index: 150;
    overflow: hidden;
    transform-origin: top right;
    transform: scale(0.9) translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: transform var(--duration-short4) var(--easing-standard), opacity var(--duration-short3);
}
.dropdown.open .dropdown-menu { transform: none; opacity: 1; pointer-events: all; }

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    font-size: 14px;
    color: var(--md-sys-color-on-surface);
    cursor: pointer;
    transition: background var(--duration-short2);
    text-decoration: none;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
}
.dropdown-item:hover { background: var(--md-sys-color-surface-container-high); text-decoration: none; }
.dropdown-item .material-icons-round { font-size: 18px; color: var(--md-sys-color-on-surface-variant); }
.dropdown-item.danger { color: var(--md-sys-color-error); }
.dropdown-item.danger .material-icons-round { color: var(--md-sys-color-error); }
.dropdown-divider { height: 1px; background: var(--md-sys-color-outline-variant); margin: 4px 0; }

.popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 140;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--shape-full);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: 1px solid;
}
.tag-critical { border-color: var(--md-sys-color-error); color: var(--md-sys-color-error); background: var(--md-sys-color-error-container); }
.tag-high { border-color: #e65100; color: #e65100; background: #fff3e0; }
.tag-medium { border-color: #f57f17; color: #f57f17; background: #fffde7; }
.tag-low { border-color: var(--md-sys-color-success); color: var(--md-sys-color-success); background: var(--md-sys-color-success-container); }

.dns-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: var(--shape-full);
    white-space: nowrap;
}
.dns-badge.ok { background: var(--md-sys-color-success-container); color: var(--md-sys-color-on-success-container); }
.dns-badge.warn { background: var(--md-sys-color-warning-container); color: var(--md-sys-color-on-warning-container); }
.dns-badge.fail { background: var(--md-sys-color-error-container); color: var(--md-sys-color-on-error-container); }
.dns-badge.unknown { background: var(--md-sys-color-surface-container-high); color: var(--md-sys-color-on-surface-variant); }

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}
.search-box .material-icons-round {
    position: absolute;
    left: 12px;
    color: var(--md-sys-color-on-surface-variant);
    pointer-events: none;
}
.search-input {
    padding-left: 44px !important;
    border-radius: var(--shape-extra-large) !important;
    background: var(--md-sys-color-surface-container) !important;
    border-color: transparent !important;
}
.search-input:focus { background: var(--md-sys-color-surface) !important; border-color: var(--md-sys-color-primary) !important; }

.filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--md-sys-color-surface-container-low);
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    flex-wrap: wrap;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 24px;
    flex-wrap: wrap;
}
.pagination-item {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--shape-full);
    font-size: 14px;
    font-weight: 500;
    color: var(--md-sys-color-on-surface);
    cursor: pointer;
    transition: background var(--duration-short3);
    text-decoration: none;
    padding: 0 4px;
}
.pagination-item:hover { background: var(--md-sys-color-surface-container-high); text-decoration: none; }
.pagination-item.active { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); }
.pagination-item.disabled { opacity: 0.38; cursor: not-allowed; pointer-events: none; }

.scroll-top-btn {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 48px;
    height: 48px;
    border-radius: var(--shape-large);
    background: var(--md-sys-color-surface-container-high);
    border: 1px solid var(--md-sys-color-outline-variant);
    color: var(--md-sys-color-on-surface-variant);
    box-shadow: var(--elevation-2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 90;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity var(--duration-short4), transform var(--duration-short4), box-shadow var(--duration-short3);
    pointer-events: none;
}
.scroll-top-btn.visible { opacity: 1; transform: none; pointer-events: all; }
.scroll-top-btn:hover { box-shadow: var(--elevation-3); color: var(--md-sys-color-primary); border-color: var(--md-sys-color-primary); }

.section-collapse { overflow: hidden; transition: max-height var(--duration-medium2) var(--easing-standard); }

.report-section { page-break-inside: avoid; margin-bottom: 48px; }
.report-cover {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
    padding: 48px;
    page-break-after: always;
}

.chart-container { position: relative; }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; }
.chart-legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--md-sys-color-on-surface-variant); }
.chart-legend-dot { width: 10px; height: 10px; border-radius: var(--shape-full); flex-shrink: 0; }

.security-score-card {
    background: linear-gradient(135deg, var(--md-sys-color-primary) 0%, #0842a0 100%);
    border-radius: var(--shape-extra-large);
    padding: 32px;
    color: white;
    display: flex;
    align-items: center;
    gap: 32px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}
.security-score-card::before {
    content: '';
    position: absolute;
    right: -40px;
    top: -40px;
    width: 200px;
    height: 200px;
    border-radius: var(--shape-full);
    background: rgba(255,255,255,.08);
    pointer-events: none;
}
.security-score-card::after {
    content: '';
    position: absolute;
    left: -20px;
    bottom: -60px;
    width: 160px;
    height: 160px;
    border-radius: var(--shape-full);
    background: rgba(255,255,255,.06);
    pointer-events: none;
}
.security-score-number {
    font-size: 72px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.03em;
    position: relative;
    z-index: 1;
}
.security-score-info { position: relative; z-index: 1; }
.security-score-title { font-size: 22px; font-weight: 400; margin-bottom: 8px; opacity: 0.9; }
.security-score-subtitle { font-size: 14px; opacity: 0.7; }

.counter { font-variant-numeric: tabular-nums; }

@keyframes count-up {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

.fade-in { animation: fade-in var(--duration-medium2) var(--easing-standard); }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.slide-up { animation: slide-up var(--duration-medium3) var(--easing-emphasized-decel); }
@keyframes slide-up { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

.notch-shape {
    clip-path: path('M 0 24 Q 0 0 24 0 H 76 Q 100 0 100 24 V 76 Q 100 100 76 100 H 24 Q 0 100 0 76 Z');
}

.shape-notch {
    border-radius: var(--shape-large);
    position: relative;
}
.shape-notch::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: var(--md-sys-color-background);
    border-radius: 0 0 var(--shape-medium) 0;
}
.shape-notch-tl::after { top: 0; left: 0; border-radius: 0 0 var(--shape-medium) 0; }
.shape-notch-tr::after { top: 0; right: 0; border-radius: 0 0 0 var(--shape-medium); }
.shape-notch-br::after { bottom: 0; right: 0; border-radius: var(--shape-medium) 0 0 0; }

.keyline {
    height: 1px;
    background: var(--md-sys-color-outline-variant);
    margin: 0;
}

.surface-tint {
    background: color-mix(in srgb, var(--md-sys-color-surface) 90%, var(--md-sys-color-primary) 10%);
}

.text-on-surface { color: var(--md-sys-color-on-surface); }
.text-on-surface-variant { color: var(--md-sys-color-on-surface-variant); }
.text-primary { color: var(--md-sys-color-primary); }
.text-error { color: var(--md-sys-color-error); }
.text-success { color: var(--md-sys-color-success); }
.text-warning { color: var(--md-sys-color-warning); }

.bg-surface { background: var(--md-sys-color-surface); }
.bg-surface-variant { background: var(--md-sys-color-surface-variant); }
.bg-container { background: var(--md-sys-color-surface-container); }
.bg-primary-container { background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); }
.bg-error-container { background: var(--md-sys-color-error-container); color: var(--md-sys-color-on-error-container); }
.bg-success-container { background: var(--md-sys-color-success-container); color: var(--md-sys-color-on-success-container); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.justify-center { justify-content: center; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.min-w-0 { min-width: 0; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.p-0 { padding: 0; }
.p-16 { padding: 16px; }
.p-24 { padding: 24px; }
.rounded { border-radius: var(--shape-small); }
.rounded-lg { border-radius: var(--shape-large); }
.rounded-full { border-radius: var(--shape-full); }
.text-xs { font-size: 11px; }
.text-sm { font-size: 12px; }
.text-base { font-size: 14px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 20px; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.opacity-60 { opacity: 0.6; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.font-mono { font-family: 'Roboto Mono', monospace; }
.text-center { text-align: center; }
.cursor-pointer { cursor: pointer; }
.select-none { user-select: none; }
.overflow-hidden { overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.highlight-row { background: rgba(26,115,232,.06) !important; }
.highlight-row:hover { background: rgba(26,115,232,.1) !important; }

@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 1s linear infinite; display: inline-block; }

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.surface-elevation-1 { box-shadow: var(--elevation-1); }
.surface-elevation-2 { box-shadow: var(--elevation-2); }
.surface-elevation-3 { box-shadow: var(--elevation-3); }

@media (max-width: 1024px) {
    :root { --nav-width: 240px; }
    .page-content { padding: 20px 24px 40px; }
    .security-score-number { font-size: 56px; }
}

@media (max-width: 768px) {
    :root { --nav-width: 280px; }

    .nav-rail {
        transform: translateX(-100%);
        box-shadow: none;
    }
    .nav-rail.open {
        transform: translateX(0);
        box-shadow: var(--elevation-5);
    }
    .nav-overlay {
        position: fixed;
        inset: 0;
        background: var(--md-sys-color-scrim);
        z-index: 99;
        opacity: 0;
        pointer-events: none;
        transition: opacity var(--duration-medium1);
    }
    .nav-overlay.visible { opacity: 1; pointer-events: all; }

    .main-content { margin-left: 0; }
    .topbar { padding: 0 16px; }
    #nav-toggle { display: flex !important; }
    .page-content { padding: 16px 16px 64px; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .stat-value { font-size: 24px; }
    .form-grid { grid-template-columns: 1fr; gap: 0; }
    .form-grid-3 { grid-template-columns: 1fr; gap: 0; }
    .card-header { padding: 16px 20px 12px; }
    .card-body { padding: 16px 20px; }
    .dialog { max-width: 100%; margin: 0; border-radius: var(--shape-extra-large) var(--shape-extra-large) 0 0; align-self: flex-end; }
    .dialog-backdrop { align-items: flex-end; padding: 0; }
    .score-gauge-wrapper { flex-direction: column; align-items: flex-start; gap: 20px; }
    .security-score-card { flex-direction: column; text-align: center; }
    .security-score-number { font-size: 64px; }
    .tabs { padding: 0 16px; }
    .topbar-title { font-size: 18px; }
    .fab-fixed { bottom: 16px; right: 16px; }
    .scroll-top-btn { bottom: 16px; right: 16px; }
    table.data-table thead th:first-child { padding-left: 16px; }
    table.data-table tbody td:first-child { padding-left: 16px; }
    .login-card { padding: 32px 24px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .issue-summary { flex-direction: column; }
    .env-card { padding: 16px; }
    .score-gauge { width: 120px; height: 120px; }
    .score-gauge-number { font-size: 30px; }
}

@media (hover: none) {
    .btn:hover { transform: none; }
    .env-card:hover { transform: none; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ─── Side Drawer ──────────────────────────────────────────── */
.drawer-backdrop {
    position: fixed;
    inset: 0;
    background: var(--md-sys-color-scrim);
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--duration-medium1) var(--easing-standard);
}
.drawer-backdrop.open { opacity: 1; pointer-events: all; }

.drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 480px;
    max-width: 100vw;
    height: 100vh;
    background: var(--md-sys-color-surface);
    z-index: 201;
    display: flex;
    flex-direction: column;
    box-shadow: var(--elevation-5);
    transform: translateX(100%);
    transition: transform var(--duration-medium3) var(--easing-emphasized-decel);
    overflow: hidden;
}
.drawer.open { transform: translateX(0); }

.drawer-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    background: var(--md-sys-color-surface-container-low);
    min-height: 64px;
    flex-shrink: 0;
}
.drawer-title { font-size: 18px; font-weight: 500; color: var(--md-sys-color-on-surface); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer-close { color: var(--md-sys-color-on-surface-variant); }

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.drawer-section {
    padding: 16px 20px;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}
.drawer-section:last-child { border-bottom: none; }
.drawer-section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--md-sys-color-on-surface-variant);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
}

.drawer-field { margin-bottom: 12px; }
.drawer-field:last-child { margin-bottom: 0; }
.drawer-field-label { font-size: 11px; color: var(--md-sys-color-on-surface-variant); margin-bottom: 2px; }
.drawer-field-value { font-size: 14px; font-weight: 400; color: var(--md-sys-color-on-surface); line-height: 1.4; }

.user-drawer-hero {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 20px 16px;
    background: var(--md-sys-color-surface-container-low);
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}
.user-drawer-avatar {
    width: 64px;
    height: 64px;
    border-radius: var(--shape-full);
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 600;
    flex-shrink: 0;
    overflow: hidden;
}
.user-drawer-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-drawer-name { font-size: 20px; font-weight: 500; color: var(--md-sys-color-on-surface); line-height: 1.3; }
.user-drawer-email { font-size: 13px; color: var(--md-sys-color-on-surface-variant); margin-top: 2px; }

.drawer-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* ─── Expandable table rows ─────────────────────────────────── */
.row-expand-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--md-sys-color-on-surface-variant);
    padding: 4px;
    border-radius: var(--shape-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background var(--duration-short2), transform var(--duration-short3);
}
.row-expand-btn:hover { background: var(--md-sys-color-surface-container-high); color: var(--md-sys-color-on-surface); }
.row-expand-btn.expanded { transform: rotate(180deg); }
.row-expand-btn .material-icons-round { font-size: 18px; }

.expandable-detail-row td {
    background: var(--md-sys-color-surface-container-lowest);
    padding: 0 !important;
}
.expandable-detail-content {
    display: none;
    padding: 16px 24px;
}
.expandable-detail-row.open .expandable-detail-content { display: block; }

/* ─── Card toolbar (search + filters inside card) ────────────── */
.card-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    flex-wrap: wrap;
    background: var(--md-sys-color-surface-container-lowest);
}
.card-toolbar .search-box { flex: 1; min-width: 200px; max-width: 340px; }

/* ─── Sortable table headers ─────────────────────────────────── */
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover { background: var(--md-sys-color-surface-container); }
th.sortable .sort-icon { font-size: 14px; vertical-align: middle; opacity: 0.4; margin-left: 2px; transition: opacity var(--duration-short2); }
th.sortable.asc .sort-icon, th.sortable.desc .sort-icon { opacity: 1; color: var(--md-sys-color-primary); }
th.sortable.desc .sort-icon { transform: rotate(180deg); display: inline-block; }

/* ─── User table avatar cell ─────────────────────────────────── */
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--shape-full);
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
    overflow: hidden;
}
.user-cell-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-cell-name { font-size: 13px; font-weight: 500; color: var(--md-sys-color-on-surface); }
.user-cell-sub { font-size: 11px; color: var(--md-sys-color-on-surface-variant); }

/* ─── Policy category group ─────────────────────────────────── */
.policy-category-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 24px;
    background: var(--md-sys-color-surface-container-low);
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    transition: background var(--duration-short2);
}
.policy-category-header:hover { background: var(--md-sys-color-surface-container); }
.policy-category-name { font-size: 13px; font-weight: 600; color: var(--md-sys-color-on-surface); flex: 1; }
.policy-category-count { font-size: 12px; color: var(--md-sys-color-on-surface-variant); }
.policy-category-toggle { color: var(--md-sys-color-on-surface-variant); font-size: 18px; transition: transform var(--duration-short3); }
.policy-category-header.collapsed .policy-category-toggle { transform: rotate(-90deg); }
.policy-rows { display: block; }
.policy-rows.hidden { display: none; }

/* ─── Service status pills ───────────────────────────────────── */
.service-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: var(--shape-full);
    font-size: 12px;
    font-weight: 500;
}
.service-pill.enabled { background: var(--md-sys-color-success-container); color: var(--md-sys-color-on-success-container); }
.service-pill.disabled { background: var(--md-sys-color-surface-container-high); color: var(--md-sys-color-on-surface-variant); }

/* ─── Clickable table rows ───────────────────────────────────── */
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--md-sys-color-surface-container-low); }

@media print {
    * { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
    .nav-rail, .topbar, .tabs, .btn, .fab-fixed, .scroll-top-btn, #sync-btn { display: none !important; }
    .main-content { margin-left: 0 !important; }
    .page-content { padding: 0 !important; }
    .card { break-inside: avoid; box-shadow: none !important; border: 1px solid #ddd; }
    a { color: inherit !important; text-decoration: none !important; }
    .dialog-backdrop { display: none !important; }
    .drawer-backdrop, .drawer { display: none !important; }
    .snackbar-container { display: none !important; }
    table.data-table tbody tr { break-inside: avoid; }
}
