/* styles.css — MASBOT Web Interface */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #5865F2;
    --primary-dark: #4752C4;
    --secondary: #57F287;
    --danger: #ED4245;
    --warning: #FEE75C;
    --bg-dark: #1e1f22;
    --bg-card: #2b2d31;
    --bg-hover: #35373c;
    --text-primary: #f2f3f5;
    --text-secondary: #b9bbbe;
    --text-muted: #94979e;
    --border: #404249;
    --shadow: rgba(0, 0, 0, 0.3);
    /* Premium UI tokens */
    --shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.28);
    --shadow-strong: 0 18px 48px rgba(0, 0, 0, 0.42);
    --card-border: rgba(255, 255, 255, 0.06);
    --card-highlight: rgba(255, 255, 255, 0.06);
    --card-bg: linear-gradient(180deg, rgba(43, 45, 49, 0.96) 0%, rgba(43, 45, 49, 0.92) 100%);
    --card-bg-2: linear-gradient(180deg, rgba(30, 31, 34, 0.96) 0%, rgba(30, 31, 34, 0.92) 100%);
    --ring: rgba(88, 101, 242, 0.28);
    --surface: #2b2d31;
    --accent-training: #289c5e;
    --accent-fto: #5865F2;
    --accent-ems: #289c5e;
    --navbar-height: 60px;
    --overlay-top-padding: calc(var(--navbar-height) + 20px);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --ease-out: cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: 0.15s var(--ease-out);
    --transition-base: 0.2s var(--ease-out);
}

/* Role Links: highlight missing mappings */
.mapping-subtitle.missing-link {
    color: var(--danger);
    font-weight: 600;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-dark);
    background-image:
        radial-gradient(ellipse 120% 70% at 50% -15%, rgba(88, 101, 242, 0.09) 0%, transparent 52%),
        radial-gradient(ellipse 70% 45% at 100% 100%, rgba(0, 200, 160, 0.05) 0%, transparent 48%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    /* Prevent text selection / I-beam cursor outside inputs */
    -webkit-user-select: none;
    user-select: none;
    cursor: default;
}

/* Allow selection + caret only in text entry controls */
input:not([type]),
input[type="text"],
input[type="number"],
input[type="password"],
input[type="email"],
input[type="search"],
input[type="tel"],
input[type="url"],
textarea {
    -webkit-user-select: text;
    user-select: text;
    cursor: text;
}

/* Prevent background scrolling when any modal is open */
body.modal-open {
    overflow: hidden;
    padding-right: var(--scrollbar-width, 0px);
}

/* Subtle medical texture background (crosses + ECG) */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.06;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cg fill='none' stroke='%23FFFFFF' stroke-opacity='0.55'%3E%3Cpath d='M28 18v10H18v8h10v10h8V36h10v-8H36V18z'/%3E%3Cpath d='M152 124v10h-10v8h10v10h8v-10h10v-8h-10v-10z'/%3E%3Cpath d='M18 112c18 0 18 0 28-24 10 24 10 24 22 24 12 0 12 0 20-18 8 18 8 18 22 18 14 0 14 0 26-30 12 30 12 30 26 30' stroke-width='2'/%3E%3C/g%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 180px 180px;
    filter: blur(0.2px);
}

/* SAFETY NET: main content and all panels must stay below navbar (navbar uses z-index 999999) */
.main-content {
    position: relative;
    z-index: 0;
}
/* Prevent main (and any descendant stacking contexts) from ever painting over the header */
main.main-content {
    z-index: 0 !important;
}

/* Login Page — blue-green gradient from icon + same medical texture as rest of site */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
    background: #000;
    overflow: hidden;
}

/* Blue→green gradient — vivid as logo (electric blue left, neon green right) */
/* Override body::before opacity and filter that were dulling the gradient */
.login-page::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 1;
    filter: none;
    z-index: 0;
    background:
        radial-gradient(ellipse 110% 90% at 50% 50%,
            rgba(0, 120, 255, 0.25) 0%,
            rgba(0, 200, 255, 0.18) 30%,
            rgba(0, 255, 180, 0.18) 60%,
            rgba(0, 255, 120, 0.25) 100%),
        linear-gradient(90deg,
            rgba(0, 100, 255, 0.55) 0%,
            rgba(0, 180, 255, 0.35) 30%,
            rgba(0, 220, 200, 0.35) 70%,
            rgba(0, 255, 136, 0.55) 100%);
    pointer-events: none;
}

/* Medical texture (crosses + ECG) — visible, vivid */
.login-page::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.12;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cg fill='none' stroke='%23FFFFFF' stroke-opacity='0.55'%3E%3Cpath d='M28 18v10H18v8h10v10h8V36h10v-8H36V18z'/%3E%3Cpath d='M152 124v10h-10v8h10v10h8v-10h10v-8h-10v-10z'/%3E%3Cpath d='M18 112c18 0 18 0 28-24 10 24 10 24 22 24 12 0 12 0 20-18 8 18 8 18 22 18 14 0 14 0 26-30 12 30 12 30 26 30' stroke-width='2'/%3E%3C/g%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 180px 180px;
    filter: blur(0.2px);
}

.login-page .login-container {
    position: relative;
    z-index: 1;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-strong);
    border: 1px solid var(--card-border);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    box-shadow: inset 0 1px 0 var(--card-highlight);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.login-logo {
    display: block;
    max-width: 280px;
    width: 100%;
    height: auto;
    margin: 0 auto 10px;
    object-fit: contain;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.login-content {
    text-align: center;
}

.login-content p {
    margin-bottom: 25px;
    color: var(--text-secondary);
}

/* Unified panel chrome — shared by profile, admin, on-duty, role callouts */
.ui-panel,
.profile-card,
.command-tools-card,
.admin-dashboard-panel,
.on-duty-section {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    position: relative;
}

.ui-panel::before,
.profile-card::before,
.command-tools-card::before,
.admin-dashboard-panel::before,
.on-duty-section::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: inset 0 1px 0 var(--card-highlight);
}

.ui-panel {
    padding: 24px;
}

.ui-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.ui-panel__body {
    position: relative;
    z-index: 1;
}

.ui-panel--accent {
    border-left: 3px solid var(--primary);
}

.ui-panel--accent-training {
    border-left-color: var(--accent-training);
}

.ui-panel--accent-fto {
    border-left-color: var(--accent-fto);
}

.ui-panel--accent-ems {
    border-left-color: var(--accent-ems);
}

.collapse-panel-body > .profile-card,
.collapse-panel-body > .ui-panel {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    border-radius: 0;
}

.collapse-panel-body > .profile-card::before,
.collapse-panel-body > .ui-panel::before {
    display: none;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--transition-base), transform var(--transition-fast), box-shadow var(--transition-base), color var(--transition-fast);
    color: white;
    background: var(--primary);
    letter-spacing: 0.01em;
}

.btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.4);
    text-decoration: none;
    color: white;
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-large {
    padding: 14px 28px;
    font-size: 1.1rem;
    width: 100%;
    justify-content: center;
    min-height: 48px;
}

/* Navbar — SAFETY NET: must always sit above all page content and panels (sticky sections) */
.navbar {
    background: rgba(43, 45, 49, 0.82);
    backdrop-filter: blur(14px) saturate(1.15);
    -webkit-backdrop-filter: blur(14px) saturate(1.15);
    border-bottom: 1px solid var(--card-border);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04), 0 8px 32px rgba(0, 0, 0, 0.22);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 999999;
    isolation: isolate;
    transition: opacity 160ms ease, filter 160ms ease;
}
/* Ensure no other rule can push header behind main/panels */
body:not(.modal-open) .navbar {
    z-index: 999999 !important;
}

/* When a modal/overlay is open: navbar sits behind overlay and is inactive (dimmed, no clicks) */
body.modal-open .navbar {
    z-index: 0 !important;
    opacity: 0.2;
    filter: blur(3px);
    pointer-events: none;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.nav-brand {
    flex-shrink: 0;
}
.nav-brand h2 {
    font-size: 1.5rem;
    white-space: nowrap;
    margin: 0;
    line-height: 1.2;
}
.nav-logo {
    display: block;
    height: 40px;
    width: auto;
    object-fit: contain;
}

.nav-menu {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: nowrap;
    min-width: 0;
    margin-left: auto;
    flex: 0 1 auto;
    /* avoid overflow so notification + user dropdowns are not clipped */
    overflow: visible;
}
.nav-menu .nav-link {
    flex-shrink: 0;
}
.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    transition: color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
    white-space: nowrap;
    font-size: 0.95rem;
    font-weight: 500;
    position: relative;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

.nav-link.active {
    color: var(--text-primary);
    background: rgba(88, 101, 242, 0.14);
    box-shadow: inset 0 0 0 1px rgba(88, 101, 242, 0.24);
}

.nav-menu .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 2px;
    border-radius: 2px;
    background: var(--primary);
    opacity: 0.9;
}

/* Hamburger (visible only on mobile) */
.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 10px;
    margin: 0;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.2s;
}
.nav-hamburger:hover {
    background: var(--bg-hover);
}
.nav-hamburger-bar {
    display: block;
    width: 22px;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
    transition: transform 0.2s, opacity 0.2s;
}
.nav-hamburger[aria-expanded="true"] .nav-hamburger-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.nav-hamburger[aria-expanded="true"] .nav-hamburger-bar:nth-child(2) {
    opacity: 0;
}
.nav-hamburger[aria-expanded="true"] .nav-hamburger-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.nav-links {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: nowrap;
    min-width: 0;
}

/* Nav drawer (mobile menu) — must be outside .navbar in DOM; fixed to viewport */
.nav-drawer {
    position: fixed;
    inset: 0;
    z-index: 1000001;
    pointer-events: none;
    visibility: hidden;
    transition: visibility 0.2s;
}
.nav-drawer.is-open {
    pointer-events: auto;
    visibility: visible;
}
.nav-drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.2s;
}
.nav-drawer.is-open .nav-drawer-backdrop {
    opacity: 1;
}
.nav-drawer-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: min(300px, 88vw);
    max-width: 300px;
    height: 100%;
    min-height: 100dvh;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.25s ease-out;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
.nav-drawer.is-open .nav-drawer-panel {
    transform: translateX(0);
}
.nav-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.nav-drawer-header span {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}
.nav-drawer-close {
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
}
.nav-drawer-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.nav-drawer-links {
    padding: 12px 10px 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.nav-drawer-links .nav-link {
    display: block;
    padding: 14px 16px;
    border-radius: 8px;
    font-size: 1rem;
    white-space: normal;
}
.nav-drawer-links .nav-link.active::after {
    display: none;
}

body.nav-drawer-open {
    overflow: hidden;
    touch-action: none;
}

body.nav-drawer-open .navbar {
    z-index: 999998 !important;
}

/* Notifications bell (leadership) — premium */
.nav-notifications-wrap {
    position: relative;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.nav-notifications-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
    position: relative;
}
.nav-notifications-btn:hover,
.nav-notifications-btn[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}
.nav-notifications-btn.has-unread {
    color: var(--text-primary);
}
.nav-notifications-btn.has-unread::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 12px;
    border: 1px solid rgba(88, 101, 242, 0.35);
    pointer-events: none;
    opacity: 0.85;
}
.nav-notifications-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: block;
}
.nav-notifications-badge {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 17px;
    text-align: center;
    color: #fff;
    background: linear-gradient(180deg, #f04747 0%, #ed4245 100%);
    border: 1.5px solid var(--bg-dark);
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(237, 66, 69, 0.45);
    display: none;
    transform: translate(25%, -25%);
}
.nav-notifications-badge.has-count {
    display: inline-block;
}
.nav-notifications-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 320px;
    max-width: min(400px, calc(100vw - 24px));
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    box-shadow: var(--shadow-strong);
    z-index: 1100;
    overflow: hidden;
    animation: nav-notif-drop-in 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-notifications-dropdown::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow: inset 0 1px 0 var(--card-highlight);
    border-radius: inherit;
}
@keyframes nav-notif-drop-in {
    from { opacity: 0; transform: translateY(-6px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.nav-notifications-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px 12px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.nav-notifications-dropdown-title-wrap {
    display: grid;
    gap: 2px;
    min-width: 0;
}
.nav-notifications-dropdown-title {
    font-weight: 900;
    letter-spacing: -0.02em;
    font-size: 1rem;
    color: var(--text-primary);
}
.nav-notifications-dropdown-sub {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.3;
}
.nav-notifications-header-count {
    flex-shrink: 0;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    box-shadow: 0 2px 10px rgba(88, 101, 242, 0.35);
}
.nav-notifications-header-count.is-zero {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    box-shadow: none;
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.nav-notifications-list {
    max-height: min(360px, 50vh);
    overflow-y: auto;
    padding: 8px;
    display: grid;
    gap: 6px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}
.nav-notifications-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.875rem;
    line-height: 1.35;
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    background: rgba(43, 45, 49, 0.35);
    width: 100%;
    text-align: left;
    position: relative;
}
.nav-notifications-item:hover {
    background: rgba(53, 55, 60, 0.65);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}
.nav-notifications-item-accent {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    line-height: 1;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
}
.nav-notifications-item-accent--feedback { background: rgba(88, 101, 242, 0.16); border-color: rgba(88, 101, 242, 0.28); }
.nav-notifications-item-accent--eoi { background: rgba(87, 242, 135, 0.12); border-color: rgba(87, 242, 135, 0.28); }
.nav-notifications-item-accent--leave { background: rgba(254, 231, 92, 0.12); border-color: rgba(254, 231, 92, 0.32); }
.nav-notifications-item-accent--vehicle { background: rgba(0, 176, 244, 0.12); border-color: rgba(0, 176, 244, 0.28); }
.nav-notifications-item-accent--unit { background: rgba(235, 69, 158, 0.12); border-color: rgba(235, 69, 158, 0.28); }
.nav-notifications-item-accent--reward_redemption { background: rgba(250, 166, 26, 0.12); border-color: rgba(250, 166, 26, 0.28); }
.nav-notifications-item-accent--interview { background: rgba(168, 85, 247, 0.12); border-color: rgba(168, 85, 247, 0.28); }
.nav-notifications-item-body {
    min-width: 0;
    flex: 1;
    display: grid;
    gap: 4px;
}
.nav-notifications-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}
.nav-notifications-type-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.nav-notifications-item-time {
    font-size: 0.72rem;
    color: var(--text-secondary);
    white-space: nowrap;
}
.nav-notifications-item-msg {
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    word-break: break-word;
}
.nav-notifications-unread-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    margin-top: 4px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.18);
}
.nav-notifications-empty {
    padding: 28px 16px 24px;
    text-align: center;
    display: grid;
    gap: 8px;
    justify-items: center;
}
.nav-notifications-empty-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    font-size: 1.25rem;
}
.nav-notifications-empty-title {
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    font-size: 0.92rem;
}
.nav-notifications-empty-sub {
    font-size: 0.82rem;
    color: var(--text-secondary);
    max-width: 240px;
    line-height: 1.4;
}
.nav-notifications-clear {
    flex-shrink: 0;
    padding: 4px 10px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.nav-notifications-clear:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.nav-notifications-footer {
    padding: 10px 12px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.12) 100%);
}
.nav-notifications-clear-all {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.nav-notifications-clear-all svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.85;
}
.nav-notifications-clear-all:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
}
@media (max-width: 480px) {
    .nav-notifications-dropdown {
        position: fixed;
        top: var(--navbar-height);
        left: 12px;
        right: 12px;
        min-width: 0;
        max-width: none;
        width: auto;
    }
    .nav-notifications-list {
        max-height: min(320px, calc(100vh - var(--navbar-height) - 140px));
    }
}

/* User menu (header) */
.user-menu {
    position: relative;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-left: 8px;
}

.user-menu-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px 6px 6px;
    border-radius: var(--radius-md);
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-primary);
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
    font: inherit;
}

.user-menu-button:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.08);
}

.user-menu-button:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.user-menu-icon {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 6px;
    background: transparent;
    border: none;
}

.user-rank-slide {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.user-rank-fallback {
    font-size: 1.25rem;
    line-height: 1;
    opacity: 0.9;
}

.user-menu-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-width: 0;
    max-width: 220px;
    gap: 4px;
}

.user-menu-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9375rem;
    letter-spacing: -0.01em;
    line-height: 1.25;
}

.user-menu-divider {
    display: none;
    height: 1px;
    width: 100%;
    min-width: 0;
    background: rgba(255, 255, 255, 0.12);
    margin: 2px 0;
}

.user-menu-text.has-rank .user-menu-divider {
    display: block;
}

.user-menu-rank {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
    letter-spacing: 0;
    line-height: 1.2;
}

.user-menu-caret {
    color: var(--text-secondary);
    font-size: 0.75rem;
    opacity: 0.8;
    margin-left: 2px;
    transition: transform 0.2s ease;
}

.user-menu-button:hover .user-menu-caret {
    opacity: 1;
}

.user-menu-dropdown {
    position: fixed;
    min-width: 220px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.04);
    overflow: hidden;
    z-index: 1;
}

/* User menu portal — dropdown lives outside navbar (avoids backdrop-filter containing block) */
.user-menu-portal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000002;
    pointer-events: none;
}

.user-menu-portal.is-open {
    display: block;
    pointer-events: auto;
}

.user-menu-portal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.user-menu-portal.is-open .user-menu-portal-backdrop {
    opacity: 1;
}

body.user-menu-open {
    overflow: hidden;
    touch-action: none;
}

body.user-menu-open .navbar {
    z-index: 999998 !important;
}

@media (min-width: 769px) {
    .user-menu-portal.is-open {
        pointer-events: none;
        background: transparent;
    }

    .user-menu-portal-backdrop {
        display: none;
    }

    .user-menu-portal.is-open .user-menu-dropdown {
        pointer-events: auto;
    }
}

.user-menu-item {
    width: 100%;
    display: block;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    text-decoration: none;
    cursor: pointer;
    font: inherit;
    font-size: 0.9rem;
    text-align: left;
    transition: background 0.15s ease, color 0.15s ease;
}

.user-menu-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.user-menu-item-danger {
    color: #ff6b6b;
}

.user-menu-item-danger:hover {
    color: #ff6b6b;
    background: rgba(237, 66, 69, 0.12);
}

/* Command Tools page */
.command-tools-container {
    display: flex;
    justify-content: center;
}

.command-tools-card {
    width: 100%;
    max-width: 1200px;
    padding: 20px;
}

.server-control-console-pre {
    display: block;
    width: 100%;
    max-height: 380px;
    overflow: auto;
    margin: 0;
    padding: 16px 18px;
    font-family: ui-monospace, 'Cascadia Code', 'Consolas', 'Monaco', monospace;
    font-size: 0.78rem;
    line-height: 1.45;
    color: #c8d0d8;
    background:
        linear-gradient(180deg, rgba(8, 10, 14, 0.92) 0%, rgba(12, 14, 18, 0.96) 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    white-space: pre-wrap;
    word-break: break-all;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* ========== System Admin (premium owner control plane) ========== */
.site-admin-shell {
    position: relative;
    max-width: 1100px;
}

.site-admin-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
    padding: 22px 22px 20px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        linear-gradient(135deg, rgba(35, 38, 48, 0.96) 0%, rgba(28, 30, 36, 0.94) 55%, rgba(24, 28, 34, 0.98) 100%);
    box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.site-admin-hero-glow {
    position: absolute;
    inset: -40% auto auto -10%;
    width: 55%;
    height: 140%;
    background: radial-gradient(circle at 30% 40%, rgba(0, 200, 160, 0.16) 0%, transparent 62%);
    pointer-events: none;
    filter: blur(8px);
    animation: site-admin-glow-drift 9s ease-in-out infinite alternate;
}

@keyframes site-admin-glow-drift {
    from { transform: translate3d(0, 0, 0) scale(1); opacity: 0.85; }
    to { transform: translate3d(8%, 4%, 0) scale(1.08); opacity: 1; }
}

.site-admin-hero-copy {
    position: relative;
    z-index: 1;
    min-width: 0;
}

.site-admin-eyebrow {
    display: inline-block;
    margin-bottom: 8px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(126, 231, 135, 0.92);
}

.site-admin-hero-title {
    margin: 0;
    font-size: 1.7rem;
    font-weight: 760;
    letter-spacing: -0.035em;
    line-height: 1.15;
    color: var(--text-primary);
}

.site-admin-hero-sub {
    margin: 8px 0 0;
    max-width: 46ch;
    font-size: 0.92rem;
    line-height: 1.45;
    color: var(--text-secondary);
}

.site-admin-hero-side {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.site-admin-owner-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #d7dbff;
    background: rgba(88, 101, 242, 0.18);
    border: 1px solid rgba(88, 101, 242, 0.4);
}

.site-admin-submenu,
.site-admin-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    margin-bottom: 18px;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.22);
    overflow-x: auto;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.site-admin-submenu-item {
    flex: 0 0 auto;
    padding: 9px 14px;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    white-space: nowrap;
    transition: color var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.site-admin-submenu-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.site-admin-submenu-item.active {
    color: #fff;
    background: linear-gradient(180deg, rgba(88, 101, 242, 0.42) 0%, rgba(88, 101, 242, 0.28) 100%);
    border-color: rgba(88, 101, 242, 0.55);
    box-shadow: 0 6px 18px rgba(88, 101, 242, 0.18);
}

.site-admin-submenu-inner {
    margin-top: 4px;
    margin-bottom: 14px;
}

.site-admin-submenu-inner .site-admin-submenu-item {
    padding: 7px 12px;
    font-size: 0.82rem;
}

.access-monitoring-subpanel {
    margin-top: 0;
}

.site-admin-panel {
    margin-top: 0;
}

.site-admin-panel[style*="display: block"],
.site-admin-panel[style*="display:block"],
.site-admin-panel.site-admin-panel-active {
    animation: site-admin-panel-in 0.28s var(--ease-out);
}

@keyframes site-admin-panel-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.site-admin-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.site-admin-panel-title,
.site-admin-surface-title {
    margin: 0;
    font-size: 1.12rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.site-admin-panel-sub,
.site-admin-surface-sub {
    margin: 6px 0 0;
    font-size: 0.88rem;
    line-height: 1.4;
    color: var(--text-secondary);
}

.site-admin-overview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.site-admin-overview-grid--compact {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    margin-bottom: 14px;
}

.site-admin-stat-card {
    background:
        linear-gradient(165deg, rgba(45, 48, 56, 0.96) 0%, rgba(32, 34, 40, 0.94) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 16px 16px 14px;
    box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: border-color var(--transition-base), transform var(--transition-base), box-shadow var(--transition-base);
}

.site-admin-stat-card:hover {
    border-color: rgba(255, 255, 255, 0.14);
    transform: translateY(-1px);
}

.site-admin-service-card[data-state="ok"] {
    border-color: rgba(126, 231, 135, 0.28);
}

.site-admin-service-card[data-state="error"],
.site-admin-service-card[data-state="unreachable"] {
    border-color: rgba(255, 123, 114, 0.32);
}

.site-admin-service-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.site-admin-service-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #c9d0ff;
    background: rgba(88, 101, 242, 0.18);
    border: 1px solid rgba(88, 101, 242, 0.32);
    flex-shrink: 0;
}

.site-admin-service-mark--bot {
    color: #9ef0c4;
    background: rgba(0, 200, 160, 0.14);
    border-color: rgba(0, 200, 160, 0.3);
}

.site-admin-service-titles {
    min-width: 0;
    flex: 1;
}

.site-admin-live-dot {
    width: 9px;
    height: 9px;
    margin-top: 6px;
    border-radius: 50%;
    background: rgba(185, 187, 190, 0.55);
    box-shadow: 0 0 0 0 rgba(185, 187, 190, 0.2);
    flex-shrink: 0;
}

.site-admin-service-card[data-state="ok"] .site-admin-live-dot {
    background: #7ee787;
    box-shadow: 0 0 0 0 rgba(126, 231, 135, 0.55);
    animation: site-admin-pulse 2.2s ease-out infinite;
}

.site-admin-service-card[data-state="error"] .site-admin-live-dot,
.site-admin-service-card[data-state="unreachable"] .site-admin-live-dot {
    background: #ff7b72;
}

@keyframes site-admin-pulse {
    0% { box-shadow: 0 0 0 0 rgba(126, 231, 135, 0.45); }
    70% { box-shadow: 0 0 0 10px rgba(126, 231, 135, 0); }
    100% { box-shadow: 0 0 0 0 rgba(126, 231, 135, 0); }
}

.site-admin-stat-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.site-admin-stat-value {
    font-size: 1.28rem;
    font-weight: 750;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    line-height: 1.2;
}

.site-admin-stat-value.ok {
    color: #7ee787;
}

.site-admin-stat-value.unreachable,
.site-admin-stat-value.error {
    color: #ff7b72;
}

.site-admin-stat-meta {
    font-size: 0.84rem;
    color: var(--text-secondary);
    margin-top: 10px;
}

.site-admin-stat-details {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 14px;
    margin: 12px 0 0;
    padding: 12px 0 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.site-admin-stat-details dt {
    font-weight: 600;
    color: rgba(185, 187, 190, 0.9);
    margin: 0;
}

.site-admin-stat-details dd {
    margin: 0;
    color: var(--text-primary);
    text-align: right;
}

.site-admin-stat-card--toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.site-admin-toolbar,
.site-admin-inline-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.site-admin-toolbar {
    margin-top: 14px;
    margin-bottom: 4px;
}

.site-admin-toolbar-spacer {
    flex: 1 1 auto;
    min-width: 8px;
}

.site-admin-btn-ghost {
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: var(--text-primary) !important;
}

.site-admin-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.16) !important;
}

.site-admin-surface {
    margin-top: 16px;
    padding: 18px !important;
    border-radius: 16px !important;
}

.site-admin-surface-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.site-admin-credit {
    margin: -6px 0 10px;
    text-align: right;
    font-size: 0.7rem;
    color: var(--text-secondary);
    opacity: 0.55;
    font-style: italic;
}

.site-admin-usage-graph {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 4px;
}

.site-admin-usage-chart {
    background:
        linear-gradient(180deg, rgba(36, 38, 44, 0.96) 0%, rgba(28, 30, 34, 0.96) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 16px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.site-admin-usage-chart h3 {
    margin: 0 0 12px;
    font-size: 0.9rem;
    font-weight: 650;
    color: var(--text-secondary);
}

.site-admin-usage-chart canvas {
    display: block;
    width: 100%;
    height: 168px;
}

html[data-theme="light"] .site-admin-usage-chart {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.08);
}

html[data-theme="light"] .site-admin-usage-chart h3 {
    color: var(--text-secondary);
}

.site-admin-stat-card-wide {
    min-width: 0;
}

.site-admin-audit-header {
    margin-bottom: 12px;
}

.site-admin-audit-filters-card {
    padding: 16px !important;
    margin-top: 0;
    margin-bottom: 12px;
}

.site-admin-audit-filters-form {
    margin-top: 0;
    margin-bottom: 0;
}

.site-admin-audit-filters-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 4px;
}

.site-admin-audit-toggle-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.site-admin-audit-toggle-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.site-admin-audit-toggle-item input[type="checkbox"] {
    margin: 0;
}

#site-admin-audit-apply {
    flex-shrink: 0;
}

.site-admin-test-notif-card {
    margin-top: 18px;
    min-width: 0;
}

.site-admin-test-notif-form {
    display: grid;
    grid-template-columns: minmax(0, 320px);
    gap: 14px;
    margin-bottom: 12px;
}

.site-admin-test-notif-form .form-group {
    margin-bottom: 0;
    min-width: 0;
}

.site-admin-test-notif-form select.form-input {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.site-admin-console-card .server-control-console-pre {
    margin-top: 2px;
}

.site-admin-restart-card,
.site-admin-danger-card {
    margin-top: 14px;
}

.site-admin-danger-card {
    border-color: rgba(237, 66, 69, 0.42) !important;
    background:
        linear-gradient(165deg, rgba(56, 30, 34, 0.55) 0%, rgba(35, 28, 32, 0.92) 100%) !important;
}

.site-admin-danger-title {
    color: #ffb4b4;
}

.site-admin-codeblock {
    white-space: pre-wrap;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 14px 16px;
    margin-top: 10px;
    color: var(--text-secondary);
    font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
    font-size: 0.82rem;
    line-height: 1.45;
}

.site-admin-codeblock--sample {
    margin-top: 0;
    color: #c9d2dc;
}

.site-admin-token-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.site-admin-token-input {
    flex: 1;
    font-family: ui-monospace, Consolas, monospace;
}

html[data-theme="light"] .site-admin-hero {
    background: linear-gradient(135deg, #fff 0%, #f4f6fb 100%);
    border-color: rgba(0, 0, 0, 0.08);
}

html[data-theme="light"] .site-admin-hero-glow {
    background: radial-gradient(circle at 30% 40%, rgba(88, 101, 242, 0.14) 0%, transparent 62%);
}

html[data-theme="light"] .site-admin-submenu,
html[data-theme="light"] .site-admin-tabs {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
}

html[data-theme="light"] .site-admin-stat-card {
    background: #fff;
}

@media (max-width: 820px) {
    .site-admin-overview-grid {
        grid-template-columns: 1fr;
    }

    .site-admin-usage-graph {
        grid-template-columns: 1fr;
    }

    .site-admin-hero {
        flex-direction: column;
        padding: 18px;
    }

    .site-admin-hero-title {
        font-size: 1.45rem;
    }

    .site-admin-toolbar-spacer {
        display: none;
    }
}

/* Admin Tools layout (menu + content) */
.admin-tools-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 18px;
}

.admin-tools-sidebar {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px;
    height: fit-content;
}

.admin-tools-nav-item {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    text-align: left;
    font: inherit;
    transition: all 0.15s ease;
}

a.admin-tools-nav-item {
    display: block;
    text-decoration: none;
    box-sizing: border-box;
}

.admin-tools-nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.admin-tools-nav-item.active {
    background: rgba(88, 101, 242, 0.18);
    border-color: rgba(88, 101, 242, 0.35);
    color: var(--text-primary);
}

.admin-tools-nav-group {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    margin: 12px 12px 6px;
    opacity: 0.85;
}

.admin-tools-nav-divider {
    height: 1px;
    background: var(--border);
    margin: 10px 0;
    opacity: 0.6;
}

.admin-tools-nav-item-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.admin-tools-content {
    min-width: 0;
}

.admin-tools-mobile-back {
    display: none;
}

/* Admin dashboard (overview) */
.admin-dashboard-card-goto {
    cursor: pointer;
    position: relative;
}
.admin-dashboard-card-goto:hover {
    border-color: rgba(88, 101, 242, 0.4);
}
.admin-dashboard-card-goto .admin-dashboard-card-link {
    position: absolute;
    bottom: 12px;
    right: 12px;
    font-size: 0.8rem;
    color: var(--primary);
    opacity: 0;
    transition: opacity 0.15s;
}
.admin-dashboard-card-goto:hover .admin-dashboard-card-link {
    opacity: 1;
}

.admin-dashboard-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.admin-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

/* My 2-Ups stats: 6 cards in 2 rows × 3 columns */
.duty-stats-grid.my-2ups-stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(2, auto);
    grid-auto-flow: row;
    margin-bottom: 24px;
}
@media (max-width: 768px) {
    .duty-stats-grid.my-2ups-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.admin-dashboard-card {
    background: var(--card-bg-2);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
    position: relative;
}

.admin-dashboard-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    pointer-events: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.admin-dashboard-card-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 6px;
}

.admin-dashboard-card-value {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.admin-dashboard-card-sub {
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-dashboard-panels {
    display: grid;
    gap: 12px;
}

.admin-dashboard-panel {
    padding: 14px;
}

.admin-dashboard-panel-title {
    font-weight: 800;
    margin-bottom: 10px;
}

.admin-dashboard-panel-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.admin-dashboard-quick-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-users-list {
    border-top: 1px solid var(--border);
    padding-top: 14px;
}

/* ============================================================
   Premium Admin — Master User Management
   ============================================================ */
#admin-section-user-management .admin-users-list {
    display: grid;
    gap: 12px;
    border-top: none;
    padding-top: 0;
}

#admin-section-user-management .command-tools-header {
    background: rgba(0, 0, 0, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 12px 12px;
    box-shadow: var(--shadow-soft);
}

#admin-section-user-management .search-input {
    background: rgba(30, 31, 34, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.10);
    color: var(--text-primary);
    border-radius: 12px;
    padding: 10px 12px;
    outline: none;
}

#admin-section-user-management .search-input:focus {
    border-color: rgba(88, 101, 242, 0.55);
    box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.18);
}

.user-mgmt-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 2px;
}

@media (max-width: 980px) {
    .user-mgmt-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    .user-mgmt-summary { grid-template-columns: 1fr; }
}

.user-mgmt-card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 12px 12px;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}
.user-mgmt-card::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.user-mgmt-k {
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.86rem;
}
.user-mgmt-v {
    font-weight: 900;
    letter-spacing: -0.02em;
    font-size: 1.35rem;
    margin-top: 4px;
}
.user-mgmt-s {
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.35;
}

.user-mgmt-row {
    background: rgba(30, 31, 34, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 14px 14px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.user-mgmt-main {
    min-width: 0;
    display: grid;
    gap: 8px;
}

.user-mgmt-title {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.user-mgmt-name {
    font-weight: 900;
    letter-spacing: -0.01em;
    font-size: 1.05rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 540px;
}

.user-mgmt-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.user-mgmt-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    align-items: center;
}

.eoi-grid {
    display: grid;
    /* Use minmax(0, ..) so cards can shrink and never overflow the container */
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    gap: 16px;
}

.eoi-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    min-width: 0; /* critical for grid overflow */
}

.eoi-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.eoi-card-header h2 {
    margin: 0;
    font-size: 1.15rem;
}

.eoi-list {
    display: grid;
    gap: 10px;
}

.eoi-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(64, 66, 73, 0.5);
    background: rgba(255,255,255,0.02);
    min-width: 0; /* allow inner text to ellipsis instead of expanding layout */
}

.eoi-item-title {
    font-weight: 800;
    margin-bottom: 3px;
}

.eoi-item-sub {
    color: var(--text-secondary);
    font-size: 0.85rem;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.4;
    max-width: 100%;
    min-width: 0;
}

/* Ensure the left text block in EOI items can shrink */
.eoi-item > div:first-child {
    min-width: 0;
}

.eoi-item-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    align-items: center;
}

/* ============================================================
   Premium Leadership EOI Inbox
   ============================================================ */
#lead-section-eoi-inbox .admin-users-list {
    display: grid;
    gap: 12px;
    border-top: none;
    padding-top: 0;
}

.eoi-premium-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}
@media (max-width: 720px) {
    .eoi-premium-summary { grid-template-columns: 1fr; }
}

.eoi-premium-card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 12px 12px;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}
.eoi-premium-card::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.eoi-premium-k {
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.86rem;
}
.eoi-premium-v {
    font-weight: 900;
    letter-spacing: -0.02em;
    font-size: 1.35rem;
    margin-top: 4px;
}
.eoi-premium-s {
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.35;
}

.eoi-premium-section {
    background: rgba(30, 31, 34, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 12px 12px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.eoi-premium-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.eoi-premium-section-title {
    font-weight: 900;
    letter-spacing: -0.01em;
}

.eoi-premium-row {
    background: rgba(43, 45, 49, 0.40);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    padding: 12px 12px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}
.eoi-premium-row-main {
    min-width: 0;
    display: grid;
    gap: 8px;
}
.eoi-premium-row-title {
    font-weight: 900;
    letter-spacing: -0.01em;
    font-size: 1.02rem;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.eoi-premium-row-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.eoi-premium-row-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    align-items: center;
}

/* Leadership Interview Tracker split lists: keep action buttons pinned right. */
#lead-awaiting-interview-list .eoi-premium-row,
#lead-awaiting-induction-list .eoi-premium-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}

#lead-awaiting-interview-list .eoi-premium-row-main,
#lead-awaiting-induction-list .eoi-premium-row-main {
    min-width: 0;
}

#lead-awaiting-interview-list .eoi-premium-row-actions,
#lead-awaiting-induction-list .eoi-premium-row-actions {
    justify-self: end;
    justify-content: flex-end;
}

@media (max-width: 760px) {
    #lead-awaiting-interview-list .eoi-premium-row,
    #lead-awaiting-induction-list .eoi-premium-row {
        grid-template-columns: 1fr;
    }

    #lead-awaiting-interview-list .eoi-premium-row-actions,
    #lead-awaiting-induction-list .eoi-premium-row-actions {
        justify-self: end;
    }
}

.interview-queue-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-card, rgba(43, 45, 49, 0.40));
}

.interview-queue-table {
    width: 100%;
    min-width: 860px;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.interview-queue-table th,
.interview-queue-table td {
    padding: 11px 12px;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
}

.interview-queue-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--bg-dark, #2b2d31);
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.interview-queue-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

.interview-queue-table tbody tr:last-child td {
    border-bottom: none;
}

.interview-queue-col-select {
    width: 44px;
    text-align: center;
}

.interview-queue-col-select input {
    margin: 0;
}

.interview-queue-col-name {
    font-weight: 700;
    min-width: 140px;
}

.interview-queue-col-date {
    white-space: nowrap;
    color: var(--text-secondary);
}

.interview-queue-col-status {
    white-space: nowrap;
}

.interview-queue-col-history {
    min-width: 220px;
}

.interview-queue-col-history .admin-pill {
    margin: 2px 6px 2px 0;
}

.interview-queue-col-actions {
    width: 1%;
}

.interview-queue-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.interview-queue-empty {
    color: var(--text-secondary);
}

html[data-theme="light"] .interview-queue-table-wrap {
    background: var(--bg-card);
}

html[data-theme="light"] .interview-queue-table thead th {
    background: #eef0f4;
}

html[data-theme="light"] .interview-queue-table tbody tr:hover {
    background: rgba(0, 0, 0, 0.04);
}

/* Interview session workspace + modals */
#lead-interview-session-toolbar .btn,
#lead-interview-session-workspace .btn {
    min-height: 36px;
}

#lead-interview-session-workspace .eoi-premium-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.lead-interview-invite-modal-content {
    max-width: 640px;
}

.lead-interview-invite-modal-body {
    padding: 0 20px 12px;
}

.lead-interview-invite-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
}

.lead-interview-invite-toolbar .form-input {
    flex: 1 1 180px;
    min-width: 0;
}

.lead-interview-invite-list {
    max-height: min(52vh, 420px);
    overflow: auto;
    display: grid;
    gap: 8px;
    padding-right: 2px;
}

.lead-interview-invite-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
}

.lead-interview-invite-row:hover {
    border-color: rgba(255, 255, 255, 0.14);
}

.lead-interview-invite-row--disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.lead-interview-invite-row--disabled:hover {
    border-color: rgba(255, 255, 255, 0.08);
}

.lead-interview-invite-row-main {
    min-width: 0;
    flex: 1;
}

.lead-interview-invite-row-title {
    font-weight: 600;
    word-break: break-word;
}

.lead-interview-invite-row-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.lead-interview-record-modal-content {
    max-width: 920px;
}

.lead-interview-record-panel-info {
    margin: 0 16px;
}

.lead-interview-record-peer-flag {
    margin: 8px 16px 0;
}

.lead-interview-record-scribe-actions {
    padding: 0 16px 8px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.lead-interview-record-questions,
.lead-interview-record-decision {
    padding: 16px;
}

.lead-interview-record-decision {
    padding-top: 0;
}

.lead-interview-record-footer {
    padding: 16px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.lead-interview-record-footer #lead-interview-record-cancel {
    margin-right: auto;
}

.lead-interview-answer-readonly {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

.lead-interview-record-modal-viewonly .lead-interview-record-questions,
.lead-interview-record-modal-viewonly .lead-interview-record-decision {
    padding-top: 8px;
}

.lead-interview-result-questions {
    display: grid;
    gap: 10px;
}

.lead-interview-result-question {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 14px 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.02) 100%);
}

.lead-interview-result-question-label {
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.35;
}

.lead-interview-result-question-answer {
    white-space: pre-wrap;
    line-height: 1.5;
    color: var(--text-primary);
}

.lead-interview-result-question-meta {
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.lead-interview-result-summary {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 14px 16px;
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
    display: grid;
    gap: 12px;
}

.lead-interview-result-outcome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.lead-interview-result-outcome-k {
    font-weight: 600;
}

.lead-interview-result-field-k {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.lead-interview-result-field-v {
    white-space: pre-wrap;
    line-height: 1.5;
}

@media (max-width: 760px) {
    #lead-interview-session-workspace .eoi-premium-row {
        grid-template-columns: 1fr;
    }

    #lead-interview-session-workspace .eoi-premium-row-actions {
        justify-content: flex-start;
    }

    .lead-interview-invite-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .lead-interview-invite-toolbar .btn {
        width: 100%;
    }

    .lead-interview-record-panel-info,
    .lead-interview-record-scribe-actions,
    .lead-interview-record-questions,
    .lead-interview-record-decision,
    .lead-interview-record-footer {
        padding-left: 12px;
        padding-right: 12px;
    }

    .lead-interview-record-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .lead-interview-record-footer #lead-interview-record-cancel {
        margin-right: 0;
        order: 3;
    }

    .lead-interview-record-footer .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .lead-interview-invite-list {
        max-height: 50vh;
    }

    #lead-awaiting-interview-list.admin-users-list {
        max-height: none;
    }
}

.eoi-premium-archive summary {
    cursor: pointer;
    user-select: none;
    color: var(--text-secondary);
}
.eoi-premium-archive-body {
    margin-top: 10px;
    display: grid;
    gap: 10px;
}

/* ============================================================
   Premium EOI Apply Modal form
   ============================================================ */
.eoi-form-shell {
    display: grid;
    gap: 12px;
}
.eoi-form-q {
    background: rgba(30, 31, 34, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 12px 12px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.eoi-form-label {
    display: block;
    font-weight: 800;
    margin-bottom: 8px;
}

/* Premium EOI review modal sections */
#eoi-review-modal .admin-users-list {
    display: grid;
    gap: 10px;
}
#eoi-review-modal .admin-user-row {
    background: rgba(30, 31, 34, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 12px 12px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    border-bottom: none !important;
}

/* Premium vote log: VOTE / VOTE CHANGE badge + outcome + name + date */
#eoi-review-modal .eoi-votes-card .eoi-votes-card-title {
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.03em;
    color: var(--text-primary);
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
#eoi-review-modal #eoi-review-votes.admin-users-list {
    gap: 12px;
}
#eoi-review-modal .eoi-vote-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(38, 39, 42, 0.6) 0%, rgba(30, 31, 34, 0.5) 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.03);
    border-left-width: 3px;
    border-left-style: solid;
    border-left-color: rgba(255, 255, 255, 0.1);
}
#eoi-review-modal .eoi-vote-row--accept {
    border-left-color: rgba(126, 231, 135, 0.5);
}
#eoi-review-modal .eoi-vote-row--deny {
    border-left-color: rgba(255, 123, 114, 0.5);
}
#eoi-review-modal .eoi-vote-row .eoi-vote-left {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
#eoi-review-modal .eoi-vote-row .eoi-vote-type {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}
#eoi-review-modal .eoi-vote-row .eoi-vote-type--change {
    color: rgba(249, 226, 175, 0.95);
    background: rgba(249, 226, 175, 0.08);
    border-color: rgba(249, 226, 175, 0.25);
}
#eoi-review-modal .eoi-vote-row .eoi-vote-pill {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}
#eoi-review-modal .eoi-vote-row .eoi-vote-pill--accept {
    color: #7ee787;
    border: 1px solid rgba(126, 231, 135, 0.4);
    background: rgba(46, 160, 67, 0.18);
    box-shadow: 0 0 0 1px rgba(126, 231, 135, 0.1);
}
#eoi-review-modal .eoi-vote-row .eoi-vote-pill--deny {
    color: #ff7b72;
    border: 1px solid rgba(255, 123, 114, 0.4);
    background: rgba(248, 81, 73, 0.18);
    box-shadow: 0 0 0 1px rgba(255, 123, 114, 0.1);
}
#eoi-review-modal .eoi-vote-row .eoi-vote-pill:not([class*="--"]) {
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
}
#eoi-review-modal .eoi-vote-row .eoi-vote-left-inner {
    display: inline-flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0 6px;
    min-width: 0;
}
#eoi-review-modal .eoi-vote-row .eoi-vote-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    letter-spacing: 0.01em;
}
#eoi-review-modal .eoi-vote-row .eoi-vote-from {
    color: var(--text-secondary);
    font-size: 0.85em;
    font-weight: 500;
    margin-left: 2px;
}
#eoi-review-modal .eoi-vote-row .eoi-vote-from::before {
    content: '· ';
    margin-right: 2px;
}
#eoi-review-modal .eoi-vote-row .eoi-vote-date-wrap {
    flex-shrink: 0;
}
#eoi-review-modal .eoi-vote-row .eoi-vote-date {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* Votes pagination */
#eoi-review-modal .eoi-votes-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
#eoi-review-modal .eoi-votes-pagination .eoi-vote-page-btn {
    padding: 6px 14px;
    font-size: 0.85rem;
}
#eoi-review-modal .eoi-votes-pagination .eoi-vote-page-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* EOI review action buttons: single row, aligned */
#eoi-review-modal .eoi-review-actions-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}
#eoi-review-modal .eoi-review-actions-row .btn {
    min-height: 38px;
    box-sizing: border-box;
}

.form-hint {
    color: var(--text-secondary);
}

/* User edit modal: role management */
.role-management-section {
    border-top: 1px solid var(--border);
    padding-top: 14px;
    margin-top: 14px;
}

.role-management-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.designation-checklist {
    display: grid;
    gap: 8px;
}

.designation-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(64, 66, 73, 0.5);
}

.designation-item label {
    margin: 0;
    font-weight: 700;
}

#admin-questions-list,
#admin-interview-questions-list {
    display: grid;
    gap: 10px;
}

.admin-questions-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}

/* Advanced settings (optional) */
.admin-advanced {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
}

.admin-advanced > summary {
    cursor: pointer;
    color: var(--text-primary);
    font-weight: 800;
    list-style: none;
}

.admin-advanced > summary::-webkit-details-marker {
    display: none;
}

.admin-advanced > summary::before {
    content: '▸';
    display: inline-block;
    margin-right: 8px;
    color: var(--text-secondary);
    transform: translateY(-1px);
}

.admin-advanced[open] > summary::before {
    content: '▾';
}

.admin-advanced-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.question-row {
    border: 1px solid rgba(64, 66, 73, 0.5);
    background: rgba(255,255,255,0.02);
    border-radius: 12px;
    padding: 12px;
    display: grid;
    gap: 8px;
}

.question-row-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.question-row-title {
    font-weight: 800;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.question-row-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.question-row-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.question-row-editor {
    display: grid;
    grid-template-columns: 1.4fr 0.7fr 0.65fr 1.25fr;
    gap: 10px;
    align-items: end;
}

.interview-question-row-editor {
    grid-template-columns: minmax(0, 1fr) auto auto;
}

.interview-question-row-editor .question-field-label textarea {
    min-height: 68px;
    resize: vertical;
}

.question-row--inactive {
    opacity: 0.72;
}

.question-field label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-bottom: 6px;
    font-weight: 700;
}

.question-inline-check {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
}

.question-field-options {
    display: grid;
    gap: 10px;
}

.question-options-list {
    display: grid;
    gap: 8px;
}

.question-option-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
}

@media (max-width: 900px) {
    .admin-advanced-grid {
        grid-template-columns: 1fr;
    }
    .question-row-editor,
    .interview-question-row-editor {
        grid-template-columns: 1fr;
    }
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.admin-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.04);
    color: var(--text-secondary);
}

.admin-pill.good {
    color: #7ee787;
    border-color: rgba(126, 231, 135, 0.35);
    background: rgba(46, 160, 67, 0.12);
}

.admin-pill.bad {
    color: #ff7b72;
    border-color: rgba(255, 123, 114, 0.35);
    background: rgba(248, 81, 73, 0.12);
}

.admin-pill.warn {
    color: #f9e2af;
    border-color: rgba(249, 226, 175, 0.35);
    background: rgba(249, 226, 175, 0.10);
}

/* Access level pills (Master User Management) – coloured bg + white text */
.admin-pill-level--site-admin {
    background: var(--danger) !important;
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.2);
}
.admin-pill-level--command,
.admin-pill-level--leadership {
    background: var(--primary) !important;
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.2);
}
.admin-pill-level--terminated {
    background: #6b7280 !important;
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.2);
}
.admin-pill-level--resigned {
    background: #78716c !important;
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.2);
}

/* ========== Disciplinary log (premium) ========== */
.disciplinary-log-premium-section {
    max-width: 960px;
}

.disciplinary-log-premium-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--card-border);
}

.disciplinary-log-premium-title-wrap {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.disciplinary-log-premium-icon {
    font-size: 1.75rem;
    line-height: 1;
    opacity: 0.9;
    filter: grayscale(0.2);
}

.disciplinary-log-premium-title {
    margin: 0 0 4px 0;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.disciplinary-log-premium-subtitle {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.disciplinary-log-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.disciplinary-log-settings-btn {
    background: var(--bg-hover);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px 14px;
    font-size: 0.9rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.disciplinary-log-settings-btn:hover {
    background: var(--bg-dark);
    border-color: var(--text-secondary);
}

.disciplinary-log-refresh-btn {
    flex-shrink: 0;
}

.disciplinary-log-settings-panel {
    margin-bottom: 20px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.disciplinary-log-settings-inner {
    padding: 18px 20px;
}

.disciplinary-log-settings-title {
    margin: 0 0 6px 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.disciplinary-log-settings-subtitle {
    margin: 0 0 14px 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

.disciplinary-log-message {
    margin-bottom: 12px;
}

.disciplinary-log-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.disciplinary-log-stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 14px 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.disciplinary-log-stat-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: var(--shadow-soft);
}

.disciplinary-log-stat-card-clickable {
    cursor: pointer;
}

.disciplinary-log-stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
    font-weight: 500;
}

.disciplinary-log-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.disciplinary-log-stat-value.trend-up { color: var(--danger); }
.disciplinary-log-stat-value.trend-down { color: var(--secondary); }
.disciplinary-log-stat-value.trend-same { color: var(--text-secondary); }

.disciplinary-log-search-wrap {
    max-width: 360px;
}

.disciplinary-log-search-input {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.95rem;
}

.disciplinary-log-pager {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.disciplinary-log-pager-info {
    white-space: nowrap;
}

.disciplinary-log-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-radius: 12px;
    overflow: hidden;
}

.disciplinary-log-loading,
.disciplinary-log-empty {
    text-align: center;
    padding: 32px 24px;
    font-size: 0.95rem;
    color: var(--text-secondary);
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
}

.disciplinary-log-card {
    display: flex;
    align-items: stretch;
    gap: 0;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.disciplinary-log-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: var(--shadow-soft);
}

.disciplinary-log-card-accent {
    width: 4px;
    flex-shrink: 0;
    border-radius: 4px 0 0 4px;
}

.disciplinary-log-card-accent.verbal {
    background: linear-gradient(180deg, #f9e2af 0%, #e6c76c 100%);
}

.disciplinary-log-card-accent.written {
    background: linear-gradient(180deg, #f0b429 0%, #c9901a 100%);
}

.disciplinary-log-card-accent.misconduct {
    background: linear-gradient(180deg, #ff7b72 0%, #ed4245 100%);
}

.disciplinary-log-card-accent.termination {
    background: linear-gradient(180deg, #8b2635 0%, #5c1a24 100%);
}

.disciplinary-log-card-accent.admin-leave {
    background: linear-gradient(180deg, #fde047 0%, #eab308 100%);
}

.disciplinary-log-card-accent.voided {
    background: var(--text-secondary);
    opacity: 0.5;
}

.disciplinary-log-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
}

.disciplinary-log-card-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.disciplinary-log-card-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.disciplinary-log-card-meta {
    font-size: 0.82rem;
    color: var(--text-secondary);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
}

.disciplinary-log-card-notes {
    font-size: 0.85rem;
    color: var(--text-secondary);
    opacity: 0.92;
    margin-top: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.disciplinary-log-card-actions {
    flex-shrink: 0;
}

.disciplinary-log-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.disciplinary-log-pill.verbal {
    color: #c9a227;
    border: 1px solid rgba(249, 226, 175, 0.4);
    background: rgba(249, 226, 175, 0.12);
}

.disciplinary-log-pill.written {
    color: #d4a017;
    border: 1px solid rgba(240, 180, 41, 0.4);
    background: rgba(240, 180, 41, 0.12);
}

.disciplinary-log-pill.misconduct {
    color: #ff7b72;
    border: 1px solid rgba(255, 123, 114, 0.4);
    background: rgba(248, 81, 73, 0.14);
}

.disciplinary-log-pill.termination {
    color: #e8a0a8;
    border: 1px solid rgba(139, 38, 53, 0.5);
    background: rgba(139, 38, 53, 0.2);
}

.disciplinary-log-pill.admin-leave {
    color: #fcd34d;
    border: 1px solid rgba(254, 231, 92, 0.45);
    background: rgba(254, 231, 92, 0.15);
}

.disciplinary-log-pill.voided {
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.06);
    text-decoration: line-through;
}

/* Log misconduct modal — single column, dropdown anchored to member field */
.disciplinary-add-misconduct-modal-content.modal-content {
    max-width: 520px;
    width: 100%;
}

.disciplinary-add-misconduct-modal-body.modal-body {
    padding: 18px 22px 22px;
}

.disciplinary-add-misconduct-modal-header.modal-header {
    padding: 18px 22px;
    flex-shrink: 0;
}

.disciplinary-add-misconduct-lead {
    margin: 0 0 20px;
    font-size: 0.92rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.disciplinary-add-misconduct-form {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
}

.disciplinary-add-misconduct-form .form-group {
    margin-bottom: 18px;
}

/* Anchor user picker below search input (not bottom of modal) */
.disciplinary-add-misconduct-member-field {
    position: relative;
    z-index: 2;
}

.disciplinary-add-misconduct-user-list.profiles-admin-user-list {
    z-index: 30;
    max-height: min(220px, 36vh);
}

.disciplinary-add-misconduct-notes {
    min-height: 100px;
    resize: vertical;
}

.disciplinary-add-misconduct-form-message.profile-message {
    margin: 4px 0 16px;
    min-height: 0;
}

.disciplinary-add-misconduct-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

html[data-theme="light"] .disciplinary-add-misconduct-actions {
    border-top-color: rgba(0, 0, 0, 0.08);
}

@media (max-width: 480px) {
    .disciplinary-add-misconduct-actions .generic-modal-btn-secondary,
    .disciplinary-add-misconduct-actions .generic-modal-btn-primary {
        flex: 1;
        min-width: calc(50% - 6px);
    }
}

/* Disciplinary record in user profile (matches disciplinary log) */
.disciplinary-profile-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.disciplinary-profile-card {
    display: flex;
    align-items: stretch;
    gap: 0;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.disciplinary-profile-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: var(--shadow-soft);
}

.disciplinary-profile-accent {
    width: 4px;
    flex-shrink: 0;
    border-radius: 4px 0 0 4px;
}

.disciplinary-profile-accent.verbal { background: var(--primary); }
.disciplinary-profile-accent.written { background: var(--warning); }
.disciplinary-profile-accent.misconduct { background: var(--danger); }
.disciplinary-profile-accent.termination { background: #8b2635; }
.disciplinary-profile-accent.admin-leave { background: #eab308; }
.disciplinary-profile-accent.voided { background: var(--text-secondary); }

.disciplinary-profile-body {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    min-width: 0;
}

.disciplinary-profile-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.disciplinary-profile-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.disciplinary-profile-title {
    font-weight: 600;
    color: var(--text-primary);
}

.disciplinary-profile-ts {
    white-space: nowrap;
}

.disciplinary-profile-notes {
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-word;
}

.disciplinary-profile-actions {
    flex-shrink: 0;
}

.admin-user-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(64, 66, 73, 0.5);
}

.admin-user-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.admin-user-name {
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-user-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* EOI answers: never truncate, wrap fully */
.eoi-question-text {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}
.eoi-answer-text {
    white-space: pre-wrap;
    overflow: visible;
    text-overflow: clip;
    word-break: break-word;
}

.admin-user-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

/* Site Admin Audit Logs — premium card presentation */
.audit-log-row {
    padding: 12px 14px;
    margin-bottom: 10px;
    border: 1px solid var(--card-border);
    border-radius: 14px;
    background: var(--card-bg-2);
    box-shadow: var(--shadow-soft), inset 0 1px 0 var(--card-highlight);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.audit-log-row:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: var(--shadow-strong), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.audit-log-row .admin-user-main {
    gap: 6px;
}

.audit-log-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}

.audit-log-badges {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.audit-log-time {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
}

.audit-log-identities,
.audit-log-detail,
.audit-log-request {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    word-break: break-word;
    line-height: 1.45;
}

.audit-log-identities {
    color: var(--text-primary);
    font-size: 0.9rem;
}

.audit-log-detail {
    color: var(--text-secondary);
}

.audit-log-request {
    color: var(--text-secondary);
    opacity: 0.95;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 0.8rem;
    padding-top: 2px;
}

.admin-pill.audit-cat-leave {
    background: rgba(87, 242, 135, 0.16);
    border-color: rgba(87, 242, 135, 0.45);
    color: #8dffb5;
}

.admin-pill.audit-cat-profile,
.admin-pill.audit-cat-employment,
.admin-pill.audit-cat-roles {
    background: rgba(88, 101, 242, 0.16);
    border-color: rgba(88, 101, 242, 0.45);
    color: #aab4ff;
}

.admin-pill.audit-cat-promotion,
.admin-pill.audit-cat-certification {
    background: rgba(254, 231, 92, 0.16);
    border-color: rgba(254, 231, 92, 0.45);
    color: #fff0a3;
}

.admin-pill.audit-cat-discipline,
.admin-pill.audit-cat-security {
    background: rgba(237, 66, 69, 0.16);
    border-color: rgba(237, 66, 69, 0.45);
    color: #ffb1b3;
}

.admin-pill.audit-cat-unit {
    background: rgba(186, 144, 255, 0.16);
    border-color: rgba(186, 144, 255, 0.45);
    color: #d3bbff;
}

html[data-theme="light"] .audit-log-row {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 249, 250, 0.94) 100%);
    border-color: var(--border);
    box-shadow: 0 6px 20px rgba(0, 39, 118, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

html[data-theme="light"] .audit-log-row:hover {
    border-color: rgba(0, 39, 118, 0.3);
    box-shadow: 0 12px 28px rgba(0, 39, 118, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.98);
}

html[data-theme="light"] .audit-log-time,
html[data-theme="light"] .audit-log-detail,
html[data-theme="light"] .audit-log-request {
    color: var(--text-secondary);
}

.command-tools-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

/* Headers inside profile cards have less bottom margin */
.profile-card .command-tools-header {
    margin-bottom: 12px;
    margin-top: 0;
}

.command-tools-header h2 {
    margin: 0;
    font-size: 1.2rem;
}

/* Section help button (top right of panel) and help body (Paramedic Tools) */
.section-help-btn {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.section-help-btn:hover {
    color: var(--primary);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.25);
}

/* Maintenance mode ! button — same style as section-help-btn */
.easter-egg-btn {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.easter-egg-btn:hover {
    color: var(--primary);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.25);
}

.command-tools-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-help-body {
    margin: 10px 0 16px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.section-help-body p {
    margin: 0;
    line-height: 1.5;
}

.command-tools-form {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 14px;
    align-items: end;
    margin-bottom: 18px;
}

.command-tools-form.command-tools-form-2col {
    grid-template-columns: 1fr 1fr;
    align-items: start;
}

.command-tools-form .form-group {
    min-width: 0;
}

.command-tools-form select.form-input {
    max-width: 100%;
    min-width: 0;
}

.command-tools-form .profile-message {
    grid-column: 1 / -1;
    margin-top: 6px;
}

/* Command → Channels (compact categorized layout) */
.admin-channels-layout {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-channels-message {
    margin-bottom: 0;
}

.admin-channels-category {
    margin-bottom: 0;
    padding: 14px 16px;
}

.admin-channels-category--full {
    grid-column: 1 / -1;
}

.admin-channels-category-title {
    margin: 0 0 4px;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.admin-channels-category-desc {
    margin: 0 0 10px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

.admin-channels-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md, 8px);
    background: var(--surface-elevated, rgba(255, 255, 255, 0.02));
}

.admin-channels-filter-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.admin-channels-filter-input {
    flex: 1 1 200px;
    min-width: 0;
    max-width: 320px;
    padding-top: 6px;
    padding-bottom: 6px;
    font-size: 0.875rem;
}

.admin-channels-toolbar-hint {
    flex: 1 1 100%;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

@media (min-width: 720px) {
    .admin-channels-toolbar-hint {
        flex: 1 1 auto;
        margin-left: auto;
        text-align: right;
    }
}

.admin-channels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}

.admin-channel-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.admin-channel-row {
    display: grid;
    grid-template-columns: minmax(108px, 34%) minmax(0, 1fr);
    gap: 4px 10px;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-color);
}

.admin-channel-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.admin-channel-row--panel {
    padding-top: 0;
    border-bottom: none;
}

.admin-channel-label {
    font-size: 0.82rem;
    font-weight: 500;
    line-height: 1.3;
    margin: 0;
    color: var(--text-primary);
}

.admin-channel-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.admin-channel-select {
    flex: 1 1 auto;
    min-width: 0;
    padding-top: 5px;
    padding-bottom: 5px;
    font-size: 0.85rem;
}

.admin-channel-controls .btn-sm {
    flex: 0 0 auto;
    min-width: 3.25rem;
    padding: 5px 10px;
    font-size: 0.78rem;
}

.admin-channel-row--no-test .admin-channel-controls {
    padding-right: calc(3.25rem + 6px);
}

.admin-channel-details {
    grid-column: 1 / -1;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.admin-channel-details summary {
    cursor: pointer;
    user-select: none;
    color: var(--text-secondary);
    list-style: none;
    width: fit-content;
}

.admin-channel-details summary::-webkit-details-marker {
    display: none;
}

.admin-channel-details summary::before {
    content: '▸ ';
    display: inline-block;
    transition: transform 0.15s ease;
}

.admin-channel-details[open] summary::before {
    transform: rotate(90deg);
}

.admin-channel-details p {
    margin: 4px 0 0;
    line-height: 1.45;
}

.admin-panel-current-info {
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

.admin-duty-log-card {
    margin-top: 4px;
}

.admin-duty-log-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.admin-duty-log-header-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.admin-duty-log-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px 14px;
    margin-bottom: 10px;
}

.admin-duty-log-field {
    margin-bottom: 0;
}

.admin-duty-log-field label {
    font-size: 0.82rem;
    margin-bottom: 4px;
}

.admin-duty-log-field--toggle {
    display: flex;
    align-items: flex-end;
}

.admin-duty-log-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    margin: 0;
}

.admin-duty-log-checkbox input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.admin-duty-log-actions {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    margin: 0;
}

.admin-duty-log-actions legend {
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0 6px;
}

.admin-duty-log-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px 14px;
    margin-top: 8px;
}

.admin-duty-log-notify-channel {
    grid-column: 1 / -1;
}

.admin-duty-log-status {
    margin-top: 10px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

@media (max-width: 520px) {
    .admin-channel-row {
        grid-template-columns: 1fr;
    }

    .admin-channel-row--no-test .admin-channel-controls {
        padding-right: 0;
    }

    .admin-channel-label {
        margin-bottom: -2px;
    }
}

.shift-edit-panel {
    margin-top: 10px;
    display: grid;
    gap: 10px;
}

.shift-edit-form {
    margin: 0;
}

.shift-edit-form .form-group {
    margin-bottom: 0;
}

.shift-edit-full-width {
    grid-column: 1 / -1;
}

.shift-quick-adjust-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.shift-quick-adjust-row .form-input {
    width: auto;
    min-width: 120px;
}

.shift-quick-adjust-row .shift-quick-adjust-number {
    min-width: 70px;
    width: 80px;
}

.shift-quick-adjust-help {
    margin-top: 6px;
}

.shift-edit-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Admin Leave section — align headers, form, and list */
#admin-section-admin-leave .command-tools-header {
    align-items: flex-start;
}
#admin-section-admin-leave .admin-leave-subsection-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 12px 0;
}
#admin-section-admin-leave .admin-leave-form-card .admin-leave-subsection-title {
    margin-bottom: 12px;
}
#admin-section-admin-leave .admin-leave-form {
    align-items: start;
    margin-bottom: 0;
}
#admin-section-admin-leave .admin-leave-form .form-group {
    margin-bottom: 0;
}
#admin-section-admin-leave .admin-leave-form .form-help {
    margin-top: 6px;
}
#admin-section-admin-leave .admin-leave-form-actions {
    margin-top: 16px;
}
#admin-section-admin-leave .admin-leave-list-header {
    margin-top: 20px;
    margin-bottom: 12px;
    align-items: center;
}
#admin-section-admin-leave .admin-leave-list-header .admin-leave-subsection-title {
    margin: 0;
}
#admin-section-admin-leave .admin-leave-archived-panel {
    margin-top: 16px;
}

/* Searchable user dropdown (Admin Leave) */
.admin-leave-user-dropdown {
    position: relative;
}
.admin-leave-user-list {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin-top: 4px;
    max-height: 240px;
    overflow-y: auto;
    background: var(--card-bg-2);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    z-index: 100;
    display: none;
}
.admin-leave-user-list.open {
    display: block;
}
.admin-leave-user-list-item {
    padding: 10px 12px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border);
}
.admin-leave-user-list-item:last-child {
    border-bottom: none;
}
.admin-leave-user-list-item:hover {
    background: rgba(255, 255, 255, 0.06);
}
.admin-leave-user-list-empty {
    padding: 12px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Profiles admin: searchable user dropdown */
.profiles-admin-user-select-wrap {
    position: relative;
}
.profiles-admin-user-select {
    position: relative;
}
.profiles-admin-user-list {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin-top: 4px;
    max-height: 240px;
    overflow-y: auto;
    background: var(--card-bg-2);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    z-index: 100;
    display: none;
}
.profiles-admin-user-list.open {
    display: block;
}
.profiles-admin-user-list-item {
    padding: 10px 12px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border);
}
.profiles-admin-user-list-item:last-child {
    border-bottom: none;
}
.profiles-admin-user-list-item:hover {
    background: rgba(255, 255, 255, 0.06);
}
.profiles-admin-user-list-empty {
    padding: 12px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.profiles-admin-log-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 8px;
    background: rgba(88, 101, 242, 0.25);
    color: var(--accent);
}
.profiles-admin-log-badge-delete {
    background: rgba(248, 81, 73, 0.25);
    color: var(--danger, #f45149);
}
.profiles-admin-log-row.profiles-admin-log-delete .admin-user-name {
    color: var(--text-secondary);
}

.profiles-admin-log-pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    max-width: 720px;
}
.profiles-admin-log-summary {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.command-mappings-list {
    border-top: 1px solid var(--border);
    padding-top: 16px;
}

.mapping-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(64, 66, 73, 0.5);
}

.mapping-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.mapping-title {
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mapping-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mapping-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

/* Role links matrix: dropdown sizing */
.mapping-row .form-input {
    min-width: 320px;
}

@media (max-width: 700px) {
    .mapping-row {
        flex-direction: column;
        align-items: stretch;
        padding: 12px 0;
        gap: 10px;
    }
    .mapping-actions {
        width: 100%;
    }
    .mapping-row .form-input {
        min-width: 0;
        width: 100%;
    }
}

.btn-danger {
    background: var(--danger);
}

.btn-danger:hover {
    background: #c83a3d;
}

@media (max-width: 768px) {
    .command-tools-form {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .command-tools-form.command-tools-form-2col {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .shift-quick-adjust-row .form-input {
        min-width: 0;
        width: 100%;
        flex: 1 1 100%;
    }

    .shift-quick-adjust-row .shift-quick-adjust-number {
        width: 100%;
    }

    .shift-edit-actions {
        justify-content: stretch;
    }

    .shift-edit-actions .btn {
        width: 100%;
    }

    .admin-tools-layout {
        grid-template-columns: 1fr;
    }

    /* Mobile: menu-first for Paramedic / FTO / Leadership / Command sidebars */
    .admin-tools-content {
        display: none;
        position: relative;
        z-index: 1;
        isolation: isolate;
    }
    .admin-tools-layout.admin-tools-mobile-in-content .admin-tools-sidebar {
        display: none;
    }
    .admin-tools-layout.admin-tools-mobile-in-content .admin-tools-content {
        display: block;
    }
    .admin-tools-sidebar {
        position: relative;
        top: auto;
        z-index: 2;
    }
    .admin-tools-mobile-back {
        display: none;
        align-items: center;
        gap: 8px;
        width: 100%;
        padding: 12px 4px;
        margin: 0 0 12px;
        border: none;
        border-bottom: 1px solid var(--border);
        background: transparent;
        color: var(--primary);
        font-size: 1rem;
        font-weight: 600;
        cursor: pointer;
        min-height: 48px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        font-family: inherit;
        text-align: left;
    }
    .admin-tools-mobile-back:hover {
        color: var(--text-primary);
    }
    .admin-tools-layout.admin-tools-mobile-in-content .admin-tools-mobile-back {
        display: flex;
    }
    .admin-tools-nav-item {
        min-height: 48px;
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .admin-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .eoi-grid {
        grid-template-columns: 1fr;
    }

    .site-admin-audit-filters-footer {
        align-items: stretch;
        justify-content: flex-start;
    }

    #site-admin-audit-apply {
        width: 100%;
    }

    .site-admin-test-notif-form {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.page-header {
    margin-bottom: 30px;
}

.dashboard-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.page-header-left {
    flex: 0 1 auto;
}

.dashboard-page-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
}

.dashboard-city-time-wrap {
    flex: 0 0 auto;
    text-align: right;
}

.dashboard-city-time-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.dashboard-city-time-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.page-header h1 {
    font-size: 2rem;
    margin-bottom: 8px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.45;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    box-shadow: inset 0 1px 0 var(--card-highlight);
}

/* Dashboard clock controls inside stat card */
.stat-card-controls {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.stat-card-controls .btn {
    padding: 10px 12px;
    font-size: 0.95rem;
    border-radius: 8px;
    flex: 1;
    min-width: 0;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-strong);
    border-color: rgba(88, 101, 242, 0.35);
}

/* Promote primary duty actions on the dashboard */
#dashboard-clock-card {
    border-color: rgba(88, 101, 242, 0.28);
    box-shadow: var(--shadow-soft), 0 0 0 1px rgba(88, 101, 242, 0.12);
}

#dashboard-clock-card:hover {
    border-color: rgba(88, 101, 242, 0.45);
}

/* Student Training dashboard card — neutral + training accent */
#dashboard-student-training-card {
    border-left: 3px solid var(--accent-training);
}

#dashboard-student-training-card .stat-content h3,
#dashboard-student-training-card .stat-label {
    color: var(--text-secondary);
}

#dashboard-student-training-card .stat-value {
    color: var(--text-primary);
}

#dashboard-student-training-card:hover {
    border-color: rgba(88, 101, 242, 0.35);
    border-left-color: var(--accent-training);
}

/* Student Training dashboard panel — neutral shell + accent stripe */
#dashboard-student-training-panel {
    margin-top: -18px;
    margin-bottom: 28px;
    border-radius: var(--radius-lg);
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-left: 3px solid var(--accent-training);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    position: relative;
}

/* FTO dashboard panel — neutral shell + MAS accent */
#dashboard-fto-panel {
    margin-top: -18px;
    margin-bottom: 28px;
    border-radius: var(--radius-lg);
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-left: 3px solid var(--accent-fto);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    position: relative;
}

#dashboard-fto-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow: inset 0 1px 0 var(--card-highlight);
}

#dashboard-fto-panel .student-training-icon {
    background: rgba(88, 101, 242, 0.14);
    border-color: rgba(88, 101, 242, 0.28);
    color: var(--primary);
    font-size: 0;
}

#dashboard-fto-panel .student-training-icon::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 3px;
    background: var(--accent-fto);
    display: block;
}

#dashboard-fto-panel .student-training-panel-head {
    background: transparent;
    border-bottom-color: var(--card-border);
}

#dashboard-fto-panel .student-training-progressfill {
    background: linear-gradient(90deg, rgba(88, 101, 242, 0.95), rgba(71, 82, 196, 0.95));
    box-shadow: 0 10px 18px rgba(88, 101, 242, 0.18);
}

/* Premium FTO activity stats */
#dashboard-fto-panel .fto-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

@media (max-width: 720px) {
    #dashboard-fto-panel .fto-stats {
        grid-template-columns: 1fr;
    }
}

#dashboard-fto-panel .fto-stat {
    background: var(--bg-dark);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 12px 12px;
    box-shadow: inset 0 1px 0 var(--card-highlight);
}

#dashboard-fto-panel .fto-stat-label {
    color: var(--text-secondary);
    font-weight: 800;
    letter-spacing: -0.01em;
    font-size: 0.92rem;
}

#dashboard-fto-panel .fto-stat-value {
    font-weight: 900;
    font-size: 1.25rem;
    margin-top: 4px;
    color: var(--text-primary);
}

#dashboard-fto-panel .fto-stat-meta {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.35;
}

/* ============================================================
   Premium FTO Tools — Activity
   ============================================================ */
#fto-section-fto-activity .admin-users-list {
    display: grid;
    gap: 12px;
}

.fto-activity-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 2px;
}

@media (max-width: 980px) {
    .fto-activity-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
    .fto-activity-summary { grid-template-columns: 1fr; }
}

.fto-activity-card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 12px 12px;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.fto-activity-card::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.fto-activity-card-label {
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.86rem;
}

.fto-activity-card-value {
    font-weight: 900;
    letter-spacing: -0.02em;
    font-size: 1.45rem;
    margin-top: 4px;
}

.fto-activity-card-meta {
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.fto-activity-row {
    background: rgba(30, 31, 34, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 14px 14px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 12px;
}

@media (max-width: 860px) {
    .fto-activity-row { grid-template-columns: 1fr; }
}

.fto-activity-row-name {
    font-weight: 900;
    letter-spacing: -0.01em;
    font-size: 1.05rem;
}

.fto-activity-row-meta {
    margin-top: 8px;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.fto-activity-row-side {
    display: grid;
    gap: 10px;
    align-content: start;
}

.fto-activity-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

@media (max-width: 560px) {
    .fto-activity-metrics { grid-template-columns: 1fr; }
}

.fto-activity-metric {
    background: rgba(43, 45, 49, 0.40);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 10px 10px;
}

.fto-activity-metric-k {
    color: rgba(214, 221, 255, 0.82);
    font-weight: 800;
    font-size: 0.86rem;
}

.fto-activity-metric-v {
    font-weight: 900;
    font-size: 1.2rem;
    margin-top: 4px;
}

.fto-activity-metric-s {
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 0.84rem;
    line-height: 1.35;
}

.fto-activity-levels {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

/* ============================================================
   Premium FTO Tools — 2-Up Logs
   ============================================================ */
#fto-section-two-up-logs .admin-users-list {
    display: grid;
    gap: 12px;
}

.two-up-logs-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 2px;
}

@media (max-width: 720px) {
    .two-up-logs-summary { grid-template-columns: 1fr; }
}

.two-up-summary-card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 12px 12px;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.two-up-summary-card::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.two-up-summary-k {
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.86rem;
}

.two-up-summary-v {
    font-weight: 900;
    letter-spacing: -0.02em;
    font-size: 1.35rem;
    margin-top: 4px;
}

.two-up-summary-s {
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.two-up-log-card {
    background: rgba(30, 31, 34, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 14px 14px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.two-up-log-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.two-up-log-titlewrap {
    min-width: 0;
}

.two-up-log-title {
    font-weight: 900;
    letter-spacing: -0.01em;
    font-size: 1.05rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.two-up-log-badges {
    margin-top: 8px;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.two-up-log-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    align-items: center;
}

.two-up-log-meta {
    margin-top: 10px;
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.two-up-log-edit {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.two-up-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0 2px;
}

.two-up-pager-mid {
    display: flex;
    justify-content: center;
    flex: 1;
}

/* ============================================================
   Premium FTO Tools — FTO Payments
   ============================================================ */
#fto-section-two-up-payments .admin-users-list {
    display: grid;
    gap: 12px;
}

#fto-section-two-up-payments .fto-payments-archive {
    margin-top: 4px;
}

#fto-section-two-up-payments .fto-payments-archive summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.fto-payments-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 2px;
}

@media (max-width: 980px) {
    .fto-payments-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    .fto-payments-summary { grid-template-columns: 1fr; }
}

.fto-payments-card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 12px 12px;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.fto-payments-card::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.fto-payments-k {
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.86rem;
}

.fto-payments-v {
    font-weight: 900;
    letter-spacing: -0.02em;
    font-size: 1.35rem;
    margin-top: 4px;
}

.fto-payments-s {
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.fto-payment-row {
    background: rgba(30, 31, 34, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 14px 14px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.fto-payment-main {
    min-width: 0;
}

.fto-payment-name {
    font-weight: 900;
    letter-spacing: -0.01em;
    font-size: 1.05rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fto-payment-meta {
    margin-top: 8px;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* ============================================================
   Premium Feedback Form
   ============================================================ */
.feedback-premium-card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 28px;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
    margin-top: 20px;
}

.feedback-premium-card::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    border-radius: 16px;
}

.feedback-premium-form {
    position: relative;
    z-index: 1;
}

.feedback-form-group {
    margin-bottom: 24px;
}

.feedback-label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.feedback-label-text {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.feedback-label-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.feedback-textarea {
    width: 100%;
    min-height: 200px;
    padding: 16px;
    background: rgba(30, 31, 34, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    transition: all 0.2s ease;
}

.feedback-textarea:focus {
    background: rgba(30, 31, 34, 0.75);
    border-color: rgba(88, 101, 242, 0.55);
    box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.18);
}

.feedback-textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

/* Premium rating slider (1–10) */
.feedback-rating-slider-wrap {
    --rating-value: 5;
    padding: 20px 20px 12px;
    background: rgba(30, 31, 34, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.feedback-rating-slider-wrap:focus-within {
    border-color: rgba(88, 101, 242, 0.4);
    box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.12);
}
.feedback-rating-slider-inner {
    position: relative;
    margin-bottom: 8px;
}
.feedback-rating-slider-value {
    display: block;
    text-align: center;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--primary);
    min-height: 2.5rem;
    line-height: 2.5rem;
    margin-bottom: 14px;
}
.feedback-rating-slider-value.empty {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 1.25rem;
}
.feedback-rating-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 10px;
    border-radius: 5px;
    background: linear-gradient(
        to right,
        rgba(88, 101, 242, 0.7) 0%,
        rgba(88, 101, 242, 0.7) calc((var(--rating-value) - 1) * 11.11%),
        rgba(255, 255, 255, 0.12) calc((var(--rating-value) - 1) * 11.11%),
        rgba(255, 255, 255, 0.12) 100%
    );
    outline: none;
}
.feedback-rating-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(145deg, #fff 0%, #e8e8e8 100%);
    border: 2px solid rgba(88, 101, 242, 0.8);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}
.feedback-rating-slider::-webkit-slider-thumb:hover {
    transform: scale(1.08);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.35), 0 0 0 2px rgba(88, 101, 242, 0.5);
}
.feedback-rating-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(145deg, #fff 0%, #e8e8e8 100%);
    border: 2px solid rgba(88, 101, 242, 0.8);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}
.feedback-rating-slider::-moz-range-thumb:hover {
    transform: scale(1.08);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.35), 0 0 0 2px rgba(88, 101, 242, 0.5);
}
.feedback-rating-slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    padding: 0 2px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}
.feedback-rating-skip {
    display: block;
    margin: 10px auto 0;
    padding: 6px 12px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s;
}
.feedback-rating-skip:hover {
    color: var(--text-primary);
}

.feedback-ratings-chart-wrap {
    margin-bottom: 20px;
    padding: 16px;
    background: rgba(30, 31, 34, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
}
.feedback-ratings-chart-title {
    margin: 0 0 12px 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}
.feedback-ratings-chart-container {
    max-width: 480px;
    height: 200px;
    margin-bottom: 8px;
}
.feedback-ratings-summary {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.feedback-satisfactory-wrap {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.feedback-satisfactory-title {
    margin: 0 0 12px 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}
.feedback-satisfactory-chart-row {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}
.feedback-satisfactory-chart-container {
    width: 140px;
    height: 140px;
    flex-shrink: 0;
}
.feedback-satisfactory-stats {
    min-width: 0;
}
.feedback-satisfactory-value {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--primary);
    line-height: 1.2;
}
.feedback-satisfactory-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 2px;
}
.feedback-satisfactory-meta {
    margin: 8px 0 0 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.feedback-rating-pill {
    background: rgba(88, 101, 242, 0.2);
    border-color: rgba(88, 101, 242, 0.4);
}

.feedback-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    padding: 16px;
    background: rgba(30, 31, 34, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.feedback-checkbox-label:hover {
    background: rgba(30, 31, 34, 0.55);
    border-color: rgba(255, 255, 255, 0.12);
}

.feedback-checkbox {
    display: none;
}

.feedback-checkbox-custom {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    background: rgba(30, 31, 34, 0.65);
    position: relative;
    transition: all 0.2s ease;
    margin-top: 2px;
}

.feedback-checkbox:checked + .feedback-checkbox-custom {
    background: var(--primary);
    border-color: var(--primary);
}

.feedback-checkbox:checked + .feedback-checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: 700;
}

.feedback-checkbox-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.feedback-checkbox-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.feedback-checkbox-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.feedback-form-actions {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.feedback-submit-btn {
    width: 100%;
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.25);
}

.feedback-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(88, 101, 242, 0.35);
}

.feedback-submit-btn:active {
    transform: translateY(0);
}

.feedback-submit-icon {
    font-size: 1.2rem;
    transition: transform 0.2s ease;
}

.feedback-submit-btn:hover .feedback-submit-icon {
    transform: translateX(2px);
}

/* ============================================================
   Premium Feedback Detail Modal
   ============================================================ */
.feedback-premium-modal {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-strong);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
}

.feedback-premium-modal::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    border-radius: 20px;
}

.feedback-modal-header {
    background: linear-gradient(180deg, rgba(43, 45, 49, 0.98) 0%, rgba(30, 31, 34, 0.95) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 24px 28px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.feedback-modal-header-content {
    flex: 1;
    min-width: 0;
}

.feedback-modal-title {
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin: 0 0 8px 0;
    line-height: 1.2;
}

.feedback-modal-status {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.feedback-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.feedback-modal-close:hover {
    background: rgba(237, 66, 69, 0.15);
    border-color: rgba(237, 66, 69, 0.3);
    color: var(--danger);
    transform: scale(1.05);
}

.feedback-modal-body {
    padding: 28px;
    position: relative;
    z-index: 1;
}

.feedback-detail-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.feedback-meta-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.feedback-meta-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.feedback-meta-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.feedback-meta-value em {
    font-style: italic;
    color: var(--text-secondary);
    font-weight: 500;
}

.feedback-meta-rank {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-left: 4px;
}

.feedback-reveal-hint {
    font-style: italic;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    position: relative;
}

.feedback-meta-value[style*="cursor: pointer"] .feedback-reveal-hint:hover,
.feedback-meta-value[style*="cursor: pointer"]:hover .feedback-reveal-hint {
    color: var(--text-primary);
    opacity: 0.9;
}

.feedback-meta-value[style*="cursor: pointer"] .feedback-reveal-hint::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 1px;
    background: currentColor;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.feedback-meta-value[style*="cursor: pointer"]:hover .feedback-reveal-hint::after {
    opacity: 0.4;
}

.feedback-content-card {
    background: rgba(30, 31, 34, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.feedback-content-card::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    border-radius: 14px;
}

.feedback-content-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.feedback-content-text {
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.7;
    white-space: pre-wrap;
    word-wrap: break-word;
    position: relative;
    z-index: 1;
    min-height: 100px;
}

.feedback-modal-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.feedback-modal-actions .btn {
    padding: 12px 20px;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: 10px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.feedback-modal-actions .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.feedback-modal-actions .btn:active {
    transform: translateY(0);
}

.feedback-modal-actions .btn-primary {
    background: var(--primary);
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.3);
}

.feedback-modal-actions .btn-primary:hover {
    box-shadow: 0 6px 16px rgba(88, 101, 242, 0.4);
}

@media (max-width: 600px) {
    .feedback-premium-modal {
        margin: 10px;
        max-width: calc(100% - 20px);
    }
    
    .feedback-modal-header {
        padding: 20px;
    }
    
    .feedback-modal-body {
        padding: 20px;
    }
    
    .feedback-detail-meta {
        grid-template-columns: 1fr;
    }
    
    .feedback-modal-actions {
        flex-direction: column;
    }
    
    .feedback-modal-actions .btn {
        width: 100%;
    }
}
}

.fto-payment-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
}

.fto-payment-owing {
    font-weight: 900;
    font-size: 1.15rem;
    padding: 6px 10px;
    border-radius: 12px;
    background: rgba(249, 226, 175, 0.10);
    border: 1px solid rgba(249, 226, 175, 0.25);
    color: #f9e2af;
}

#dashboard-student-training-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.student-training-panel-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    align-items: center;
    border-bottom: 1px solid var(--card-border);
    background: transparent;
}

.student-training-panel-title {
    display: flex;
    gap: 12px;
    align-items: center;
    min-width: 0;
}

.student-training-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(40, 156, 94, 0.14);
    border: 1px solid rgba(40, 156, 94, 0.28);
    flex: 0 0 auto;
    font-size: 0;
    color: var(--accent-training);
}

.student-training-icon::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 3px;
    background: var(--accent-training);
    display: block;
}

.student-training-kicker {
    color: var(--text-primary);
    font-weight: 900;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.student-training-sub {
    color: var(--text-secondary);
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 760px;
}

.student-training-panel-right {
    display: flex;
    gap: 14px;
    align-items: center;
    flex: 0 0 auto;
}

.student-training-percent {
    font-weight: 900;
    font-size: 2rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.student-training-controls {
    display: flex;
    gap: 10px;
}

.student-training-panel-body {
    padding: 14px 18px 16px;
    display: grid;
    gap: 14px;
}

.student-training-progressbar {
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.10);
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.student-training-progressfill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(87, 242, 135, 0.95), rgba(40, 156, 94, 0.92));
    box-shadow: 0 10px 18px rgba(40, 156, 94, 0.18);
}

.student-training-fto-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--bg-dark);
    border: 1px solid var(--card-border);
}

.student-training-fto-label {
    font-size: 0.82rem;
    line-height: 1.35;
    color: var(--text-secondary);
    max-width: 62%;
}

.student-training-fto-meta {
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--text-primary);
    text-align: right;
    white-space: nowrap;
}

.student-training-feedback-title {
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.student-training-feedback-preview {
    display: grid;
    gap: 10px;
}

.student-training-feedback-item {
    border-radius: 12px;
    border: 1px solid var(--card-border);
    background: var(--bg-dark);
    padding: 10px 12px;
}

.student-training-feedback-note {
    white-space: pre-wrap;
    color: var(--text-primary);
}

.student-training-feedback-note.preview {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.student-training-feedback-meta {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Training Notes cards (FTO overlay) */
.training-note-card {
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.16);
    padding: 12px 12px;
    margin-top: 10px;
}

.training-note-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.training-note-meta {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.training-note-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
}

.training-note-badge-student {
    border-color: rgba(40, 156, 94, 0.35);
    background: rgba(40, 156, 94, 0.14);
    color: var(--accent-training);
}

.training-note-body {
    white-space: pre-wrap;
    color: var(--text-primary);
}


.stat-icon {
    font-size: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    position: relative;
    flex-shrink: 0;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.rank-slide-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    max-width: 60px;
    max-height: 60px;
}

.stat-content h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* On Duty Units — primary live list (matches ui-panel chrome) */
.on-duty-section {
    padding: 24px;
    margin-bottom: 40px;
}

.on-duty-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.on-duty-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.on-duty-count {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.on-duty-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.on-duty-item,
.on-duty-unit {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 100%);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: box-shadow 0.25s ease, border-color 0.2s ease, transform 0.2s ease;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.on-duty-item:hover,
.on-duty-unit:hover {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0.02) 100%);
    border-color: rgba(59, 130, 246, 0.45);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

.on-duty-unit--patrol {
    border-left: 3px solid rgba(52, 211, 153, 0.85);
}

.on-duty-unit--event {
    border-left: 3px solid rgba(96, 165, 250, 0.95);
}

.on-duty-unit--office {
    border-left: 3px solid rgba(251, 191, 36, 0.9);
}

.on-duty-unit--peer {
    border-left: 3px solid rgba(167, 139, 250, 0.95);
}

.on-duty-unit--mixed {
    box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.35);
}

.on-duty-unit {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0;
    overflow: hidden;
}

.on-duty-unit--mine {
    border-color: rgba(88, 101, 242, 0.55);
    box-shadow: var(--shadow-soft), 0 0 0 1px rgba(88, 101, 242, 0.22);
}

.on-duty-unit--mine .on-duty-unit-summary {
    background: rgba(88, 101, 242, 0.08);
}

.on-duty-unit-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    border: none;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.on-duty-unit-summary:hover {
    background: rgba(255, 255, 255, 0.03);
}

.on-duty-unit-summary-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
}

.on-duty-unit-summary .on-duty-unit-callsign {
    font-size: 1.1rem;
    margin-right: 2px;
}

.on-duty-unit-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    white-space: nowrap;
}

.on-duty-unit-meta-chip--type {
    color: var(--text-primary);
    border-color: rgba(88, 101, 242, 0.28);
    background: rgba(88, 101, 242, 0.1);
}

.on-duty-you-pill {
    background: rgba(88, 101, 242, 0.22) !important;
    color: #c5caff !important;
    border: 1px solid rgba(88, 101, 242, 0.4);
    font-weight: 800;
}

.on-duty-expand-caret {
    flex: 0 0 auto;
    color: var(--text-secondary);
    transition: transform 140ms ease;
    font-size: 0.9rem;
    line-height: 1;
}

.on-duty-unit.is-expanded .on-duty-expand-caret {
    transform: rotate(180deg);
}

.on-duty-unit-compact-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    padding: 0 16px 12px;
}

.on-duty-unit.is-expanded .on-duty-unit-compact-actions {
    display: none;
}

.on-duty-unit-details {
    display: none;
    flex-direction: column;
    gap: 12px;
    padding: 0 16px 16px;
    border-top: 1px solid var(--card-border);
    padding-top: 12px;
}

.on-duty-unit.is-expanded .on-duty-unit-details {
    display: flex;
}

.on-duty-unit-details-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.on-duty-crew-preview {
    color: var(--text-muted);
    font-size: 0.8rem;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.on-duty-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.on-duty-filter-chip {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.on-duty-filter-chip:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.on-duty-filter-chip.is-active {
    color: var(--text-primary);
    border-color: var(--primary);
    background: rgba(88, 101, 242, 0.18);
}

.on-duty-list[data-filter="patrol"] .on-duty-band--office,
.on-duty-list[data-filter="patrol"] .on-duty-band--events,
.on-duty-list[data-filter="office"] .on-duty-band--patrol,
.on-duty-list[data-filter="office"] .on-duty-band--events,
.on-duty-list[data-filter="office"] .on-duty-band--peer,
.on-duty-list[data-filter="events"] .on-duty-band--patrol,
.on-duty-list[data-filter="events"] .on-duty-band--office,
.on-duty-list[data-filter="events"] .on-duty-band--peer,
.on-duty-list[data-filter="peer"] .on-duty-band--patrol,
.on-duty-list[data-filter="peer"] .on-duty-band--office,
.on-duty-list[data-filter="peer"] .on-duty-band--events,
.on-duty-list[data-filter="mine"] .on-duty-unit:not(.on-duty-unit--mine),
.on-duty-list[data-filter="mine"] .on-duty-band--peer .on-duty-section-label,
.on-duty-list[data-filter="mine"] .on-duty-band--office .on-duty-section-label,
.on-duty-list[data-filter="mine"] .on-duty-band--events .on-duty-section-label,
.on-duty-list[data-filter="mine"] .on-duty-band--patrol .on-duty-section-label {
    display: none;
}

.on-duty-list[data-filter="mine"] .on-duty-band--patrol:not(:has(.on-duty-unit--mine)),
.on-duty-list[data-filter="mine"] .on-duty-band--office:not(:has(.on-duty-unit--mine)),
.on-duty-list[data-filter="mine"] .on-duty-band--events:not(:has(.on-duty-unit--mine)),
.on-duty-list[data-filter="mine"] .on-duty-band--peer:not(:has(.on-duty-unit--mine)) {
    display: none;
}

.on-duty-duty-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 14px;
    padding: 14px 16px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(16, 185, 129, 0.06));
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.on-duty-multi-select {
    width: 100%;
    min-height: 140px;
    padding: 8px 10px;
    line-height: 1.45;
}

.on-duty-multi-select option {
    padding: 4px 6px;
}

.on-duty-section-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 20px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.on-duty-section-label:first-child {
    margin-top: 0;
}

.on-duty-section-label-icon {
    width: 12px;
    height: 12px;
    margin-top: 5px;
    border-radius: 3px;
    flex-shrink: 0;
    font-size: 0 !important;
    background: var(--text-secondary);
    opacity: 0.85;
}

.on-duty-section-label--patrol .on-duty-section-label-icon {
    background: rgba(52, 211, 153, 0.95);
}

.on-duty-section-label--office .on-duty-section-label-icon {
    background: rgba(251, 191, 36, 0.95);
}

.on-duty-section-label--events .on-duty-section-label-icon {
    background: rgba(96, 165, 250, 0.95);
}

.on-duty-section-label--peer .on-duty-section-label-icon {
    background: rgba(167, 139, 250, 0.95);
}

.on-duty-section-label--mine .on-duty-section-label-icon {
    background: var(--primary);
}

.on-duty-section-label-title {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--text-primary);
}

.on-duty-section-label-sub {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.on-duty-event-bundle {
    margin-bottom: 18px;
    padding: 14px 16px 16px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(96, 165, 250, 0.22);
}

.on-duty-event-bundle-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--text-primary);
}

.on-duty-event-bundle-stats {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 10px;
    line-height: 1.4;
}

.on-duty-event-bundle-senior {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin: 0 0 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    line-height: 1.45;
}

.on-duty-event-bundle-senior-rank {
    font-weight: 500;
    color: var(--text-secondary);
}

.on-duty-event-bundle-title {
    font-size: 1rem;
}

.on-duty-event-bundle-radio {
    color: var(--text-secondary);
    font-weight: 500;
}

.on-duty-event-bundle-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.on-duty-unit-header {
    display: flex;
    align-items: center;
    gap: 14px;
    justify-content: space-between;
}

.on-duty-unit-title {
    min-width: 0;
}

.on-duty-unit-callsign {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--text-primary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.on-duty-unit-sub {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.on-duty-unit-senior {
    margin-top: 2px;
}

.on-duty-unit-members {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.unit-member-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(0,0,0,0.10);
}

.unit-member-main {
    min-width: 0;
    flex: 1;
}

.unit-member-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.unit-member-rankslide {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 6px;
    overflow: hidden;
    background: rgba(0,0,0,0.10);
    border: 1px solid rgba(64, 66, 73, 0.5);
}

.unit-member-rankslide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.unit-member-rank {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.unit-member-certs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.unit-member-cert-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(88, 101, 242, 0.16);
    border: 1px solid rgba(88, 101, 242, 0.32);
    color: var(--text-primary);
    font-size: 0.68rem;
    font-weight: 650;
    letter-spacing: 0.01em;
    line-height: 1.2;
    white-space: nowrap;
}

.unit-member-cert-chip--more {
    background: rgba(87, 242, 135, 0.14);
    border-color: rgba(87, 242, 135, 0.28);
    font-weight: 650;
}

.on-duty-avatar {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    border: none;
    overflow: hidden;
    padding: 0;
}

.on-duty-avatar .rank-slide-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
    display: block;
}

.on-duty-info {
    flex: 1;
    min-width: 0;
}

.on-duty-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 4px;
}

.on-duty-rank {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.on-duty-duration {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.on-duty-duration-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.on-duty-duration-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--secondary);
}

.on-duty-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.on-duty-actions .btn {
    padding: 8px 12px;
    font-size: 0.85rem;
}

.on-duty-empty {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-style: italic;
}

/* Clock Management Section */
.clock-management-section {
    margin-bottom: 40px;
}

.clock-management-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
}

.clock-header {
    background: rgba(88, 101, 242, 0.10);
    border-bottom: 1px solid rgba(64, 66, 73, 0.7);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.clock-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.clock-header h2 {
    margin: 0;
    font-size: 1.05rem;
    color: var(--text-primary);
    font-weight: 700;
}

.clock-content {
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.clock-time-display {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
    text-align: center;
    margin: 0;
}

.clock-time-value {
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.2;
}

.clock-time-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

.clock-controls-inline {
    display: flex;
    gap: 16px;
    width: 100%;
}

.clock-controls-inline .btn-clock-in,
.clock-controls-inline .btn-clock-out {
    flex: 1;
    min-width: 0;
    padding: 14px 18px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
}

.clock-management-card .clock-message {
    width: 100%;
    margin: 0;
    padding: 12px 16px;
    font-size: 0.95rem;
}

@media (max-width: 768px) {
    .clock-time-value {
        font-size: 2rem;
    }
    
    .clock-controls-inline {
        flex-direction: column;
        gap: 12px;
    }
    
    .clock-controls-inline .btn-clock-in,
    .clock-controls-inline .btn-clock-out {
        width: 100%;
        padding: 16px 24px;
    }
}

/* Profile Page */
.profile-container {
    max-width: 600px;
    margin: 0 auto;
}

.profile-card {
    padding: 24px;
}

.profile-readonly .form-group { margin-bottom: 16px; }
.profile-readonly .form-group:last-of-type { margin-bottom: 0; }
.profile-display-value {
    margin: 4px 0 0;
    font-size: 1rem;
    color: var(--text-primary);
}
.settings-profile-form .form-group { margin-bottom: 16px; }
.settings-profile-form .form-group:last-of-type { margin-bottom: 0; }

/* ============================================================
   Training flow stepper (Standard → Final → Exam → Ready)
   ============================================================ */
.training-flow-stepper {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 0.88rem;
    color: var(--text-secondary);
}
.training-flow-step {
    white-space: nowrap;
}
.training-flow-step.done {
    color: var(--secondary);
    font-weight: 600;
}
.training-flow-step.current {
    color: var(--primary);
    font-weight: 700;
}
.training-flow-arrow {
    color: var(--border);
    font-weight: 400;
}

/* ============================================================
   Premium Training Checklist
   ============================================================ */
.training-checklist {
    padding: 18px;
}

/* ============================================================
   Premium Exam UI
   ============================================================ */
.exam-shell {
    display: grid;
    gap: 12px;
}

.exam-hero {
    background: linear-gradient(135deg, rgba(88, 101, 242, 0.22), rgba(87, 242, 135, 0.10));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 14px 16px;
    box-shadow: var(--shadow-soft);
}

.exam-hero-title {
    font-weight: 900;
    letter-spacing: -0.02em;
    font-size: 1.05rem;
}

.exam-hero-sub {
    color: var(--text-secondary);
    margin-top: 2px;
    font-size: 0.92rem;
}

.exam-hero-note {
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(30, 31, 34, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.exam-hero-note-icon {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(254, 231, 92, 0.15);
    border: 1px solid rgba(254, 231, 92, 0.25);
}

.exam-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    position: relative;
}

.exam-card::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow: inset 0 1px 0 var(--card-highlight);
}

.exam-body {
    padding: 14px 16px 8px;
    display: grid;
    gap: 12px;
}

.exam-section {
    display: grid;
    gap: 10px;
}

.exam-question,
.exam-ack {
    background: rgba(30, 31, 34, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 12px 12px;
}

.exam-question-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.exam-question-title {
    display: flex;
    gap: 10px;
    align-items: baseline;
    min-width: 0;
}

.exam-question-num {
    flex: none;
    font-weight: 900;
    font-size: 0.82rem;
    letter-spacing: 0.02em;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(88, 101, 242, 0.18);
    border: 1px solid rgba(88, 101, 242, 0.22);
}

.exam-question-text {
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
}

.exam-badge {
    flex: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.exam-options {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.exam-option {
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 10px;
    align-items: start;
    padding: 10px 10px;
    border-radius: 12px;
    background: rgba(43, 45, 49, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
    transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.exam-option:hover {
    background: rgba(53, 55, 60, 0.55);
    border-color: rgba(255, 255, 255, 0.10);
}

.exam-option:active {
    transform: translateY(1px);
}

/* Staff read-only exam: answer key (correct options) */
.exam-option.exam-option--correct-key {
    border: 2px solid #22c55e;
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.2);
}

.exam-option-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.exam-option-control {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    position: relative;
}

.exam-option-control.is-radio {
    border-radius: 999px;
}

.exam-option-control::after {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 3px;
    background: rgba(87, 242, 135, 0.95);
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 140ms ease, transform 140ms ease;
}

.exam-option-control.is-radio::after {
    border-radius: 999px;
}

.exam-option-input:checked + .exam-option-control {
    background: rgba(87, 242, 135, 0.14);
    border-color: rgba(87, 242, 135, 0.30);
    box-shadow: 0 0 0 3px rgba(87, 242, 135, 0.10);
}

.exam-option-input:checked + .exam-option-control::after {
    opacity: 1;
    transform: scale(1);
}

.exam-option-text {
    color: var(--text-primary);
    line-height: 1.35;
}

.exam-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(30, 31, 34, 0.35);
}

.exam-footer .profile-message {
    flex: 1;
    min-width: 0;
}

/* Exam config editor toolbar */
.ex-editor-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.ex-editor-floating-actions {
    margin-left: auto;
    display: flex;
    gap: 10px;
    align-items: center;
    position: sticky;
    top: calc(var(--navbar-height, 60px) + 12px);
    z-index: 30;
    padding: 8px;
    border-radius: 10px;
    border: 1px solid rgba(64, 66, 73, 0.7);
    background: rgba(30, 31, 34, 0.92);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
}

@media (max-width: 820px) {
    .ex-editor-floating-actions {
        width: 100%;
        margin-left: 0;
        justify-content: flex-end;
    }
}

.training-checklist-header {
    display: grid;
    gap: 10px;
    margin-bottom: 12px;
}

.training-checklist-titlewrap {
    min-width: 0;
}

.training-checklist-title {
    font-weight: 800;
    letter-spacing: -0.01em;
    font-size: 1.1rem;
}

.training-checklist-sub {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 6px;
}

.training-progress {
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.training-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, rgba(88, 101, 242, 0.9), rgba(87, 242, 135, 0.85));
    border-radius: 999px;
    box-shadow: 0 8px 16px rgba(88, 101, 242, 0.18);
}

.training-checklist-body {
    display: grid;
    gap: 12px;
}

.training-group {
    background: rgba(30, 31, 34, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    overflow: hidden;
}

.training-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(43, 45, 49, 0.75);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.training-group-title {
    font-weight: 800;
    letter-spacing: -0.01em;
}

.training-group-meta {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.training-group-body {
    padding: 6px 10px;
}

.training-item {
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 12px;
    align-items: start;
    padding: 10px 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
    position: relative;
}

.training-item:hover {
    background: rgba(53, 55, 60, 0.55);
}

.training-item.is-done {
    background: rgba(87, 242, 135, 0.06);
}

.training-item-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.training-item-toggle {
    width: 44px;
    height: 28px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    position: relative;
    margin-top: 2px;
}

.training-item-toggle::after {
    content: '';
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    position: absolute;
    top: 50%;
    left: 3px;
    transform: translateY(-50%);
    transition: transform 140ms ease, background 140ms ease;
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.35);
}

.training-item-input:checked + .training-item-toggle {
    background: rgba(87, 242, 135, 0.22);
    border-color: rgba(87, 242, 135, 0.35);
    box-shadow: 0 0 0 3px rgba(87, 242, 135, 0.12);
}

.training-item-input:checked + .training-item-toggle::after {
    transform: translate(16px, -50%);
    background: rgba(87, 242, 135, 0.95);
}

.training-item-input:focus-visible + .training-item-toggle {
    outline: none;
    box-shadow: 0 0 0 4px var(--ring);
}

.training-item-main {
    min-width: 0;
}

.training-item-title {
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.25;
}

.training-item-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 4px;
}

.training-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.training-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.training-item-input:disabled + .training-item-toggle {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.training-item:has(.training-item-input:disabled) {
    opacity: 0.8;
    cursor: not-allowed;
    pointer-events: none;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-dark);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--ring);
}

.form-input:read-only {
    background: var(--bg-hover);
    cursor: default;
    opacity: 0.7;
}

/* Dropdowns should look/feel clickable unless disabled */
select.form-input {
    cursor: pointer;
}

/* Explicit disabled styling (so the "not allowed" cursor is only for truly disabled controls) */
.form-input-error {
    border-color: var(--danger) !important;
    background-color: rgba(237, 66, 69, 0.12) !important;
    color: var(--text-primary) !important;
}

.form-input:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.form-help {
    display: block;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 6px;
}

.profile-message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    text-align: left;
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 20px;
    min-height: 20px;
    font-size: 0.92rem;
    line-height: 1.45;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(43, 45, 49, 0.45);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    position: relative;
    overflow: hidden;
}
.profile-message:empty {
    display: none;
}
.profile-message::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    border-radius: 10px 0 0 10px;
    background: var(--primary);
    opacity: 0.85;
}

.profile-message.success {
    background: rgba(87, 242, 135, 0.1);
    color: #9ef0b8;
    border-color: rgba(87, 242, 135, 0.28);
}
.profile-message.success::before {
    background: var(--secondary);
}

.profile-message.error {
    background: rgba(237, 66, 69, 0.1);
    color: #ff9a9c;
    border-color: rgba(237, 66, 69, 0.28);
}
.profile-message.error::before {
    background: var(--danger);
}

.profile-message.warn {
    background: rgba(254, 231, 92, 0.08);
    color: #ffe98a;
    border-color: rgba(254, 231, 92, 0.32);
}
.profile-message.warn::before {
    background: var(--warning);
}

/* Duty Statistics Cards */
.duty-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.duty-stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.2s;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
    position: relative;
    min-width: 0;
    overflow: hidden;
}

.duty-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-strong);
    border-color: rgba(88, 101, 242, 0.45);
}

.duty-stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    flex-shrink: 0;
}

.duty-stat-icon.blue {
    background: rgba(88, 101, 242, 0.2);
}

.duty-stat-icon.green {
    background: rgba(87, 242, 135, 0.2);
}

.duty-stat-icon.yellow {
    background: rgba(254, 231, 92, 0.2);
}

.duty-stat-icon.purple {
    background: rgba(155, 89, 182, 0.2);
}

.duty-stat-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.duty-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.duty-stat-value.blue {
    color: var(--primary);
}

.duty-stat-value.green {
    color: var(--secondary);
}

.duty-stat-value.yellow {
    color: var(--warning);
}

.duty-stat-value.purple {
    color: #9b59b6;
}

.duty-stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.duty-stat-compare-wrap {
    margin-top: 4px;
    font-size: 0.8rem;
}
.duty-stat-compare.up {
    color: var(--success, #22c55e);
}
.duty-stat-compare.down {
    color: var(--text-secondary);
}
.duty-stat-compare.same {
    color: var(--text-secondary);
    opacity: 0.85;
}

/* Monthly Performance Chart */
.monthly-performance-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 40px;
}

.monthly-performance-header {
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.monthly-performance-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.monthly-performance-chart-container {
    position: relative;
    height: 400px;
    width: 100%;
}

/* Shift History Section */
.shift-history-section {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 40px;
    box-shadow: var(--shadow-soft);
    position: relative;
}

.shift-history-section::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    pointer-events: none;
    box-shadow: inset 0 1px 0 var(--card-highlight);
}

.shift-history-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 20px;
}

.shift-history-title {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.shift-history-icon {
    font-size: 2rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(88, 101, 242, 0.2);
    border-radius: 8px;
    flex-shrink: 0;
}

.shift-history-title h2 {
    margin: 0 0 4px 0;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.shift-history-subtitle {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.filter-period-section {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.filter-period-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.filter-buttons {
    display: flex;
    gap: 8px;
}

.filter-btn {
    padding: 8px 14px;
    background: rgba(30, 31, 34, 0.75);
    border: 1px solid rgba(64, 66, 73, 0.85);
    border-radius: 999px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease, border-color 120ms ease, color 120ms ease;
    font-family: inherit;
    position: relative;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.filter-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    color: var(--text-primary);
}

.filter-btn.active {
    background: linear-gradient(180deg, rgba(88, 101, 242, 0.95), rgba(71, 82, 196, 0.95));
    border-color: rgba(88, 101, 242, 0.75);
    color: white;
    box-shadow: 0 10px 24px rgba(88, 101, 242, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.filter-btn:active {
    transform: translateY(1px);
}

.filter-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px var(--ring), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.shifts-history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.shift-history-item {
    background: rgba(30, 31, 34, 0.92);
    border: 1px solid rgba(64, 66, 73, 0.65);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.shift-history-item:hover {
    background: rgba(53, 55, 60, 0.65);
    border-color: rgba(88, 101, 242, 0.35);
    transform: translateY(-1px);
}

.shift-history-item-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.shift-history-item-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(88, 101, 242, 0.1);
    border-radius: 6px;
    flex-shrink: 0;
}

.shift-history-item-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.shift-history-item-date {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.shift-history-item-duration {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.shift-duration-value {
    color: var(--primary);
    font-weight: 600;
}

.shift-history-item-right {
    display: flex;
    align-items: center;
}

.shift-status-badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.shift-status-badge.completed {
    background: rgba(87, 242, 135, 0.2);
    color: var(--secondary);
    border: 1px solid var(--secondary);
}

.shift-status-badge.active {
    background: rgba(88, 101, 242, 0.2);
    color: var(--primary);
    border: 1px solid var(--primary);
}

/* Responsive adjustments for shift history */
@media (max-width: 768px) {
    .shift-history-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .filter-period-section {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .filter-buttons {
        width: 100%;
    }

    .filter-btn {
        flex: 1;
    }

    .shift-history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .shift-history-item-right {
        width: 100%;
        justify-content: flex-start;
    }
}

/* Shifts List (Legacy - kept for compatibility) */
.shifts-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
}

.shifts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.shift-item {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.shift-item:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
}

.shift-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.shift-date {
    font-weight: 600;
    color: var(--text-primary);
}

.shift-time {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.shift-duration {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--secondary);
}

/* Roster Page */
.roster-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
    animation: fadeInDown 0.4s ease-out;
}

.roster-title-section {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.roster-title-section .roster-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    flex-shrink: 0;
    background: rgba(88, 101, 242, 0.16);
    border: 1px solid rgba(88, 101, 242, 0.3);
    position: relative;
    font-size: 0;
    animation: none;
}

.roster-title-section .roster-icon::before {
    content: '';
    position: absolute;
    inset: 8px;
    border-radius: 3px;
    background: var(--primary);
}

.roster-title {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.roster-subtitle {
    margin: 6px 0 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    max-width: 520px;
    line-height: 1.45;
}

.roster-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.roster-refresh-btn {
    white-space: nowrap;
}

.roster-count {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 8px 14px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 20px;
    min-width: 0;
}

.roster-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.search-section {
    animation: fadeIn 0.5s ease-out;
}

.roster-search-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.roster-search-input {
    width: 100%;
    max-width: 360px;
}

.roster-filters-wrap {
    margin-top: 16px;
}

.roster-filters-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.roster-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.roster-clear-filters {
    font-size: 0.85rem;
    padding: 6px 12px;
}

.roster-empty {
    text-align: center;
    padding: 48px 24px;
    background: var(--bg-card);
    border: 1px dashed var(--border);
    border-radius: 12px;
    animation: fadeIn 0.3s ease-out;
}

.roster-empty-title {
    margin: 0 0 8px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.roster-empty-hint {
    margin: 0 0 16px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
}

.roster-empty-clear {
    margin-top: 8px;
}

.roster-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.9rem;
    user-select: none;
}

.roster-filter-chip input {
    accent-color: var(--primary);
}

.roster-filter-select {
    min-width: 220px;
    height: 40px;
}

.officer-certs {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.cert-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(88, 101, 242, 0.18);
    border: 1px solid rgba(88, 101, 242, 0.35);
    color: var(--text-primary);
    font-size: 0.78rem;
    line-height: 1;
}

.cert-pill.more {
    background: rgba(87, 242, 135, 0.14);
    border-color: rgba(87, 242, 135, 0.28);
}

.search-input {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-input:focus {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.2);
}

.roster-list-new {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    animation: fadeIn 0.6s ease-out;
}

.roster-activity-report-panel {
    margin-top: 8px;
    min-width: 0;
    max-width: 100%;
}

.roster-activity-report-intro {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.45;
    margin: 0 0 14px;
}

.activity-report-legend-orange {
    color: #f5a623;
}

.activity-report-legend-red {
    color: #e74c3c;
}

.roster-activity-report-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    align-items: center;
    margin-bottom: 14px;
    min-width: 0;
    max-width: 100%;
}

.roster-activity-report-month-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.roster-activity-report-month-input {
    min-width: 10rem;
}

.roster-activity-report-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    flex: 1 1 12rem;
    min-width: 0;
    overflow-wrap: anywhere;
}

.roster-activity-report-table-wrap {
    overflow-x: visible;
    max-width: 100%;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-card);
}

.roster-activity-report-table {
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.roster-activity-report-table th,
.roster-activity-report-table td {
    padding: 10px 8px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.roster-activity-report-table th {
    background: rgba(0, 0, 0, 0.2);
    font-weight: 700;
    color: var(--text-secondary);
    white-space: normal;
    vertical-align: bottom;
    line-height: 1.25;
}

.roster-activity-report-table td {
    vertical-align: top;
}

/* Percent widths sum to 100% so the table never exceeds the panel width on narrow viewports. */
.roster-activity-report-table th:nth-child(1),
.roster-activity-report-table td:nth-child(1) {
    width: 6%;
}

.roster-activity-report-table th:nth-child(2),
.roster-activity-report-table td:nth-child(2) {
    width: 20%;
}

.roster-activity-report-table th:nth-child(3),
.roster-activity-report-table td:nth-child(3) {
    width: 10%;
}

.roster-activity-report-table th:nth-child(4),
.roster-activity-report-table td:nth-child(4) {
    width: 11%;
}

.roster-activity-report-table th:nth-child(5),
.roster-activity-report-table td:nth-child(5) {
    width: 11%;
}

.roster-activity-report-table th:nth-child(6),
.roster-activity-report-table td:nth-child(6) {
    width: 12%;
}

.roster-activity-report-table th:nth-child(7),
.roster-activity-report-table td:nth-child(7) {
    width: 8%;
}

.roster-activity-report-table th:nth-child(8),
.roster-activity-report-table td:nth-child(8) {
    width: 10%;
}

.roster-activity-report-table th:nth-child(9),
.roster-activity-report-table td:nth-child(9) {
    width: 12%;
}

.roster-ar-th-select {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 2px 0;
}

.roster-ar-th-select-label {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-primary);
    line-height: 1.1;
    white-space: normal;
    text-align: center;
    overflow-wrap: break-word;
}

.roster-activity-report-table .roster-ar-col-select {
    text-align: center;
    vertical-align: middle;
    box-sizing: border-box;
}

.roster-activity-report-table thead .roster-ar-col-select {
    background: rgba(0, 0, 0, 0.35);
    white-space: normal;
}

html[data-theme="light"] .roster-activity-report-table thead .roster-ar-col-select {
    background: rgba(0, 0, 0, 0.08);
}

.roster-activity-report-table tbody .roster-ar-col-select {
    background: var(--bg-card);
}

.roster-activity-report-table tr.activity-report-row-orange .roster-ar-col-select {
    background: rgba(245, 166, 35, 0.22);
}

.roster-activity-report-table tr.activity-report-row-red .roster-ar-col-select {
    background: rgba(231, 76, 60, 0.24);
}

.roster-activity-report-table .roster-ar-col-select input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    min-width: 1.25rem;
    min-height: 1.25rem;
    margin: 0;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: var(--primary);
    opacity: 1;
    vertical-align: middle;
    /* Native control can disappear on some dark themes without explicit sizing */
    appearance: auto;
    -webkit-appearance: auto;
}

.roster-activity-report-table tr:last-child td {
    border-bottom: none;
}

.roster-activity-report-table tr.activity-report-row-orange td {
    background: rgba(245, 166, 35, 0.14);
}

.roster-activity-report-table tr.activity-report-row-red td {
    background: rgba(231, 76, 60, 0.16);
}

.roster-activity-report-table .roster-ar-actions {
    white-space: normal;
    text-align: center;
    vertical-align: middle;
}

.roster-activity-report-table .roster-ar-actions .btn {
    max-width: 100%;
    box-sizing: border-box;
    white-space: normal;
    line-height: 1.2;
    text-align: center;
}

/* Promotion report has 8 columns; keep action button single-line/readable. */
#roster-promotion-report-panel .roster-activity-report-table th:nth-child(8),
#roster-promotion-report-panel .roster-activity-report-table td:nth-child(8) {
    width: 14%;
}

#roster-promotion-report-panel .roster-activity-report-table .roster-ar-actions .btn {
    white-space: nowrap;
    min-width: 92px;
}

/* Paramedic Card */
.officer-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: slideInUp 0.5s ease-out backwards;
    animation-fill-mode: both;
    position: relative;
    backdrop-filter: blur(10px);
    cursor: pointer;
}

.officer-card:hover {
    border-color: var(--primary);
    box-shadow: 0 8px 24px rgba(88, 101, 242, 0.3);
    transform: translateY(-4px);
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

.officer-card-main {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 24px;
    transition: all 0.3s ease;
}

.officer-card-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

.officer-avatar {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    padding: 0;
}

.rank-slide-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 6px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
}

.officer-card:hover .rank-slide-image {
    /* keep full slide visible (no zoom-crop) */
    transform: none;
}

.officer-card:hover .officer-avatar {
    transform: scale(1.05);
}

.officer-info {
    flex: 1;
    min-width: 0;
}

.officer-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.15rem;
    margin-bottom: 4px;
    transition: color 0.3s ease;
}

.officer-card:hover .officer-name {
    color: var(--primary);
}

.officer-rank-line {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.officer-rank-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.officer-rank {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.status-badge {
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
    transform: scale(1);
}

.status-badge:hover {
    transform: scale(1.05);
}

.status-badge.leadership {
    background: var(--warning);
    color: #000;
}

.status-badge.command {
    background: #9b59b6;
    color: #fff;
}

.status-badge.supervisor {
    background: rgba(88, 101, 242, 0.25);
    color: var(--primary);
    border: 1px solid rgba(88, 101, 242, 0.35);
}

.status-badge.active {
    background: var(--secondary);
    color: #000;
}

.status-badge.on-leave {
    background: rgba(254, 231, 92, 0.3);
    color: var(--warning);
}

/* Collapsible panels (Leave UI, Leadership Leave sections) */
.collapse-panel {
    border: 1px solid var(--card-border);
    border-radius: 12px;
    background: var(--card-bg);
    overflow: hidden;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
    position: relative;
}

.collapse-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    pointer-events: none;
    box-shadow: inset 0 1px 0 var(--card-highlight);
}

.collapse-panel + .collapse-panel {
    margin-top: 12px;
}

.collapse-summary {
    list-style: none;
    cursor: pointer;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    /* Keep count + caret aligned to the right consistently */
    justify-content: flex-start;
    gap: 10px;
    user-select: none;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.02) 100%);
}

.collapse-summary:hover {
    background: linear-gradient(180deg, rgba(88, 101, 242, 0.10) 0%, rgba(255, 255, 255, 0.02) 100%);
}

/* Hide default marker so we can draw our own */
.collapse-panel summary::-webkit-details-marker {
    display: none;
}

.collapse-summary-title {
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.collapse-summary-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.collapse-summary::after {
    content: '▾';
    color: var(--text-secondary);
    transition: transform 140ms ease;
    margin-left: 6px;
}

/* Make the count badge a fixed column so all panels line up */
.collapse-summary-meta .admin-pill {
    min-width: 34px;
    text-align: center;
    justify-content: center;
}

.collapse-panel[open] > .collapse-summary::after {
    transform: rotate(180deg);
}

.collapse-panel-body {
    padding: 12px 14px 14px;
    border-top: 1px solid rgba(64, 66, 73, 0.65);
}

/* Leave Inbox — premium summary + rows */
.leave-inbox-premium {
    margin-top: 0;
}
.leave-inbox-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}
.leave-inbox-summary-card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}
.leave-inbox-summary-card::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    border-radius: 12px;
}
.leave-inbox-summary-k {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.82rem;
}
.leave-inbox-summary-v {
    font-weight: 800;
    letter-spacing: -0.02em;
    font-size: 1.5rem;
    margin-top: 4px;
}
.leave-inbox-section .collapse-panel {
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
    border-radius: 14px;
    overflow: hidden;
}
.leave-inbox-section .collapse-summary {
    padding: 14px 18px;
}
.leave-inbox-section .collapse-panel-body {
    padding: 14px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.leave-inbox-row {
    background: rgba(43, 45, 49, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    flex-wrap: wrap;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.leave-inbox-row:hover {
    border-color: rgba(88, 101, 242, 0.35);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}
.leave-inbox-row-main {
    min-width: 0;
    display: grid;
    gap: 6px;
}
.leave-inbox-row-title {
    font-weight: 700;
    letter-spacing: -0.01em;
    font-size: 1rem;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.leave-inbox-row-meta {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.leave-inbox-row-actions {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
}
.leave-inbox-pager {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    align-items: center;
    margin-top: 12px;
    flex-wrap: wrap;
}


.officer-mdt-section,
.officer-assigned-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mdt-label,
.assigned-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mdt-value {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 600;
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
}

.mdt-value:hover {
    border-color: var(--primary);
    background: var(--bg-hover);
}

.assigned-value {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.officer-card-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.officer-hours-section {
    display: flex;
    gap: 8px;
}

.hour-pill {
    padding: 8px 14px;
    border-radius: 24px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 2px solid;
    white-space: nowrap;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.hour-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.hour-pill-green {
    background: rgba(87, 242, 135, 0.1);
    border-color: var(--secondary);
    color: var(--secondary);
}

.hour-pill-yellow {
    background: rgba(254, 231, 92, 0.1);
    border-color: var(--warning);
    color: var(--warning);
}

.hour-pill-blue {
    background: rgba(88, 101, 242, 0.1);
    border-color: var(--primary);
    color: var(--primary);
}

.hour-pill-icon {
    font-size: 0.9rem;
}

.hour-pill-text {
    font-size: 0.85rem;
}

.officer-actions {
    display: flex;
    gap: 8px;
}

.officer-no-profile-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
}

.action-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1rem;
    position: relative;
    transform: rotate(0deg);
}

.action-icon:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    color: var(--primary);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.3);
}

.action-icon.action-icon-label {
    width: auto;
    padding: 8px 12px;
    border-radius: 20px;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 500;
}

.action-icon.action-icon-label span {
    white-space: nowrap;
}

.action-icon.toggle-expand {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Expanded Paramedic Card */
.officer-card-expanded {
    border-top: 1px solid var(--border);
    padding: 24px;
    background: var(--bg-dark);
    animation: slideDown 0.3s ease-out;
    max-height: 1000px;
    overflow: hidden;
}

@keyframes slideDown {
    from {
        max-height: 0;
        opacity: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
    to {
        max-height: 1000px;
        opacity: 1;
        padding-top: 24px;
        padding-bottom: 24px;
    }
}

@keyframes slideUp {
    from {
        max-height: 1000px;
        opacity: 1;
        padding-top: 24px;
        padding-bottom: 24px;
    }
    to {
        max-height: 0;
        opacity: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
}

.expanded-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.previous-months-section h4,
.activity-trend-section h4 {
    margin: 0 0 16px 0;
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.previous-months-list {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.month-badge {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
}

.month-badge:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 4px 8px rgba(88, 101, 242, 0.2);
}

.month-hours {
    color: var(--secondary);
    font-weight: 600;
    margin-left: 8px;
}

.trend-subtitle {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0 0 12px 0;
}

.trend-chart-mini {
    height: 200px;
    position: relative;
}

/* Paramedic Statistics Modal */
.officer-stats-modal {
    max-width: 900px;
}

.modal-header-left {
    flex: 1;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.modal-rank-slide-wrap {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.modal-rank-slide-wrap .modal-rank-slide-img {
    max-width: 56px;
    max-height: 56px;
    width: auto;
    height: auto;
}

.modal-rank-slide-wrap #modal-rank-slide-fallback {
    font-size: 2rem;
    line-height: 1;
}

.modal-header-name-rank {
    flex: 1;
    min-width: 0;
}

.modal-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.modal-callsign-badge {
    background: rgba(87, 242, 135, 0.2);
    color: var(--secondary);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
}

.officer-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.officer-stat-card {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.officer-stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 8px 16px rgba(88, 101, 242, 0.2);
}

.officer-stat-icon {
    font-size: 1.8rem;
    margin-bottom: 12px;
    transition: transform 0.3s ease;
}

.officer-stat-card:hover .officer-stat-icon {
    transform: scale(1.1) rotate(5deg);
}

.officer-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    transition: color 0.3s ease;
}

.officer-stat-card:hover .officer-stat-value {
    color: var(--primary);
}

.officer-stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.officer-stat-status {
    font-size: 0.8rem;
    margin-top: 4px;
}

.officer-stat-status.success {
    color: var(--secondary);
}

.officer-stat-status.warning {
    color: var(--warning);
}

.monthly-comparison-section {
    margin-bottom: 24px;
}

.monthly-comparison-section h3 {
    margin: 0 0 16px 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.comparison-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comparison-bar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.comparison-label {
    min-width: 120px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.comparison-bar-container {
    flex: 1;
    height: 36px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.comparison-bar-fill {
    height: 100%;
    border-radius: 8px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    position: relative;
    overflow: hidden;
}


.comparison-bar-fill.blue {
    background: rgba(88, 101, 242, 0.3);
    border: 1px solid var(--primary);
}

.comparison-bar-fill.green {
    background: rgba(87, 242, 135, 0.3);
    border: 1px solid var(--secondary);
}

.comparison-bar-fill.yellow {
    background: rgba(254, 231, 92, 0.3);
    border: 1px solid var(--warning);
}

.comparison-value {
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
}

.monthly-overview-section {
    margin-top: 24px;
}

.overview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.overview-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.overview-period {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.overview-chart-container {
    height: 300px;
    position: relative;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.3s ease;
}

.overview-chart-container:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.2);
}

/* Disciplinary actions summary in user profile (Statistics tab) */
.user-profile-disciplinary-summary {
    margin-top: 24px;
    padding: 16px;
    background: var(--card-bg-2);
    border: 1px solid var(--card-border);
    border-radius: 12px;
}
.user-profile-disciplinary-summary h3 {
    margin: 0 0 10px 0;
    font-size: 1.05rem;
    color: var(--text-primary);
}
.user-profile-disciplinary-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.user-profile-disciplinary-count {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Legacy roster styles (kept for compatibility) */
.roster-list {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.roster-item {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
    cursor: pointer;
}

.roster-item:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.roster-item-info {
    flex: 1;
}

.roster-item-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-bottom: 6px;
}

.roster-item-details {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.roster-detail {
    color: var(--text-secondary);
}

.roster-separator {
    color: var(--border);
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    width: auto;
    height: auto;
    min-height: 100dvh;
    /* Backdrop should cover EVERYTHING, including the sticky header */
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 5000;
    align-items: center;
    justify-content: center;
    padding: var(--overlay-top-padding, 80px) 20px 20px 20px; /* top padding so content appears below navbar */
    overflow-y: auto; /* allow overlay scroll on small screens */
    overscroll-behavior: contain; /* stop scroll chaining to page behind */
}

.modal-content {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    width: 100%;
    max-width: 700px;
    /* Single-scroll-container modal: scroll the dialog itself (account for overlay top padding) */
    max-height: calc(100vh - var(--overlay-top-padding, 80px) - 20px);
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: var(--shadow-strong);
    display: flex;
    flex-direction: column;
    min-height: 0;
    position: relative;
}

.modal-content::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    pointer-events: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* Modal body: normal flow (dialog scrolls) */
.modal-body {
    flex: 0 0 auto;
    min-height: 0;
    overflow: visible;
}

.modal-content.officer-stats-modal {
    max-width: 900px;
    animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    /* Softer header: fade into modal background */
    border-bottom: 1px solid rgba(64, 66, 73, 0.55);
    position: sticky;
    top: 0;
    z-index: 2;
    background: linear-gradient(
        to bottom,
        rgba(43, 45, 49, 0.98) 0%,
        rgba(43, 45, 49, 0.92) 70%,
        rgba(43, 45, 49, 0.86) 100%
    );
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Section help overlay — detailed guide on complex pages */
.section-help-overlay {
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.section-help-overlay .section-help-overlay-content {
    max-width: 640px;
    max-height: calc(100vh - var(--overlay-top-padding, 80px) - 20px);
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-strong), 0 0 0 1px rgba(255, 255, 255, 0.04);
    overflow: hidden;
    animation: modalSlideIn 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.section-help-overlay .modal-header {
    padding: 18px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(
        180deg,
        rgba(43, 45, 49, 0.98) 0%,
        rgba(43, 45, 49, 0.92) 100%
    );
}
.section-help-overlay .modal-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}
.section-help-overlay-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 20px 24px 8px;
}
.section-help-overlay-actions {
    padding: 14px 24px 20px;
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(
        180deg,
        rgba(43, 45, 49, 0.55) 0%,
        rgba(43, 45, 49, 0.88) 100%
    );
    flex-shrink: 0;
}
.help-overlay-prose,
#section-help-overlay-inner,
#release-announcement-overlay-inner {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
}
.help-overlay-prose h3,
#section-help-overlay-inner h3,
#release-announcement-overlay-inner h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 1.15em 0 0.45em;
    padding-bottom: 0.35em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.help-overlay-prose h3:first-child,
#section-help-overlay-inner h3:first-child,
#release-announcement-overlay-inner h3:first-child { margin-top: 0; }
.help-overlay-prose p,
#section-help-overlay-inner p,
#release-announcement-overlay-inner p { margin: 0 0 0.8em; }
.help-overlay-prose ul,
.help-overlay-prose ol,
#section-help-overlay-inner ul,
#section-help-overlay-inner ol,
#release-announcement-overlay-inner ul,
#release-announcement-overlay-inner ol {
    margin: 0.35em 0 0.85em;
    padding-left: 1.35em;
}
.help-overlay-prose li,
#section-help-overlay-inner li,
#release-announcement-overlay-inner li { margin-bottom: 0.35em; }
.help-overlay-prose li:last-child,
#section-help-overlay-inner li:last-child,
#release-announcement-overlay-inner li:last-child { margin-bottom: 0; }
.help-overlay-prose strong,
#section-help-overlay-inner strong,
#release-announcement-overlay-inner strong { color: var(--text-primary); font-weight: 600; }
.help-overlay-prose code,
#section-help-overlay-inner code,
#release-announcement-overlay-inner code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.88em;
    padding: 0.12em 0.4em;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}
.section-help-detail-link {
    display: inline-block;
    margin-top: 6px;
    font-size: 0.88rem;
    color: var(--primary);
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    text-decoration: underline;
}
.section-help-detail-link:hover { color: var(--secondary); }
html[data-theme="light"] .section-help-overlay {
    background: rgba(15, 23, 42, 0.45);
}
html[data-theme="light"] .section-help-overlay .section-help-overlay-content {
    border-color: rgba(15, 23, 42, 0.1);
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.14);
}
html[data-theme="light"] .section-help-overlay .modal-header,
html[data-theme="light"] .section-help-overlay-actions {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.96) 100%);
    border-color: rgba(15, 23, 42, 0.08);
}
html[data-theme="light"] .help-overlay-prose h3,
html[data-theme="light"] #section-help-overlay-inner h3,
html[data-theme="light"] #release-announcement-overlay-inner h3 {
    border-bottom-color: rgba(15, 23, 42, 0.08);
}
html[data-theme="light"] .help-overlay-prose code,
html[data-theme="light"] #section-help-overlay-inner code,
html[data-theme="light"] #release-announcement-overlay-inner code {
    background: rgba(15, 23, 42, 0.06);
    border-color: rgba(15, 23, 42, 0.08);
}

/* Competitions help — match the premium competition page treatment */
.section-help-overlay-comp .section-help-overlay-content {
    max-width: 720px;
    background:
        radial-gradient(900px 260px at 0% 0%, rgba(88, 101, 242, 0.18), transparent 55%),
        radial-gradient(700px 220px at 100% 0%, rgba(87, 242, 135, 0.08), transparent 50%),
        var(--card-bg, var(--bg-card));
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-strong, 0 18px 48px rgba(0, 0, 0, 0.35)), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.section-help-overlay-comp .modal-header {
    background: transparent;
    border-bottom-color: rgba(255, 255, 255, 0.08);
}
.section-help-overlay-comp .modal-header h2 {
    font-weight: 800;
    letter-spacing: -0.02em;
}
.section-help-overlay-comp .section-help-overlay-body {
    padding: 16px 18px 6px;
}
.section-help-overlay-comp .section-help-overlay-actions {
    background: transparent;
    border-top-color: rgba(255, 255, 255, 0.08);
}
.comp-help {
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: comp-current-in 420ms ease-out;
}
.comp-help-card {
    position: relative;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(30, 31, 34, 0.5);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.comp-help-card-accent {
    background:
        linear-gradient(135deg, rgba(88, 101, 242, 0.16), rgba(88, 101, 242, 0.04) 55%, transparent),
        rgba(30, 31, 34, 0.55);
    border-color: rgba(88, 101, 242, 0.28);
}
.comp-help-kicker {
    font-size: 0.72rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 8px;
}
.comp-help-card p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.55;
}
.comp-help-card p + .comp-help-steps,
.comp-help-card p + .comp-help-list {
    margin-top: 12px;
}
.comp-help-card strong {
    color: var(--text-primary);
    font-weight: 700;
}
.comp-help-steps {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.comp-help-step {
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 10px;
    align-items: start;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.18);
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.45;
}
.comp-help-step-n {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 850;
    font-size: 0.82rem;
    color: var(--text-primary);
    background: rgba(88, 101, 242, 0.22);
    border: 1px solid rgba(88, 101, 242, 0.35);
}
.comp-help-list {
    margin: 0;
    padding-left: 1.2em;
    color: var(--text-secondary);
}
.comp-help-list li {
    margin-bottom: 0.45em;
}
.comp-help-list li:last-child {
    margin-bottom: 0;
}
html[data-theme="light"] .section-help-overlay-comp .section-help-overlay-content {
    background:
        radial-gradient(900px 260px at 0% 0%, rgba(88, 101, 242, 0.1), transparent 55%),
        var(--card-bg, #fff);
}
html[data-theme="light"] .comp-help-card {
    background: rgba(15, 23, 42, 0.03);
    border-color: rgba(15, 23, 42, 0.08);
}
html[data-theme="light"] .comp-help-card-accent {
    background:
        linear-gradient(135deg, rgba(88, 101, 242, 0.1), rgba(88, 101, 242, 0.03) 55%, transparent),
        rgba(15, 23, 42, 0.03);
    border-color: rgba(88, 101, 242, 0.22);
}
html[data-theme="light"] .comp-help-kicker {
    color: rgba(15, 23, 42, 0.5);
}
html[data-theme="light"] .comp-help-step {
    background: rgba(15, 23, 42, 0.03);
    border-color: rgba(15, 23, 42, 0.08);
}

/* ============================================================
   Admin Leave Current Modal — Premium
   ============================================================ */
.admin-leave-current-modal-premium {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: rgba(0, 0, 0, 0.6);
}

.admin-leave-current-modal-content {
    min-width: 440px;
    max-width: 560px;
    width: 92%;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-strong), 0 0 0 1px rgba(255, 255, 255, 0.05);
    overflow: hidden;
    position: relative;
}

.admin-leave-current-modal-content::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    pointer-events: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    z-index: 1;
}

.admin-leave-current-modal-header {
    padding: 20px 24px 18px;
    background: linear-gradient(
        180deg,
        rgba(43, 45, 49, 0.98) 0%,
        rgba(43, 45, 49, 0.94) 50%,
        rgba(43, 45, 49, 0.9) 100%
    );
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.admin-leave-current-modal-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-leave-current-modal-icon {
    font-size: 1.5rem;
    line-height: 1;
    opacity: 0.9;
}

.admin-leave-current-modal-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    line-height: 1.3;
}

.admin-leave-current-modal-refresh-btn {
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.admin-leave-current-modal-close {
    width: 36px;
    height: 36px;
    font-size: 1.75rem;
    border-radius: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.admin-leave-current-modal-close:hover {
    background: rgba(237, 66, 69, 0.15);
    color: #ED4245;
    transform: scale(1.05);
}

.admin-leave-current-modal-body {
    padding: 20px 24px 24px;
    position: relative;
    z-index: 1;
    background: linear-gradient(
        180deg,
        rgba(30, 31, 34, 0.5) 0%,
        rgba(30, 31, 34, 0.6) 100%
    );
}

.admin-leave-current-modal-message {
    margin-bottom: 12px;
}

#admin-leave-current-modal .admin-leave-current-modal-list {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
    display: grid;
    gap: 10px;
}

#admin-leave-current-modal .admin-leave-current-modal-list .admin-user-row {
    background: rgba(43, 45, 49, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 14px 16px;
    border-bottom: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#admin-leave-current-modal .admin-leave-current-modal-list .admin-user-row::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #eab308 0%, #ca8a04 100%);
    border-radius: 12px 0 0 12px;
}

#admin-leave-current-modal .admin-leave-current-modal-list .admin-user-row:hover {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#admin-leave-current-modal .admin-leave-current-modal-list .admin-user-name {
    font-weight: 700;
    letter-spacing: -0.01em;
}

#admin-leave-current-modal .admin-leave-current-modal-list .admin-user-meta {
    font-size: 0.84rem;
    margin-top: 2px;
}

#admin-leave-current-modal .admin-leave-current-modal-list .admin-user-actions .btn {
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 8px;
}

.modal-content form {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: visible;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* Reward Management overlays — structured premium layout */
.reward-overlay-premium {
    background:
        radial-gradient(1200px 500px at 50% -10%, rgba(88, 101, 242, 0.18), transparent 65%),
        rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.reward-overlay-content {
    width: 94%;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: var(--shadow-strong), 0 0 0 1px rgba(255, 255, 255, 0.04);
    /* Allow vertical scrolling on tall content (e.g. prize-type editor with the
       letter-template section visible). Inherits max-height from .modal-content
       so the dialog itself is the single scroll container; horizontal overflow is
       still clipped to preserve the 16px rounded corners. */
    overflow-x: hidden;
    overflow-y: auto;
}

.reward-grant-content {
    max-width: 760px;
}

.reward-types-content {
    max-width: 900px;
}

.reward-overlay-body {
    padding: 20px 22px 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.reward-overlay-form {
    padding: 0 !important;
}

.reward-overlay-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.reward-grid-full {
    grid-column: 1 / -1;
}

.reward-overlay-section {
    margin-bottom: 12px;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.01));
}

.reward-overlay-section-flat {
    margin-bottom: 0;
}

.reward-overlay-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.reward-overlay-section-title {
    margin: 0 0 10px 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.reward-expiry-presets {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin-top: 8px;
}

.reward-expiry-preset-btn {
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
}

.reward-expiry-preset-btn:hover {
    background: rgba(255, 255, 255, 0.09);
}

.reward-overlay-actions {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.reward-template-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

#lead-prize-types-list .profile-card {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    transition: border-color 0.2s ease, background 0.2s ease;
}

#lead-prize-types-list .profile-card:hover {
    border-color: rgba(88, 101, 242, 0.35);
    background: rgba(88, 101, 242, 0.08);
}

/* Rewards list cards (paramedic + leadership) */
.reward-list-card {
    margin-bottom: 12px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)),
        rgba(30, 31, 34, 0.5);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
}

.reward-list-card-claimable {
    border-color: rgba(87, 242, 135, 0.28);
}

.reward-list-card-lead {
    border-color: rgba(88, 101, 242, 0.26);
}

.reward-list-card-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.reward-list-title-wrap {
    min-width: 260px;
    flex: 1;
}

.reward-list-title {
    font-weight: 700;
    font-size: 1.02rem;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.reward-list-meta-row {
    margin-top: 5px;
}

.reward-list-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.reward-list-letter-details {
    margin-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 10px;
}

.reward-list-letter-details summary {
    cursor: pointer;
    color: var(--text-primary);
    font-weight: 600;
}

.reward-letter-preview {
    margin-top: 8px;
    line-height: 1.55;
}

/* Compact reward cards (used in list views) */
.reward-list-card-compact {
    padding: 12px 14px;
    margin-bottom: 8px;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
}

.reward-list-card-compact .reward-list-card-head {
    gap: 10px;
    align-items: center;
}

.reward-list-card-compact .reward-list-title-wrap {
    min-width: 0;
}

.reward-list-card-compact .reward-list-title {
    font-size: 0.98rem;
    line-height: 1.25;
}

.reward-list-card-compact .reward-list-meta-row {
    margin-top: 2px;
    font-size: 0.82rem;
}

.reward-list-card-compact .reward-list-actions {
    flex-shrink: 0;
    gap: 6px;
}

.reward-list-card-compact .reward-list-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Collapsible "Previous / used" section card */
.reward-section-collapse {
    padding: 0;
    overflow: hidden;
}

.reward-section-collapse > .reward-section-collapse-summary {
    list-style: none;
    cursor: pointer;
    padding: 18px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    user-select: none;
    font-weight: 700;
    font-size: 1.02rem;
    color: var(--text-primary);
    transition: background 0.15s ease;
}

.reward-section-collapse > .reward-section-collapse-summary::-webkit-details-marker {
    display: none;
}

.reward-section-collapse > .reward-section-collapse-summary::before {
    content: '▸';
    display: inline-block;
    margin-right: 8px;
    transition: transform 0.18s ease;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.reward-section-collapse[open] > .reward-section-collapse-summary::before {
    transform: rotate(90deg);
}

.reward-section-collapse > .reward-section-collapse-summary:hover {
    background: rgba(255, 255, 255, 0.03);
}

.reward-section-collapse-title {
    flex: 1;
}

.reward-section-collapse-meta {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.85rem;
    white-space: nowrap;
}

.reward-section-collapse-list {
    padding: 0 22px 18px;
}

.reward-section-collapse-list .reward-list-card-compact:last-child {
    margin-bottom: 0;
}

/* Grouped sub-section (used in leadership rewards split) */
.reward-list-subsection {
    margin-top: 4px;
}

.reward-list-subsection + .reward-list-subsection {
    margin-top: 14px;
}

.reward-list-subsection.reward-list-subsection-pending {
    border: 1px solid rgba(250, 204, 21, 0.45);
    background: rgba(250, 204, 21, 0.06);
    border-radius: 12px;
    padding: 12px 14px 4px;
    margin-bottom: 14px;
}

.reward-list-subsection.reward-list-subsection-pending .reward-list-subsection-title {
    color: #facc15;
}

.reward-target-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
    min-height: 28px;
}

.reward-target-chips:empty {
    display: none;
}

.reward-target-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px 4px 10px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.35);
    color: var(--text-primary);
    font-size: 0.85rem;
    line-height: 1.2;
    max-width: 100%;
}

.reward-target-chip-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 240px;
}

.reward-target-chip-remove {
    appearance: none;
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0 2px;
    border-radius: 50%;
    opacity: 0.75;
}

.reward-target-chip-remove:hover,
.reward-target-chip-remove:focus {
    opacity: 1;
    background: rgba(255, 255, 255, 0.08);
}

.reward-list-subsection-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.reward-list-subsection-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.reward-list-subsection-meta {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.reward-list-subsection.reward-list-subsection-collapse {
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
}

.reward-list-subsection.reward-list-subsection-collapse > summary {
    list-style: none;
    cursor: pointer;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    user-select: none;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0;
}

.reward-list-subsection.reward-list-subsection-collapse > summary::-webkit-details-marker {
    display: none;
}

.reward-list-subsection.reward-list-subsection-collapse > summary::before {
    content: '▸';
    margin-right: 6px;
    transition: transform 0.18s ease;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.reward-list-subsection.reward-list-subsection-collapse[open] > summary::before {
    transform: rotate(90deg);
}

.reward-list-subsection-collapse > .reward-list-subsection-body {
    padding: 4px 14px 14px;
}

/* Page-turner pagination controls */
.reward-list-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.reward-pagination-prev,
.reward-pagination-next {
    padding: 6px 12px;
    font-size: 0.88rem;
    min-width: 70px;
}

.reward-pagination-prev:disabled,
.reward-pagination-next:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.reward-pagination-numbers {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.reward-pagination-num {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    min-width: 34px;
    height: 32px;
    padding: 0 8px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.reward-pagination-num:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.22);
}

.reward-pagination-num.is-active {
    background: var(--primary-color, #5865f2);
    border-color: var(--primary-color, #5865f2);
    color: #fff;
    cursor: default;
}

.reward-pagination-num.is-active:hover {
    background: var(--primary-color, #5865f2);
}

.reward-pagination-ellipsis {
    color: var(--text-secondary);
    padding: 0 4px;
    user-select: none;
}

.reward-pagination-info {
    flex-basis: 100%;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-top: 2px;
}

@media (max-width: 640px) {
    .reward-list-pagination {
        gap: 6px;
    }
    .reward-pagination-prev,
    .reward-pagination-next {
        padding: 6px 10px;
        min-width: 64px;
        font-size: 0.82rem;
    }
    .reward-pagination-num {
        min-width: 30px;
        height: 30px;
        font-size: 0.82rem;
    }
}

/* Reward details modal */
.reward-details-content {
    width: min(680px, 96vw);
    max-width: 680px;
}

.reward-details-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.reward-details-summary {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 6px 14px;
    align-items: baseline;
}

.reward-details-summary dt {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.reward-details-summary dd {
    margin: 0;
    color: var(--text-primary);
    font-size: 0.92rem;
    word-break: break-word;
}

.reward-details-letter {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 12px;
    line-height: 1.55;
    color: var(--text-primary);
    max-height: 44vh;
    overflow: auto;
}

.reward-details-letter strong.label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.88rem;
    margin-bottom: 6px;
    font-weight: 600;
}

@media (max-width: 900px) {
    .reward-overlay-grid {
        grid-template-columns: 1fr;
    }

    .reward-list-title-wrap {
        min-width: 0;
    }

    .reward-template-actions {
        justify-content: stretch;
    }

    .reward-template-actions .btn {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .reward-list-actions {
        width: 100%;
    }

    .reward-list-actions .btn {
        width: 100%;
    }

    .reward-overlay-body {
        padding: 16px;
        gap: 10px;
    }

    .reward-expiry-presets {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .reward-overlay-actions {
        flex-direction: column-reverse;
    }

    .reward-overlay-actions .btn {
        width: 100%;
    }
}

/* Settings modal - Premium sidebar layout */
.settings-modal-content {
    max-width: 900px;
    width: 90vw;
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
}
.settings-modal-content .modal-actions {
    padding: 20px 24px;
    border-top: 1px solid var(--border);
    margin-top: auto;
    flex-shrink: 0;
}
.settings-modal-layout {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
.settings-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: var(--bg-dark);
    border-right: 1px solid var(--border);
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}
.settings-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    position: relative;
    border-left: 3px solid transparent;
    width: 100%;
    font-family: inherit;
}
.settings-nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.settings-nav-item.active {
    background: rgba(88, 101, 242, 0.1);
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 600;
}
html[data-theme="light"] .settings-nav-item.active {
    background: rgba(213, 43, 30, 0.08);
    color: var(--primary);
    border-left-color: var(--primary);
}
.settings-nav-icon {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}
.settings-nav-label {
    flex: 1;
}
.settings-mobile-back {
    display: none;
}
.settings-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px;
    min-width: 0;
}
.settings-tab-content {
    display: none;
    animation: fadeIn 0.2s ease-out;
}
.settings-tab-content.active {
    display: block;
}
.settings-tab-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}
.settings-tab-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin: 0 0 28px 0;
    line-height: 1.5;
}
.settings-grid {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.settings-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.settings-row:last-child {
    border-bottom: none;
}
.settings-label {
    min-width: 160px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
}
.settings-select {
    min-width: 200px;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-dark);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.2s;
}
.settings-select:hover {
    border-color: var(--primary);
}
.settings-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.15);
}
html[data-theme="light"] .settings-select:focus {
    box-shadow: 0 0 0 3px rgba(213, 43, 30, 0.15);
}
.settings-sound-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.settings-sound-row .settings-select {
    min-width: 140px;
}
.settings-sessions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.settings-session-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 14px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
}
.settings-session-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.settings-session-device {
    font-weight: 600;
    color: var(--text-primary);
}
.settings-session-current {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    margin-left: 8px;
}
.settings-session-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.settings-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
}
.settings-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Light mode: Settings sidebar */
html[data-theme="light"] .settings-sidebar {
    background: var(--bg-dark);
    border-right-color: var(--border);
}
html[data-theme="light"] .settings-nav-item.active {
    background: rgba(213, 43, 30, 0.08);
    color: var(--primary);
}
html[data-theme="light"] .settings-row {
    border-bottom-color: rgba(0, 39, 118, 0.08);
}

/* Theme & font size (data attributes on html) */
/* Light mode: Ambulance Victoria brand — Primary Red #D52B1E, Primary Blue #002776 */
html[data-theme="light"] {
    --primary: #D52B1E;
    --primary-dark: #b3241a;
    --bg-dark: #f5f6f8;
    --bg-card: #ffffff;
    --bg-hover: #e8eaef;
    --text-primary: #002776;
    --text-secondary: #3d4a6c;
    --border: #a8b2c4;
    /* Card and panel backgrounds (used by duty stats, modals, sidebars, etc.) */
    --card-bg: linear-gradient(180deg, #ffffff 0%, rgba(255, 255, 255, 0.98) 100%);
    --card-bg-2: linear-gradient(180deg, #f5f6f8 0%, #e8eaef 100%);
    --card-border: rgba(0, 39, 118, 0.12);
    --card-highlight: rgba(0, 39, 118, 0.04);
    /* Shadows */
    --shadow: rgba(0, 39, 118, 0.12);
    --shadow-soft: 0 10px 28px rgba(0, 39, 118, 0.08);
    --shadow-strong: 0 18px 48px rgba(0, 39, 118, 0.12);
    --ring: rgba(213, 43, 30, 0.25);
    --surface: #f5f6f8;
    --text-muted: #5a6789;
    --accent-training: #15803d;
    --accent-fto: #D52B1E;
    --accent-ems: #166534;
}
html[data-theme="light"] body::before {
    opacity: 0.04;
}

/* Light mode: any text that is light grey / light tint in dark mode → dark grey (readable on light bg) */
html[data-theme="light"] #dashboard-student-training-card .stat-content h3,
html[data-theme="light"] #dashboard-student-training-card .stat-label,
html[data-theme="light"] #dashboard-student-training-card .stat-value,
html[data-theme="light"] #dashboard-fto-panel .fto-stat-label,
html[data-theme="light"] #dashboard-fto-panel .fto-stat-value,
html[data-theme="light"] #dashboard-fto-panel .fto-stat-meta,
html[data-theme="light"] .fto-activity-metric-k,
html[data-theme="light"] .fto-activity-metric-v,
html[data-theme="light"] .fto-activity-metric-s,
html[data-theme="light"] .student-training-kicker,
html[data-theme="light"] .student-training-sub,
html[data-theme="light"] .student-training-percent,
html[data-theme="light"] .student-training-feedback-title,
html[data-theme="light"] .student-training-feedback-note,
html[data-theme="light"] .student-training-feedback-meta,
html[data-theme="light"] .training-note-badge-student {
    color: var(--text-secondary);
}
html[data-theme="light"] .fto-activity-metric-v {
    color: var(--text-primary);
}

/* FTO / training: light mode keeps neutral card chrome + accent stripe */
html[data-theme="light"] #dashboard-fto-panel {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-left: 3px solid var(--accent-fto);
    box-shadow: var(--shadow-soft);
}
html[data-theme="light"] #dashboard-fto-panel::before {
    box-shadow: inset 0 1px 0 var(--card-highlight);
}
html[data-theme="light"] #dashboard-fto-panel .fto-stat {
    background: var(--bg-dark);
    border: 1px solid var(--card-border);
    box-shadow: inset 0 1px 0 var(--card-highlight);
}
html[data-theme="light"] #dashboard-fto-panel .student-training-panel-head {
    background: transparent;
    border-bottom-color: var(--card-border);
}
html[data-theme="light"] #dashboard-fto-panel .student-training-panel-body {
    background: transparent;
}
html[data-theme="light"] #dashboard-fto-panel .student-training-icon {
    background: rgba(213, 43, 30, 0.12);
    border-color: rgba(213, 43, 30, 0.3);
}

html[data-theme="light"] #dashboard-student-training-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-left: 3px solid var(--accent-training);
    box-shadow: var(--shadow-soft);
}
html[data-theme="light"] #dashboard-student-training-card:hover {
    border-color: rgba(213, 43, 30, 0.35);
    border-left-color: var(--accent-training);
    box-shadow: var(--shadow-soft);
}
html[data-theme="light"] #dashboard-student-training-panel {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-left: 3px solid var(--accent-training);
    box-shadow: var(--shadow-soft);
}
html[data-theme="light"] #dashboard-student-training-panel::before {
    box-shadow: inset 0 1px 0 var(--card-highlight);
}
html[data-theme="light"] #dashboard-student-training-panel .student-training-panel-head {
    background: transparent;
    border-bottom-color: var(--card-border);
}
html[data-theme="light"] #dashboard-student-training-panel .student-training-icon {
    background: rgba(21, 128, 61, 0.1);
    border-color: rgba(21, 128, 61, 0.28);
}
html[data-theme="light"] #dashboard-student-training-panel .student-training-fto-label {
    color: var(--text-secondary);
}
html[data-theme="light"] #dashboard-student-training-panel .student-training-fto-meta {
    color: var(--text-primary);
}
html[data-theme="light"] #dashboard-student-training-panel .student-training-fto-row {
    background: var(--bg-dark);
    border-color: var(--card-border);
}

/* Elements with hardcoded dark colors */
html[data-theme="light"] .duty-stat-card {
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.08);
}
html[data-theme="light"] .unit-member-row {
    background: rgba(0, 0, 0, 0.04);
}
html[data-theme="light"] .unit-member-cert-chip {
    background: rgba(88, 101, 242, 0.12);
    border-color: rgba(88, 101, 242, 0.28);
    color: var(--primary-dark);
}
html[data-theme="light"] .unit-member-cert-chip--more {
    background: rgba(0, 39, 118, 0.08);
    border-color: rgba(0, 39, 118, 0.2);
    color: var(--text-primary);
}
html[data-theme="light"] .on-duty-item,
html[data-theme="light"] .on-duty-unit {
    background: var(--bg-dark);
    border-color: var(--border);
    box-shadow: inset 0 1px 0 rgba(41, 37, 36, 0.04), 0 4px 18px rgba(41, 37, 36, 0.08);
}
html[data-theme="light"] .on-duty-item:hover,
html[data-theme="light"] .on-duty-unit:hover {
    background: linear-gradient(180deg, #ffffff 0%, #f7f8fb 100%);
    border-color: rgba(88, 101, 242, 0.38);
    box-shadow: 0 8px 26px rgba(41, 37, 36, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
html[data-theme="light"] .on-duty-unit--mine {
    border-color: rgba(88, 101, 242, 0.5);
    box-shadow: var(--shadow-soft), 0 0 0 1px rgba(88, 101, 242, 0.18);
}
html[data-theme="light"] .on-duty-unit--mine .on-duty-unit-summary {
    background: rgba(88, 101, 242, 0.06);
}
html[data-theme="light"] .on-duty-unit-summary:hover {
    background: rgba(0, 0, 0, 0.03);
}
html[data-theme="light"] .on-duty-you-pill {
    color: var(--primary-dark) !important;
}
html[data-theme="light"] .on-duty-unit-meta-chip {
    background: rgba(0, 0, 0, 0.04);
    border-color: var(--border);
    color: var(--text-secondary);
}
html[data-theme="light"] .on-duty-filter-chip.is-active {
    background: rgba(88, 101, 242, 0.12);
}
html[data-theme="light"] .on-duty-event-bundle {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(41, 37, 36, 0.14);
}
html[data-theme="light"] .on-duty-section-label,
html[data-theme="light"] .on-duty-event-bundle-senior {
    border-bottom-color: rgba(41, 37, 36, 0.12);
}
html[data-theme="light"] .on-duty-unit-callsign {
    text-shadow: none;
}
/* Login keeps logo-style background (black + blue-green glow + texture) in all themes */
html[data-theme="light"] .login-page {
    background: #000;
}
/* Inactive filter buttons (All / Standard / Final / Test) */
html[data-theme="light"] .filter-btn {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.12);
    color: var(--text-secondary);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
html[data-theme="light"] .filter-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    color: var(--text-primary);
}
/* Modal header (Settings and others) */
html[data-theme="light"] .modal-header {
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.98) 0%, rgba(248, 249, 250, 0.95) 70%, rgba(242, 243, 245, 0.92) 100%);
    border-bottom: 1px solid var(--border);
}
html[data-theme="light"] .feedback-modal-header {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 249, 250, 0.95) 50%, rgba(242, 243, 245, 0.92) 100%);
    border-bottom: 1px solid var(--border);
}
html[data-theme="light"] .generic-modal-header-premium {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 249, 250, 0.95) 50%, rgba(242, 243, 245, 0.92) 100%);
    border-bottom: 1px solid var(--border);
}

/* Notification bell: light theme tweaks */
html[data-theme="light"] .nav-notifications-btn:hover,
html[data-theme="light"] .nav-notifications-btn[aria-expanded="true"] {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
}
html[data-theme="light"] .nav-notifications-item {
    background: rgba(255, 255, 255, 0.72);
    border-color: rgba(0, 0, 0, 0.08);
}
html[data-theme="light"] .nav-notifications-item:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.12);
}
html[data-theme="light"] .nav-notifications-dropdown-header {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 249, 250, 0.95) 100%);
    border-bottom-color: var(--border);
}
html[data-theme="light"] .profile-message {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(0, 0, 0, 0.08);
}

/* Help (?) and maintenance (!) circle buttons: visible border in light mode */
html[data-theme="light"] .section-help-btn,
html[data-theme="light"] .easter-egg-btn {
    border-color: var(--border);
    background: rgba(0, 39, 118, 0.04);
    color: var(--text-secondary);
}
html[data-theme="light"] .section-help-btn:hover,
html[data-theme="light"] .easter-egg-btn:hover {
    border-color: var(--primary);
    background: rgba(213, 43, 30, 0.06);
    color: var(--primary);
}

/* Admin Leave Current Modal — light theme */
html[data-theme="light"] .admin-leave-current-modal-content {
    border-color: var(--border);
    box-shadow: var(--shadow-strong), 0 0 0 1px rgba(0, 0, 0, 0.04);
}
html[data-theme="light"] .admin-leave-current-modal-content::before {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
html[data-theme="light"] .admin-leave-current-modal-header {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 249, 250, 0.95) 50%, rgba(242, 243, 245, 0.92) 100%);
    border-bottom-color: var(--border);
}
html[data-theme="light"] .admin-leave-current-modal-title {
    color: var(--text-primary);
}
html[data-theme="light"] .admin-leave-current-modal-body {
    background: linear-gradient(180deg, rgba(248, 249, 250, 0.6) 0%, rgba(242, 243, 245, 0.8) 100%);
}
html[data-theme="light"] #admin-leave-current-modal .admin-leave-current-modal-list .admin-user-row {
    background: var(--bg-dark) !important;
    border-color: var(--border) !important;
    box-shadow: inset 0 1px 0 rgba(0, 39, 118, 0.04) !important;
}
html[data-theme="light"] #admin-leave-current-modal .admin-leave-current-modal-list .admin-user-row:hover {
    border-color: rgba(0, 39, 118, 0.2);
    box-shadow: 0 4px 12px rgba(0, 39, 118, 0.08);
}
html[data-theme="light"] #admin-leave-current-modal .admin-leave-current-modal-list .admin-user-meta {
    color: var(--text-secondary);
}

/* Ambulance Victoria red accent overrides (replace hardcoded purple in light mode) */
html[data-theme="light"] .btn-primary:hover {
    box-shadow: 0 4px 12px rgba(213, 43, 30, 0.35);
}
html[data-theme="light"] .filter-btn.active {
    background: linear-gradient(180deg, #D52B1E, #b3241a);
    border-color: rgba(213, 43, 30, 0.75);
    color: white;
    box-shadow: 0 10px 24px rgba(213, 43, 30, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
html[data-theme="light"] .admin-tools-nav-item.active {
    background: rgba(213, 43, 30, 0.12);
    border-color: rgba(213, 43, 30, 0.3);
    color: var(--text-primary);
}
html[data-theme="light"] .duty-stat-card:hover {
    border-color: rgba(213, 43, 30, 0.4);
}

/* Light mode: user/roster rows, inbox cards, list items */
html[data-theme="light"] .user-mgmt-row,
html[data-theme="light"] .user-mgmt-card::before,
html[data-theme="light"] .admin-user-row,
html[data-theme="light"] #eoi-review-modal .admin-user-row,
html[data-theme="light"] .eoi-premium-row,
html[data-theme="light"] .fto-activity-row,
html[data-theme="light"] .two-up-logs-row,
html[data-theme="light"] .fto-payment-row,
html[data-theme="light"] .prank-log-row {
    background: var(--bg-dark) !important;
    border-color: var(--border) !important;
    box-shadow: inset 0 1px 0 rgba(0, 39, 118, 0.04) !important;
}
html[data-theme="light"] .user-mgmt-search {
    background: var(--bg-dark) !important;
    border-color: var(--border) !important;
}
/* Master User Management: search bar and header */
html[data-theme="light"] #admin-section-user-management .search-input {
    background: var(--bg-dark) !important;
    border-color: var(--border) !important;
    color: var(--text-primary);
}
html[data-theme="light"] #admin-section-user-management .search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--ring);
}
html[data-theme="light"] #admin-section-user-management .command-tools-header {
    background: var(--bg-dark) !important;
    border-color: var(--border) !important;
}
/* 2-up log cards */
html[data-theme="light"] .two-up-log-card,
html[data-theme="light"] .two-up-summary-card {
    background: var(--bg-dark) !important;
    border-color: var(--border) !important;
    box-shadow: var(--shadow-soft);
}
html[data-theme="light"] .two-up-summary-card::before {
    box-shadow: inset 0 1px 0 rgba(0, 39, 118, 0.06);
}
html[data-theme="light"] .two-up-log-meta,
html[data-theme="light"] .two-up-log-edit {
    border-color: var(--border) !important;
}
/* FTO activity cards */
html[data-theme="light"] .fto-activity-card {
    background: var(--bg-dark) !important;
    border-color: var(--border) !important;
    box-shadow: var(--shadow-soft);
}
html[data-theme="light"] .fto-activity-card::before {
    box-shadow: inset 0 1px 0 rgba(0, 39, 118, 0.06);
}
html[data-theme="light"] .fto-activity-metric {
    background: rgba(0, 39, 118, 0.06) !important;
    border-color: var(--border) !important;
}
/* EOI and Feedback inbox backgrounds */
html[data-theme="light"] .eoi-premium-section {
    background: var(--bg-dark) !important;
    border-color: var(--border) !important;
    box-shadow: none;
}
html[data-theme="light"] .eoi-premium-card,
html[data-theme="light"] .eoi-premium-card::before {
    background: var(--bg-card) !important;
    border-color: var(--border) !important;
    box-shadow: none;
}
html[data-theme="light"] .eoi-premium-card::before {
    box-shadow: inset 0 1px 0 rgba(0, 39, 118, 0.06);
}
html[data-theme="light"] .feedback-content-card {
    background: var(--bg-dark) !important;
    border-color: var(--border) !important;
}
html[data-theme="light"] .feedback-content-card::before {
    box-shadow: inset 0 1px 0 rgba(0, 39, 118, 0.06);
}
html[data-theme="light"] .eoi-premium-section-head,
html[data-theme="light"] .fto-activity-metrics {
    background: rgba(0, 39, 118, 0.06) !important;
    border-color: var(--border) !important;
}

/* Light mode: collapse panels (Checklist header + body) */
html[data-theme="light"] .collapse-panel {
    box-shadow: 0 10px 26px rgba(0, 39, 118, 0.08);
}
html[data-theme="light"] .collapse-panel-body {
    border-top-color: var(--border) !important;
}
html[data-theme="light"] .collapse-summary {
    background: linear-gradient(180deg, rgba(0, 39, 118, 0.04) 0%, rgba(0, 39, 118, 0.02) 100%);
}
html[data-theme="light"] .collapse-summary:hover {
    background: linear-gradient(180deg, rgba(213, 43, 30, 0.08) 0%, rgba(0, 39, 118, 0.02) 100%);
}

/* Light mode: training checklist (FTO checklist with toggles) */
html[data-theme="light"] .training-group {
    background: rgba(0, 39, 118, 0.06) !important;
    border-color: var(--border) !important;
}
html[data-theme="light"] .training-group-header {
    background: rgba(0, 39, 118, 0.08) !important;
    border-bottom-color: var(--border) !important;
}
html[data-theme="light"] .training-checklist-body {
    background: transparent;
}

/* Light mode: feedback detail cards, checkboxes, inputs */
html[data-theme="light"] .feedback-detail-card {
    background: var(--bg-dark) !important;
    border-color: var(--border) !important;
}
html[data-theme="light"] .feedback-checkbox-label {
    background: var(--bg-dark) !important;
    border-color: var(--border) !important;
}
html[data-theme="light"] .feedback-checkbox-label:hover {
    background: var(--bg-hover) !important;
    border-color: var(--border) !important;
}
html[data-theme="light"] .feedback-checkbox-custom {
    background: var(--bg-hover) !important;
}
html[data-theme="light"] .feedback-textarea,
html[data-theme="light"] .feedback-input {
    background: var(--bg-dark) !important;
    border-color: var(--border) !important;
}
html[data-theme="light"] .feedback-textarea:focus,
html[data-theme="light"] .feedback-input:focus {
    background: var(--bg-card) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(213, 43, 30, 0.15) !important;
}
html[data-theme="light"] .feedback-rating-slider-wrap {
    background: var(--bg-dark) !important;
    border-color: var(--border) !important;
}
html[data-theme="light"] .feedback-rating-slider-wrap:focus-within {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(213, 43, 30, 0.15) !important;
}
html[data-theme="light"] .feedback-rating-slider-value:not(.empty) {
    color: var(--primary);
}
html[data-theme="light"] .feedback-rating-slider {
    background: linear-gradient(
        to right,
        rgba(213, 43, 30, 0.5) 0%,
        rgba(213, 43, 30, 0.5) calc((var(--rating-value) - 1) * 11.11%),
        rgba(0, 0, 0, 0.1) calc((var(--rating-value) - 1) * 11.11%),
        rgba(0, 0, 0, 0.1) 100%
    );
}
html[data-theme="light"] .feedback-rating-slider::-webkit-slider-thumb {
    background: linear-gradient(145deg, #fff 0%, #f0f0f0 100%);
    border-color: var(--primary);
}
html[data-theme="light"] .feedback-rating-slider::-moz-range-thumb {
    background: linear-gradient(145deg, #fff 0%, #f0f0f0 100%);
    border-color: var(--primary);
}
html[data-theme="light"] .feedback-ratings-chart-wrap {
    background: var(--bg-dark) !important;
    border-color: var(--border) !important;
}
html[data-theme="light"] .feedback-ratings-chart-title { color: var(--text-primary); }
html[data-theme="light"] .feedback-ratings-summary { color: var(--text-secondary); }
html[data-theme="light"] .feedback-satisfactory-wrap { border-top-color: var(--border); }
html[data-theme="light"] .feedback-satisfactory-title { color: var(--text-primary); }
html[data-theme="light"] .feedback-satisfactory-value { color: var(--primary); }
html[data-theme="light"] .feedback-satisfactory-label,
html[data-theme="light"] .feedback-satisfactory-meta { color: var(--text-secondary); }

/* Light mode: exam/training UI */
html[data-theme="light"] .exam-hero-note,
html[data-theme="light"] .exam-question-card,
html[data-theme="light"] .exam-option {
    background: var(--bg-dark) !important;
    border-color: var(--border) !important;
}
html[data-theme="light"] .exam-option:hover {
    background: var(--bg-hover) !important;
}
html[data-theme="light"] .exam-option.exam-option--correct-key {
    border-color: #16a34a !important;
    box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.25) !important;
}
html[data-theme="light"] .student-training-feedback-item {
    background: rgba(0, 39, 118, 0.06) !important;
    border-color: var(--border) !important;
}
html[data-theme="light"] .student-training-feedback-note {
    color: var(--text-primary);
}

/* Light mode: shift history item */
html[data-theme="light"] .shift-history-item {
    background: var(--bg-card) !important;
    border-color: var(--border) !important;
    box-shadow: 0 6px 16px rgba(0, 39, 118, 0.06);
}

/* Light mode: generic modal inputs and footer */
html[data-theme="light"] .generic-modal-input-premium {
    background: var(--bg-dark) !important;
    border-color: var(--border) !important;
}
html[data-theme="light"] .generic-modal-input-premium:focus {
    background: var(--bg-card) !important;
    box-shadow: 0 0 0 4px rgba(213, 43, 30, 0.15) !important;
}
html[data-theme="light"] .generic-modal-actions-premium {
    border-top-color: var(--border) !important;
    background: linear-gradient(180deg, rgba(0, 39, 118, 0.04) 0%, rgba(0, 39, 118, 0.06) 100%) !important;
}
html[data-theme="light"] .generic-modal-btn-secondary {
    background: var(--bg-hover) !important;
    border-color: var(--border) !important;
    color: var(--text-primary);
}
html[data-theme="light"] .generic-modal-btn-secondary:hover {
    background: var(--border) !important;
    border-color: var(--text-secondary) !important;
}

/* Light mode: status/cert pills – better contrast (navy/red tint) */
html[data-theme="light"] .cert-pill {
    background: rgba(0, 39, 118, 0.1) !important;
    border-color: rgba(0, 39, 118, 0.25) !important;
    color: var(--text-primary);
}
html[data-theme="light"] .cert-pill.more {
    background: rgba(0, 39, 118, 0.08) !important;
    border-color: rgba(0, 39, 118, 0.2) !important;
}
html[data-theme="light"] .status-badge.supervisor {
    background: rgba(213, 43, 30, 0.12) !important;
    border-color: rgba(213, 43, 30, 0.3) !important;
    color: var(--primary);
}
html[data-theme="light"] .status-badge.on-leave {
    color: #8b6914;
}
html[data-theme="light"] .feedback-detail-meta {
    border-bottom-color: var(--border) !important;
}

/* Light mode: biscuits (admin-pill, status badges) – readable text on light backgrounds */
html[data-theme="light"] .admin-pill:not(.admin-pill-level) {
    background: rgba(0, 39, 118, 0.08) !important;
    border-color: rgba(0, 39, 118, 0.2) !important;
    color: var(--text-primary);
}
html[data-theme="light"] .admin-pill.good {
    background: rgba(22, 101, 52, 0.14) !important;
    border-color: rgba(22, 101, 52, 0.35) !important;
    color: #166534;
}
html[data-theme="light"] .admin-pill.bad {
    background: rgba(185, 28, 28, 0.12) !important;
    border-color: rgba(185, 28, 28, 0.35) !important;
    color: #b91c1c;
}
html[data-theme="light"] .admin-pill.warn {
    background: rgba(146, 64, 14, 0.12) !important;
    border-color: rgba(146, 64, 14, 0.35) !important;
    color: #92400e;
}
html[data-theme="light"] .admin-pill-archived {
    background: #e5e7eb !important;
    border-color: #9ca3af !important;
    color: #374151;
}

/* Archived student modal: competencies table + exam results */
.roster-item-clickable {
    cursor: pointer;
}
.archived-section-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--text-primary);
}
.archived-competencies-table-wrap {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border);
}
.archived-competencies-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.archived-competencies-table th,
.archived-competencies-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.archived-competencies-table th {
    background: var(--bg-hover);
    color: var(--text-secondary);
    font-weight: 600;
}
.archived-competencies-table tbody tr:last-child td {
    border-bottom: none;
}
.archived-competencies-table tbody tr:hover {
    background: var(--bg-hover);
}
.archived-competency-label {
    font-weight: 500;
    color: var(--text-primary);
}
.archived-exams-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.archived-exam-card {
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-dark);
}
.archived-exam-card.archived-exam-passed {
    border-color: var(--secondary);
    background: rgba(87, 242, 135, 0.08);
}
.archived-exam-card.archived-exam-failed {
    border-color: var(--danger);
    background: rgba(237, 66, 69, 0.08);
}
.archived-exam-header {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.archived-exam-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.archived-exam-score {
    font-size: 0.9rem;
    color: var(--text-primary);
}
.archived-exam-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 8px;
}
.archived-exam-badge.passed {
    background: var(--secondary);
    color: #1a1a1a;
}
.archived-exam-badge.failed {
    background: var(--danger);
    color: #fff;
}

/* Master User Management: access level biscuits keep coloured bg + white text in light mode */
html[data-theme="light"] #admin-section-user-management .admin-pill-level--site-admin {
    background: var(--danger) !important;
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.25);
}
html[data-theme="light"] #admin-section-user-management .admin-pill-level--command,
html[data-theme="light"] #admin-section-user-management .admin-pill-level--leadership {
    background: var(--primary) !important;
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.25);
}
html[data-theme="light"] #admin-section-user-management .admin-pill-level--terminated {
    background: #6b7280 !important;
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.25);
}
html[data-theme="light"] #admin-section-user-management .admin-pill-level--resigned {
    background: #78716c !important;
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.25);
}

/* Light mode: card content must be dark (summary cards were blank because text inherited white) */
html[data-theme="light"] .user-mgmt-card,
html[data-theme="light"] .user-mgmt-card .user-mgmt-k,
html[data-theme="light"] .user-mgmt-card .user-mgmt-v,
html[data-theme="light"] .user-mgmt-card .user-mgmt-s,
html[data-theme="light"] .eoi-premium-card .eoi-premium-k,
html[data-theme="light"] .eoi-premium-card .eoi-premium-v,
html[data-theme="light"] .eoi-premium-card .eoi-premium-s {
    color: var(--text-primary);
}
html[data-theme="light"] .user-mgmt-card .user-mgmt-k,
html[data-theme="light"] .user-mgmt-card .user-mgmt-s,
html[data-theme="light"] .eoi-premium-card .eoi-premium-k,
html[data-theme="light"] .eoi-premium-card .eoi-premium-s {
    color: var(--text-secondary);
}
html[data-theme="light"] .user-mgmt-row .user-mgmt-name,
html[data-theme="light"] .user-mgmt-row .user-mgmt-title,
html[data-theme="light"] .user-mgmt-row .user-mgmt-meta,
html[data-theme="light"] .eoi-premium-row .eoi-premium-row-title,
html[data-theme="light"] .eoi-premium-row .eoi-premium-row-meta,
html[data-theme="light"] .feedback-content-label,
html[data-theme="light"] .feedback-content-text,
html[data-theme="light"] .feedback-meta-value {
    color: var(--text-primary);
}
html[data-theme="light"] .user-mgmt-row .user-mgmt-meta .training-chip,
html[data-theme="light"] .eoi-premium-row .eoi-premium-row-meta {
    color: var(--text-secondary);
}
html[data-theme="light"] .training-chip {
    color: var(--text-secondary);
}
html[data-theme="light"] .eoi-premium-section-title,
html[data-theme="light"] .eoi-premium-section-head,
html[data-theme="light"] .feedback-content-label {
    color: var(--text-primary);
}

/* Disciplinary log premium — light theme */
html[data-theme="light"] .disciplinary-log-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(248,250,252,0.98) 100%);
    border-color: rgba(0, 0, 0, 0.08);
}
html[data-theme="light"] .disciplinary-log-card:hover {
    border-color: rgba(0, 0, 0, 0.12);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}
html[data-theme="light"] .disciplinary-log-pill.verbal {
    color: #92400e;
    border-color: rgba(146, 64, 14, 0.35);
    background: rgba(254, 243, 199, 0.8);
}
html[data-theme="light"] .disciplinary-log-pill.written {
    color: #b45309;
    border-color: rgba(180, 83, 9, 0.35);
    background: rgba(254, 249, 195, 0.8);
}
html[data-theme="light"] .disciplinary-log-pill.misconduct {
    color: #b91c1c;
    border-color: rgba(185, 28, 28, 0.35);
    background: rgba(254, 226, 226, 0.8);
}
html[data-theme="light"] .disciplinary-log-pill.termination {
    color: #7f1d1d;
    border-color: rgba(127, 29, 29, 0.4);
    background: rgba(254, 202, 202, 0.6);
}
html[data-theme="light"] .disciplinary-log-pill.admin-leave {
    color: #854d0e;
    border-color: rgba(234, 179, 8, 0.45);
    background: rgba(254, 249, 195, 0.8);
}
html[data-theme="light"] .disciplinary-log-loading,
html[data-theme="light"] .disciplinary-log-empty {
    background: rgba(248, 250, 252, 0.98);
    border-color: rgba(0, 0, 0, 0.08);
}

html[data-theme="light"] .shift-status-badge.completed {
    background: rgba(22, 101, 52, 0.14) !important;
    border-color: #166534 !important;
    color: #166534;
}
html[data-theme="light"] .shift-status-badge.active {
    background: rgba(213, 43, 30, 0.12) !important;
    border-color: var(--primary) !important;
    color: var(--primary);
}
html[data-theme="light"] .status-badge.leadership {
    background: #fbbf24 !important;
    border: 1px solid #b45309 !important;
    color: #422006 !important;
    font-weight: 700;
}
html[data-theme="light"] .status-badge.command {
    background: #D52B1E !important;
    border: 1px solid #b3241a !important;
    color: #ffffff !important;
    font-weight: 700;
}
html[data-theme="light"] .status-badge.active {
    background: rgba(22, 101, 52, 0.2) !important;
    color: #166534;
}
html[data-theme="light"] .status-badge.on-leave {
    background: rgba(251, 191, 36, 0.25) !important;
    color: #78350f;
}
html[data-theme="light"] .hour-pill-green {
    background: rgba(22, 101, 52, 0.12) !important;
    border-color: #166534 !important;
    color: #166534;
}
html[data-theme="light"] .hour-pill-yellow {
    background: rgba(146, 64, 14, 0.12) !important;
    border-color: #92400e !important;
    color: #92400e;
}
html[data-theme="light"] .hour-pill-blue {
    background: rgba(0, 39, 118, 0.12) !important;
    border-color: var(--text-primary) !important;
    color: var(--text-primary);
}
html[data-theme="light"] .training-note-badge-student {
    background: rgba(22, 101, 52, 0.14) !important;
    border-color: rgba(22, 101, 52, 0.35) !important;
    color: #166534;
}
html[data-theme="light"] .two-up-pager .admin-pill {
    background: rgba(0, 39, 118, 0.1) !important;
    border-color: rgba(0, 39, 118, 0.25) !important;
    color: var(--text-primary);
}

html[data-font-size="small"] {
    font-size: 14px;
}
html[data-font-size="medium"] {
    font-size: 16px;
}
html[data-font-size="large"] {
    font-size: 18px;
}

/* Reports Page */
.reports-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.search-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    position: sticky;
    top: 80px;
    z-index: 10;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: padding 0.2s ease, gap 0.2s ease, border-radius 0.2s ease;
}

/* Leadership Roster: ~1/4 height when scrolled — single line, no horizontal scroll (fits container) */
#lead-section-roster .search-section.roster-search-slim {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px 10px;
    padding: 4px 10px 6px;
    border-radius: 8px;
    top: 56px;
    min-width: 0;
}
#lead-section-roster .search-section.roster-search-slim .roster-search-label {
    margin: 0;
    font-size: 0.75rem;
    flex-shrink: 0;
}
#lead-section-roster .search-section.roster-search-slim .roster-search-input,
#lead-section-roster .search-section.roster-search-slim .search-input {
    padding: 4px 8px;
    font-size: 0.85rem;
    width: 100%;
    min-width: 0;
    max-width: 140px;
    height: 28px;
    min-height: 28px;
    flex: 1 1 80px;
}
#lead-section-roster .search-section.roster-search-slim .roster-filters-wrap {
    margin-top: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px 8px;
    flex-wrap: nowrap;
    min-width: 0;
    flex: 1 1 auto;
}
#lead-section-roster .search-section.roster-search-slim .roster-filters-label {
    margin: 0;
    font-size: 0.75rem;
    flex-shrink: 0;
}
#lead-section-roster .search-section.roster-search-slim .roster-filters {
    gap: 4px 6px;
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    min-width: 0;
    flex: 1 1 auto;
}
#lead-section-roster .search-section.roster-search-slim .roster-filter-chip {
    padding: 2px 5px;
    font-size: 0.72rem;
    white-space: nowrap;
    flex-shrink: 0;
}
#lead-section-roster .search-section.roster-search-slim .roster-filter-select {
    min-width: 0;
    width: 90px;
    max-width: 110px;
    height: 26px;
    font-size: 0.78rem;
    padding: 0 4px;
    flex: 0 1 auto;
}
#lead-section-roster .search-section.roster-search-slim .roster-clear-filters {
    font-size: 0.72rem;
    padding: 2px 6px;
    height: 26px;
    flex-shrink: 0;
    white-space: nowrap;
}

.search-input {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-dark);
    border: 2px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(88, 101, 242, 0.1);
    transform: translateY(-2px);
}

.users-list {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
}

.user-card {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.user-card:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.user-card h3 {
    font-size: 1rem;
    margin-bottom: 4px;
}

.user-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.user-report {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
}

.user-report h2 {
    margin-bottom: 20px;
}

.report-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.report-stat {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.report-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.report-value {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

@keyframes mas-spin {
    to { transform: rotate(360deg); }
}

.mas-loading,
.mas-loading-inline,
.mas-app-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.mas-loading::before,
.mas-loading-inline::before,
.mas-app-loading::before,
.mas-modal-busy::before {
    content: '';
    display: block;
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.12);
    border-top-color: var(--primary, #5865F2);
    border-radius: 50%;
    animation: mas-spin 0.75s linear infinite;
    flex-shrink: 0;
}

.mas-loading.mas-loading-compact,
.mas-modal-busy {
    padding: 20px;
    gap: 10px;
}

.mas-loading.mas-loading-compact::before,
.mas-modal-busy::before {
    width: 24px;
    height: 24px;
    border-width: 2px;
}

.mas-loading-inline {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 0;
    text-align: left;
    font-size: 0.92rem;
}

.mas-loading-inline::before {
    width: 18px;
    height: 18px;
    border-width: 2px;
}

td.mas-loading,
th.mas-loading {
    padding: 24px 16px;
}

.mas-app-loading {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(17, 18, 20, 0.72);
    backdrop-filter: blur(4px);
}

.mas-modal-body-relative {
    position: relative;
}

.mas-modal-busy {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(17, 18, 20, 0.55);
    backdrop-filter: blur(2px);
}

.mas-refreshing {
    position: relative;
    opacity: 0.72;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.mas-refreshing::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-top-color: var(--primary, #5865F2);
    border-radius: 50%;
    animation: mas-spin 0.75s linear infinite;
    z-index: 2;
}

.mas-load-error {
    padding: 16px;
    text-align: center;
    color: var(--text-secondary, #a0a0a0);
}

.mas-load-error-msg {
    margin: 0;
}

.mas-stat-busy {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.mas-stat-busy::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 18px;
    height: 18px;
    margin-top: -9px;
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-top-color: var(--primary, #5865F2);
    border-radius: 50%;
    animation: mas-spin 0.75s linear infinite;
}

.mas-chart-busy {
    position: relative;
    min-height: 120px;
}

.mas-chart-busy::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 28px;
    height: 28px;
    margin: -14px 0 0 -14px;
    border: 3px solid rgba(255, 255, 255, 0.12);
    border-top-color: var(--primary, #5865F2);
    border-radius: 50%;
    animation: mas-spin 0.75s linear infinite;
    z-index: 2;
}

/* Clock Section (legacy - kept for compatibility) */
.clock-section {
    margin-top: 40px;
    margin-bottom: 40px;
}

.clock-section h2 {
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.clock-controls {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 20px;
}

.btn-clock-in,
.btn-clock-out {
    min-width: 200px;
    padding: 16px 32px;
    font-size: 1.2rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-clock-in {
    background: var(--secondary);
    color: #000;
}

.btn-clock-in:hover:not(:disabled) {
    background: #4ae874;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(87, 242, 135, 0.4);
}

.btn-clock-out {
    background: var(--danger);
    color: white;
}

.btn-clock-out:hover:not(:disabled) {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(237, 66, 69, 0.4);
}

.btn-clock-in:disabled,
.btn-clock-out:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    font-size: 1.5rem;
}

.clock-message {
    text-align: center;
    padding: 12px;
    border-radius: 6px;
    margin-top: 10px;
    min-height: 20px;
}

.clock-message.success {
    background: rgba(87, 242, 135, 0.2);
    color: var(--secondary);
    border: 1px solid var(--secondary);
}

.clock-message.error {
    background: rgba(237, 66, 69, 0.2);
    color: var(--danger);
    border: 1px solid var(--danger);
}

/* Quota Bar */
.quota-bar-container {
    width: 100%;
    height: 8px;
    background: var(--bg-dark);
    border-radius: 4px;
    margin-top: 12px;
    overflow: hidden;
}

.quota-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary) 0%, var(--primary) 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: row;
        height: 60px;
        padding: 0 20px;
        flex-wrap: nowrap;
    }

    .nav-hamburger {
        display: flex;
        order: -1;
        margin-right: 4px;
    }

    .nav-brand {
        flex: 1;
        min-width: 0;
    }

    .nav-logo {
        height: 36px;
    }

    .nav-menu .nav-links {
        display: none;
    }

    .nav-menu {
        flex-wrap: nowrap;
        margin-top: 0;
        justify-content: flex-end;
        gap: 8px;
    }

    .user-menu-text {
        max-width: 140px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .profile-field {
        flex-direction: column;
        gap: 4px;
    }

    .clock-controls {
        flex-direction: column;
    }

    .btn-clock-in,
    .btn-clock-out {
        width: 100%;
    }

    .roster-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .roster-item-action {
        width: 100%;
    }

    .officer-card-main {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .officer-card-left,
    .officer-card-right {
        width: 100%;
    }

    .officer-hours-section {
        flex-wrap: wrap;
    }

    .officer-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .comparison-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .comparison-label {
        min-width: auto;
    }

.roster-item-action .btn {
    width: 100%;
}

.roster-item-hours {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.roster-hours-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.roster-hours-value {
    color: var(--secondary);
    font-weight: 600;
}

/* Modal Tabs */
.modal-tabs {
    display: none;
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    gap: 0;
    background: var(--bg-card);
    position: sticky;
    top: 77px; /* below header (approx) */
    z-index: 2;
}

.modal-tab {
    background: transparent !important;
    border: none !important;
    border-bottom: 2px solid transparent !important;
    padding: 16px 24px;
    color: var(--text-secondary) !important;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    outline: none;
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.modal-tab:hover {
    color: var(--text-primary) !important;
    background: var(--bg-hover) !important;
}

.modal-tab.active {
    color: var(--primary) !important;
    border-bottom-color: var(--primary) !important;
    background: transparent !important;
}

.modal-tab-content {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: visible;
    min-height: 0;
}

.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
    flex: 1;
    min-height: 400px;
    padding: 20px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.chart-container canvas {
    max-height: 100%;
}

    .modal-content {
        max-width: 100%;
        margin: 10px;
    }
}

/* ============================================================
   Fake Admin Access Modal
   ============================================================ */
.fake-admin-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: var(--overlay-top-padding, 80px) 20px 20px;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.fake-admin-card {
    background: linear-gradient(180deg, rgba(30, 31, 34, 0.98) 0%, rgba(20, 21, 24, 0.98) 100%);
    border: 2px solid rgba(237, 66, 69, 0.3);
    border-radius: 16px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.fake-admin-header {
    text-align: center;
    margin-bottom: 24px;
}

.fake-admin-header h1 {
    font-size: 2rem;
    color: var(--text-primary);
    margin: 0 0 8px 0;
    font-weight: 700;
}

.fake-admin-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin: 0;
}

.fake-admin-warning {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    background: rgba(237, 66, 69, 0.1);
    border: 1px solid rgba(237, 66, 69, 0.3);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.fake-admin-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.fake-admin-warning-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.fake-admin-warning-text {
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

.fake-admin-warning-text strong {
    color: #ED4245;
}

.fake-admin-instruction {
    background: rgba(237, 66, 69, 0.15);
    border: 1px solid rgba(237, 66, 69, 0.25);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
}

.fake-admin-instruction p {
    color: var(--text-primary);
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

.fake-admin-instruction p strong {
    font-weight: 700;
}

.fake-admin-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.fake-admin-actions .btn {
    min-width: 100px;
}

.fake-admin-actions .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================================
   Fake Admin Login (prank step 1) — matches app theme
   ============================================================ */
.admin-login-modal {
    position: fixed;
    inset: 0;
    z-index: 19999;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: var(--overlay-top-padding, 80px) 20px 20px;
    pointer-events: auto;
    backdrop-filter: blur(4px);
}

.admin-login-container {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-strong);
    font-family: inherit;
    overflow: hidden;
}

.admin-login-header {
    padding: 20px 24px;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border);
}

.admin-login-title {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.admin-login-subtitle {
    margin: 4px 0 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 400;
}

.admin-login-access-section {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
}

.admin-login-access-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.admin-login-shield {
    font-size: 1.25rem;
    filter: grayscale(0.3);
    opacity: 0.9;
}

.admin-login-access-text {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.admin-login-accent {
    color: var(--danger);
    font-weight: 600;
}

.admin-login-instruction {
    padding: 14px 24px;
    background: rgba(237, 66, 69, 0.12);
    border-bottom: 1px solid rgba(237, 66, 69, 0.25);
}

.admin-login-instruction p {
    margin: 0;
    color: var(--text-primary);
    font-size: 0.88rem;
    line-height: 1.45;
}

.admin-login-actions {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
}

.admin-login-btn {
    flex: 1;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    border: 1px solid transparent;
}

.admin-login-btn-close {
    background: var(--bg-hover);
    border-color: var(--border);
    color: var(--text-primary);
}

.admin-login-btn-close:hover:not(:disabled) {
    background: var(--bg-dark);
    border-color: var(--text-secondary);
}

.admin-login-btn-primary {
    background: var(--primary);
    border-color: var(--primary-dark);
    color: #fff;
}

.admin-login-btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    border-color: var(--primary);
}

.admin-login-btn:disabled {
    opacity: 0.85;
    cursor: not-allowed;
}

.admin-login-btn-close:disabled {
    background: var(--bg-dark);
    border-color: var(--border);
    color: var(--text-secondary);
}

.admin-login-btn-primary:disabled {
    background: var(--bg-hover);
    border-color: var(--border);
    color: var(--text-secondary);
}

/* ============================================================
   Fake Secure Console (overlay panel — matches site UI)
   ============================================================ */
.console-modal {
    position: fixed;
    inset: 0;
    z-index: 20000;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: var(--overlay-top-padding, 80px) 20px 20px;
    pointer-events: auto;
    backdrop-filter: blur(4px);
}

.console-container {
    width: 90%;
    max-width: 720px;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    font-family: 'Courier New', 'Consolas', 'Monaco', monospace;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-strong);
    overflow: hidden;
}

.console-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.console-title {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.console-close {
    background: var(--bg-hover);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.2s;
}

.console-close:hover {
    background: var(--primary);
    border-color: var(--primary-dark);
    color: #fff;
}

.console-body {
    height: 320px;
    padding: 16px 20px;
    overflow-y: auto;
    background: var(--bg-dark);
    color: var(--text-primary);
    font-size: 0.85rem;
    line-height: 1.6;
    flex-shrink: 0;
}

.console-body::-webkit-scrollbar {
    width: 8px;
}

.console-body::-webkit-scrollbar-track {
    background: var(--bg-card);
}

.console-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.console-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

.console-line {
    margin-bottom: 4px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.console-prompt {
    color: var(--text-secondary);
    margin-right: 8px;
}

.console-text {
    color: var(--text-primary);
}

.console-cursor {
    color: var(--primary);
    animation: blink 1s step-end infinite;
    margin-left: 2px;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.console-progress-container {
    padding: 16px 20px;
    background: var(--bg-dark);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.console-progress-bar {
    width: 100%;
    height: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
}

.console-progress-fill {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.3s ease;
}

.console-progress-text {
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-align: center;
}

/* ============================================================
   Prank Access Logs (premium)
   ============================================================ */
.prank-logs-card {
    max-width: 640px;
}

.prank-logs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.prank-logs-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.prank-logs-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.02em;
}

.prank-logs-subtitle {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.prank-logs-wipe-btn {
    background: var(--danger);
    color: #fff;
    border: none;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    flex-shrink: 0;
}

.prank-logs-wipe-btn:hover {
    background: #c73b3e;
}

.prank-logs-wipe-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.prank-logs-message {
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.prank-logs-message.success {
    color: var(--secondary);
}

.prank-logs-summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-weight: 500;
}

.prank-logs-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.prank-logs-loading {
    text-align: center;
    padding: 32px 20px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    background: var(--bg-dark);
    border: 1px dashed var(--border);
    border-radius: 12px;
}

.prank-logs-loading::before {
    content: '';
    display: inline-block;
    width: 1em;
    height: 1em;
    margin-right: 0.5em;
    vertical-align: -0.15em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: mas-spin 0.7s linear infinite;
}

.prank-logs-empty {
    text-align: center;
    padding: 32px 20px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    background: var(--bg-dark);
    border: 1px dashed var(--border);
    border-radius: 12px;
}

.prank-logs-empty-icon {
    display: block;
    font-size: 2rem;
    margin-bottom: 10px;
    opacity: 0.6;
}

.prank-log-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 12px;
    border-left: 3px solid var(--primary);
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 1px 0 var(--card-highlight);
}

.prank-log-row:hover {
    border-left-color: var(--primary-dark);
    box-shadow: var(--shadow-soft);
}

.prank-log-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    color: var(--text-secondary);
}

.prank-log-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.prank-log-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.prank-log-phase {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 500;
    line-height: 1.3;
}

.prank-log-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.prank-log-ago {
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.85;
}

/* ============================================================
   Rick Roll Animation
   ============================================================ */
.rickroll-container {
    position: fixed;
    inset: 0;
    z-index: 20001;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: var(--overlay-top-padding, 80px) 20px 20px;
    overflow: hidden;
}

.rickroll-content {
    position: relative;
    z-index: 2;
    text-align: center;
    pointer-events: none;
}

.rickroll-title {
    font-size: 4.5rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5), 0 0 40px rgba(255, 255, 255, 0.3);
    margin: 0 0 40px 0;
    animation: titlePulse 2s ease-in-out infinite;
    letter-spacing: 2px;
}

.rickroll-lyrics-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.rickroll-lyrics {
    font-size: 1.8rem;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    margin: 0;
    font-weight: 600;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.rickroll-lyrics.active {
    opacity: 1;
    transform: translateY(0);
    animation: lyricPulse 1.5s ease-in-out infinite;
}

#rickroll-waveform {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 150px;
    z-index: 1;
    pointer-events: none;
}

.rickroll-close {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #fff;
    color: #fff;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.2s;
}

.rickroll-close:hover {
    background: #fff;
    color: #000;
}

@keyframes titlePulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.9; }
}

@keyframes lyricPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.nav-rickroll-btn {
    transition: opacity 0.2s;
    font-weight: 300;
    vertical-align: middle;
}

/* ============================================================
   Premium Generic Modal (Alert/Confirm/Prompt)
   ============================================================ */
.generic-modal-premium {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: rgba(0, 0, 0, 0.65);
}

.generic-modal-content-premium {
    max-width: 500px;
    width: 90%;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-strong), 0 0 0 1px rgba(255, 255, 255, 0.05);
    overflow: hidden;
    opacity: 0;
    transform: scale(0.92) translateY(-24px);
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.generic-modal-premium-active .generic-modal-content-premium {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.generic-modal-premium:not(.generic-modal-premium-active) .generic-modal-content-premium {
    opacity: 0;
    transform: scale(0.95) translateY(-12px);
}

@keyframes genericModalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(-24px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.generic-modal-content-premium::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    pointer-events: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    z-index: 1;
}

.generic-modal-header-premium {
    padding: 24px 28px 20px;
    background: linear-gradient(
        180deg,
        rgba(43, 45, 49, 0.98) 0%,
        rgba(43, 45, 49, 0.95) 50%,
        rgba(43, 45, 49, 0.92) 100%
    );
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 2;
}

.generic-modal-title-premium {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
}

.generic-modal-close-premium {
    width: 36px;
    height: 36px;
    font-size: 1.8rem;
    border-radius: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.generic-modal-close-premium:hover {
    background: rgba(237, 66, 69, 0.15);
    color: #ED4245;
    transform: scale(1.05);
}

.generic-modal-body-premium {
    padding: 24px 28px;
    position: relative;
    z-index: 1;
}

.generic-modal-message-premium {
    margin: 0 0 24px 0;
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.generic-modal-input-container-premium {
    margin-bottom: 8px;
}

.generic-modal-input-premium {
    width: 100%;
    padding: 14px 16px;
    background: rgba(30, 31, 34, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
}

.generic-modal-input-premium:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(30, 31, 34, 0.8);
    box-shadow: 0 0 0 4px rgba(88, 101, 242, 0.15), 0 2px 8px rgba(88, 101, 242, 0.1);
    transform: translateY(-1px);
}

.generic-modal-input-premium::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.generic-modal-actions-premium {
    padding: 20px 28px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(
        180deg,
        rgba(30, 31, 34, 0.4) 0%,
        rgba(30, 31, 34, 0.5) 100%
    );
    position: relative;
    z-index: 1;
}

.generic-modal-btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 24px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.generic-modal-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.generic-modal-btn-secondary:active {
    transform: translateY(0);
}

.generic-modal-btn-primary {
    padding: 12px 28px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(88, 101, 242, 0.25);
}

.generic-modal-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(88, 101, 242, 0.4);
}

.generic-modal-btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(88, 101, 242, 0.3);
}

@media (max-width: 600px) {
    /* Settings (preferences) modal: full viewport on mobile, content below header */
    #settings-modal.modal {
        padding: var(--overlay-top-padding, 80px) 0 0 0;
        align-items: stretch;
        justify-content: stretch;
    }

    .generic-modal-content-premium {
        width: 95%;
        max-width: none;
    }
    
    .generic-modal-header-premium,
    .generic-modal-body-premium,
    .generic-modal-actions-premium {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .generic-modal-actions-premium {
        flex-direction: column-reverse;
    }
    
    .generic-modal-btn-secondary,
    .generic-modal-btn-primary {
        width: 100%;
    }
    
    /* Settings modal responsive (preferences – mobile friendly) */
    .settings-modal-content {
        width: 100%;
        max-width: 100%;
        min-height: 100dvh;
        min-height: 100vh;
        max-height: 100dvh;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
        padding-bottom: env(safe-area-inset-bottom, 0);
    }
    .settings-modal-content .modal-header {
        padding: 14px 16px;
        flex-shrink: 0;
    }
    .settings-modal-content .modal-header h2 {
        font-size: 1.25rem;
    }
    .settings-modal-content .modal-close {
        min-width: 44px;
        min-height: 44px;
        width: 44px;
        height: 44px;
        margin: -8px -8px -8px 0;
    }
    /* Mobile: back button (shown only when viewing a tab) */
    .settings-mobile-back {
        display: none;
        align-items: center;
        gap: 8px;
        width: 100%;
        padding: 12px 16px;
        margin: 0;
        border: none;
        border-bottom: 1px solid var(--border);
        background: var(--bg-dark);
        color: var(--primary);
        font-size: 1rem;
        font-weight: 500;
        cursor: pointer;
        flex-shrink: 0;
        min-height: 48px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        font-family: inherit;
    }
    .settings-mobile-back:hover {
        background: var(--bg-hover);
    }
    .settings-modal-content.settings-mobile-in-content .settings-mobile-back {
        display: flex;
    }
    .settings-modal-layout {
        flex-direction: column;
        flex: 1;
        min-height: 0;
    }
    /* Mobile: menu list view (default) – vertical list of options */
    .settings-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: none;
        padding: 12px 0;
        overflow-x: visible;
        overflow-y: auto;
        flex-direction: column;
        gap: 0;
        flex: 1;
        min-height: 0;
        -webkit-overflow-scrolling: touch;
    }
    .settings-modal-content.settings-mobile-in-content .settings-sidebar {
        display: none;
    }
    .settings-nav-item {
        width: 100%;
        padding: 16px 20px;
        min-height: 52px;
        border-left: none;
        border-bottom: 1px solid var(--border);
        border-radius: 0;
        white-space: normal;
        flex-shrink: 0;
        font-size: 1rem;
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(88, 101, 242, 0.2);
        user-select: none;
        justify-content: flex-start;
    }
    .settings-nav-item:last-child {
        border-bottom: none;
    }
    .settings-nav-item.active {
        border-left: none;
        border-bottom: 1px solid var(--border);
        border-bottom-color: var(--primary);
        background: rgba(88, 101, 242, 0.08);
    }
    html[data-theme="light"] .settings-nav-item.active {
        background: rgba(213, 43, 30, 0.06);
    }
    .settings-nav-icon {
        display: inline-block;
        font-size: 1.25rem;
    }
    /* Mobile: content hidden until a menu item is selected */
    .settings-content {
        display: none;
        padding: 16px;
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .settings-modal-content.settings-mobile-in-content .settings-content {
        display: flex;
        flex-direction: column;
    }
    .settings-tab-title {
        font-size: 1.25rem;
        margin-bottom: 4px;
    }
    .settings-tab-desc {
        font-size: 0.9rem;
        margin-bottom: 20px;
    }
    .settings-label {
        min-width: 100%;
        margin-bottom: 4px;
    }
    .settings-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 14px 0;
    }
    .settings-select {
        width: 100%;
        min-width: auto;
        max-width: 100%;
        box-sizing: border-box;
    }
    .settings-sound-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .settings-sound-row .settings-select {
        width: 100%;
        min-width: auto;
    }
    #settings-play-sound-btn {
        width: 100%;
    }
    .settings-modal-content .modal-actions {
        flex-direction: column-reverse;
        gap: 10px;
        padding: 16px;
        flex-shrink: 0;
    }
    .settings-modal-content .modal-actions .btn {
        width: 100%;
        min-height: 44px;
        justify-content: center;
    }
    .settings-profile-form .form-group {
        margin-bottom: 14px;
    }
    .settings-profile-form .form-input {
        width: 100%;
        box-sizing: border-box;
    }
    .settings-profile-form .btn-primary {
        width: 100%;
        min-height: 44px;
    }
    .settings-session-item {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 14px;
    }
    .settings-session-info {
        order: 1;
    }
    .settings-session-item .btn {
        order: 2;
        width: 100%;
        min-height: 44px;
    }
    .settings-checkbox-label {
        min-height: 44px;
        align-items: center;
        padding: 4px 0;
    }
}

.nav-rickroll-btn:hover {
    opacity: 0.4 !important;
}

/* ============================================================
   Leaderboards (Paramedic Tools)
   ============================================================ */

.leaderboard-category-buttons {
    flex-wrap: wrap;
    max-width: 100%;
}

.param-leaderboard-wrap {
    width: 100%;
    overflow-x: auto;
}

.param-leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.param-leaderboard-table th,
.param-leaderboard-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
}

.param-leaderboard-table thead th {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.param-leaderboard-table tbody tr:not(.leaderboard-podium-1):not(.leaderboard-podium-2):not(.leaderboard-podium-3):hover {
    background: var(--bg-hover, rgba(255, 255, 255, 0.04));
}

.param-leaderboard-table .param-lb-col-rank {
    width: 3rem;
    white-space: nowrap;
    vertical-align: middle;
}

.param-leaderboard-table .param-lb-medal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.75rem;
    min-height: 2.75rem;
    padding: 4px;
    border-radius: 12px;
    font-size: 1.85rem;
    line-height: 1;
    box-shadow:
        0 4px 14px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.param-leaderboard-table tbody tr:hover .param-lb-medal {
    transform: scale(1.06);
}

.param-leaderboard-table .param-lb-medal--1 {
    background: linear-gradient(145deg, #fff9e6 0%, #f0c14d 35%, #c98900 100%);
    box-shadow:
        0 0 0 1px rgba(255, 220, 120, 0.5),
        0 6px 22px rgba(212, 160, 18, 0.45),
        inset 0 2px 0 rgba(255, 255, 255, 0.35);
    filter: drop-shadow(0 2px 8px rgba(212, 160, 18, 0.4));
}

.param-leaderboard-table .param-lb-medal--2 {
    background: linear-gradient(145deg, #ffffff 0%, #d8dce8 40%, #9aa3b8 100%);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.35),
        0 6px 22px rgba(140, 150, 175, 0.4),
        inset 0 2px 0 rgba(255, 255, 255, 0.45);
    filter: drop-shadow(0 2px 8px rgba(120, 130, 155, 0.35));
}

.param-leaderboard-table .param-lb-medal--3 {
    background: linear-gradient(145deg, #f0c8a0 0%, #cd7f32 45%, #8b4a1a 100%);
    box-shadow:
        0 0 0 1px rgba(255, 200, 140, 0.35),
        0 6px 22px rgba(160, 90, 40, 0.45),
        inset 0 2px 0 rgba(255, 220, 180, 0.25);
    filter: drop-shadow(0 2px 8px rgba(140, 75, 30, 0.4));
}

.param-leaderboard-table tr.leaderboard-podium-1 td {
    padding-top: 14px;
    padding-bottom: 14px;
    border-bottom-color: rgba(212, 160, 18, 0.35);
}

.param-leaderboard-table tr.leaderboard-podium-1 {
    background: linear-gradient(
        90deg,
        rgba(212, 160, 18, 0.22) 0%,
        rgba(212, 160, 18, 0.06) 45%,
        rgba(20, 22, 28, 0.2) 100%
    );
    box-shadow: inset 4px 0 0 #e8b923;
}

.param-leaderboard-table tr.leaderboard-podium-1 .param-lb-col-name {
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
    text-shadow: 0 1px 12px rgba(212, 160, 18, 0.25);
}

.param-leaderboard-table tr.leaderboard-podium-1 .param-lb-col-time {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #fcd34d;
}

.param-leaderboard-table tr.leaderboard-podium-1:hover {
    background: linear-gradient(
        90deg,
        rgba(212, 160, 18, 0.3) 0%,
        rgba(212, 160, 18, 0.1) 50%,
        rgba(20, 22, 28, 0.25) 100%
    );
}

.param-leaderboard-table tr.leaderboard-podium-2 td {
    padding-top: 13px;
    padding-bottom: 13px;
    border-bottom-color: rgba(160, 170, 190, 0.3);
}

.param-leaderboard-table tr.leaderboard-podium-2 {
    background: linear-gradient(
        90deg,
        rgba(170, 180, 200, 0.18) 0%,
        rgba(170, 180, 200, 0.05) 45%,
        rgba(20, 22, 28, 0.15) 100%
    );
    box-shadow: inset 4px 0 0 #b8c0d4;
}

.param-leaderboard-table tr.leaderboard-podium-2 .param-lb-col-name {
    font-weight: 600;
    font-size: 1.02rem;
}

.param-leaderboard-table tr.leaderboard-podium-2 .param-lb-col-time {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #e2e8f0;
}

.param-leaderboard-table tr.leaderboard-podium-2:hover {
    background: linear-gradient(
        90deg,
        rgba(170, 180, 200, 0.26) 0%,
        rgba(170, 180, 200, 0.09) 50%,
        rgba(20, 22, 28, 0.2) 100%
    );
}

.param-leaderboard-table tr.leaderboard-podium-3 td {
    padding-top: 12px;
    padding-bottom: 12px;
    border-bottom-color: rgba(180, 120, 70, 0.35);
}

.param-leaderboard-table tr.leaderboard-podium-3 {
    background: linear-gradient(
        90deg,
        rgba(180, 110, 55, 0.2) 0%,
        rgba(180, 110, 55, 0.06) 45%,
        rgba(20, 22, 28, 0.15) 100%
    );
    box-shadow: inset 4px 0 0 #c17a3a;
}

.param-leaderboard-table tr.leaderboard-podium-3 .param-lb-col-name {
    font-weight: 600;
    font-size: 1rem;
}

.param-leaderboard-table tr.leaderboard-podium-3 .param-lb-col-time {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #fdba74;
}

.param-leaderboard-table tr.leaderboard-podium-3:hover {
    background: linear-gradient(
        90deg,
        rgba(180, 110, 55, 0.28) 0%,
        rgba(180, 110, 55, 0.1) 50%,
        rgba(20, 22, 28, 0.2) 100%
    );
}

.param-leaderboard-table tr.leaderboard-row-you:not(.leaderboard-podium-1):not(.leaderboard-podium-2):not(.leaderboard-podium-3) {
    background: rgba(88, 101, 242, 0.12);
}

.param-leaderboard-table tr.leaderboard-row-you:not(.leaderboard-podium-1):not(.leaderboard-podium-2):not(.leaderboard-podium-3):hover {
    background: rgba(88, 101, 242, 0.18);
}

.param-leaderboard-table tr.leaderboard-podium-1.leaderboard-row-you,
.param-leaderboard-table tr.leaderboard-podium-2.leaderboard-row-you,
.param-leaderboard-table tr.leaderboard-podium-3.leaderboard-row-you {
    box-shadow:
        inset 4px 0 0 #e8b923,
        0 0 0 1px rgba(88, 101, 242, 0.45),
        0 0 20px rgba(88, 101, 242, 0.15);
}

.param-leaderboard-table tr.leaderboard-podium-2.leaderboard-row-you {
    box-shadow:
        inset 4px 0 0 #b8c0d4,
        0 0 0 1px rgba(88, 101, 242, 0.45),
        0 0 20px rgba(88, 101, 242, 0.12);
}

.param-leaderboard-table tr.leaderboard-podium-3.leaderboard-row-you {
    box-shadow:
        inset 4px 0 0 #c17a3a,
        0 0 0 1px rgba(88, 101, 242, 0.45),
        0 0 20px rgba(88, 101, 242, 0.12);
}

.param-leaderboard-table tr.leaderboard-podium-1.leaderboard-row-you:hover,
.param-leaderboard-table tr.leaderboard-podium-2.leaderboard-row-you:hover,
.param-leaderboard-table tr.leaderboard-podium-3.leaderboard-row-you:hover {
    filter: brightness(1.03);
}

/* ============================================================
   Keybind Installer (Paramedic Tools)
   ============================================================ */

.kb-layout-tabs {
    display: flex;
    gap: 4px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.kb-layout-tab {
    padding: 10px 18px;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    font-family: inherit;
}

.kb-layout-tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.kb-layout-tab.active {
    background: var(--bg-dark);
    border-color: var(--secondary);
    border-bottom: 1.5px solid var(--bg-dark);
    color: var(--secondary);
    position: relative;
    z-index: 1;
}

.kb-tab-panels {
    border: 1.5px solid var(--border);
    border-radius: 0 8px 8px 8px;
    margin-top: -1.5px;
    padding: 24px;
    position: relative;
}

.kb-layout-tab.active ~ .kb-tab-panels,
.kb-tab-panels.kb-bordered-active {
    border-color: var(--secondary);
}

.kb-tab-panel {
    display: none;
}

.kb-tab-panel.active {
    display: block;
}

.kb-bind-group {
    display: none;
}

.kb-bind-group.active {
    display: block;
}

/* Keyboard visualisation wrapper */
.kb-wrap {
    padding: 16px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
    display: block;
    overflow: hidden;
    width: 100%;
    position: relative;
}

.kb-keyboard {
    display: inline-flex;
    flex-direction: column;
    user-select: none;
    transform-origin: top left;
}

.kb-top {
    display: flex;
    gap: 14px;
    margin-bottom: 8px;
}

.kb-body {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.kb-section {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.kb-row {
    display: flex;
    gap: 3px;
    height: 36px;
}

.kb-key {
    height: 36px;
    min-width: 36px;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #64748b;
    flex-shrink: 0;
    position: relative;
    cursor: default;
    font-family: inherit;
}

.kb-key-bound {
    background: rgba(87, 242, 135, 0.12);
    border-color: var(--secondary);
    color: var(--secondary);
    font-weight: bold;
    cursor: help;
}

.kb-key-bound:hover {
    background: rgba(87, 242, 135, 0.3);
}

.kb-key-bound:hover::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-dark);
    border: 1px solid var(--secondary);
    color: var(--secondary);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 11px;
    white-space: nowrap;
    z-index: 10;
    pointer-events: none;
    font-weight: normal;
}

.kb-numpad {
    display: grid;
    grid-template-columns: repeat(4, 36px);
    grid-auto-rows: 36px;
    gap: 3px;
}

.kb-numpad .kb-key {
    height: auto;
    min-width: unset;
}

/* Legend */
.kb-legend {
    display: flex;
    gap: 16px;
    padding: 12px 0 16px;
    font-size: 12px;
    color: var(--text-secondary);
}

.kb-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.kb-legend-swatch {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    border: 1.5px solid;
}

.kb-swatch-bound {
    background: rgba(87, 242, 135, 0.12);
    border-color: var(--secondary);
}

.kb-swatch-unbound {
    background: var(--bg-card);
    border-color: var(--border);
}

/* Bind rows */
.kb-bind-row {
    background: var(--bg-card);
    padding: 12px 14px;
    margin: 6px 0;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.15s;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    gap: 12px;
    border: 1px solid transparent;
}

.kb-bind-row:hover {
    background: var(--bg-hover);
    border-color: var(--border);
}

.kb-bind-row span {
    word-break: break-all;
    user-select: text;
}

.kb-copy-btn {
    background: var(--secondary);
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    flex-shrink: 0;
    color: #000;
    font-size: 12px;
    transition: background 0.15s;
}

.kb-copy-btn:hover {
    background: #3dd975;
}

.kb-copy-btn.kb-copied {
    background: var(--primary) !important;
    color: #fff !important;
}

/* Light theme overrides */
html[data-theme="light"] .kb-wrap {
    background: rgba(0, 0, 0, 0.04);
    border-color: var(--border);
}

html[data-theme="light"] .kb-key {
    background: var(--bg-card);
    border-color: var(--border);
    color: #94a3b8;
}

html[data-theme="light"] .kb-bind-row {
    background: var(--bg-card);
}

html[data-theme="light"] .kb-bind-row:hover {
    background: var(--bg-hover);
}

@media (max-width: 700px) {
    .kb-tab-panels {
        padding: 14px;
    }
    .kb-wrap {
        padding: 10px;
    }
    .kb-bind-row {
        font-size: 11px;
        padding: 10px;
    }
}

/* ============================================================
   Competitions UI
   ============================================================ */
.competition-active-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #57F287;
    border-radius: 50%;
    margin-left: 6px;
    vertical-align: middle;
    box-shadow: 0 0 6px #57F287;
    animation: comp-dot-pulse 1.6s ease-in-out infinite;
}
@keyframes comp-dot-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.18); opacity: 0.7; }
}
.competition-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 10px;
    background: var(--bg-card);
}
.competition-row-current {
    position: relative;
    overflow: hidden;
    gap: 14px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    background:
        radial-gradient(1200px 280px at 0% 0%, rgba(88, 101, 242, 0.16), transparent 55%),
        radial-gradient(900px 240px at 100% 0%, rgba(87, 242, 135, 0.08), transparent 50%),
        var(--card-bg, var(--bg-card));
    box-shadow: var(--shadow-soft, 0 8px 24px rgba(0, 0, 0, 0.22));
    animation: comp-current-in 420ms ease-out;
}
.competition-row-current::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
    border-radius: inherit;
}
@keyframes comp-current-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.comp-current-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: stretch;
    padding: 18px 18px 4px;
}
.comp-current-hero-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.competition-row .comp-row-eyebrow {
    font-size: 0.72rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
}
.competition-row-current .comp-row-title {
    font-weight: 850;
    font-size: 1.35rem;
    letter-spacing: -0.02em;
    line-height: 1.2;
}
.comp-current-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.4;
    max-width: 52ch;
}
.comp-current-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}
.comp-countdown-card {
    min-width: 170px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.22);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}
.comp-countdown-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
}
.competition-row-current .comp-countdown {
    font-size: 1.2rem;
    font-weight: 850;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}
.comp-panel {
    margin: 0 14px 14px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(30, 31, 34, 0.45);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.comp-panel-muted {
    background: rgba(30, 31, 34, 0.28);
}
.comp-panel-title {
    font-size: 0.78rem;
    font-weight: 750;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 10px;
}
.comp-prize-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.comp-prize-card {
    position: relative;
    padding: 12px 12px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.18);
    overflow: hidden;
}
.comp-prize-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
}
.comp-prize-place-1::before { background: #f1c40f; }
.comp-prize-place-2::before { background: #b0b6c0; }
.comp-prize-place-3::before { background: #cd7f32; }
.comp-prize-place {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.comp-prize-place-1 .comp-prize-place { color: #f1c40f; }
.comp-prize-place-2 .comp-prize-place { color: #d5d8de; }
.comp-prize-place-3 .comp-prize-place { color: #e0a46a; }
.comp-prize-list {
    margin: 0;
    padding-left: 16px;
    color: var(--text-secondary);
    font-size: 0.86rem;
    line-height: 1.4;
}
.comp-prize-list li { margin: 0 0 4px; }
.comp-prize-empty {
    list-style: none;
    margin-left: -16px;
    opacity: 0.7;
    font-style: italic;
}
.comp-ticket-card {
    margin: 0 14px 14px;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background:
        linear-gradient(135deg, rgba(88, 101, 242, 0.18), rgba(88, 101, 242, 0.04) 55%, transparent),
        rgba(30, 31, 34, 0.5);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
    animation: comp-current-in 480ms ease-out;
}
.comp-ticket-stat .comp-ticket-k {
    font-size: 0.72rem;
    font-weight: 750;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
}
.comp-ticket-stat .comp-ticket-v {
    margin-top: 4px;
    font-size: 1.55rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}
.comp-ticket-chips {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.comp-ticket-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.22);
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
}
.comp-result-block {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.comp-result-winners {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.comp-result-winner {
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.4;
}
.comp-result-receipt {
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    word-break: break-all;
}
.comp-lead-section-label {
    font-size: 0.78rem;
    font-weight: 750;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin: 4px 0 10px;
}
.comp-lead-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.competition-row-lead {
    margin-bottom: 0;
}
.competition-row-lead-scheduled {
    background:
        radial-gradient(1200px 280px at 0% 0%, rgba(241, 196, 15, 0.12), transparent 55%),
        radial-gradient(900px 240px at 100% 0%, rgba(88, 101, 242, 0.08), transparent 50%),
        var(--card-bg, var(--bg-card));
}
.competition-row-lead-history {
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(30, 31, 34, 0.4);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.competition-row-lead-history .comp-row-title {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}
.comp-meta-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.18);
    color: var(--text-secondary);
    font-size: 0.78rem;
    line-height: 1.3;
}
.comp-panel-actions {
    margin-top: 0;
}
.comp-panel-actions .comp-row-actions {
    margin: 0;
}
.comp-modal .modal-header {
    align-items: flex-start;
}
.comp-modal-subtitle {
    margin: 4px 0 0;
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.4;
}
.comp-modal-body {
    padding: 18px 20px 20px;
}
.comp-modal-section {
    margin-bottom: 14px;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(30, 31, 34, 0.45);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.comp-modal-hint {
    margin: 0 0 10px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.4;
}
.comp-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.comp-toggle-row {
    display: flex !important;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    margin: 0 0 12px;
}
.comp-toggle-row input {
    margin-top: 3px;
}
.comp-toggle-row .form-help {
    display: block;
    margin-top: 4px;
}
.comp-type-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.comp-type-option {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.16);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.comp-type-option:has(input:checked) {
    border-color: rgba(88, 101, 242, 0.55);
    background: linear-gradient(135deg, rgba(88, 101, 242, 0.18), rgba(88, 101, 242, 0.04));
}
.comp-type-option span {
    font-weight: 700;
    color: var(--text-primary);
}
.comp-type-option small {
    color: var(--text-secondary);
    font-size: 0.78rem;
}
.comp-type-option input { display: none; }
.comp-progress-options {
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.comp-progress-mode-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.comp-progress-mode-card {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.16);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.comp-progress-mode-card:has(input:checked) {
    border-color: rgba(88, 101, 242, 0.55);
    background: linear-gradient(135deg, rgba(88, 101, 242, 0.18), rgba(88, 101, 242, 0.04));
}
.comp-progress-mode-card input { display: none; }
.comp-progress-mode-title {
    font-weight: 800;
    color: var(--text-primary);
}
.comp-progress-mode-desc {
    color: var(--text-secondary);
    font-size: 0.78rem;
}
.comp-weekday-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.comp-weekday-chip {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.18);
    color: var(--text-secondary);
    border-radius: 999px;
    padding: 6px 11px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.comp-weekday-chip.is-active {
    border-color: rgba(88, 101, 242, 0.55);
    background: rgba(88, 101, 242, 0.22);
    color: var(--text-primary);
}
.comp-ranks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
}
.comp-rank-option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border-radius: 8px;
    cursor: pointer;
}
.comp-rank-option:hover {
    background: rgba(255, 255, 255, 0.04);
}
.comp-prize-edit-card {
    margin-bottom: 10px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.16);
}
.comp-prize-edit-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    gap: 8px;
}
.comp-prize-edit-head h5 {
    margin: 0;
    font-size: 0.95rem;
}
.comp-bonus-body {
    padding: 18px 20px 20px;
}
@media (max-width: 720px) {
    .comp-type-toggle,
    .comp-progress-mode-grid {
        grid-template-columns: 1fr;
    }
}
.comp-bonus-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.comp-bonus-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(110px, 0.55fr) minmax(0, 1.2fr);
    gap: 12px;
    align-items: start;
}
.comp-bonus-form-grid .form-group {
    margin: 0;
}
.comp-bonus-member-field {
    position: relative;
    z-index: 5;
}
.comp-bonus-member-field .profiles-admin-user-list {
    z-index: 40;
    max-height: min(240px, 36vh);
}
.comp-bonus-selected {
    margin-bottom: 8px;
}
.comp-bonus-selected-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(88, 101, 242, 0.35);
    background:
        linear-gradient(135deg, rgba(88, 101, 242, 0.18), rgba(88, 101, 242, 0.04)),
        rgba(0, 0, 0, 0.2);
}
.comp-bonus-selected-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.comp-bonus-selected-clear {
    appearance: none;
    border: none;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    width: 28px;
    height: 28px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
}
.comp-bonus-selected-clear:hover {
    background: rgba(237, 66, 69, 0.2);
    color: #ED4245;
}
.comp-bonus-form-actions {
    display: flex;
    justify-content: flex-end;
}
.comp-bonus-existing {
    margin-top: 16px;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(30, 31, 34, 0.45);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.comp-bonus-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: min(320px, 40vh);
    overflow-y: auto;
}
.comp-bonus-row {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.16);
}
.comp-bonus-amount {
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    font-size: 1.05rem;
    text-align: center;
}
.comp-bonus-amount.is-plus { color: #57F287; }
.comp-bonus-amount.is-minus { color: #ED4245; }
.comp-bonus-row-name {
    font-weight: 700;
    color: var(--text-primary);
}
.comp-bonus-row-meta {
    color: var(--text-secondary);
    font-size: 0.78rem;
    text-align: right;
    line-height: 1.35;
    white-space: nowrap;
}
.comp-bonus-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
}
@media (max-width: 720px) {
    .comp-bonus-form-grid {
        grid-template-columns: 1fr;
    }
    .comp-bonus-row {
        grid-template-columns: 48px minmax(0, 1fr);
    }
    .comp-bonus-row-meta {
        grid-column: 2;
        text-align: left;
        white-space: normal;
    }
}
.comp-history-details {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 12px 14px;
    background: rgba(30, 31, 34, 0.35);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.comp-history-details > summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--text-secondary);
    list-style: none;
}
.comp-history-details > summary::-webkit-details-marker { display: none; }
.comp-history-details[open] > summary {
    margin-bottom: 2px;
    color: var(--text-primary);
}
.competition-row .comp-row-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.competition-row .comp-row-title {
    font-weight: 700;
    font-size: 1rem;
}
.competition-row .comp-row-meta {
    color: var(--text-secondary);
    font-size: 0.85rem;
}
.competition-row .comp-row-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.comp-status-badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 750;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.comp-status-SCHEDULED { background: rgba(241, 196, 15, 0.15); color: #f1c40f; }
.comp-status-ACTIVE { background: rgba(87, 242, 135, 0.15); color: #57F287; }
.comp-status-ENDED { background: rgba(108, 117, 125, 0.2); color: var(--text-secondary); }
.comp-status-CANCELLED { background: rgba(237, 66, 69, 0.15); color: #ED4245; }
.comp-leaderboard {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.comp-leaderboard-row {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: rgba(0, 0, 0, 0.12);
}
.comp-leaderboard-row.is-me {
    border-color: rgba(88, 101, 242, 0.35);
    background: rgba(88, 101, 242, 0.12);
}
.comp-leaderboard-place {
    font-weight: 850;
    font-size: 0.95rem;
    color: var(--text-secondary);
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.comp-leaderboard-name { font-weight: 650; }
.comp-leaderboard-rank {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.82rem;
}
.comp-leaderboard-tickets {
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    color: var(--text-primary);
}
.comp-leaderboard-tickets-label {
    margin-left: 4px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.78rem;
}
.comp-countdown {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: var(--primary);
}
@media (max-width: 720px) {
    .comp-current-hero {
        grid-template-columns: 1fr;
        padding: 16px 14px 2px;
    }
    .comp-countdown-card { min-width: 0; }
    .comp-prize-grid { grid-template-columns: 1fr; }
    .competition-row-current .comp-row-title { font-size: 1.2rem; }
    .comp-panel,
    .comp-ticket-card { margin-left: 12px; margin-right: 12px; }
}
.comp-prize-row {
    display: grid;
    grid-template-columns: 1.5fr 1fr auto;
    gap: 8px;
    margin-bottom: 6px;
    align-items: end;
}
@media (max-width: 600px) {
    .comp-prize-row { grid-template-columns: 1fr; }
    .comp-leaderboard-row { grid-template-columns: 28px 1fr auto; }
}

/* UI preferences: compact mode */
html[data-compact="true"] .stat-card,
html[data-compact="true"] .admin-dashboard-card,
html[data-compact="true"] .profile-card,
html[data-compact="true"] .roster-item,
html[data-compact="true"] .eoi-premium-row {
    padding: 10px 12px;
}
html[data-compact="true"] .admin-tools-nav-item {
    padding-top: 8px;
    padding-bottom: 8px;
}

/* UI preferences: animations */
html[data-animations="none"] *,
html[data-animations="none"] *::before,
html[data-animations="none"] *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
}
html[data-animations="reduced"] .modal,
html[data-animations="reduced"] .nav-drawer-panel,
html[data-animations="reduced"] .login-card {
    transition-duration: 0.12s !important;
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

.on-duty-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}
.on-duty-updated {
    font-size: 0.8rem;
    margin-left: auto;
}
.btn-sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.82rem;
}
.section-copy-link-btn {
    margin-left: 8px;
    font-size: 0.82rem;
    padding: 0.3rem 0.55rem;
}
.sensitive-access-notice {
    margin-top: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
}
.form-field-error {
    border-color: var(--danger, #ed4245) !important;
}
.form-inline-error {
    color: var(--danger, #ed4245);
    font-size: 0.82rem;
    margin-top: 4px;
}

/* Release announcement banner + overlay */
.release-announcement-banner {
    background: linear-gradient(90deg, rgba(88, 101, 242, 0.22) 0%, rgba(0, 200, 160, 0.14) 100%);
    border-bottom: 1px solid rgba(88, 101, 242, 0.35);
}
.release-announcement-banner-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.release-announcement-banner-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}
.release-announcement-banner-text {
    flex: 1 1 220px;
    min-width: 0;
    text-align: left;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 4px 0;
    font: inherit;
}
.release-announcement-banner-text strong {
    display: block;
    font-size: 0.95rem;
}
.release-announcement-banner-sub {
    display: block;
    margin-top: 2px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.4;
}
.release-announcement-banner-btn {
    flex-shrink: 0;
}
.release-announcement-banner-dismiss {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
}
.release-announcement-banner-dismiss:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}
.release-announcement-overlay-content {
    max-width: 680px;
}
.release-announcement-overlay-actions {
    padding: 0 24px 20px;
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid var(--border);
    margin-top: 0;
    padding-top: 16px;
}
#release-announcement-overlay-inner h3 {
    font-size: 1.05rem;
    color: var(--text-primary);
    margin: 1.15em 0 0.4em;
}
#release-announcement-overlay-inner h3:first-child { margin-top: 0; }
#release-announcement-overlay-inner p { margin: 0 0 0.75em; color: var(--text-secondary); line-height: 1.55; }
#release-announcement-overlay-inner ul {
    margin: 0.35em 0 0.85em;
    padding-left: 1.25em;
    color: var(--text-secondary);
    line-height: 1.5;
}
#release-announcement-overlay-inner li { margin-bottom: 0.3em; }
#release-announcement-overlay-inner strong { color: var(--text-primary); }
.release-announcement-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(88, 101, 242, 0.2);
    color: var(--primary);
    margin-right: 6px;
    vertical-align: middle;
}
@media (max-width: 600px) {
    .release-announcement-banner-inner {
        padding: 10px 12px;
    }
    .release-announcement-banner-btn {
        width: 100%;
    }
}

/* ============================================================
   UI polish layer — spacing, motion, surfaces, light theme
   ============================================================ */

/* Subtle page entrance — opacity only (transform breaks position:fixed modals inside .page) */
.page.active {
    animation: page-fade-in 0.28s var(--ease-out) both;
}
@keyframes page-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Global thin scrollbars */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
}
*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
*::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.22);
    background-clip: padding-box;
}

.main-content {
    padding: 32px 24px 48px;
}

.dashboard-city-time-wrap {
    padding: 8px 14px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--card-border);
    box-shadow: inset 0 1px 0 var(--card-highlight);
}

.dashboard-city-time-label {
    letter-spacing: 0.08em;
    font-weight: 600;
}

.dashboard-city-time-value {
    font-size: 1.2rem;
    letter-spacing: -0.02em;
}

.admin-tools-sidebar {
    background: var(--card-bg-2);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 12px;
    box-shadow: var(--shadow-soft);
}

@media (min-width: 769px) {
    .admin-tools-sidebar {
        position: sticky;
        top: calc(var(--navbar-height) + 16px);
        height: fit-content;
    }
}

.admin-tools-nav-item.active {
    background: rgba(88, 101, 242, 0.16);
    border-color: rgba(88, 101, 242, 0.32);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    font-weight: 600;
}

.admin-dashboard-card {
    border-radius: var(--radius-lg);
    transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}
.admin-dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
}

.roster-item {
    background: var(--card-bg-2);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    box-shadow: inset 0 1px 0 var(--card-highlight);
}
.roster-item:hover {
    box-shadow: var(--shadow-soft), inset 0 1px 0 var(--card-highlight);
}

.user-menu-dropdown {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: nav-notif-drop-in 0.2s var(--ease-out);
}
.user-menu-dropdown::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    box-shadow: inset 0 1px 0 var(--card-highlight);
}
.user-menu-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.user-menu-item:last-child {
    border-bottom: none;
}

.section-help-btn,
.easter-egg-btn {
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.section-help-btn:hover,
.easter-egg-btn:hover {
    background: rgba(88, 101, 242, 0.12);
    border-color: rgba(88, 101, 242, 0.35);
    box-shadow: 0 0 0 3px var(--ring);
}

.release-announcement-banner {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.modal-content {
    border-radius: var(--radius-lg);
    border-color: var(--card-border);
}

.nav-drawer-panel {
    background: var(--card-bg);
    border-right-color: var(--card-border);
    box-shadow: 8px 0 40px rgba(0, 0, 0, 0.35);
}

.settings-nav-item.active {
    font-weight: 600;
}

/* Respect reduced motion / animation prefs */
html[data-animations="none"] .page.active,
html[data-animations="reduced"] .page.active {
    animation: none;
}
@media (prefers-reduced-motion: reduce) {
    .page.active {
        animation: none;
    }
}

/* Light theme polish overrides */
html[data-theme="light"] body {
    background-image:
        radial-gradient(ellipse 120% 70% at 50% -15%, rgba(213, 43, 30, 0.06) 0%, transparent 52%),
        radial-gradient(ellipse 70% 45% at 100% 100%, rgba(0, 39, 118, 0.04) 0%, transparent 48%);
}
html[data-theme="light"] .navbar {
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 1px 0 rgba(0, 39, 118, 0.06), 0 8px 28px rgba(0, 39, 118, 0.08);
}
html[data-theme="light"] .nav-link:hover {
    background: rgba(0, 39, 118, 0.06);
}
html[data-theme="light"] .nav-link.active {
    background: rgba(213, 43, 30, 0.1);
    box-shadow: inset 0 0 0 1px rgba(213, 43, 30, 0.2);
}
html[data-theme="light"] .nav-menu .nav-link.active::after {
    background: var(--primary);
}
html[data-theme="light"] .stat-card {
    box-shadow: var(--shadow-soft);
}
html[data-theme="light"] .stat-icon {
    background: rgba(0, 39, 118, 0.05);
    border-color: rgba(0, 39, 118, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
html[data-theme="light"] .dashboard-city-time-wrap {
    background: rgba(0, 39, 118, 0.04);
}
html[data-theme="light"] * {
    scrollbar-color: rgba(0, 39, 118, 0.2) transparent;
}
html[data-theme="light"] *::-webkit-scrollbar-thumb {
    background: rgba(0, 39, 118, 0.2);
    background-clip: padding-box;
}
html[data-theme="light"] .user-menu-button:hover {
    background: rgba(0, 39, 118, 0.06);
    border-color: rgba(0, 39, 118, 0.1);
}
html[data-theme="light"] .section-help-btn,
html[data-theme="light"] .easter-egg-btn {
    background: rgba(0, 39, 118, 0.04);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
html[data-theme="light"] .section-help-btn:hover,
html[data-theme="light"] .easter-egg-btn:hover {
    background: rgba(213, 43, 30, 0.08);
    border-color: rgba(213, 43, 30, 0.25);
}

/* ============================================================
   Mobile polish — Phase 1 (max-width: 768px / 480px)
   ============================================================ */

.mas-responsive-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.mas-responsive-grid-bonus {
    display: grid;
    grid-template-columns: 2fr 1fr 3fr auto;
    gap: 8px;
    align-items: end;
}

/* Legacy bonus grid kept for any residual markup; primary layout is .comp-bonus-form-grid */

@media (max-width: 768px) {
    .main-content {
        padding: 20px 16px calc(24px + env(safe-area-inset-bottom, 0px));
        padding-left: max(16px, env(safe-area-inset-left, 0px));
        padding-right: max(16px, env(safe-area-inset-right, 0px));
    }

    .release-announcement-banner {
        padding-left: env(safe-area-inset-left, 0px);
        padding-right: env(safe-area-inset-right, 0px);
    }

    .release-announcement-banner-inner {
        padding: 8px 12px;
        gap: 8px;
    }

    .release-announcement-banner-text strong {
        font-size: 0.9rem;
    }

    .release-announcement-banner-sub {
        font-size: 0.78rem;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .release-announcement-banner-btn {
        width: auto;
        flex-shrink: 0;
        min-height: 44px;
        padding: 0 14px;
    }

    .release-announcement-banner-dismiss {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Modals — less dead space above dialog */
    .modal {
        padding: max(12px, env(safe-area-inset-top, 0px)) 12px max(16px, env(safe-area-inset-bottom, 0px));
        align-items: flex-start;
    }

    .modal-content {
        max-height: calc(100dvh - max(12px, env(safe-area-inset-top, 0px)) - max(16px, env(safe-area-inset-bottom, 0px)) - 24px);
        margin: 0;
    }

    /* Section headers + action rows */
    .command-tools-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .command-tools-header-actions {
        flex-wrap: wrap;
        width: 100%;
        gap: 8px;
    }

    .command-tools-header-actions .btn,
    .command-tools-header-actions .section-help-btn,
    .command-tools-header-actions .easter-egg-btn {
        min-height: 44px;
    }

    .command-tools-header-actions .btn {
        flex: 1 1 calc(50% - 4px);
    }

    /* Touch-friendly icon buttons */
    .section-help-btn,
    .easter-egg-btn {
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }

    /* Site Admin tab pills — horizontal scroll */
    .site-admin-submenu {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 8px;
        padding-bottom: 10px;
        margin-bottom: 14px;
        mask-image: linear-gradient(to right, transparent, #000 8px, #000 calc(100% - 8px), transparent);
    }

    .site-admin-submenu::-webkit-scrollbar {
        display: none;
    }

    .site-admin-submenu-item {
        flex-shrink: 0;
        min-height: 44px;
        padding: 10px 16px;
        white-space: nowrap;
    }

    .site-admin-submenu-inner .site-admin-submenu-item {
        min-height: 40px;
        padding: 8px 14px;
    }

    /* User menu — bottom sheet (portal is on body, outside navbar) */
    .user-menu-caret {
        display: none;
    }

    .user-menu-text {
        max-width: 110px;
    }

    .user-menu-rank {
        display: none;
    }

    .user-menu-portal-backdrop {
        display: block;
    }

    .user-menu-dropdown {
        left: 0;
        right: 0;
        bottom: 0;
        top: auto !important;
        width: 100%;
        max-width: none;
        min-width: 0;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        border: 1px solid var(--card-border);
        border-bottom: none;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        animation: user-menu-sheet-in 0.22s var(--ease-out);
    }

    @keyframes user-menu-sheet-in {
        from { opacity: 0; transform: translateY(100%); }
        to { opacity: 1; transform: translateY(0); }
    }

    .user-menu-item {
        min-height: 52px;
        padding: 14px 20px;
        font-size: 1rem;
    }

    /* Leaderboard period chips */
    .leaderboard-category-buttons {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 8px;
        padding-bottom: 4px;
    }

    .leaderboard-category-buttons::-webkit-scrollbar {
        display: none;
    }

    .leaderboard-category-buttons .btn,
    .leaderboard-category-buttons button {
        flex-shrink: 0;
        white-space: nowrap;
        min-height: 44px;
    }

    /* Charts */
    .chart-container {
        min-height: 220px;
        height: 220px;
        padding: 12px;
    }

  .site-admin-usage-graph {
        grid-template-columns: 1fr;
    }

    /* Responsive inline-style grids */
    .mas-responsive-grid-2,
    .mas-responsive-grid-bonus,
    .command-tools-form[style*="grid-template-columns"],
    .comp-bonus-form-grid {
        grid-template-columns: 1fr !important;
    }

    .comp-bonus-form-actions .btn,
    .comp-bonus-footer .btn {
        width: 100%;
    }

    /* Copy-friendly messages on mobile */
    .profile-message,
    .audit-log-row,
    .param-leaderboard-table td,
    .shift-history-item {
        -webkit-user-select: text;
        user-select: text;
    }

    .duty-stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .user-menu-text {
        display: none;
    }

    .user-menu-button {
        padding: 6px;
        min-width: 44px;
        min-height: 44px;
        justify-content: center;
    }

    .nav-container {
        padding: 0 12px;
    }

    .officer-stats-grid {
        grid-template-columns: 1fr;
    }
}

html[data-theme="light"] {
    --theme-color-meta: #ffffff;
}

@media (max-width: 768px) {
    html[data-theme="light"] .user-menu-dropdown {
        box-shadow: 0 -8px 40px rgba(0, 39, 118, 0.15);
    }
}
