@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap');

:root {
    --ink: #17223b;
    --muted: #6f7b91;
    --line: #e5e9f2;
    --surface: #ffffff;
    --canvas: #f5f7fb;
    --primary: #5574e8;
    --primary-dark: #405dcc;
    --violet: #765be7;
    --green: #18a874;
    --orange: #ee9b2d;
    --red: #e5505d;
    --sidebar: 248px;
    --app-max-width: 1920px;
    --radius: 18px;
    --shadow: 0 16px 45px rgba(35, 52, 89, .08);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; min-height: 100vh; background: var(--canvas); color: var(--ink); font: 14px/1.5 "DM Sans", "Segoe UI", sans-serif; }
button, input, select { font: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(21px, 2vw, 28px); letter-spacing: -.03em; }
h2 { margin-bottom: 8px; font-size: clamp(25px, 3vw, 38px); line-height: 1.15; letter-spacing: -.04em; }
h3 { margin-bottom: 8px; font-size: 19px; letter-spacing: -.02em; }
p { color: var(--muted); }

.app-shell { display: flex; width: min(100%, var(--app-max-width)); margin: 0 auto; }
.sidebar { position: fixed; inset: 0 auto 0 max(0px, calc((100vw - var(--app-max-width)) / 2)); z-index: 30; display: flex; width: var(--sidebar); flex-direction: column; padding: 24px 16px; background: var(--surface); border-right: 1px solid var(--line); transition: transform .25s ease; }
.brand { display: block; padding: 0 10px 28px; }
.brand img { width: 184px; height: auto; }
.nav { display: flex; flex: 1; flex-direction: column; gap: 5px; }
.nav a { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; min-height: 46px; padding: 0 13px; color: #617088; border-radius: 12px; font-weight: 600; transition: .18s ease; }
.nav a:hover { color: var(--ink); background: #f5f7fc; }
.nav a.active { color: #405dcc; background: #eef1ff; }
.nav a.disabled { opacity: .48; cursor: not-allowed; }
.nav a small { padding: 2px 7px; border-radius: 20px; background: #eef0f6; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.nav-icon { display: grid; width: 25px; height: 25px; place-items: center; font-size: 18px; }
.nav-label { margin: 24px 13px 7px; color: #a0a8b8; font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.sidebar-profile { display: grid; grid-template-columns: 38px 1fr; gap: 10px; align-items: center; padding: 16px 10px 0; border-top: 1px solid var(--line); }
.sidebar-profile strong, .sidebar-profile small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-profile small { color: var(--muted); font-size: 11px; }
.avatar { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 12px; color: white; background: linear-gradient(135deg, var(--primary), var(--violet)); font-weight: 700; }
.app-main { display: flex; width: calc(min(100vw, var(--app-max-width)) - var(--sidebar)); max-width: calc(var(--app-max-width) - var(--sidebar)); min-height: 100vh; margin-left: var(--sidebar); flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; min-height: 86px; align-items: center; gap: 16px; padding: 14px clamp(20px, 4vw, 48px); background: rgba(245, 247, 251, .88); border-bottom: 1px solid rgba(229, 233, 242, .85); backdrop-filter: blur(14px); }
.topbar > div { flex: 1; }
.button.logout-button { width: 52px; min-height: 52px; padding: 0; }
.logout-icon { display: block; width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; }
.eyebrow { display: block; margin-bottom: 4px; color: var(--primary); font-size: 10px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.menu-button { display: none; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; }
.content { width: 100%; max-width: 1600px; margin: 0 auto; padding: clamp(22px, 4vw, 48px); flex: 1; }
.footer { display: flex; justify-content: space-between; padding: 20px clamp(22px, 4vw, 48px); color: #929bad; border-top: 1px solid var(--line); font-size: 11px; }
.sidebar-backdrop { display: none; }
/* Desktop sidebar grouping and collapse */
.sidebar-collapse-button { position: absolute; top: 22px; right: -13px; z-index: 2; display: grid; width: 26px; height: 38px; place-items: center; color: var(--primary); background: white; border: 1px solid var(--line); border-radius: 999px; box-shadow: 0 8px 22px rgba(35,52,89,.12); cursor: pointer; font-size: 18px; font-weight: 800; }
.nav-group { display: grid; gap: 4px; }
.nav-subitems { display: grid; gap: 4px; margin-left: 25px; padding-left: 10px; border-left: 1px solid var(--line); }
.nav-subitems a { min-height: 38px; grid-template-columns: 24px 1fr auto; padding-left: 10px; font-size: 12px; }
.nav-subitems .nav-icon { width: 21px; height: 21px; font-size: 14px; }
.sidebar-collapsed { --sidebar: 78px; }
.sidebar-collapsed .sidebar { padding-left: 12px; padding-right: 12px; }
.sidebar-collapsed .brand { padding-left: 0; padding-right: 0; text-align: center; }
.sidebar-collapsed .brand img { width: 46px; max-width: 46px; height: 46px; object-fit: cover; object-position: left center; }
.sidebar-collapsed .nav a { grid-template-columns: 1fr; justify-items: center; padding: 0; }
.sidebar-collapsed .nav a > span:not(.nav-icon), .sidebar-collapsed .nav-label, .sidebar-collapsed .sidebar-profile div, .sidebar-collapsed .nav-subitems { display: none; }
.sidebar-collapsed .nav-icon { width: 38px; height: 38px; font-size: 18px; }
.sidebar-collapsed .sidebar-profile { grid-template-columns: 1fr; padding-left: 0; padding-right: 0; justify-items: center; }
.sidebar-collapsed .avatar { width: 38px; height: 38px; }
@media (max-width: 760px) {
    .sidebar-collapse-button { display: none; }
    .sidebar-collapsed { --sidebar: 220px; }
    .sidebar-collapsed .sidebar { padding: 24px 16px; }
    .sidebar-collapsed .brand img { width: 184px; max-width: 184px; height: auto; object-fit: contain; }
    .sidebar-collapsed .nav a { grid-template-columns: 28px 1fr auto; justify-items: stretch; padding: 0 13px; }
    .sidebar-collapsed .nav a > span:not(.nav-icon), .sidebar-collapsed .nav-label, .sidebar-collapsed .sidebar-profile div { display: block; }
    .sidebar-collapsed .nav-subitems { display: grid; }
    .sidebar-collapsed .sidebar-profile { grid-template-columns: 38px 1fr; justify-items: stretch; padding: 16px 10px 0; }
    .button.logout-button { width: 48px; min-height: 48px; }
    .logout-icon { width: 30px; height: 30px; }
}

.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; padding: 0 18px; border: 1px solid transparent; border-radius: 11px; font-weight: 700; cursor: pointer; transition: transform .16s ease, box-shadow .16s ease, background .16s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: white; background: linear-gradient(135deg, var(--primary), #6c62e5); box-shadow: 0 8px 22px rgba(85,116,232,.24); }
.button.primary:hover { background: linear-gradient(135deg, var(--primary-dark), #5b50d0); }
.button.secondary, .button.ghost { color: var(--ink); background: var(--surface); border-color: var(--line); }
.button.full { width: 100%; }
.panel { padding: clamp(20px, 3vw, 30px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.panel-heading h3 { margin: 0; }
.hero-panel { position: relative; overflow: hidden; display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 22px; padding: clamp(28px, 5vw, 54px); color: white; background: linear-gradient(125deg, #273a73, #536ed4 58%, #7b60e8); border-radius: 24px; box-shadow: 0 20px 55px rgba(58, 75, 145, .24); }
.hero-panel::after { position: absolute; right: -55px; top: -110px; width: 330px; height: 330px; border: 55px solid rgba(255,255,255,.08); border-radius: 50%; content: ""; }
.hero-panel > * { position: relative; z-index: 1; }
.hero-panel h2 { max-width: 600px; font-size: clamp(30px, 4vw, 48px); }
.hero-panel p { max-width: 650px; margin-bottom: 0; color: rgba(255,255,255,.75); font-size: 16px; }
.hero-panel .eyebrow { color: #c8d7ff; }
.hero-panel .button { color: #3f58ba; background: white; white-space: nowrap; }
.hero-panel .button:hover, .hero-panel .button:focus-visible { color: #fff; background: #2946b3; }
.dashboard-quick-access { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.dashboard-quick-button { min-height: 48px; gap: 9px; color: white !important; background: linear-gradient(125deg, #273a73, #536ed4 58%, #7b60e8) !important; border-color: transparent !important; box-shadow: 0 10px 24px rgba(58,75,145,.18); }
.dashboard-quick-button:hover, .dashboard-quick-button:focus-visible { color: #000 !important; background: linear-gradient(125deg, #e6f1ff, #e9edff 58%, #eee8ff) !important; border-color: #d8dff5 !important; }
.dashboard-quick-button > span { display: grid; width: 25px; height: 25px; place-items: center; font-size: 18px; }
.dashboard-quick-button > span svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dashboard-last-login { display: flex; align-items: center; justify-content: flex-end; gap: 9px; margin-top: 20px; color: var(--muted); font-size: 11px; }
.dashboard-last-login span { text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.dashboard-last-login strong { color: var(--ink); }
.dashboard-last-login a { color: var(--primary-dark); font-weight: 700; text-decoration: underline; text-decoration-color: rgba(64,93,204,.3); text-underline-offset: 3px; }
.dashboard-last-login a:hover, .dashboard-last-login a:focus-visible { color: var(--violet); text-decoration-color: currentColor; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.stat-card { display: flex; align-items: center; gap: 15px; padding: 21px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.stat-card strong, .stat-card span { display: block; }
.stat-card strong { font-size: 27px; line-height: 1.1; }
.stat-card div span { color: var(--muted); font-size: 12px; }
.stat-card .stat-icon { display: inline-flex; align-self: center; flex: 0 0 44px; width: 44px; height: 44px; padding: 0; align-items: center; justify-content: center; border-radius: 13px; font-size: 19px; font-weight: 700; line-height: 1; text-align: center; }
.safety-triangle-icon { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.stat-icon.blue { color: #4267dd; background: #edf1ff; }.stat-icon.violet { color: #765be7; background: #f1edff; }.stat-icon.orange { color: #d47e13; background: #fff3df; }.stat-icon.red { color: #d83d4d; background: #ffeaed; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, .8fr); gap: 22px; }
.progress-list > div { display: grid; grid-template-columns: 14px 1fr auto; gap: 13px; align-items: center; padding: 15px 0; border-top: 1px solid var(--line); }
.progress-list > div:first-child { border-top: 0; }
.progress-list strong, .progress-list small { display: block; }.progress-list small { color: var(--muted); }.progress-list > div > span:last-child { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.status-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 0 4px currentColor inset, 0 0 0 3px rgba(0,0,0,.03); }
.status-dot.green { color: var(--green); background: var(--green); }.status-dot.orange { color: var(--orange); background: var(--orange); }.status-dot.red { color: var(--red); background: var(--red); }
.callout-panel { background: linear-gradient(155deg, white, #f3f0ff); }
.legend { display: grid; gap: 13px; margin-top: 25px; }.legend span { display: flex; align-items: center; gap: 10px; color: #526078; }.legend i { flex: 0 0 auto; }

.page-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 25px; }.page-intro p { max-width: 680px; margin-bottom: 0; }.page-intro.split { align-items: center; }
.summary-pills { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }.summary-pills span { padding: 8px 12px; background: white; border: 1px solid var(--line); border-radius: 40px; color: var(--muted); font-size: 11px; }.summary-pills strong { color: var(--ink); }
.upload-panel { margin-bottom: 20px; }
.drop-zone { display: grid; min-height: 260px; place-items: center; align-content: center; gap: 7px; padding: 30px; text-align: center; background: #fafbfe; border: 2px dashed #cfd6e7; border-radius: 16px; cursor: pointer; transition: .18s ease; }.drop-zone:hover, .drop-zone.has-file { background: #f3f5ff; border-color: var(--primary); }.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }.drop-zone > span { color: var(--muted); }.upload-mark { display: grid; width: 55px; height: 55px; place-items: center; margin-bottom: 8px; color: var(--primary) !important; background: #eaf0ff; border-radius: 17px; font-size: 27px; }
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 22px; }.privacy-note { color: var(--muted); font-size: 12px; }
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }.info-grid article { display: grid; grid-template-columns: 38px 1fr; gap: 13px; padding: 20px; }.info-grid article > strong { display: grid; width: 34px; height: 34px; place-items: center; color: white; background: var(--primary); border-radius: 11px; }.info-grid h3 { margin-bottom: 3px; font-size: 15px; }.info-grid p { margin: 0; font-size: 12px; }
.alert { margin-bottom: 18px; padding: 13px 16px; border: 1px solid; border-radius: 12px; }.alert.success { color: #137954; background: #eaf9f3; border-color: #bfead9; }.alert.error { color: #a82c39; background: #fff0f2; border-color: #f4c5ca; }.alert.warning { color: #946012; background: #fff7e8; border-color: #f1d59d; }
.roster-panel { margin-bottom: 22px; padding-left: 0; padding-right: 0; }.roster-panel .panel-heading { padding: 0 28px; }.scroll-hint { color: var(--muted); font-size: 11px; }
.table-scroll { overflow-x: auto; scrollbar-color: #cbd2e3 transparent; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
.roster-table { min-width: 1370px; font-size: 10px; }.roster-table th, .roster-table td { height: 38px; padding: 5px 7px; text-align: center; white-space: nowrap; border-top: 1px solid var(--line); border-right: 1px solid #f0f2f7; }.roster-table thead th { color: #758097; background: #f8f9fc; font-weight: 700; }.roster-table .sticky-col { position: sticky; left: 0; z-index: 2; width: 205px; max-width: 205px; padding-left: 24px; text-align: left; background: white; box-shadow: 8px 0 12px rgba(38,48,74,.04); }.roster-table thead .sticky-col { z-index: 3; background: #f8f9fc; }.roster-table .sticky-col strong, .roster-table .sticky-col small { display: block; overflow: hidden; text-overflow: ellipsis; }.roster-table .sticky-col small { color: var(--muted); font-weight: 400; }.roster-table td[class*="code-o"] { color: #738099; background: #fafbfc; }.roster-table td[class*="code-ab"], .roster-table td[class*="code-fi"] { color: #7a5e25; background: #fffaf0; }.roster-table .annotation-row td { height: 29px; color: #6b5aa4; text-align: left; background: #f7f4ff; border-top: 0; }.roster-table .annotation-row .sticky-col { background: #f7f4ff; }
.preview-details { align-items: start; }.code-cloud { display: flex; flex-wrap: wrap; gap: 8px; }.code-cloud span { display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: #f5f7fb; border: 1px solid var(--line); border-radius: 9px; }.code-cloud small { display: grid; min-width: 21px; height: 21px; place-items: center; color: var(--primary); background: white; border-radius: 7px; }.muted { margin: 20px 0 0; color: var(--muted); font-size: 12px; }.approval-panel form { margin: 25px 0 8px; }

.users-grid { grid-template-columns: minmax(0, 1.8fr) minmax(290px, .7fr); align-items: start; }.data-table { min-width: 760px; }.data-table th, .data-table td { padding: 13px 12px; text-align: left; border-top: 1px solid var(--line); }.data-table thead th { padding-top: 0; color: var(--muted); border-top: 0; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }.data-table td strong, .data-table td small { display: block; }.data-table td small { color: var(--muted); }.role-badge { display: inline-flex; padding: 4px 9px; border-radius: 20px; font-size: 10px; font-weight: 700; }.role-badge.admin { color: #5e45ca; background: #efeaff; }.role-badge.user { color: #4267a6; background: #eaf2ff; }.status-label { display: inline-flex; align-items: center; gap: 6px; }.status-label i { width: 7px; height: 7px; background: #a1aaba; border-radius: 50%; }.status-label.active i { background: var(--green); }.action-menu { position: relative; }.action-menu summary { cursor: pointer; color: var(--primary); font-weight: 600; }.action-menu > div { position: absolute; right: 0; z-index: 5; min-width: 150px; padding: 6px; background: white; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }.action-menu button { width: 100%; padding: 8px; text-align: left; background: transparent; border: 0; border-radius: 7px; cursor: pointer; }.action-menu button:hover { background: #f4f6fb; }.create-user-panel { position: sticky; top: 110px; }
.form-stack { display: grid; gap: 17px; }.form-stack label > span, .form-stack label > small { display: block; }.form-stack label > span { margin-bottom: 6px; font-size: 12px; font-weight: 700; }.form-stack label > small { margin-top: 4px; color: var(--muted); font-size: 10px; }.form-stack input, .form-stack select { width: 100%; height: 44px; padding: 0 12px; color: var(--ink); background: white; border: 1px solid #d9dfeb; border-radius: 10px; outline: 0; }.form-stack input:focus, .form-stack select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(85,116,232,.12); }
.password-panel { max-width: 520px; }
.action-menu .reset-form { padding-top: 6px; border-top: 1px solid var(--line); }
.action-menu .reset-form input { width: 100%; height: 34px; margin-bottom: 4px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; font-size: 11px; }
.empty-state { max-width: 640px; margin: 40px auto; text-align: center; }.empty-state .status-dot { width: 16px; height: 16px; margin-bottom: 16px; }

.auth-shell { display: grid; min-height: 100vh; padding: 30px 20px; place-items: center; align-content: center; background: radial-gradient(circle at 10% 10%, #edf1ff, transparent 35%), radial-gradient(circle at 90% 90%, #eee8ff, transparent 40%), #f8f9fc; }.auth-card { width: min(440px, 100%); padding: clamp(28px, 6vw, 46px); background: rgba(255,255,255,.94); border: 1px solid white; border-radius: 24px; box-shadow: 0 28px 80px rgba(37,50,88,.14); }.auth-logo { width: 190px; margin-bottom: 38px; }.auth-heading { margin-bottom: 25px; }.auth-heading h1 { margin-bottom: 8px; font-size: 29px; }.auth-heading p { margin-bottom: 0; }.auth-footnote { margin: 24px 0 0; font-size: 11px; }

@media (max-width: 1050px) {
    :root { --sidebar: 220px; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .content-grid, .users-grid { grid-template-columns: 1fr; }
    .create-user-panel { position: static; }
    .dashboard-quick-access { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    .sidebar { width: min(290px, 84vw); transform: translateX(-102%); box-shadow: 20px 0 50px rgba(24,34,58,.2); }
    .app-main { width: 100%; margin-left: 0; }
    .menu-open .sidebar { transform: translateX(0); }
    .sidebar-backdrop { position: fixed; inset: 0; z-index: 25; background: rgba(24,32,53,.35); backdrop-filter: blur(2px); }
    .menu-open .sidebar-backdrop { display: block; }
    .menu-button { display: inline-grid; place-items: center; }
    .topbar { min-height: 74px; padding: 11px 16px; }
    .content { padding: 22px 16px; }
    .hero-panel { display: block; padding: 29px 24px; }.hero-panel .button { margin-top: 24px; }
    .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }.stat-card { display: flex; align-items: center; padding: 16px; }.stat-icon { margin-bottom: 0; }
    .page-intro, .page-intro.split { display: block; }.summary-pills { justify-content: flex-start; margin-top: 18px; }
    .form-actions { display: grid; }.form-actions .button { width: 100%; }
    .info-grid { grid-template-columns: 1fr; }
    .footer { display: block; }.footer span { display: block; }
}

@media (max-width: 440px) {
    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
    .stat-card {
        min-width: 0;
        gap: 9px;
        padding: 12px 10px;
    }
    .stat-card .stat-icon {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
    }
    .stat-card div { min-width: 0; }
    .stat-card strong { font-size: 22px; }
    .stat-card div span {
        font-size: 10px;
        line-height: 1.25;
    }
    .topbar .eyebrow { display: none; }.topbar h1 { font-size: 20px; }
    .drop-zone { min-height: 220px; padding: 20px; }
    .dashboard-quick-access {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
    .dashboard-quick-button {
        min-width: 0;
        padding: 0 9px;
        font-size: 11px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
.stat-icon.green { color: #12835d; background: #e7f8f1; }
.period-form { display: flex; align-items: end; gap: 9px; padding: 13px; background: white; border: 1px solid var(--line); border-radius: 14px; }
.period-form label span { display: block; margin-bottom: 3px; color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.period-form input { height: 39px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; }
.findings-panel { margin-bottom: 22px; }
.rules-panel { margin-top: 22px; }
.legal-note { color: var(--muted); font-size: 11px; }
.rule-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.rule-card { padding: 18px; background: #fafbfe; border: 1px solid var(--line); border-radius: 14px; }
.rule-card h4 { margin: 14px 0 5px; font-size: 15px; }
.rule-card p { min-height: 72px; margin: 8px 0 14px; font-size: 11px; }
.rule-card a { color: var(--primary); font-size: 11px; font-weight: 700; }
.rule-top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.rule-number { color: var(--primary); font-size: 20px; }
.code-definition-grid { display: grid; grid-template-columns: repeat(3, minmax(260px, 1fr)); gap: 16px; }
.code-definition-card { padding: 20px; }
.code-card-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.code-token { display: inline-flex; padding: 7px 10px; color: white; background: linear-gradient(135deg, var(--primary), var(--violet)); border-radius: 9px; font-weight: 700; }
.form-stack.compact { gap: 11px; }
.time-fields { display: grid; grid-template-columns: 1fr 1fr .8fr; gap: 7px; }

@media (max-width: 1050px) {
    .rule-grid, .code-definition-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
    .period-form { display: grid; grid-template-columns: 1fr 1fr; margin-top: 18px; }
    .period-form .button { grid-column: 1 / -1; }
    .rule-grid, .code-definition-grid { grid-template-columns: 1fr; }
    .rule-card p { min-height: 0; }
}

.roster-history-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.roster-history-card { display: grid; gap: 19px; padding: 23px; }
.roster-card-top { display: grid; grid-template-columns: 58px 1fr auto; gap: 14px; align-items: center; }
.month-tile { display: grid; width: 58px; height: 58px; place-items: center; align-content: center; color: white; background: linear-gradient(135deg, var(--primary), var(--violet)); border-radius: 16px; box-shadow: 0 9px 22px rgba(85,116,232,.22); }
.month-tile strong { font-size: 20px; line-height: 1; }.month-tile span { margin-top: 3px; font-size: 9px; opacity: .8; }
.roster-card-title h3, .roster-card-title p { margin: 0; }.roster-card-title p { font-size: 11px; }
.import-status { padding: 5px 9px; color: #68758c; background: #eff2f7; border-radius: 30px; font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.import-status.imported { color: #137954; background: #e8f8f1; }.import-status.review { color: #946012; background: #fff4df; }.import-status.failed, .import-status.rejected { color: #aa3340; background: #ffebee; }
.roster-metrics { display: grid; grid-template-columns: repeat(3, 1fr); overflow: hidden; background: #f7f9fc; border: 1px solid #edf0f5; border-radius: 13px; }
.roster-metrics span { padding: 12px; color: var(--muted); text-align: center; font-size: 10px; border-left: 1px solid #e7ebf2; }.roster-metrics span:first-child { border-left: 0; }.roster-metrics strong { display: block; color: var(--ink); font-size: 18px; }
.roster-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; margin: 0; }
.roster-meta div { min-width: 0; }.roster-meta dt { color: #969fb0; font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }.roster-meta dd { overflow: hidden; margin: 3px 0 0; color: #536078; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.roster-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding-top: 16px; border-top: 1px solid var(--line); }.roster-card-footer > span { color: #939cad; font-family: Consolas, monospace; font-size: 9px; }

@media (max-width: 1050px) { .roster-history-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
    .roster-card-top { grid-template-columns: 52px 1fr; }.month-tile { width: 52px; height: 52px; }.import-status { grid-column: 1 / -1; justify-self: start; }
    .roster-meta { grid-template-columns: 1fr; }.roster-card-footer { align-items: stretch; flex-direction: column; }.roster-card-footer .button { width: 100%; }
}

.roster-search-panel, .matrix-filter-panel { margin-bottom: 20px; padding: 18px; }
.roster-search-panel { margin-bottom: 14px; padding: 14px 16px; }
.roster-archive-filter { gap: 8px; }
.roster-archive-filter label { min-width: 170px; }
.roster-archive-filter .search-grow { min-width: 220px; flex: 1; }
.roster-archive-filter input, .roster-archive-filter select { height: 38px; }
.roster-archive-filter .button { min-height: 38px; padding: 0 14px; }
.roster-search-panel .search-result-note { margin: 9px 0 0; font-size: 10px; }
.roster-search-form, .matrix-filter-form { display: flex; align-items: end; gap: 10px; }
.roster-search-form label, .matrix-filter-form label { min-width: 210px; }
.roster-search-form label > span, .matrix-filter-form label > span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.roster-search-form input, .roster-search-form select, .matrix-filter-form input, .matrix-filter-form select { width: 100%; height: 42px; padding: 0 11px; color: var(--ink); background: white; border: 1px solid #d9dfeb; border-radius: 10px; outline: 0; }
.roster-search-form input:focus, .roster-search-form select:focus, .matrix-filter-form input:focus, .matrix-filter-form select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(85,116,232,.12); }
.search-grow { flex: 1; }.search-result-note { margin: 12px 0 -2px; color: var(--muted); font-size: 10px; }
.roster-card-actions { display: flex; gap: 7px; }.roster-card-actions .button { min-height: 38px; padding: 0 13px; }
.back-link { display: block; margin-bottom: 14px; color: var(--primary); font-size: 11px; font-weight: 700; }
.roster-source-panel { align-self: start; }.roster-source-panel .button { margin-top: 12px; }

@media (max-width: 760px) {
    .roster-search-form, .matrix-filter-form { display: grid; grid-template-columns: 1fr 1fr; }
    .roster-search-form label, .matrix-filter-form label, .search-grow { min-width: 0; }
    .roster-search-form .search-grow, .matrix-filter-form .search-grow { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
    .roster-search-form, .matrix-filter-form { grid-template-columns: 1fr; }
    .roster-search-form .search-grow, .matrix-filter-form .search-grow { grid-column: auto; }
    .roster-card-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
}

.duty-code-panel { padding-left: 0; padding-right: 0; overflow: hidden; }
.duty-code-panel .panel-heading { padding: 0 28px; }
.duty-code-table { min-width: 1220px; }
.duty-code-table th:first-child, .duty-code-table td:first-child { padding-left: 28px; }
.duty-code-table th:last-child, .duty-code-table td:last-child { padding-right: 28px; }
.duty-code-table td { vertical-align: middle; }
.duty-code-table .unmapped-row { background: #fffdf8; }
.duty-code-table input, .duty-code-table select { height: 38px; padding: 0 9px; color: var(--ink); background: white; border: 1px solid #d9dfeb; border-radius: 8px; outline: 0; font: inherit; }
.duty-code-table input:focus, .duty-code-table select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(85,116,232,.12); }
.duty-code-table .code-label-input { width: 210px; }
.duty-code-table select[name="category"] { width: 112px; }
.duty-code-table select[name="counts_as_work"] { width: 122px; }
.duty-code-table input[type="time"] { width: 105px; }
.duty-code-table input[type="number"] { width: 66px; }
.break-input { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; }
.code-save-button { min-height: 38px; padding: 0 15px; }
@media (max-width: 760px) {
    .duty-code-panel .panel-heading { display: block; padding: 0 20px; }
    .duty-code-panel .summary-pills { margin-top: 12px; }
}
.group-title-panel { margin-bottom: 20px; padding: 20px 0 0; overflow: hidden; }
.group-title-panel .panel-heading, .roster-list-panel .panel-heading { padding: 0 24px; }
.group-title-panel .panel-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.group-title-table { min-width: 680px; }
.group-title-table th:first-child, .group-title-table td:first-child { padding-left: 24px; }
.group-title-table th:last-child, .group-title-table td:last-child { padding-right: 24px; }
.group-title-table input { width: min(420px, 100%); height: 38px; padding: 0 10px; color: var(--ink); background: white; border: 1px solid #d9dfeb; border-radius: 8px; outline: 0; }
.group-title-table input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(85,116,232,.12); }
.roster-list-panel { padding: 14px 0 0; overflow: hidden; }
.roster-list-panel .panel-heading { margin-bottom: 12px; padding: 0 16px; }
.roster-list-table { min-width: 0; font-size: 10px; }
.roster-list-table th, .roster-list-table td { padding: 6px 5px; vertical-align: middle; }
.roster-list-table th:first-child, .roster-list-table td:first-child { padding-left: 16px; }
.roster-list-table th:last-child, .roster-list-table td:last-child { padding-right: 16px; }
.roster-list-table .roster-group-row th { padding: 9px 16px; color: var(--ink); background: #f5f7fc; border-top: 1px solid #e3e7f0; }
.roster-group-summary { display: grid; grid-template-columns: minmax(220px, .72fr) minmax(0, 1.8fr); gap: 12px; align-items: center; }
.roster-group-toggle { display: grid; grid-template-columns: 24px auto minmax(0, 1fr); gap: 7px; align-items: center; padding: 0; color: var(--ink); background: transparent; border: 0; text-align: left; cursor: pointer; }
.roster-group-toggle-mark { display: grid; width: 24px; height: 24px; place-items: center; color: var(--primary); background: white; border: 1px solid var(--line); border-radius: 7px; font-size: 14px; font-weight: 800; }
.roster-list-table .roster-group-row .code-token { padding: 4px 7px; font-size: 9px; }
.roster-group-title { min-width: 0; overflow: hidden; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.roster-group-title small { display: block; margin-top: 1px; color: var(--muted); font-size: 9px; font-weight: 500; }
.yearly-import-row { display: grid; grid-template-columns: 38px repeat(12, minmax(0, 1fr)); gap: 2px; align-items: center; }
.yearly-import-row > strong { font-size: 10px; }
.yearly-import-month { display: grid; gap: 3px; justify-items: center; color: var(--muted); font-weight: 500; }
.yearly-import-month small { font-size: 8px; }
.yearly-import-month .status-dot { width: 8px; height: 8px; }
.roster-detail-heading th { padding: 7px 5px; color: var(--muted); background: #fafbfe; border-top: 1px solid var(--line); font-size: 8px; letter-spacing: .07em; text-transform: uppercase; }
.roster-detail-heading th:first-child { padding-left: 16px; }
.roster-detail-heading th:last-child { padding-right: 16px; }
.roster-list-table td > strong, .roster-list-table td > small { display: block; }
.roster-list-table td > small { margin-top: 2px; color: var(--muted); font-size: 9px; white-space: nowrap; }
.roster-list-table th:nth-child(1), .roster-list-table td:nth-child(1) { width: 140px; }
.roster-list-table th:nth-child(2), .roster-list-table td:nth-child(2), .roster-list-table th:nth-child(3), .roster-list-table td:nth-child(3) { width: 72px; }
.roster-list-table th:nth-child(4), .roster-list-table td:nth-child(4) { width: 150px; max-width: 150px; }
.roster-list-table th:nth-child(5), .roster-list-table td:nth-child(5) { width: 125px; }
.roster-list-table th:nth-child(6), .roster-list-table td:nth-child(6) { width: 88px; }
.roster-list-table th:nth-child(7), .roster-list-table td:nth-child(7) { width: 110px; }
.roster-list-table .source-cell { width: 150px; max-width: 150px; }
.roster-list-table .source-cell strong, .roster-list-table .source-cell small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compact-actions { display: flex; gap: 5px; }
.button.compact-button { min-height: 30px; padding: 0 9px; font-size: 9px; }
@media (max-width: 1050px) {
    .roster-list-table { min-width: 900px; }
}
@media (max-width: 760px) {
    .group-title-panel .panel-heading, .roster-list-panel .panel-heading { display: block; padding: 0 18px; }
}
.roster-table thead th.weekend-day { color: #b24a57; background: #fff0f2; font-weight: 900; box-shadow: inset 0 -3px 0 #e78490; }
.roster-table td.weekend-cell { background-color: #fffafb; }
/* Roster selection, compliance filters, and statistics */
.compact-filter-panel { margin-bottom: 22px; padding: 18px; }
.filter-form { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }
.filter-form label { min-width: 190px; }
.filter-form label > span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.filter-form input, .filter-form select { width: 100%; min-height: 42px; padding: 0 11px; color: var(--ink); background: white; border: 1px solid #d9dfeb; border-radius: 10px; outline: 0; }
.filter-form input:focus, .filter-form select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(85,116,232,.12); }
.filter-actions { display: flex; gap: 8px; align-items: center; }
.roster-browser-filter .employee-multiselect { min-width: 280px; flex: 1; }
.filter-form .employee-multiselect select { min-height: 116px; padding: 6px; }
.employee-multiselect small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.roster-browser-panel { padding: 20px 0 0; overflow: hidden; }
.roster-browser-panel .panel-heading { padding: 0 24px; }
.duty-matrix { min-width: max-content; font-size: 10px; }
.duty-matrix th, .duty-matrix td { min-width: 42px; height: 40px; padding: 5px 7px; text-align: center; border-top: 1px solid var(--line); border-right: 1px solid #f0f2f7; }
.duty-matrix thead th { background: #f8f9fc; }
.duty-matrix thead th small, .duty-matrix thead th strong { display: block; }
.duty-matrix .sticky-name { position: sticky; left: 0; z-index: 2; min-width: 220px; max-width: 220px; padding-left: 24px; text-align: left; background: white; box-shadow: 8px 0 12px rgba(38,48,74,.04); }
.duty-matrix thead .sticky-name { z-index: 3; background: #f8f9fc; }
.duty-matrix .sticky-name strong, .duty-matrix .sticky-name small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.duty-matrix .sticky-name small { color: var(--muted); font-weight: 400; }
.weekend-day { color: #b24a57; background: #fff0f2 !important; font-weight: 900; }
.weekend-cell { background-color: #fffafb; }
.holiday-day { color: #8a5510; background: #fff3df !important; box-shadow: inset 0 -3px 0 var(--orange); }
.holiday-cell { background: #fffaf0; }
.roster-calendar-meta { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 10px 16px; }
.roster-calendar-legend { display: flex; flex-wrap: wrap; gap: 10px; color: var(--muted); font-size: 9px; font-weight: 700; }
.roster-calendar-legend span { display: inline-flex; align-items: center; gap: 5px; }
.calendar-swatch { width: 12px; height: 12px; border: 1px solid transparent; border-radius: 4px; }
.calendar-swatch.weekend { background: #fff0f2; border-color: #e78490; }
.calendar-swatch.holiday { background: #fff3df; border-color: var(--orange); }
.statistics-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.code-count-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(115px, 1fr)); gap: 10px; }
.code-count-grid > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px; background: #f8f9fc; border: 1px solid var(--line); border-radius: 11px; }
@media (max-width: 1050px) { .statistics-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) {
    .filter-form { display: grid; grid-template-columns: 1fr 1fr; }
    .filter-form label, .roster-browser-filter .employee-multiselect { min-width: 0; }
    .employee-multiselect, .filter-actions { grid-column: 1 / -1; }
    .filter-actions .button { flex: 1; }
    .statistics-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 440px) { .filter-form, .statistics-grid { grid-template-columns: 1fr; } .employee-multiselect, .filter-actions { grid-column: auto; } }

/* Imported-layout roster browser refinements */
.matrix-filter-form.roster-browser-filter { flex-wrap: wrap; }
.matrix-filter-form .employee-multiselect { min-width: 300px; flex: 1; }
.matrix-filter-form .employee-multiselect select { height: 230px; min-height: 230px; padding-top: 6px; padding-bottom: 6px; resize: vertical; overflow: auto; }
.matrix-filter-form .employee-multiselect small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.roster-table thead th.holiday-day { color: #8a5510; background: #fff3df; box-shadow: inset 0 -3px 0 var(--orange); }
.roster-table td.holiday-cell { background-color: #fffaf0; }
@media (max-width: 760px) { .matrix-filter-form .employee-multiselect { min-width: 0; grid-column: 1 / -1; } }
/* Yearly statistics */
.statistics-heading { margin: 0 0 14px; }
.statistics-section > .panel { margin-bottom: 22px; }
.yearly-statistics { margin-top: 42px; padding-top: 30px; border-top: 1px solid var(--line); }
/* Combined all-group duty-code list */
.all-groups-duty-codes { min-width: 1350px; }
.all-groups-duty-codes .group-start-row td { border-top: 3px solid #dfe4ef; }
.group-code-label { display: block; color: var(--primary); font-size: 11px; letter-spacing: .04em; }
.group-code-repeat { color: #a0a8b8; font-size: 9px; }
/* Global duty-code table */
.global-duty-code-table { min-width: 1280px; }
.global-duty-code-table .code-save-button { white-space: nowrap; }
.code-action-cell { min-width: 190px; }
.database-update-option { display: flex; align-items: flex-start; gap: 7px; margin-bottom: 8px; color: var(--ink); cursor: pointer; font-size: 10px; font-weight: 700; line-height: 1.25; }
.database-update-option input { width: 15px; height: 15px; margin: 0; padding: 0; border: 0; border-radius: 3px; accent-color: var(--primary); }
.database-update-option span, .database-update-option small { display: block; }
.database-update-option small { margin-top: 2px; color: var(--muted); font-size: 8px; font-weight: 500; }
.preview-details-single { grid-template-columns: 1fr; }
.preview-top-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 10px; }
.preview-top-actions .summary-pills { flex-basis: 100%; justify-content: flex-end; }
.employee-search { min-width: 220px; }
.group-title-separator { color: var(--muted); font-weight: 700; }
@media (max-width: 760px) {
    .preview-details-single { grid-template-columns: 1fr; }
.preview-top-actions { justify-content: flex-start; margin-top: 18px; }
    .preview-top-actions .summary-pills { justify-content: flex-start; }
}
/* Responsive group and individual filters */
.matrix-filter-form.roster-browser-filter {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(140px, 1fr) minmax(140px, 1fr);
    align-items: end;
    gap: 12px;
    min-width: 0;
}
.matrix-filter-form.roster-browser-filter > label { min-width: 0; }
.matrix-filter-form .employee-search,
.matrix-filter-form .employee-multiselect,
.matrix-filter-form .filter-actions { grid-column: 1 / -1; min-width: 0; }
.matrix-filter-form .employee-multiselect { width: 100%; }
.matrix-filter-form .employee-multiselect select { width: 100%; max-width: 100%; box-sizing: border-box; }
.matrix-filter-form .filter-actions { justify-content: flex-end; }
.matrix-filter-form input:disabled,
.matrix-filter-form select:disabled { color: #8d96a6; background: #f3f5f8; cursor: not-allowed; }
@media (max-width: 760px) {
    .matrix-filter-form.roster-browser-filter { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .matrix-filter-form .group-field { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
    .matrix-filter-form.roster-browser-filter { grid-template-columns: minmax(0, 1fr); }
    .matrix-filter-form .employee-search,
    .matrix-filter-form .group-field,
    .matrix-filter-form .date-field,
    .matrix-filter-form .employee-multiselect,
    .matrix-filter-form .filter-actions { grid-column: 1; }
    .matrix-filter-form .filter-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .matrix-filter-form .filter-actions .button { width: 100%; }
}
/* Statistics graphical comparisons */
.statistics-chart-panel { min-width: 0; margin-bottom: 22px; overflow: hidden; }
.statistics-line-charts { display: grid; min-width: 0; gap: 18px; }
.statistics-line-panel { --line-color: #5574e8; min-width: 0; padding: 18px; background: #fafbfe; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.statistics-metric-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 10px; }
.statistics-metric-heading > div { display: flex; align-items: center; gap: 10px; }
.statistics-metric-heading > span { color: var(--muted); font-size: 11px; white-space: nowrap; }
.statistics-metric-heading > span strong { color: var(--ink); font-size: 14px; }
.statistics-metric-icon { display: inline-flex; flex: 0 0 36px; width: 36px; height: 36px; padding: 0; align-items: center; justify-content: center; color: white; background: var(--line-color); font-size: 12px; font-weight: 800; line-height: 1; text-align: center; }
.statistics-line-early, .statistics-line-day, .statistics-line-late { --line-color: #5574e8; }
.statistics-line-fi { --line-color: #765be7; }
.statistics-line-ab { --line-color: #18a874; }
.statistics-line-sunday { --line-color: #ee9b2d; }
.statistics-line-holiday { --line-color: #e5505d; }
.statistics-line-scroll { width: 100%; max-width: 100%; padding-bottom: 8px; overflow-x: auto; overflow-y: hidden; scrollbar-gutter: stable; overscroll-behavior-x: contain; }
.statistics-line-chart { display: block; min-width: 720px; }
.statistics-line-grid { stroke: #e0e5ee; stroke-width: 1; }
.statistics-line-axis-label { fill: #8791a3; font-size: 9px; }
.statistics-line-series { fill: none; stroke: var(--line-color); stroke-linecap: round; stroke-linejoin: round; stroke-width: 3; }
.statistics-line-point { fill: white; stroke: var(--line-color); stroke-width: 3; }
.statistics-line-value { fill: var(--ink); font-size: 12px; font-weight: 800; }
.statistics-line-person { fill: var(--ink); font-size: 10px; font-weight: 700; }
.statistics-line-person-number { fill: var(--muted); font-size: 8px; }
.statistics-line-average { stroke: var(--line-color); stroke-dasharray: 7 5; stroke-width: 2; opacity: .75; }
.statistics-line-average-label { fill: var(--line-color); font-size: 9px; font-weight: 800; }
@media (max-width: 640px) {
    .statistics-chart-panel .panel-heading { display: block; }
    .statistics-chart-panel .legal-note { display: block; margin-top: 5px; }
    .statistics-line-panel { padding: 14px; }
    .statistics-metric-heading { display: block; }
    .statistics-metric-heading > span { display: block; margin-top: 7px; }
}
/* Legal rules engine */
.engine-status-badge { display: inline-flex; align-items: center; gap: 9px; min-height: 42px; padding: 0 14px; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 12px; white-space: nowrap; }
.legal-engine-run-panel { margin-bottom: 22px; }
.legal-engine-form { display: grid; grid-template-columns: repeat(2, minmax(130px, .65fr)) repeat(2, minmax(210px, 1fr)) auto; align-items: end; gap: 12px; }
.legal-engine-form label { min-width: 0; }
.legal-engine-form label > span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.legal-engine-form input, .legal-engine-form select { width: 100%; min-width: 0; min-height: 42px; padding: 0 11px; color: var(--ink); background: white; border: 1px solid #d9dfeb; border-radius: 10px; outline: 0; }
.legal-engine-form input:focus, .legal-engine-form select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(85,116,232,.12); }
.legal-engine-form .button { min-height: 42px; white-space: nowrap; }
.engine-run-note { margin: 13px 0 0; color: var(--muted); font-size: 10px; }
.rule-source-reference { margin-top: 7px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.legal-rule-library { margin-top: 0; }
@media (max-width: 1180px) {
    .legal-engine-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .legal-engine-form .button { grid-column: 1 / -1; width: 100%; }
}
@media (max-width: 640px) {
    .engine-status-badge { margin-top: 16px; }
    .legal-engine-form { grid-template-columns: minmax(0, 1fr); }
    .legal-engine-form .button { grid-column: 1; }
}
/* Shared table pagination */
.table-pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 18px 18px; border-top: 1px solid var(--line); }
.pagination-summary { margin-right: auto; color: var(--muted); font-size: 10px; font-weight: 700; }
.pagination-sizes, .pagination-pages { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.pagination-sizes::before { margin-right: 3px; color: var(--muted); content: 'Rows'; font-size: 9px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.pagination-button { display: inline-flex; min-width: 32px; height: 32px; padding: 0 9px; align-items: center; justify-content: center; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font: inherit; font-size: 10px; font-weight: 800; }
.pagination-button:hover:not(:disabled), .pagination-button:focus-visible { color: var(--primary); border-color: var(--primary); outline: none; }
.pagination-button.active { color: white; background: var(--primary); border-color: var(--primary); }
.pagination-button:disabled { color: #a6adba; background: #f5f6f9; cursor: not-allowed; }
@media (max-width: 640px) {
    .table-pagination { align-items: flex-start; }
    .pagination-summary { flex-basis: 100%; margin-right: 0; }
    .pagination-pages { flex-basis: 100%; }
}
/* Batch roster import */
.batch-preview-heading { align-items: flex-start; }
.batch-preview-list { display: grid; gap: 18px; }
.batch-preview-item { padding: 0; overflow: hidden; }
.batch-preview-item > summary { display: grid; grid-template-columns: 38px minmax(220px, 1fr) auto 24px; gap: 14px; align-items: center; padding: 20px 24px; cursor: pointer; list-style: none; }
.batch-preview-item > summary::-webkit-details-marker { display: none; }
.batch-roster-number { display: inline-flex; width: 34px; height: 34px; align-items: center; justify-content: center; color: white; background: var(--primary); border-radius: 10px; font-weight: 800; }
.batch-roster-title strong, .batch-roster-title small { display: block; }
.batch-roster-title small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.batch-expand-mark { color: var(--muted); font-size: 20px; font-weight: 800; transition: transform .18s ease; }
.batch-preview-item[open] .batch-expand-mark { transform: rotate(180deg); }
.batch-preview-body { padding: 0 0 24px; border-top: 1px solid var(--line); }
.batch-preview-body > .alert { margin: 18px 24px; }
.batch-roster-panel { margin: 0; padding-top: 22px; border: 0; border-radius: 0; box-shadow: none; }
.batch-code-panel { margin: 20px 24px 0; background: #fafbfe; box-shadow: none; }
@media (max-width: 760px) {
    .batch-preview-item > summary { grid-template-columns: 38px minmax(0, 1fr) 20px; padding: 17px; }
    .batch-preview-item > summary .summary-pills { grid-column: 1 / -1; margin-top: 0; }
    .batch-code-panel { margin: 16px; }
}
/* Page loading indicator */
.page-loader { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; background: rgba(245,247,251,.92); backdrop-filter: blur(8px); opacity: 1; visibility: visible; transition: opacity .22s ease, visibility .22s ease; }
.is-loaded-page .page-loader { opacity: 0; visibility: hidden; pointer-events: none; }
.is-loading-page .page-loader { opacity: 1; visibility: visible; pointer-events: auto; }
.loader-dots { display: flex; align-items: center; gap: 11px; padding: 13px 17px; background: var(--ink); border: 1px solid rgba(255,255,255,.2); border-radius: 999px; box-shadow: 0 16px 40px rgba(23,34,59,.22); }
.loader-dot-group { display: flex; align-items: center; gap: 8px; }
.loader-dot { display: block; width: 12px; height: 12px; background: white; border-radius: 50%; box-shadow: 0 0 0 .5px rgba(255,255,255,.2); }
.loader-plane { display: grid; width: 28px; height: 28px; place-items: center; color: white; font-size: 22px; line-height: 1; transform: rotate(-10deg); }

/* Login monitoring and IP protection */
.login-security-settings, .login-attempt-filter { margin-bottom: 22px; }
.country-policy { display: flex; align-items: flex-start; gap: 11px; margin: -5px 0 20px; padding: 13px 15px; background: #f1fbf7; border: 1px solid #cdeee0; border-radius: 12px; }
.country-policy .status-dot { flex: 0 0 auto; margin-top: 5px; }
.country-policy strong { display: block; margin-bottom: 2px; }
.country-policy p { margin: 0; font-size: 12px; }
.pagination-button.disabled { pointer-events: none; }
.login-security-settings .panel-heading p { max-width: 520px; margin: 0; text-align: right; }
.security-tier-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.security-tier { padding: 18px; background: #f8f9fc; border: 1px solid var(--line); border-radius: 14px; }
.security-tier label > span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.security-tier input, .security-tier select { width: 100%; height: 42px; padding: 0 11px; color: var(--ink); background: white; border: 1px solid #d9dfeb; border-radius: 9px; }
.duration-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 11px; }
.login-attempts-table { min-width: 1480px; }
.login-attempts-table code { color: var(--ink); font: 12px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; }
.login-outcome { display: inline-flex; padding: 4px 9px; border-radius: 99px; font-size: 10px; font-weight: 800; }
.login-outcome.success { color: #087651; background: #e2f8ef; }
.login-outcome.failed { color: #a93743; background: #ffeaec; }
.login-outcome.blocked { color: #fff; background: var(--red); }
.login-outcome-tabs { display: flex; gap: 7px; margin: -8px 0 18px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.login-outcome-tab { display: inline-flex; min-height: 36px; align-items: center; justify-content: center; padding: 0 15px; color: var(--muted); background: #f7f8fc; border: 1px solid var(--line); border-radius: 9px; font-size: 11px; font-weight: 800; }
.login-outcome-tab:hover, .login-outcome-tab:focus-visible { color: var(--primary-dark); border-color: #bfcaf5; }
.login-outcome-tab.active { color: white; background: linear-gradient(135deg, var(--primary), var(--violet)); border-color: transparent; }
.user-agent-cell { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 900px) { .security-tier-grid { grid-template-columns: 1fr; } .login-security-settings .panel-heading p { text-align: left; } }
.loader-dot-group-left .loader-dot:nth-child(1), .loader-dot-group-right .loader-dot:nth-child(4) { animation: loader-dot-1 1.8s steps(1, end) infinite; }
.loader-dot-group-left .loader-dot:nth-child(2), .loader-dot-group-right .loader-dot:nth-child(3) { animation: loader-dot-2 1.8s steps(1, end) infinite; }
.loader-dot-group-left .loader-dot:nth-child(3), .loader-dot-group-right .loader-dot:nth-child(2) { animation: loader-dot-3 1.8s steps(1, end) infinite; }
.loader-dot-group-left .loader-dot:nth-child(4), .loader-dot-group-right .loader-dot:nth-child(1) { animation: loader-dot-4 1.8s steps(1, end) infinite; }
@keyframes loader-dot-1 { 0%, 49.999% { background: white; } 50%, 99.999% { background: var(--red); } 100% { background: white; } }
@keyframes loader-dot-2 { 0%, 37.499% { background: white; } 37.5%, 87.499% { background: var(--red); } 87.5%, 100% { background: white; } }
@keyframes loader-dot-3 { 0%, 24.999% { background: white; } 25%, 74.999% { background: var(--red); } 75%, 100% { background: white; } }
@keyframes loader-dot-4 { 0%, 12.499% { background: white; } 12.5%, 62.499% { background: var(--red); } 62.5%, 100% { background: white; } }
@media (prefers-reduced-motion: reduce) { .loader-dot { animation: none; } }

.table-person-link { display: inline-block; color: var(--ink); border-radius: 8px; }
.table-person-link:hover strong, .table-person-link:focus-visible strong { color: var(--primary); text-decoration: underline; }
.table-person-link small { color: var(--muted); }

.group-stats-parent-row {
    background: rgba(118, 91, 231, 0.08);
    font-weight: 800;
}

.group-stat-name {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.group-stat-name.is-child {
    padding-left: 1.35rem;
    position: relative;
}

.group-stat-name.is-child::before {
    content: "↳";
    position: absolute;
    left: 0;
    color: var(--muted);
    font-weight: 700;
}

.group-stats-table small {
    color: var(--muted);
}

.matrix-filter-form .subgroup-field {
    min-width: 0;
}
@media (max-width: 760px) {
    .matrix-filter-form .subgroup-field { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
    .matrix-filter-form .subgroup-field { grid-column: 1; }
}



/* Employees page */
.employee-filter-panel .employee-single-select { min-width: min(520px, 100%); }
.employee-profile-panel { overflow: hidden; }
.employee-profile-card { display: flex; align-items: center; gap: 22px; }
.employee-photo-link { display: inline-flex; flex: 0 0 auto; width: 54px; height: 54px; align-items: center; justify-content: center; color: var(--primary); background: linear-gradient(135deg, rgba(118,91,231,.14), rgba(85,116,232,.10)); border-radius: 16px; box-shadow: 0 8px 24px rgba(25, 30, 45, .16); text-decoration: none; }
.employee-photo-link:hover, .employee-photo-link:focus-visible { color: var(--primary); transform: translateY(-1px); outline: 3px solid rgba(85,116,232,.35); outline-offset: 3px; }
.employee-photo-icon { font-size: 24px; line-height: 1; }
.employee-profile-details { min-width: 0; }
.employee-profile-details h3 { margin: 4px 0 14px; font-size: 24px; }
.employee-facts { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 12px; margin: 0; }
.employee-facts div { padding: 12px; background: #f8f9fd; border: 1px solid var(--line); border-radius: 14px; }
.employee-facts dt { margin: 0 0 4px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.employee-facts dd { margin: 0; color: var(--ink); font-weight: 800; }
.employee-statistics-section { margin-top: 22px; }
.employee-stat-grid .stat-card { min-height: 94px; }
.employee-duty-panel { margin-top: 18px; }
.employee-duty-strip { display: grid; grid-template-columns: repeat(5, minmax(110px, 1fr)); gap: 12px; }
.employee-duty-card { padding: 14px; background: #f8f9fd; border: 1px solid var(--line); border-radius: 16px; }
.employee-duty-card span, .employee-duty-card small, .employee-duty-card em { display: block; }
.employee-duty-card span { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.employee-duty-card strong { display: block; margin: 8px 0 4px; color: var(--ink); font-size: 22px; line-height: 1; }
.employee-duty-card small { color: var(--muted); font-size: 10px; font-weight: 700; }
.employee-duty-card em { margin-top: 6px; color: var(--primary); font-size: 10px; font-style: normal; font-weight: 800; }
.employee-duty-card.is-empty strong { color: var(--muted); }
.employee-duty-card.is-today { background: linear-gradient(135deg, rgba(118,91,231,.16), rgba(85,116,232,.14)); border-color: rgba(85,116,232,.42); box-shadow: 0 10px 24px rgba(85,116,232,.12); }
.employee-duty-card.is-today span { color: var(--primary); }
@media (max-width: 860px) {
    .employee-duty-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
    .employee-duty-strip { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
    .employee-profile-card { align-items: flex-start; }
    .employee-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
    .employee-profile-card { display: block; }
    .employee-photo-link { margin-bottom: 14px; }
    .employee-facts { grid-template-columns: 1fr; }
}






/* Duty-code filters */
.duty-code-filter-panel { margin-bottom: 18px; padding: 18px; }
.duty-code-filter-form { flex-wrap: wrap; }
.duty-code-filter-pills a { padding: 8px 12px; background: white; border: 1px solid var(--line); border-radius: 40px; color: var(--muted); font-size: 11px; }
.duty-code-filter-pills a.active { color: var(--primary); background: #eef1ff; border-color: rgba(85,116,232,.25); }
.duty-code-filter-pills a strong { color: var(--ink); }
.duty-code-table { min-width: 1160px; }
.duty-code-table .status-label { color: var(--ink); }
.duty-code-table .status-label:hover { color: var(--primary); text-decoration: underline; }
.duty-code-table td:nth-child(5) small { display: block; max-width: 180px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }


/* Overview group counts */
.overview-groups-panel { margin-bottom: 22px; }
.overview-group-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.overview-group-card { display: grid; grid-template-columns: auto 1fr; gap: 11px; align-items: center; padding: 14px; background: #fafbfe; border: 1px solid var(--line); border-radius: 14px; }
.overview-group-card.is-parent { background: rgba(118,91,231,.08); }
.overview-group-card[href] { transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.overview-group-card[href]:hover, .overview-group-card[href]:focus-visible { border-color: rgba(85,116,232,.45); box-shadow: 0 8px 22px rgba(85,116,232,.12); outline: none; transform: translateY(-1px); }
.overview-group-card.is-child { margin-left: 12px; }
.overview-group-card strong, .overview-group-card small { display: block; }
.overview-group-card small { color: var(--muted); font-size: 11px; }
@media (max-width: 560px) { .overview-group-card.is-child { margin-left: 0; } }

/* Group statistics collapse controls */
.group-stats-toggle { display: inline-grid; width: 24px; height: 24px; place-items: center; margin-right: 2px; color: var(--primary); background: white; border: 1px solid rgba(85,116,232,.28); border-radius: 8px; cursor: pointer; font-weight: 900; line-height: 1; }
.group-stats-toggle:hover { background: #eef1ff; }
.group-stats-child-row[hidden] { display: none; }

/* Codex UI tidy-up: filter rows, collapsed submenus, duty-code pagination */

.nav .nav-subitems { display: none; }
.nav .nav-group.is-open .nav-subitems { display: grid; }
.nav .nav-group > a::after { content: '▾'; margin-left: auto; color: var(--muted); font-size: 10px; transition: transform .18s ease; }
.nav .nav-group.is-open > a::after { transform: rotate(180deg); }
.sidebar-collapsed .nav .nav-subitems { display: none; }

.matrix-filter-form .date-row, .duty-code-filter-form .date-row { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr); gap: 12px; align-items: end; }
.matrix-filter-form .date-row .date-field { min-width: 0; }
@media (max-width: 760px) { .matrix-filter-form .date-row, .duty-code-filter-form .date-row { grid-template-columns: 1fr; } }

.duty-code-filter-form label { min-width: 210px; }
.duty-code-panel .table-pagination { padding-left: 28px; padding-right: 28px; }
.rule-source-reference { color: var(--primary); font-size: 11px; font-weight: 800; text-decoration: none; }
.rule-source-reference:hover { text-decoration: underline; }
.users-grid { grid-template-columns: 1fr; }
.users-grid .create-user-panel { position: static; }


/* Roster/statistics filter date row placement */
.matrix-filter-form.roster-browser-filter .date-row { grid-column: 1 / -1; width: min(430px, 100%); }
.matrix-filter-form.roster-browser-filter .date-row .date-field { min-width: 0; }
@media (max-width: 760px) { .matrix-filter-form.roster-browser-filter .date-row { width: 100%; } }

/* Group statistics monthly employee drill-down */
.table-number-link { color: var(--primary); font-weight: 900; text-decoration: none; }
.table-number-link:hover { text-decoration: underline; }
.group-month-chart-panel { overflow: hidden; }
.group-month-chart { display: grid; grid-template-columns: repeat(12, minmax(54px, 1fr)); gap: 12px; min-height: 280px; align-items: end; padding: 20px 8px 4px; overflow-x: auto; }
.group-month-bar-item { display: grid; min-width: 54px; height: 240px; grid-template-rows: auto 1fr auto; gap: 8px; align-items: end; justify-items: center; color: var(--ink); }
.group-month-bar-item strong { font-size: 12px; font-weight: 900; }
.group-month-bar-item small { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.group-month-bar { display: block; width: 100%; max-width: 42px; min-height: 5px; background: linear-gradient(180deg, #7d6af2, var(--primary)); border-radius: 12px 12px 4px 4px; box-shadow: 0 12px 26px rgba(85,116,232,.2); }
@media (max-width: 760px) { .group-month-chart { grid-template-columns: repeat(12, 58px); } }

/* Group statistics monthly employee line chart */
.group-month-line-scroll { width: 100%; overflow-x: auto; padding-bottom: 8px; }
.group-month-line-chart { display: block; min-width: 760px; }
.group-month-grid { stroke: #e4e8f2; stroke-width: 1; }
.group-month-axis-label, .group-month-month { fill: var(--muted); font-size: 11px; font-weight: 800; }
.group-month-line { fill: none; stroke: var(--primary); stroke-width: 4; stroke-linejoin: round; stroke-linecap: round; }
.group-month-point { fill: white; stroke: var(--primary); stroke-width: 4; }
.group-month-value { fill: var(--ink); font-size: 12px; font-weight: 900; }

/* Global table column alignment */
table th, table td { text-align: center; vertical-align: middle; }
.data-table th, .data-table td,
.roster-table th, .roster-table td,
.duty-matrix th, .duty-matrix td { text-align: center; vertical-align: middle; }
.roster-table .sticky-col,
.duty-matrix .sticky-name,
.roster-table .annotation-row td { text-align: center; }
.data-table td strong,
.data-table td small,
.roster-list-table td > strong,
.roster-list-table td > small,
.roster-table .sticky-col strong,
.roster-table .sticky-col small { text-align: center; }
.roster-list-table .roster-group-row th,
.roster-list-table th:nth-child(1),
.roster-list-table td:nth-child(1),
.roster-list-table th:nth-child(4),
.roster-list-table td:nth-child(4),
.roster-list-table th:nth-child(5),
.roster-list-table td:nth-child(5),
.roster-list-table td:nth-child(1) > strong,
.roster-list-table td:nth-child(1) > small,
.roster-list-table td:nth-child(4) > strong,
.roster-list-table td:nth-child(4) > small,
.roster-list-table td:nth-child(5) > strong,
.roster-list-table td:nth-child(5) > small { text-align: left; }

/* Page-scoped table alignment and compact duty-code layout */
.code-inventory-link:hover, .code-inventory-link:focus-visible { color: white; background: var(--primary); outline: none; }
.duty-code-table th, .duty-code-table td { padding-left: 8px; padding-right: 8px; }
.duty-code-table .code-label-input { width: 170px; }
.duty-code-table select[name="category"] { width: 100px; }
.duty-code-table select[name="counts_as_work"] { width: 108px; }
.duty-code-table input[type="time"] { width: 96px; }
.compliance-findings-table th:nth-child(3),
.compliance-findings-table td:nth-child(3),
.compliance-findings-table td:nth-child(3) strong,
.compliance-findings-table td:nth-child(3) small,
.statistics-individual-table th:nth-child(2),
.statistics-individual-table td:nth-child(2),
.statistics-individual-table td:nth-child(2) strong,
.statistics-individual-table td:nth-child(2) small,
.users-table th:first-child,
.users-table td:first-child,
.users-table td:first-child strong,
.users-table td:first-child small,
.group-title-table th:first-child,
.group-title-table td:first-child { text-align: left; }
/* Active roster: employee alignment and current-day marker */
.roster-browser-table .sticky-col,
.roster-browser-table .sticky-col strong,
.roster-browser-table .sticky-col small { text-align: left; }
.import-preview-roster-table .sticky-col,
.import-preview-roster-table .sticky-col strong,
.import-preview-roster-table .sticky-col small { text-align: left; }
.roster-detail-table .sticky-col,
.roster-detail-table .sticky-col strong,
.roster-detail-table .sticky-col small,
.roster-detail-table .annotation-row td { text-align: left; }
.calendar-swatch.today { background: rgba(85,116,232,.16); border-color: rgba(85,116,232,.42); }
.roster-browser-table thead th.today-day { color: var(--primary); background: rgba(85,116,232,.16) !important; box-shadow: inset 0 -3px 0 rgba(85,116,232,.42); }
.roster-browser-table td.today-cell { background: rgba(85,116,232,.07) !important; box-shadow: inset 2px 0 0 rgba(85,116,232,.24), inset -2px 0 0 rgba(85,116,232,.24); font-weight: 800; }
/* Editable duty-code inventory badges */
.code-cloud > a.code-inventory-link { display: flex; align-items: center; gap: 8px; padding: 7px 10px; color: var(--ink); background: #f5f7fb; border: 1px solid var(--line); border-radius: 9px; text-decoration: none; }
.code-cloud > a.code-inventory-link:hover, .code-cloud > a.code-inventory-link:focus-visible { color: white; background: var(--primary); border-color: var(--primary); outline: none; }
.code-cloud > a.code-inventory-link:hover small, .code-cloud > a.code-inventory-link:focus-visible small { color: var(--primary); }
.action-menu-link { display: block; padding: 8px; color: var(--primary); border-radius: 7px; font-weight: 600; }
.action-menu-link:hover { background: #f4f6fb; }
