/* Shared presentation layer. Higher specificity keeps lazy-loaded legacy
   styles from changing the interface. IDs and application behavior stay intact. */
html:root {
    --background: #0e1420;
    --surface: #171f2e;
    --surface-border: #2b3547;
    --text-primary: #edf1f8;
    --text-secondary: #a8b4c6;
    --accent: #b3a8ff;
    --success: #63d8af;
    --danger: #ff9ba6;
    --input-background: #111a28;
    --ui-raised: #1c2637;
    --ui-soft: #202b3e;
    --ui-brand: #735ee0;
    --ui-brand-hover: #6954d7;
    --ui-accent-soft: #2b2545;
    --ui-positive-bg: #183b32;
    --ui-positive-text: #83e5bf;
    --ui-warning-bg: #3e3021;
    --ui-warning-text: #f4c384;
    --ui-danger-bg: #402630;
    --ui-shadow: 0 3px 14px #00000012;
    color-scheme: dark;
    scroll-padding-top: 24px;
}
html:root[data-theme="light"] {
    --background: #eaf4fa;
    --surface: #fbfdff;
    --surface-border: #c2d3e4;
    --text-primary: #122841;
    --text-secondary: #445b71;
    --accent: #334baa;
    --success: #08765c;
    --danger: #a72749;
    --input-background: #ffffff;
    --ui-raised: #ffffff;
    --ui-soft: #edf4fc;
    --ui-brand: #364cc1;
    --ui-brand-hover: #253a9b;
    --ui-accent-soft: #e6ebff;
    --ui-positive-bg: #d6f6ec;
    --ui-positive-text: #075c49;
    --ui-warning-bg: #fff0d2;
    --ui-warning-text: #804507;
    --ui-danger-bg: #ffe4eb;
    --ui-shadow: inset 0 1px 0 #ffffff, 0 5px 18px #25467d12;
    --glass-panel: linear-gradient(125deg, #fffffff2, #f6fbffce);
    --glass-sheen: linear-gradient(110deg, #ffffffb3, #ffffff24 58%, #c8e4ff4f);
    color-scheme: light;
}
html:root body {
    background: var(--background);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
html:root body button,
html:root body input,
html:root body select,
html:root body textarea { font-family: inherit; font-size: .875rem; }
html:root body button { font-weight: 600; transition: background-color 150ms, border-color 150ms, box-shadow 150ms; }
html:root body button:disabled { cursor: not-allowed; opacity: .5; }
html:root body :focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
html:root body input:not([type="checkbox"]):not([type="hidden"]),
html:root body select,
html:root body textarea {
    min-height: 44px;
    max-width: 100%;
    border: 1px solid var(--surface-border) !important;
    border-radius: 9px;
    color: var(--text-primary) !important;
    background-color: var(--input-background) !important;
    padding: 10px 13px;
    font-size: .875rem;
}
html:root body input::placeholder,
html:root body textarea::placeholder { color: var(--text-secondary); opacity: .85; }
html:root body input:focus,
html:root body select:focus,
html:root body textarea:focus { border-color: var(--accent) !important; box-shadow: 0 0 0 3px var(--ui-accent-soft); }
html:root body input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--ui-brand); cursor: pointer; }
html:root body select {
    appearance: none;
    padding-right: 36px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%23828ca0' stroke-width='1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
}
html:root body .eyebrow,
html:root body .admin-reports-eyebrow { color: var(--accent); font-size: .75rem; font-weight: 700; letter-spacing: .09em; }
html:root body h1,
html:root body h2,
html:root body h3,
html:root body h4 { color: var(--text-primary); letter-spacing: -.025em; line-height: 1.25; }
html:root body .primary-button,
html:root body .admin-report-primary,
html:root body .admin-users-primary,
html:root body .admin-correction-save,
html:root body .data-cleanup-preview-button,
html:root body .password-change-primary,
html:root body .app-modal__button--primary {
    min-height: 44px;
    padding: 11px 20px;
    border: 1px solid transparent;
    border-radius: 9px;
    color: #fff;
    background: var(--ui-brand);
    box-shadow: 0 2px 3px #0000000c;
}
html:root body .primary-button:hover:not(:disabled),
html:root body .admin-report-primary:hover:not(:disabled),
html:root body .admin-users-primary:hover:not(:disabled) { background: var(--ui-brand-hover); transform: none; }
html:root body .secondary-button,
html:root body .theme-toggle-button,
html:root body .change-password-button,
html:root body .admin-reports-button,
html:root body .admin-reports-header-button,
html:root body .admin-users-open-button,
html:root body .audit-history-open-button,
html:root body .security-activity-open-button,
html:root body .workforce-detail-button,
html:root body .admin-users-secondary,
html:root body .password-change-secondary,
html:root body .app-modal__button--secondary {
    min-height: 40px;
    padding: 9px 14px;
    border: 1px solid var(--surface-border);
    border-radius: 8px;
    color: var(--text-primary);
    background: var(--surface);
    font-size: .875rem;
    white-space: nowrap;
}
html:root body .secondary-button:hover:not(:disabled),
html:root body .theme-toggle-button:hover:not(:disabled),
html:root body .change-password-button:hover:not(:disabled),
html:root body .workforce-detail-button:hover:not(:disabled) { background: var(--ui-soft); border-color: var(--accent); transform: none; }
/* Login: a quiet editorial panel paired with a focused sign-in form. */
html:root body #loginView { padding: 40px 24px; }
html:root body .login-shell {
    display: grid;
    grid-template-columns: 1.08fr 1fr;
    width: min(1040px, 100%);
    min-height: 640px;
    overflow: hidden;
    border: 1px solid var(--surface-border);
    border-radius: 22px;
    background: var(--surface);
    box-shadow: 0 24px 80px #00000016;
}
html:root body .login-story { position: relative; display: flex; flex-direction: column; padding: 36px 44px; color: #fff; background: #282540; overflow: hidden; }
html:root body .login-story__brand { display: flex; align-items: center; gap: 11px; font-weight: 650; font-size: 1.1rem; }
html:root body .brand-glyph { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #fff; background: #7863e7; font-size: 1rem; font-weight: 800; flex-shrink: 0; }
html:root body .login-story__content { margin: 56px 0 30px; }
html:root body .story-kicker { color: #c5bcef; font-size: .75rem; letter-spacing: .16em; font-weight: 600; }
html:root body .login-story h2 { margin: 18px 0; color: #fff; font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 650; line-height: 1.12; letter-spacing: -.045em; }
html:root body .login-story__content > p:not(.story-kicker) { max-width: 330px; color: #ccc7df; line-height: 1.8; font-size: .9375rem; }
html:root body .login-story__footer { margin-top: auto; color: #b6afcd; font-size: .8125rem; }
html:root body .workday-art { position: relative; height: 160px; margin-top: 32px; }
html:root body .workday-art__tile { position: absolute; top: 5px; left: 12px; width: 205px; padding: 20px; background: #ffffff0b; border: 1px solid #ffffff1c; border-radius: 14px; transform: rotate(-5deg); }
html:root body .workday-art__tile span { display: block; margin-bottom: 16px; color: #d1c9ee; font-size: .625rem; letter-spacing: .13em; }
html:root body .workday-art__tile i { display: inline-block; height: 34px; width: 24px; margin-right: 10px; border-radius: 5px; background: #9c8be0; }
html:root body .workday-art__tile i:nth-of-type(2) { height: 47px; background: #bfafea; }
html:root body .workday-art__tile i:nth-of-type(3) { height: 25px; background: #8c82ae; }
html:root body .workday-art__tile i:nth-of-type(4) { height: 39px; background: #80b9a7; }
html:root body .workday-art__clock { position: absolute; top: 13px; left: 190px; width: 105px; height: 105px; border-radius: 50%; background: #c1b3ee; color: #37304f; border: 7px solid #282540; }
html:root body .workday-art__caption { position: absolute; left: 64px; bottom: 0; display: flex; align-items: center; gap: 8px; font-size: .75rem; color: #d1c9e4; }
html:root body .workday-art__caption span { width: 15px; height: 2px; background: #a99acb; }
html:root body .login-card { width: 100%; align-self: center; padding: 52px 48px; border: 0 !important; border-radius: 0; background: transparent !important; box-shadow: none !important; backdrop-filter: none; }
html:root body .login-header { gap: 14px; }
html:root body .system-mark { border: 0; color: #fff; background: var(--ui-brand); border-radius: 12px; }
html:root body .login-header .system-mark { display: none; }
html:root body .login-header h1 { font-size: 1.75rem; }
html:root body .login-header .eyebrow { margin-bottom: 12px; font-size: .75rem; }
html:root body .login-description { margin: 14px 0 28px; font-size: .9375rem; line-height: 1.7; color: var(--text-secondary); }
html:root body .login-form { gap: 10px; }
html:root body .login-form label { color: var(--text-primary); font-size: .875rem; margin-top: 12px; }
html:root body .login-form input { height: 48px; }
html:root body .login-form .primary-button { margin-top: 18px; min-height: 48px; }
html:root body .login-footnote { margin-top: 26px; color: var(--text-secondary); font-size: .8125rem; line-height: 1.7; }
html:root body .status-card { padding: 40px; border-radius: 18px; background: var(--surface) !important; box-shadow: var(--ui-shadow) !important; }
html:root body .status-card p::after { content: ""; display: block; width: 24px; height: 24px; margin: 24px auto 0; border: 2px solid var(--surface-border); border-top-color: var(--accent); border-radius: 50%; animation: interface-spin .9s linear infinite; }
@keyframes interface-spin { to { transform: rotate(360deg); } }
/* The signed-in workspace follows its containing viewport, including when the
   browser is resized. Tables keep their own horizontal scroll area. */
html:root body #authenticatedView {
    --workspace-gutter: clamp(12px, 1.5vw, 28px);
    display: block;
    padding: var(--workspace-gutter) var(--workspace-gutter) 40px;
}
html:root body .workspace-card {
    width: 100% !important;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0 !important;
    border-radius: 0;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none;
}
html:root body .workspace-header {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 25rem), 1fr));
    align-items: stretch;
    gap: 14px;
    padding: 0;
    margin-bottom: 18px;
    border: 0;
}
html:root body .workspace-overview,
html:root body .workspace-account,
html:root body .command-center__header {
    min-width: 0;
    padding: clamp(16px, 1.5vw, 26px);
    border: 1px solid var(--surface-border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--ui-shadow);
}
html:root body .workspace-overview {
    display: grid;
    align-content: center;
    justify-items: start;
    background:
        linear-gradient(115deg, transparent 60%, var(--ui-accent-soft)),
        var(--surface);
    border-inline-start: 4px solid var(--ui-brand);
}
html:root body .workspace-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: var(--text-secondary);
    font-size: .8125rem;
    font-weight: 650;
    text-decoration: none;
}
html:root body .workspace-brand .brand-glyph { width: 25px; height: 25px; border-radius: 7px; font-size: .8125rem; }
html:root body .workspace-header h1 { font-size: clamp(1.6rem, 2vw, 2.125rem); font-weight: 700; }
html:root body .workspace-description { margin-top: 4px; color: var(--text-secondary); font-size: .9375rem; }
html:root body .workspace-account {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: center;
    justify-items: end;
    gap: 12px;
}
html:root body .workspace-user__details {
    display: flex;
    min-width: 0;
    max-width: 100%;
    width: auto;
    align-items: center;
    gap: 10px;
    margin: 0;
    text-align: start;
}
html:root body .workspace-avatar {
    width: 42px;
    height: 42px;
    flex: none;
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    background:
        radial-gradient(circle at 50% 37%, var(--accent) 0 5px, transparent 5.8px),
        radial-gradient(ellipse 11px 8px at 50% 77%, var(--accent) 94%, transparent),
        var(--ui-accent-soft);
}
html:root body .workspace-identity { display: grid; min-width: 0; overflow-wrap: anywhere; }
html:root body #userName { font-size: 1rem; color: var(--text-primary); }
html:root body #userEmail { font-size: .8125rem; }
html:root body .role-badge { flex: none; margin: 0; padding: 3px 9px; color: var(--accent) !important; background: var(--ui-accent-soft); font-size: .75rem; letter-spacing: .02em; text-transform: capitalize; }
html:root body .workspace-user {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: flex-end !important;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
}
html:root body .workspace-user > button { margin: 0; background-color: var(--ui-soft); }
html:root body .role-workspace { margin-top: 0; min-width: 0; }
/* Shared cards and readable numeric summaries. */
html:root body .attendance-start-card,
html:root body .current-status-card,
html:root body .metric-card,
html:root body .workforce-card,
html:root body .status-overview,
html:root body .workforce-roster,
html:root body .aux-section,
html:root body .timeline-section,
html:root body .team-live-status {
    color: var(--text-primary);
    border: 1px solid var(--surface-border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--ui-shadow);
}
html:root body .attendance-start-card { padding: 32px; gap: 32px; border-left: 4px solid var(--ui-brand); }
html:root body .attendance-start-card h2 { font-size: 1.625rem; }
html:root body .attendance-start-card p { font-size: .9375rem; }
html:root body .shift-summary span { font-size: .75rem; letter-spacing: .04em; }
html:root body .shift-summary strong { font-size: .9375rem; }
html:root body .current-status-card { padding: 28px 30px; border-left: 4px solid var(--success); }
html:root body .status-title-row h2 { font-size: 2rem; }
html:root body .attendance-state { font-size: .75rem; letter-spacing: .03em; }
html:root body .attendance-state--active { color: var(--ui-positive-text); background: var(--ui-positive-bg); }
html:root body .attendance-date { font-size: .875rem; }
html:root body .status-duration span { font-size: .75rem; letter-spacing: .04em; }
html:root body .status-duration strong { font-size: 1.75rem; font-weight: 650; font-variant-numeric: tabular-nums; }
html:root body .attendance-metrics { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
html:root body .metric-card { min-height: 134px; padding: 20px; gap: 10px; }
html:root body .metric-card > span,
html:root body .workforce-card > span { color: var(--text-secondary); font-size: .875rem; font-weight: 500; text-transform: none; letter-spacing: 0; }
html:root body .metric-card strong { font-size: 1.625rem; font-variant-numeric: tabular-nums; }
html:root body .metric-card small { color: var(--text-secondary); font-size: .75rem; }
html:root body .metric-value--warning { color: var(--danger); }
html:root body .aux-section,
html:root body .timeline-section { margin-top: 22px; padding: 26px; }
html:root body .section-heading { margin-bottom: 22px; }
html:root body .section-heading h3 { font-size: 1.125rem; }
html:root body .aux-grid { gap: 12px; }
html:root body .aux-button { min-height: 116px; padding: 18px; border-color: var(--surface-border); border-radius: 10px; background: var(--ui-soft); }
html:root body .aux-button strong { font-size: .9375rem; }
html:root body .aux-button span { color: var(--text-secondary); font-size: .8125rem; line-height: 1.6; }
html:root body .aux-button:hover:not(:disabled) { transform: none; border-color: var(--accent); background: var(--ui-accent-soft); }
html:root body .aux-button--break { border-top: 3px solid var(--ui-warning-text); }
html:root body .aux-button--break:hover:not(:disabled) { background: var(--ui-warning-bg); border-color: var(--ui-warning-text); }
html:root body .workstation-panel { padding: 22px; border: 1px solid var(--surface-border); background: var(--ui-soft); }
html:root body .workstation-form label { color: var(--text-primary); font-size: .875rem; }
html:root body .danger-button,
html:root body .workforce-row-action--logout { color: var(--danger); border-color: var(--danger); background: transparent; border-radius: 8px; }
html:root body .danger-button:hover:not(:disabled),
html:root body .workforce-row-action--logout:hover:not(:disabled) { background: var(--ui-danger-bg); }
html:root body .timeline-item { padding-bottom: 24px; }
html:root body .timeline-item:not(:last-child)::before { background: var(--surface-border); }
html:root body .timeline-heading strong { font-size: .9375rem; }
html:root body .timeline-heading span,
html:root body .timeline-details,
html:root body .timeline-notes { font-size: .875rem; color: var(--text-secondary); }
/* Team and management views share a common information hierarchy. */
html:root body .command-center { grid-template-columns: minmax(0, 1fr); gap: 18px; }
html:root body .command-center__header {
    display: flex !important;
    flex-flow: row wrap;
    align-items: center !important;
    justify-content: space-between;
    gap: 18px 24px;
}
html:root body .command-center__header > .command-center__overview { flex: 1 1 19rem; min-width: 0; align-self: center; }
html:root body .command-center__topline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-bottom: 8px; }
html:root body .command-center__topline .eyebrow { margin: 0; }
html:root body .command-center__header h2 { font-size: 1.375rem; }
html:root body .command-center__subtitle { margin-top: 4px; font-size: .875rem; }
html:root body .command-center__sync {
    align-self: center;
    gap: 6px;
    margin: 0;
    min-height: 0;
    padding: 2px 8px;
    border-radius: 20px;
    background: var(--ui-positive-bg);
    color: var(--ui-positive-text);
    font-size: .75rem;
    font-variant-numeric: tabular-nums;
}
html:root body .command-center__pulse { width: 6px; height: 6px; box-shadow: none; }
html:root body #commandCenterAdminActions {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.75rem), 1fr)) !important;
    flex: 1 1 36.5rem;
    max-width: 44rem;
    gap: 8px !important;
}
html:root body #commandCenterAdminActions:has(> button:only-child) { flex: 0 1 auto; }
html:root body #commandCenterAdminActions:not(:has(button)) { display: none !important; }
html:root body #commandCenterAdminActions > button { min-width: 0; white-space: normal; background-color: var(--ui-soft); }
html:root body .workforce-cards { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
html:root body .workforce-card { min-height: 126px; padding: 20px; gap: 14px; }
html:root body .workforce-card strong { color: var(--text-primary); font-size: 2rem; font-weight: 650; font-variant-numeric: tabular-nums; }
html:root body .workforce-card:nth-child(2) { border-top: 3px solid var(--success); }
html:root body .workforce-card--warning { border-top: 3px solid var(--ui-warning-text); }
html:root body .workforce-card--warning strong { color: var(--ui-warning-text); }
html:root body .status-overview,
html:root body .workforce-roster { padding: 24px; }
html:root body .status-overview__heading h3,
html:root body .roster-header h3 { font-size: 1.125rem; }
html:root body .status-counts { gap: 10px; }
html:root body .status-counts > div { padding: 14px 12px; border: 1px solid var(--surface-border); background: var(--ui-soft); border-radius: 9px; }
html:root body .status-counts span { font-size: .8125rem; }
html:root body .status-counts strong { color: var(--text-primary); font-size: 1.125rem; }
html:root body .roster-header { align-items: center; flex-wrap: wrap; gap: 18px; margin-bottom: 22px; }
html:root body .roster-filters { flex-wrap: wrap; }
html:root body .bulk-action-bar { padding: 15px; background: var(--ui-soft); border: 1px solid var(--surface-border); border-radius: 10px; margin-bottom: 18px; }
html:root body .bulk-action-bar__selection strong { color: var(--text-primary); font-size: .875rem; }
html:root body .bulk-action-bar__selection span { color: var(--text-secondary); font-size: .8125rem; }
html:root body .workforce-row-action { min-height: 36px; padding: 7px 11px; color: var(--accent); border: 1px solid var(--surface-border); border-radius: 7px; background: var(--surface); font-size: .8125rem; }
html:root body .workforce-row-action--logout { color: var(--danger); }
html:root body .workforce-detail-button { min-height: 34px; padding: 6px 12px; font-size: .8125rem; }
html:root body .team-live-status { margin-top: 24px; overflow: hidden; }
html:root body .team-live-status__header { padding: 24px; border-color: var(--surface-border); }
html:root body .team-live-status__header h2 { font-size: 1.25rem; }
html:root body .team-live-status__subtitle { font-size: .875rem; }
html:root body .team-live-status__summary article { background: var(--ui-soft); border: 1px solid var(--surface-border); border-radius: 9px; padding: 16px; }
html:root body .team-live-status__summary article span { color: var(--text-secondary); font-size: .8125rem; }
html:root body .team-live-status__summary article strong { color: var(--text-primary); font-size: 1.5rem; }
html:root body .team-live-status__duration { color: var(--text-secondary); font-size: .875rem; }
html:root body .team-live-status__sync,
html:root body .team-live-status__presence--online { color: var(--ui-positive-text); font-size: .75rem; }
html:root body .team-live-status__sync { background: var(--ui-positive-bg); }
html:root body .team-live-status__you { color: var(--accent); background: var(--ui-accent-soft); font-size: .75rem; }
html:root body .team-live-status__presence--offline { color: var(--text-secondary); font-size: .75rem; }
/* Keep wide tables inside their own scroll regions on smaller screens. */
html:root body [class*="table-shell"],
html:root body .employee-history-scroll { max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; border-color: var(--surface-border); border-radius: 10px; }
html:root body table { border-collapse: collapse; }
html:root body table thead th { padding: 14px 13px; color: var(--text-secondary) !important; background: var(--ui-soft) !important; border-color: var(--surface-border) !important; font-size: .75rem; font-weight: 650; text-transform: none; letter-spacing: .01em; white-space: nowrap; }
html:root body table tbody td { padding: 17px 13px; color: var(--text-primary) !important; background: var(--surface); border-color: var(--surface-border) !important; font-size: .875rem; }
html:root body table tbody tr:hover td { background: var(--ui-soft); }
html:root body .employee-cell strong,
html:root body .admin-user-person strong,
html:root body .team-live-status__person strong { color: var(--text-primary); font-size: .875rem; }
html:root body .employee-cell span,
html:root body .employee-cell small,
html:root body .admin-user-person span,
html:root body .status-cell small { color: var(--text-secondary); font-size: .75rem; }
html:root body .table-time { color: var(--text-primary); font-size: .9375rem; font-variant-numeric: tabular-nums; }
html:root body .status-pill,
html:root body .compliance-badge,
html:root body .admin-user-status,
html:root body .team-live-status__status { display: inline-flex; width: fit-content; padding: 5px 9px; border-radius: 6px; font-size: .75rem; font-weight: 600; letter-spacing: 0; text-transform: none; white-space: nowrap; }
html:root body .status-pill--available,
html:root body .compliance-badge--completed,
html:root body .admin-user-status--active,
html:root body .team-live-status__status--work { color: var(--ui-positive-text); background: var(--ui-positive-bg); }
html:root body .status-pill--workstation,
html:root body .status-pill--meeting,
html:root body .status-pill--other,
html:root body .compliance-badge--in-progress,
html:root body .team-live-status__status--meeting { color: var(--accent); background: var(--ui-accent-soft); }
html:root body .status-pill--break,
html:root body .attention-list span,
html:root body .team-live-status__status--break { color: var(--ui-warning-text); background: var(--ui-warning-bg); font-size: .75rem; }
html:root body .status-pill--logged-out,
html:root body .status-pill--not-started,
html:root body .compliance-badge--not-started,
html:root body .team-live-status__status--offline { color: var(--text-secondary); background: var(--ui-soft); }
html:root body .compliance-badge--below { color: var(--danger); background: var(--ui-danger-bg); }
html:root body .app-modal--danger .app-modal__button--primary { color: var(--danger); background: var(--ui-danger-bg); border-color: var(--danger); }
html:root body .app-modal--warning .app-modal__button--primary { color: var(--ui-warning-text); background: var(--ui-warning-bg); border-color: var(--ui-warning-text); }
/* Apply the same surfaces to every existing account, report and admin dialog. */
html:root body [role="dialog"] { color: var(--text-primary) !important; background: var(--surface) !important; border: 1px solid var(--surface-border) !important; border-radius: 18px; box-shadow: 0 24px 90px #00000036; }
html:root body [role="dialog"] > header { padding: 24px 28px; border-color: var(--surface-border); background: var(--surface); }
html:root body [role="dialog"] h2 { color: var(--text-primary); font-size: 1.5rem; }
html:root body [role="dialog"] h3 { color: var(--text-primary); font-size: 1.125rem; }
html:root body [role="dialog"] header p:not(.eyebrow):not(.admin-reports-eyebrow) { color: var(--text-secondary); font-size: .875rem; }
html:root body [role="dialog"] label { font-size: .875rem; color: var(--text-primary); }
html:root body [role="dialog"] label > span { color: var(--text-secondary); font-size: .875rem; }
html:root body [role="dialog"] button[class*="close"] { display: grid; place-items: center; min-width: 40px; min-height: 40px; border: 1px solid var(--surface-border); border-radius: 9px; color: var(--text-secondary); background: var(--ui-soft); font-size: 1.5rem; }
html:root body .admin-reports-periods { gap: 6px; padding: 5px; width: fit-content; max-width: 100%; border-radius: 10px; background: var(--ui-soft); }
html:root body .admin-report-period { min-height: 40px; padding: 9px 18px; border: 0; color: var(--text-secondary); background: transparent; font-size: .875rem; border-radius: 7px; }
html:root body .admin-report-period.active { color: #fff; background: var(--ui-brand); box-shadow: var(--ui-shadow); }
html:root body .admin-report-summary article,
html:root body .admin-users-summary article,
html:root body .employee-history-panel,
html:root body .employee-day-detail,
html:root body .admin-user-fixed { border: 1px solid var(--surface-border); border-radius: 11px; background: var(--ui-soft); }
html:root body .admin-report-summary article span,
html:root body .admin-users-summary article span { color: var(--text-secondary); font-size: .875rem; }
html:root body .admin-report-summary article strong,
html:root body .admin-users-summary article strong { color: var(--text-primary); font-size: 1.75rem; }
html:root body .admin-report-export-actions button { min-height: 40px; padding: 9px 14px; border: 1px solid var(--surface-border); border-radius: 8px; color: var(--text-primary); background: var(--surface); font-size: .875rem; }
html:root body .form-error,
html:root body .attendance-message--error { color: var(--danger); background: var(--ui-danger-bg); border-color: var(--danger); font-size: .875rem; }
html:root body .attendance-message--info { color: var(--accent); background: var(--ui-accent-soft); border-color: var(--surface-border); font-size: .875rem; }
html:root body .shift-end-reminder { color: var(--ui-warning-text); background: var(--ui-warning-bg); border-color: var(--ui-warning-text); }
html:root body .shift-end-reminder strong { color: var(--ui-warning-text); font-size: .875rem; }
html:root body .shift-end-reminder span { color: var(--text-secondary); font-size: .875rem; }
html:root body .audit-history-summary article,
html:root body .security-activity-summary article,
html:root body .employee-day-metrics article,
html:root body .admin-correction-summary article,
html:root body .admin-correction-section,
html:root body .data-cleanup-section,
html:root body .data-cleanup-dataset,
html:root body .audit-change-card,
html:root body .security-details-grid section,
html:root body .employee-detail-event__body,
html:root body .admin-correction-session,
html:root body .admin-correction-boundary-row,
html:root body .admin-correction-pending-item { border-color: var(--surface-border); background: var(--ui-soft); border-radius: 10px; }
html:root body .audit-history-summary span,
html:root body .security-activity-summary span,
html:root body .employee-day-metrics span,
html:root body .admin-correction-summary span,
html:root body .data-cleanup-dataset span,
html:root body .security-detail-item span,
html:root body .audit-change-item span,
html:root body .admin-user-fixed span,
html:root body .admin-user-fixed strong { font-size: .8125rem; color: var(--text-secondary); }
html:root body .audit-history-summary strong,
html:root body .security-activity-summary strong { font-size: 1.75rem; }
html:root body .admin-correction-summary strong,
html:root body .employee-day-metrics strong { font-size: 1rem; }
html:root body .admin-correction-section-heading span,
html:root body .admin-correction-eyebrow,
html:root body .app-modal__eyebrow { color: var(--accent); font-size: .75rem; letter-spacing: .05em; }
html:root body .admin-correction-session-range,
html:root body .employee-detail-event__notes,
html:root body .workforce-action-dialog__employee,
html:root body .audit-time,
html:root body .app-modal__message { color: var(--text-secondary); font-size: .875rem; }
html:root body .admin-correction-section-heading p,
html:root body .admin-correction-boundary-detail,
html:root body .admin-correction-aux-heading span,
html:root body .admin-correction-reallocation-actions p,
html:root body .employee-detail-event__heading span,
html:root body .employee-detail-event__meta,
html:root body .audit-person span,
html:root body .security-person span,
html:root body .security-device-stack span { color: var(--text-secondary); font-size: .8125rem; }
html:root body .audit-change-item strong,
html:root body .security-detail-item strong { color: var(--text-primary); font-size: .875rem; }
html:root body .audit-change-details summary,
html:root body .security-details summary,
html:root body .employee-history-date { color: var(--accent); font-size: .875rem; }
html:root body .admin-correction-footer,
html:root body .app-modal__actions { background: var(--surface); border-color: var(--surface-border); }
html:root body .security-activity-tabs button { min-height: 40px; color: var(--text-secondary); background: var(--ui-soft); border-color: var(--surface-border); border-radius: 8px; }
html:root body .security-activity-tabs button.is-active { color: #fff; background: var(--ui-brand); }
html:root body .admin-user-edit-button,
html:root body .admin-correction-use-range-button,
html:root body .admin-correction-remove-button,
html:root body .admin-correction-cancel,
html:root body .data-cleanup-selection-actions button,
html:root body .admin-user-password button { min-height: 36px; padding: 7px 12px; color: var(--accent); background: var(--ui-accent-soft); border: 1px solid var(--surface-border); border-radius: 7px; font-size: .8125rem; }
html:root body .admin-correction-reallocation-actions button { min-height: 40px; color: #fff; background: var(--ui-brand); font-size: .875rem; }
html:root body .admin-user-state-button--active,
html:root body .admin-user-status--disabled,
html:root body .data-cleanup-delete-button { color: var(--danger); background: var(--ui-danger-bg); font-size: .8125rem; }
html:root body .admin-user-state-button--disabled { color: var(--ui-positive-text); background: var(--ui-positive-bg); font-size: .8125rem; }
html:root body .security-event,
html:root body .security-severity,
html:root body .security-session-state,
html:root body .admin-report-status,
html:root body .audit-action { color: var(--accent); background: var(--ui-accent-soft); font-size: .75rem; }
html:root body .security-severity--warning,
html:root body .security-session-state--stale,
html:root body .security-event--access_blocked,
html:root body .security-event--environment_changed { color: var(--ui-warning-text); background: var(--ui-warning-bg); }
html:root body .security-severity--critical,
html:root body .audit-action--logout { color: var(--danger); background: var(--ui-danger-bg); }
html:root body .security-session-state--live,
html:root body .admin-report-status--closed { color: var(--ui-positive-text); background: var(--ui-positive-bg); }
html:root body .data-cleanup-warning,
html:root body .password-change-requirement,
html:root body .bulk-confirmation { color: var(--ui-warning-text); background: var(--ui-warning-bg); font-size: .875rem; }
html:root body .data-cleanup-warning strong { color: var(--ui-warning-text); font-size: .875rem; }
html:root body .data-cleanup-warning span,
html:root body .data-cleanup-total span,
html:root body .admin-site-card small,
html:root body .admin-user-site span,
html:root body .admin-report-employee span,
html:root body .admin-report-toolbar span { color: var(--text-secondary); font-size: .8125rem; }
html:root body .admin-user-site strong,
html:root body .admin-user-shift strong,
html:root body .data-cleanup-dataset strong { color: var(--text-primary); font-size: .875rem; }
html:root body #passwordChangeForm label > span { color: var(--text-secondary); font-size: .875rem; }
html:root body #passwordChangeForm small { color: var(--text-secondary); font-size: .8125rem; }
html:root body .admin-report-warning { color: var(--ui-warning-text) !important; }
html:root body .data-cleanup-message--error,
html:root body .admin-correction-message--error,
html:root body .admin-users-error,
html:root body .admin-report-error,
html:root body .audit-history-error,
html:root body .security-activity-error,
html:root body .employee-detail-error,
html:root body .password-change-error { color: var(--danger); background: var(--ui-danger-bg); font-size: .875rem; }
/* Light theme surfaces for the shared shell and lazy-loaded workspaces. */
html:root[data-theme="light"] body {
    background:
        radial-gradient(ellipse 62rem 38rem at 0% 0%, #bceeea 0%, transparent 76%),
        radial-gradient(ellipse 60rem 38rem at 100% 10%, #cfdaff 0%, transparent 77%),
        linear-gradient(140deg, #edfaff, #e8f0ff 65%, #e5f6f5);
}
html:root[data-theme="light"] body :is(
    .workspace-account, .command-center__header, .workforce-card, .metric-card,
    .attendance-start-card, .current-status-card, .status-overview, .workforce-roster,
    .aux-section, .timeline-section, .team-live-status, .login-shell
) {
    background: var(--glass-panel);
    box-shadow: var(--ui-shadow);
}
html:root[data-theme="light"] body .workspace-overview {
    border-inline-start-color: #3263c9;
    background:
        linear-gradient(114deg, #faffff 3%, transparent 76%),
        linear-gradient(125deg, transparent 69%, #ffffff75 69.2%, transparent 78%),
        linear-gradient(125deg, #c1f3ec, #bcdffa 70%, #bfccff);
}
html:root[data-theme="light"] body :is(.brand-glyph, .system-mark) {
    background: linear-gradient(135deg, #117187, #394bbd 75%);
    box-shadow: inset 0 1px 0 #ffffff75, 0 3px 9px #2d4e9730;
}
html:root[data-theme="light"] body .workspace-avatar {
    background-color: #e4ecff;
    border-color: #b9cbec;
}
html:root[data-theme="light"] body .login-story {
    background:
        linear-gradient(135deg, transparent 65%, #ffffff10 65%, transparent 85%),
        linear-gradient(145deg, #12465f, #224785 57%, #483e95);
}
html:root[data-theme="light"] body .login-story__content > p:not(.story-kicker),
html:root[data-theme="light"] body :is(.story-kicker, .login-story__footer) { color: #e0edff; }
html:root[data-theme="light"] body .status-card { background: var(--glass-panel) !important; }
html:root[data-theme="light"] body .workforce-card:nth-child(2) { border-top-color: #12a57c; }
html:root[data-theme="light"] body .workforce-card--warning { border-top-color: #e59a2b; }
html:root[data-theme="light"] body :is(.workspace-user, #commandCenterAdminActions) > button {
    background: linear-gradient(165deg, #fff, #edf3fc);
    border-color: #b6cbe0;
    box-shadow: inset 0 1px 0 #fff, 0 2px 4px #233e6710;
}
html:root[data-theme="light"] body :is(.workspace-user, #commandCenterAdminActions) > button:hover:not(:disabled) {
    color: var(--accent);
    border-color: #7a94ce;
    background: #e4edff;
}
html:root[data-theme="light"] body :is(input:not([type="checkbox"]):not([type="hidden"]), select, textarea):not(:focus) {
    border-color: #7e90a4 !important;
}
html:root[data-theme="light"] body [role="dialog"] {
    background: linear-gradient(140deg, #fffffff9, #f3f8fffa) !important;
    box-shadow: inset 0 1px 0 white, 0 20px 65px #102d5440;
}
html:root[data-theme="light"] body [role="dialog"] > header {
    background: var(--glass-sheen), linear-gradient(100deg, #d7f5f1, #e3eaff);
}
@supports ((backdrop-filter: blur(12px)) or (-webkit-backdrop-filter: blur(12px))) {
    html:root[data-theme="light"] body :is(.workspace-account, .workspace-overview, .command-center__header, .login-shell, [role="dialog"]) {
        -webkit-backdrop-filter: blur(12px);
        backdrop-filter: blur(12px);
    }
}
@media (prefers-reduced-transparency: reduce) {
    html:root[data-theme="light"] { --glass-panel: #fff; }
    html:root[data-theme="light"] body :is(.workspace-account, .workspace-overview, .command-center__header, .login-shell, [role="dialog"]) {
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
    html:root[data-theme="light"] body [role="dialog"] { background: var(--surface) !important; }
}
/* Responsive layout is based on available space, not account permissions. */
@media (max-width: 1200px) {
    html:root body .workforce-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    html:root body .status-counts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    html:root body .attendance-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
    html:root body .login-shell { grid-template-columns: .85fr 1fr; min-height: 580px; }
    html:root body .login-story { padding: 30px; }
    html:root body .login-card { padding: 36px 28px; }
    html:root body .workday-art { transform: scale(.8); transform-origin: left top; }
    html:root body .aux-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    html:root body .attendance-start-card { grid-template-columns: 1fr; padding: 24px; gap: 24px; }
    html:root body .shift-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    html:root body .attendance-start-button { justify-self: start; }
    html:root body .roster-filters { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
    html:root body .roster-filters input { grid-column: 1 / -1; min-width: 0; }
    html:root body .roster-filters select { width: 100%; }
}
@media (max-width: 600px) {
    html:root body #loginView { padding: 20px 16px; }
    html:root body .login-shell { display: block; min-height: 0; border-radius: 16px; }
    html:root body .login-story { padding: 24px; }
    html:root body .login-story__content { margin: 26px 0 0; }
    html:root body .login-story h2 { font-size: 2rem; margin-bottom: 0; }
    html:root body .login-story__content > p:not(.story-kicker),
    html:root body .login-story__footer,
    html:root body .workday-art { display: none; }
    html:root body .login-card { padding: 28px 24px; }
    html:root body .login-header h1 { font-size: 1.5rem; }
    html:root body .login-description { margin-bottom: 16px; }
    html:root body .workspace-account { justify-items: start; }
    html:root body .workspace-user { width: 100%; justify-content: flex-start !important; }
    html:root body .workspace-user > button { flex: 1 1 8rem; min-width: 0; white-space: normal; }
    html:root body .attendance-metrics,
    html:root body .workforce-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    html:root body .metric-card,
    html:root body .workforce-card { padding: 16px; min-height: 116px; }
    html:root body .metric-card strong { font-size: 1.375rem; }
    html:root body .current-status-card { padding: 22px; align-items: flex-start; }
    html:root body .status-duration { min-width: 0; text-align: left; }
    html:root body .status-title-row { flex-wrap: wrap; }
    html:root body .status-title-row h2 { font-size: 1.75rem; }
    html:root body .aux-section,
    html:root body .timeline-section,
    html:root body .status-overview,
    html:root body .workforce-roster { padding: 20px 16px; }
    html:root body .aux-button { padding: 14px; }
    html:root body .status-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    html:root body .status-counts > div { padding: 12px 9px; gap: 7px; }
    html:root body .team-live-status__header { padding: 20px 16px; }
    html:root body [role="dialog"] { max-width: 100%; border-radius: 12px; }
    html:root body [role="dialog"] > header { padding: 20px; }
    html:root body .admin-report-period { padding: 9px 12px; }
}
@media (prefers-reduced-motion: reduce) {
    html:root body *, html:root body *::before, html:root body *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

html:root body .report-period-picker {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

html:root body #adminReportsClose,
html:root body #dataCleanupClose {
    width: auto;
    padding: 0 14px;
    font-size: .875rem;
}

html:root body .profile-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 4px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text-primary);
    text-align: start;
}
html:root body .profile-trigger:hover { background: var(--ui-soft); }
html:root body .profile-trigger #userEmail { font-weight: 400; }
html:root body .profile-link { color: var(--accent); text-decoration: underline; font-size: .75rem; }
html:root body .workspace-avatar { display: inline-block; overflow: hidden; }
html:root body .workspace-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
html:root body button.workspace-avatar { min-height: 0; padding: 0; }
html:root body button.workspace-avatar:disabled { opacity: 1; cursor: default; }
html:root body button.workspace-avatar:enabled { cursor: zoom-in; }
html:root body button.workspace-avatar:enabled:hover,
html:root body button.workspace-avatar:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
html:root body .photo-person { display: flex; align-items: center; gap: 12px; }
html:root body :is(#personalProfile, #profilePhotoViewer) {
    margin: auto;
    width: min(28rem, 94vw);
    padding: clamp(16px, 4vw, 24px);
    max-height: 90dvh;
    overflow: auto;
}
html:root body :is(#personalProfile, #profilePhotoViewer)::backdrop { background: #101827b3; }
html:root body #personalProfile .photo-person { margin: 18px 0 24px; }
html:root body #personalPhoto { width: 60px; height: 60px; }
html:root body #personalProfile input { width: 100%; }
html:root body :is(#profilePhotoHelp, #profilePhotoEmail, .photo-crop-help) { color: var(--text-secondary); font-size: .875rem; }
html:root body #profilePhotoHelp { margin: 6px 0 12px; }
html:root body :is(#profilePhotoStatus, #profilePhotoViewerStatus) { margin: 12px 0; }
html:root body :is(#profilePhotoStatus, #profilePhotoViewerStatus):empty { margin: 0; }
html:root body .photo-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 14px; }
html:root body #profilePhotoCrop {
    min-width: 0;
    margin: 18px 0 0;
    padding: 14px;
    border: 1px solid var(--surface-border);
    border-radius: 12px;
}
html:root body #profilePhotoCrop legend { padding: 0 6px; font-weight: 600; }
html:root body #profilePhotoCanvas {
    display: block;
    width: min(100%, 14rem, 32dvh);
    height: auto;
    margin: auto;
    border-radius: 10px;
    cursor: grab;
    touch-action: none;
}
html:root body #profilePhotoCanvas:active { cursor: grabbing; }
html:root body .photo-crop-help { margin: 8px 0 12px; text-align: center; }
html:root body .photo-crop-sliders { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 6px 12px; }
html:root body #personalProfile input[type="range"] {
    height: 28px;
    min-height: 0;
    margin: 0;
    padding: 0;
    appearance: auto;
    background: transparent;
    border: 0;
    box-shadow: none;
    accent-color: var(--accent);
}
html:root body #profilePhotoViewerImage:not([hidden]) {
    display: block;
    width: min(100%, 384px);
    height: auto;
    max-height: 65dvh;
    margin: 16px auto 0;
    object-fit: contain;
    border-radius: 12px;
}
@media (max-width: 480px) {
    html:root body .profile-trigger { flex-wrap: wrap; }
}
