/* =
   NREZERVACIJE – STYLESHEET
   Svetla/temna tema prek CSS spremenljivk (:root / .light-mode).
   = */

/* ---------- Theme variables ---------- */
:root {
    --pico-overlay-color: transparent;
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-button: #222;
    --bg-hover: #2a2a2a;
    --bg-today: #102a43;
    --bg-today-slot: #0f1b2a;

    --text-primary: #ddd;
    --text-secondary: #bbb;
    --text-muted: #aaa;
    --text-heading: #DBEAFE;

    --border-color: #2a2a2a;
    --shadow: rgba(0, 0, 0, .35);

    --school-blue: #1558C5;
    --school-blue-dark: #0A2F8F;
    --school-blue-light: #EAF2FF;
    --nurnit-blue: #1558C5;
    --nurnit-blue-light: #1E73E8;
    --nurnit-blue-dark: #0A2F8F;

    --success: #22c55e;
    --success-bg: #fcfffd;
    --success-border: #e5efe8;
    --success-text: #14532d;

    --warning: #eab308;
    --warning-bg: #fffbeb;
    --warning-border: #fde68a;
    --warning-text: #78350f;

    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --danger-border: #fecaca;
    --danger-text: #7f1d1d;
}

.light-mode {
    --bg-primary: #f5f5f5;
    --bg-secondary: #ffffff;
    --bg-tertiary: #ffffff;
    --bg-button: #e0e0e0;
    --bg-hover: #d0d0d0;
    --bg-today: #e3f2fd;
    --bg-today-slot: #f0f8ff;

    --text-primary: #333;
    --text-secondary: #555;
    --text-muted: #777;
    --text-heading: #0A2F8F;

    --border-color: #ccc;
    --shadow: rgba(0, 0, 0, .1);
}

/* ---------- Global form element sizing ---------- */
input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="reset"]),
select {
    min-height: 38px !important;
    height: 38px !important;
    padding: .25rem .6rem !important;
    font-size: .875rem !important;
    box-sizing: border-box;
}
textarea {
    min-height: 38px !important;
    padding: .25rem .6rem !important;
    box-sizing: border-box;
}

/* ---------- Base layout ---------- */
html {
    scrollbar-gutter: stable;
    overflow-y: scroll;
    padding: 0 !important;
    margin: 0 !important;
}

body {
    max-width: min(1600px, 96vw);
    min-height: 100vh;
    margin: auto;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
}

main { flex: 1; padding: 0 !important; margin: 0 !important; }

/* ---------- Network canvas (login page) ---------- */
#netCanvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

body.page-login > header,
body.page-login > main,
body.page-login > footer,
body.page-login > dialog {
    position: relative;
    z-index: 1;
}

table { width: 100%; }

.grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 900px) {
    .grid { grid-template-columns: 220px 1fr; }
}

.muted { color: var(--text-muted); }

.qty-badge {
    background: var(--bg-button);
    color: var(--text-primary);
    padding: .1rem .4rem;
    border-radius: .3rem;
    border: 1px solid var(--border-color);
}

.admin-table tbody tr:hover td,
.reservations-table tbody tr:hover td,
.activity-table tbody tr:hover td {
    background: #eef4ff;
    transition: background .15s ease;
}

html[data-theme="dark"] .admin-table tbody tr:hover td,
html[data-theme="dark"] .reservations-table tbody tr:hover td,
html[data-theme="dark"] .activity-table tbody tr:hover td {
    background: rgba(255, 255, 255, .04);
}

/* ---------- Header and navigation ---------- */
header {
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 0 0 1rem 1rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .08);
    position: relative;
    overflow: hidden;
}

html[data-theme="dark"] header {
    background: rgba(30, 41, 59, .92);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: .3;
    pointer-events: none;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding-right: 0;
    position: relative;
    z-index: 1;
}

.app-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0;
    font-size: 1.5rem;
    font-weight: 400;
}

/* Brand color — update --brand-n-color when final brand palette is defined */
:root { --brand-n-color: #93C5FD; }

.brand-title-n {
    color: var(--brand-n-color);
    font-size: 1.12em;
    display: inline-block;
    line-height: 1;
    vertical-align: baseline;
}

.brand-title-text {
    opacity: 0.9;
}

.app-title h2 {
    margin: 0;
    font-size: inherit;
    font-weight: inherit;
    line-height: 1.05;
    letter-spacing: -.03em;
}

.school-logo {
    width: 100px;
    height: 100px;
    object-fit: contain;
    background: rgba(255, 255, 255, .92);
    padding: .35rem;
    border-radius: 1rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .08);
}

.school-logo.product-logo {
    width: 90px;
    height: 90px;
    padding: .55rem;
    background: transparent;
    box-shadow: none;
}

.top-nav,
.nav-links,
.login-status {
    display: flex;
    align-items: center;
}

.top-nav {
    flex: 1;
    justify-content: flex-end;
    gap: 1.25rem;
    flex-wrap: wrap;
    align-items: flex-start;
}

.nav-area {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .35rem;
}

.nav-links {
    gap: .75rem;
    flex-wrap: wrap;
    transition: all .3s ease;
    flex-wrap: wrap;
    row-gap: .35rem;
    margin-left: 0;
}

.nav-links.mobile-hidden { display: none; }

.nav-links a {
    color: var(--school-blue);
    text-decoration: none;
    padding: .35rem .65rem;
    border-radius: .6rem;
    font-weight: 500;
    transition: all .2s ease;
}

.nav-links a:hover,
.nav-links a.active {
    background: var(--school-blue-light);
    color: var(--school-blue);
}

html[data-theme="dark"] .nav-links a,
html[data-theme="dark"] .week-nav a,
html[data-theme="dark"] .week-nav a:visited {
    color: #93c5fd !important;
}

html[data-theme="dark"] .reservation-tabs a,
html[data-theme="dark"] .reservation-tabs a:visited {
    color: #93c5fd !important;
    background: rgba(147, 197, 253, .06) !important;
    border-color: rgba(147, 197, 253, .22) !important;
}

html[data-theme="dark"] .nav-links a:hover,
html[data-theme="dark"] .week-nav a:hover,
html[data-theme="dark"] .week-nav a:focus,
html[data-theme="dark"] .reservation-tabs a:hover {
    color: #ffffff !important;
    background: rgba(147, 197, 253, .15) !important;
}

html[data-theme="dark"] .nav-links a.active,
html[data-theme="dark"] .reservation-tabs a.active {
    color: #ffffff !important;
    background: rgba(147, 197, 253, .75) !important;
    border: 1px solid rgba(147, 197, 253, .45) !important;
}

.login-status { gap: .5rem; }

.top-nav .login-status {
    align-self: center;
    margin-top: 0;
}

html[data-theme="dark"] .login-status { color: #cbd5e1; }
html[data-theme="dark"] .login-status strong { color: #fff; }
html[data-theme="dark"] .login-status a { color: #93c5fd; }
html[data-theme="dark"] .login-status a:hover { color: #fff; }

.mobile-nav-toggle {
    display: none;
    min-width: 44px;
    min-height: 44px;
    margin-left: 1rem;
    padding: .5rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    background: none;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 18px;
}

.mobile-nav-toggle:hover { background: var(--bg-hover); }

.always-visible-nav {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: .75rem !important;
    width: auto !important;
    margin-top: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
}

.always-visible-nav a {
    display: inline-flex !important;
    width: auto !important;
    padding: .25rem .45rem !important;
    border-bottom: 0 !important;
}

.admin-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    margin: 0;
    padding: .35rem .75rem;
    border: 1px solid transparent;
    border-radius: .7rem;
    background: transparent;
    color: var(--school-blue);
    font: inherit;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
}

.admin-menu-toggle:hover,
.admin-menu-toggle:focus-visible {
    background: var(--school-blue-light);
    color: var(--school-blue);
}

header.admin-menu-open .admin-menu-toggle {
    display: none;
}

header.admin-menu-open {
    overflow: visible !important;
    border-radius: 0 0 0 1.25rem !important;
}

.admin-subnav {
    display: none;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: .2rem .35rem;
    margin-top: 0;
    padding: 0;
    border-top: 0;
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 10;
}

.admin-subnav.is-open {
    display: flex;
    background: linear-gradient(135deg, #0F3E91 0%, #1558C8 55%, #0B2F7A 100%);
    border-top: 1px solid rgba(255, 255, 255, .15);
    padding: .4rem 1.25rem .55rem;
    border-radius: 0 0 1.25rem 1.25rem;
    box-shadow: 0 8px 20px rgba(10, 47, 143, .18);
}

html[data-theme="dark"] .admin-subnav.is-open {
    background: linear-gradient(135deg, #061540 0%, #0A2F8F 58%, #061540 100%);
}

header.admin-menu-open ~ main {
    padding-top: 2.75rem !important;
}

.admin-subnav a {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: .2rem .55rem;
    border-radius: .55rem;
    color: var(--school-blue);
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
}

.admin-subnav a:hover,
.admin-subnav a.active {
    background: var(--school-blue-light);
    color: var(--school-blue);
}

html[data-theme="dark"] .admin-menu-toggle,
html[data-theme="dark"] .admin-subnav a {
    color: #93c5fd;
}

html[data-theme="dark"] .admin-menu-toggle:hover,
html[data-theme="dark"] .admin-menu-toggle:focus-visible,
html[data-theme="dark"] .admin-subnav a:hover,
html[data-theme="dark"] .admin-subnav a.active {
    background: rgba(147, 197, 253, .15);
    color: #fff;
}

/* ---------- Login ---------- */
.login-page {
    margin: 1.6rem 0 2rem;
}

.login-fields {
    display: grid;
    gap: .65rem;
}

.login-fields label {
    margin: .3rem 0 -.25rem;
    font-weight: 500;
}

.login-error {
    margin-bottom: 1rem;
    padding: .75rem .9rem;
    border: 1px solid var(--danger-border);
    border-radius: .75rem;
    background: var(--danger-bg);
    color: var(--danger-text);
}

/* ---------- Footer ---------- */
.app-footer {
    background: var(--bg-secondary, #f8fafc);
    border-top: 1px solid var(--border-color, #e2e8f0);
    padding: 1.5rem 0 .8rem !important;
    margin-top: 4rem;
}

html[data-theme="dark"] .app-footer { background: rgba(30, 41, 59, .4); }

.footer-content {
    display: grid !important;
    grid-template-columns: 1.4fr 1fr .8fr;
    gap: 2rem !important;
    align-items: start !important;
    max-width: 100%;
    margin: 0 auto .5rem !important;
}

.footer-card { min-width: 0; }

.footer-card h4 {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: .5rem !important;
    font-size: 1.05rem !important;
    font-weight: 600;
}


.footer-card p,
.footer-card a,
.footer-links a,
.footer-bottom small {
    color: var(--text-muted, #64748b);
}

.footer-card p {
    font-size: .95rem !important;
    line-height: 1.4 !important;
    margin-bottom: .3rem !important;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: .6rem;
}

.footer-links a,
.footer-card a {
    font-size: .95rem !important;
    text-decoration: none;
    transition: color .2s ease;
}

.footer-links a:hover,
.footer-card a:hover { color: var(--pico-primary); }

.footer-note {
    margin-top: .4rem !important;
    padding-top: .4rem !important;
    border-top: 1px dashed var(--border-color, #e2e8f0);
    font-size: .85rem !important;
    font-style: italic;
}

.footer-instruction-link {
    display: block;
    margin-top: .45rem;
    color: var(--text-primary, #334155) !important;
    font-size: .95rem !important;
    font-weight: 700;
    line-height: 1.4;
    text-decoration: none !important;
}

.footer-instruction-link:hover,
.footer-instruction-link:focus-visible {
    color: var(--pico-primary) !important;
    text-decoration: none !important;
}

.footer-instruction-intro {
    margin: .4rem 0 0 !important;
    color: var(--text-muted, #64748b);
    font-size: .84rem !important;
    line-height: 1.35 !important;
}

.footer-install-btn {
    display: block;
    margin-top: .45rem;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-primary, #334155) !important;
    font-size: .95rem !important;
    font-weight: 700;
    line-height: 1.4;
    cursor: pointer;
    text-align: left;
    transition: color .2s ease;
}

.footer-install-btn:hover {
    color: var(--pico-primary) !important;
}

html[data-theme="dark"] .footer-install-btn {
    color: #e5e7eb !important;
}

html[data-theme="dark"] .footer-install-btn:hover {
    color: #93c5fd !important;
}

.install-guides {
    display: grid;
    gap: .55rem;
    margin-top: .55rem;
}

.install-guide-card {
    padding: .5rem;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    background: rgba(248, 250, 252, .7);
}

.install-guide-card > strong {
    display: block;
    margin-bottom: .35rem;
    color: var(--text-primary, #334155);
    font-size: .86rem;
}

.install-guide-card p {
    margin: .35rem 0 0 !important;
    color: var(--text-muted, #64748b);
    font-size: .8rem !important;
    line-height: 1.32 !important;
}

.install-browser-bar {
    display: flex;
    align-items: center;
    gap: .28rem;
    min-height: 32px;
    padding: .25rem;
    border: 1px solid #d7dde7;
    border-radius: 10px;
    background: #f8fafc;
}

.install-browser-address {
    min-width: 0;
    flex: 1;
    display: flex;
    align-items: center;
    gap: .25rem;
    padding: .28rem .4rem .28rem .6rem;
    border-radius: 999px;
    background: #fff;
    color: #64748b;
    font-size: .74rem;
}

.install-browser-address-text {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.install-browser-button,
.install-browser-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.install-browser-menu {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 26px;
    min-height: 24px;
    padding: .1rem .42rem;
    color: #334155;
}

html[data-theme="dark"] .footer-instruction-link {
    color: #e5e7eb !important;
}

html[data-theme="dark"] .install-guide-card,
html[data-theme="dark"] .install-browser-bar {
    background: rgba(15, 23, 42, .65);
    border-color: #334155;
}

html[data-theme="dark"] .install-browser-address {
    background: rgba(30, 41, 59, .95);
    color: #cbd5e1;
}

html[data-theme="dark"] .install-browser-menu {
    color: #94a3b8;
}

.footer-bottom {
    max-width: 100%;
    margin: .4rem auto 0 !important;
    padding-top: .4rem !important;
    border-top: 1px solid var(--border-color, #e2e8f0);
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 1rem;
}

.footer-bottom small { line-height: 1.6; }

.theme-toggle-footer,
.theme-toggle-header {
    width: 2.5rem !important;
    height: 2.5rem !important;
    border-radius: 50% !important;
    background: #fff !important;
    border: 1px solid #dbe3ee !important;
    color: #475569 !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s ease;
    flex-shrink: 0;
}

html[data-theme="dark"] .theme-toggle-footer,
html[data-theme="dark"] .theme-toggle-header {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

.theme-toggle-footer:hover,
.theme-toggle-header:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .08);
}

/* Pill toggle (alternativa) */
.theme-toggle-pill {
    position: relative;
    align-self: center;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 60px;
    height: 30px;
    padding: 3px;
    border-radius: 999px;
    background: rgba(255,255,255,0.18) !important;
    border: 1.5px solid rgba(255,255,255,0.35) !important;
    cursor: pointer;
    transition: background .2s ease;
}

.pill-indicator {
    position: absolute;
    left: 3px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.18);
    transition: transform .25s cubic-bezier(.4,0,.2,1);
    pointer-events: none;
}

html[data-theme="dark"] .pill-indicator {
    transform: translateX(30px);
    background: #334155;
}

.pill-icon {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: rgba(255,255,255,0.6);
    transition: color .2s ease;
    flex-shrink: 0;
}

.pill-sun  { color: rgba(255,255,255,0.5); }
.pill-moon { color: rgba(255,255,255,0.5); }

html[data-theme="light"] .pill-sun  { color: #1558C5; }
html[data-theme="dark"]  .pill-moon { color: #93c5fd; }

.theme-toggle-header {
    position: absolute;
    top: .75rem;
    right: .9rem;
    z-index: 3;
    width: 2.15rem !important;
    height: 2.15rem !important;
    min-width: 2.15rem !important;
    min-height: 2.15rem !important;
    padding: 0 !important;
}

.app-footer {
    position: relative;
    padding: .75rem 1.25rem !important;
    margin-top: 3rem;
}


.app-footer .footer-bottom {
    position: absolute;
    right: 1.25rem;
    bottom: .75rem;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
}

.app-footer .theme-toggle-footer {
    width: 2.1rem !important;
    height: 2.1rem !important;
}

.app-footer {
    position: relative;
    padding: .8rem 1.25rem .55rem !important;
    margin-top: 3rem;
}

.app-footer .footer-compact {
    display: none !important;
}

.app-footer .footer-card {
    display: block !important;
}

.app-footer .footer-bottom small {
    display: inline !important;
}

.app-footer .footer-content {
    display: grid !important;
    grid-template-columns: minmax(0, 1.25fr) minmax(180px, .8fr) minmax(220px, .9fr);
    gap: 1rem !important;
    align-items: start !important;
    max-width: 100%;
    margin: 0 auto .35rem !important;
}

.app-footer .footer-card:last-child {
    justify-self: end;
    max-width: 280px;
}

.app-footer .footer-card h4 {
    margin-bottom: .25rem !important;
}

.app-footer .footer-card p {
    margin-bottom: .2rem !important;
}

.app-footer .footer-links {
    gap: .35rem;
}

.app-footer .footer-note {
    margin-top: .25rem !important;
    padding-top: .25rem !important;
}

.app-footer .footer-bottom {
    position: static !important;
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
    gap: 1rem;
    margin: .3rem 0 0 !important;
    padding-top: .3rem !important;
    border-top: 1px solid var(--border-color, #e2e8f0) !important;
}

.app-footer .theme-toggle-footer {
    width: 2rem !important;
    height: 2rem !important;
}

.app-footer .footer-card .footer-instruction-link {
    display: block !important;
    color: var(--text-primary, #334155) !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
    letter-spacing: 0 !important;
    text-decoration: none !important;
}

html[data-theme="dark"] .app-footer .footer-card .footer-instruction-link {
    color: #e5e7eb !important;
}

/* ---------- Buttons ---------- */
/* ── Admin buttons — canonical definition ─────────────────────────────────── */
.admin-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 42px;
    padding: 0 .9rem;
    margin: 0;
    border-radius: .6rem;
    box-sizing: border-box;
    font-size: .9rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    vertical-align: middle;
    /* visual */
    border: 1px solid #C9D9F8;
    background: linear-gradient(180deg, #FFFFFF, #F4F8FF);
    color: #0A2F8F;
    box-shadow: 0 2px 8px rgba(10, 47, 143, .06);
    transition: background .15s, border-color .15s, box-shadow .15s, transform .1s;
}

.admin-btn:hover,
.admin-btn:focus-visible {
    border-color: #9DBBF1;
    background: linear-gradient(180deg, #F8FBFF, #EAF2FF);
    color: #0A2F8F;
    box-shadow: 0 6px 16px rgba(10, 47, 143, .12);
    transform: translateY(-1px);
}

.admin-btn-edit,
.login-actions .admin-btn,
.reservation-period-actions .admin-btn,
.date-picker-btn,
.reservation-period-btn {
    background: linear-gradient(135deg, #1558C5, #0A2F8F);
    border-color: #0A2F8F;
    color: #FFFFFF;
    box-shadow: 0 8px 18px rgba(10, 47, 143, .18);
}

.admin-btn-edit:hover,
.login-actions .admin-btn:hover,
.reservation-period-actions .admin-btn:hover,
.date-picker-btn:hover,
.reservation-period-btn:hover {
    background: linear-gradient(135deg, #1E73E8, #1558C5);
    border-color: #1558C5;
    color: #FFFFFF;
    box-shadow: 0 10px 22px rgba(10, 47, 143, .24);
}

.admin-btn-delete,
button.danger,
.button.danger {
    background: #9D4B4B;
    border-color: #C98282;
    color: #FFFFFF;
}

.admin-btn-delete:hover,
button.danger:hover,
.button.danger:hover {
    background: #854040;
    border-color: #B36B6B;
    color: #FFFFFF;
}

.admin-btn-unlock {
    background: #dcfce7;
    border-color: #bbf7d0;
    color: #166534;
}

.admin-btn-unlock:hover {
    background: #bbf7d0;
    border-color: #86efac;
    color: #15803d;
}

/* dark mode */
html[data-theme="dark"] .admin-btn {
    background: linear-gradient(180deg, #172334, #111827);
    color: #DBEAFE;
    border-color: #24456B;
    box-shadow: none;
}

html[data-theme="dark"] .admin-btn:hover {
    background: linear-gradient(180deg, #1e293b, #172334);
    border-color: #3a5f8a;
    color: #DBEAFE;
}

html[data-theme="dark"] .admin-btn-edit,
html[data-theme="dark"] .login-actions .admin-btn,
html[data-theme="dark"] .reservation-period-actions .admin-btn,
html[data-theme="dark"] .date-picker-btn,
html[data-theme="dark"] .reservation-period-btn {
    background: #16233a;
    color: #93c5fd;
    border-color: #60a5fa;
}

html[data-theme="dark"] .admin-btn-edit:hover,
html[data-theme="dark"] .login-actions .admin-btn:hover,
html[data-theme="dark"] .reservation-period-actions .admin-btn:hover,
html[data-theme="dark"] .date-picker-btn:hover,
html[data-theme="dark"] .reservation-period-btn:hover {
    background: #1c2d49;
    border-color: #93c5fd;
    color: #ffffff;
}

html[data-theme="dark"] .admin-btn-delete,
html[data-theme="dark"] button.danger,
html[data-theme="dark"] .button.danger {
    background: #321a1a;
    color: #fca5a5;
    border-color: #5f2c2c;
}

html[data-theme="dark"] .admin-btn-delete:hover,
html[data-theme="dark"] button.danger:hover {
    background: #3d2020;
}

html[data-theme="dark"] .admin-btn-unlock {
    background: #14532d;
    border-color: #166534;
    color: #86efac;
}

html[data-theme="dark"] .admin-btn-unlock:hover {
    background: #166534;
    border-color: #16a34a;
    color: #bbf7d0;
}
/* ── end admin buttons ────────────────────────────────────────────────────── */

button,
.info-btn,
.cancel-chip,
.reserve-btn,
.cancel-btn { touch-action: manipulation; }

/* ---------- Schedule filters and week navigation ---------- */
.schedule-container { width: 100%; }
.mobile-only { display: none; }
.desktop-text { display: inline; }
.mobile-text { display: none; }

.schedule-filters {
    display: grid;
    grid-template-columns: 185px 185px 1fr;
    align-items: end;
    gap: .5rem .8rem;
    margin: .85rem 0 1rem;
    padding: .85rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
}

html[data-theme="dark"] .schedule-filters {
    background: #111827;
    border: 1px solid #334155;
}

.schedule-filter-item { margin: 0; }

.schedule-filter-item label {
    font-size: .8rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: .25rem;
}

html[data-theme="dark"] .schedule-filter-item label { color: #cbd5e1; }

.schedule-filter-item:has(.schedule-toggle-group) {
    grid-column: 3 / -1;
}
.schedule-filters--3-items {
    grid-template-columns: 185px 185px 185px 1fr;
}
.schedule-filters--3-items .schedule-filter-item:has(.schedule-toggle-group) {
    grid-column: 4 / -1;
}

.schedule-toggle-group {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: .4rem;
}

.schedule-toggle-group label {
    display: inline-flex;
    align-items: center;
    gap: 0;
    margin: 0;
    white-space: nowrap;
    cursor: pointer;
    padding: .32rem .75rem;
    border-radius: 2rem;
    border: 1.5px solid #c7d2e0;
    background: #f3f6fa;
    color: #4b5563;
    font-size: .82rem;
    font-weight: 500;
    line-height: 1.4;
    user-select: none;
    transition: background .15s, border-color .15s, color .15s;
}

.schedule-toggle-group label:hover {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #1d4ed8;
}

.schedule-toggle-group input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.schedule-toggle-group label:has(input:checked) {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
    font-weight: 600;
}

html[data-theme="dark"] .schedule-toggle-group label {
    background: #1e293b;
    border-color: #334155;
    color: #94a3b8;
}

html[data-theme="dark"] .schedule-toggle-group label:hover {
    border-color: #3b82f6;
    background: #1e3a5f;
    color: #93c5fd;
}

html[data-theme="dark"] .schedule-toggle-group label:has(input:checked) {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.reserved-inline-list {
    display: none;
    gap: .12rem;
    margin-top: .26rem;
    text-align: left;
    color: #52637A;
    font-size: .68rem;
    font-weight: 700;
    line-height: 1.2;
}

.reserved-inline-list span {
    display: flex;
    align-items: baseline;
    gap: 0;
    overflow: hidden;
}

.bk-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 0 1 auto;
}

.bk-qty {
    white-space: nowrap;
    flex-shrink: 0;
    font-size: .8em;
    opacity: .75;
}

.bk-class {
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: auto;
    padding-left: .3em;
}

.device-availability.show-reserved-details {
    align-items: flex-start;
    min-height: 58px;
}

.device-availability.show-reserved-details .reserved-inline-list {
    display: grid;
}

.device-availability[data-total="1"].show-reserved-details .bk-qty {
    display: none;
}

.device-availability.show-reserved-details .device-info {
    width: 100%;
}

.device-availability.show-reserved-details .info-btn,
.device-availability.show-reserved-details .popover,
.device-availability.show-reserved-details .capacity-bar,
.device-availability.show-reserved-details .status-badge {
    display: none !important;
}

html[data-theme="dark"] .reserved-inline-list {
    color: #CBD5E1;
}

@media (max-width: 1120px) {
    .schedule-toggle-group {
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: .45rem;
    }
}

.schedule-select,
.location-select {
    width: 100% !important;
    max-width: 185px !important;
    min-height: 38px !important;
    padding: .25rem .6rem !important;
    margin: 0 !important;
}

.week-nav {
    display: flex;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .6rem;
    color: var(--school-blue);
}

/* ---------- Legend ---------- */
.legend {
    width: fit-content;
    display: inline-flex;
    flex-wrap: wrap;
    gap: .45rem !important;
    padding: .42rem .6rem !important;
    border-radius: 12px !important;
    border: 1px solid #ddd;
    margin-bottom: 1rem;
    background: var(--bg-secondary, #fff);
}

.legend-inline,
.schedule-filters .legend {
    margin-left: auto;
    margin-bottom: 0;
    justify-self: end;
    align-self: center;
}

.legend-box {
    min-width: auto !important;
    justify-content: center;
    padding: .2rem .55rem !important;
    border-radius: 999px !important;
    box-shadow: none !important;
    font-size: .82rem !important;
    font-weight: 800 !important;
}

.legend-box.device-availability {
    padding-right: .65rem !important;
    margin-bottom: 0 !important;
    gap: 0 !important;
}

.legend-box span { line-height: 1; }

/* ---------- Schedule table ---------- */
.schedule-grid-container {
    max-height: none !important;
    overflow: visible !important;
}

.schedule-grid {
    width: 100%;
    table-layout: auto !important;
    border-collapse: separate;
    border-spacing: .18rem !important;
    overflow: visible !important;
}

.schedule-grid,
.schedule-grid tbody,
.schedule-grid tr,
.schedule-grid td,
.schedule-slot,
.device-availability,
.device-info {
    overflow: visible !important;
}

.schedule-grid th,
.schedule-grid td {
    padding: .18rem !important;
    text-align: left;
    vertical-align: top !important;
    border: 1px solid var(--border-color);
}

.schedule-grid thead { background: transparent !important; }

.schedule-grid th {
    background: linear-gradient(135deg, var(--school-blue), var(--school-blue-dark)) !important;
    color: #fff !important;
    border: 0 !important;
    border-radius: 14px !important;
    text-align: center;
    padding: .75rem .35rem !important;
}

.schedule-grid th small { color: rgba(255, 255, 255, .9); }

.schedule-grid th:first-child {
    background: transparent !important;
    color: var(--text-primary) !important;
}

.schedule-grid th.today {
    background: linear-gradient(135deg, #4b8cb3, var(--school-blue)) !important;
}
.lesson-col {
    width: 86px !important;
}

.schedule-grid th:first-child,
.schedule-grid td:first-child {
    width: 86px !important;
    min-width: 86px !important;
    max-width: 86px !important;
    white-space: normal !important;
}

.schedule-grid td:first-child {
    background: var(--bg-secondary);
    border-radius: 12px;
    font-weight: 600;
    text-align: center !important;
    vertical-align: top !important;
    padding-top: .35rem !important;
    line-height: 1.05 !important;
    position: relative;
}

.schedule-grid td:first-child strong {
    display: block !important;
    font-size: .68rem !important;
    margin: 0 !important;
    line-height: 1.05 !important;
    white-space: nowrap !important;
}

.schedule-grid td:first-child .lesson-time {
    display: block !important;
    margin-top: 5px !important;
    font-size: .58rem !important;
    font-weight: 400 !important;
    line-height: 1.3 !important;
    text-align: center !important;
    white-space: nowrap !important;
    color: var(--text-secondary) !important;
}

html[data-theme="dark"] .schedule-grid td:first-child .lesson-time {
    color: rgba(255, 255, 255, .8) !important;
}
.schedule-grid td.schedule-slot {
    min-width: 150px;
    padding: .12rem !important;
    position: relative;
}

.schedule-grid td.schedule-slot.today { background-color: var(--bg-today-slot); }

.slot {
    position: relative;
    overflow: visible;
    padding: .5rem;
    border: 1px solid var(--border-color);
    border-radius: .4rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* ---------- Device availability cards ---------- */
.device-availability {
    position: relative;
    overflow: visible !important;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .3rem;
    padding: .18rem .3rem .18rem .5rem !important;
    padding-right: 1.25rem !important;
    margin-bottom: .1rem !important;
    min-height: unset !important;
    border: none;
    border-left: 3px solid #dbe3ea;
    border-radius: 6px !important;
    box-shadow: none !important;
    color: var(--text-primary);
    font-size: .78rem !important;
    line-height: 1.05 !important;
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}

.device-availability:focus { outline: none; }

.device-availability:focus-visible {
    outline: 2px solid rgba(37, 99, 235, .35);
    outline-offset: 2px;
}

.device-availability.clickable { cursor: pointer; }

.device-availability.clickable:hover {
    outline: none;
    transform: translateY(-1px) !important;
    box-shadow: none !important;
    filter: brightness(1.03);
}

.device-availability.clickable:active {
    transform: translateY(0) scale(.98) !important;
    box-shadow: none !important;
    filter: brightness(.97);
}

.device-availability.capacity-free {
    background: linear-gradient(90deg, var(--schedule-free-bg) 0%, #ffffff 60%) !important;
    border: none !important;
    border-left: 3px solid var(--schedule-free) !important;
    box-shadow: none !important;
    color: var(--schedule-free-text) !important;
}

.device-availability.capacity-partial {
    background: linear-gradient(90deg, var(--schedule-partial-bg) 0%, #ffffff 60%) !important;
    border: none !important;
    border-left: 3px solid var(--schedule-partial) !important;
    box-shadow: none !important;
    color: var(--schedule-partial-text) !important;
}

.device-availability.capacity-full {
    background: linear-gradient(90deg, var(--schedule-full-bg) 0%, #ffffff 60%) !important;
    border: none !important;
    border-left: 3px solid var(--schedule-full) !important;
    box-shadow: none !important;
    color: var(--schedule-full-text) !important;
}

html[data-theme="dark"] .device-availability.capacity-free {
    background: linear-gradient(90deg, rgba(34, 197, 94, .22) 0%, rgba(34, 197, 94, .06) 60%) !important;
    border-left-color: var(--success) !important;
    color: #dcfce7 !important;
}

html[data-theme="dark"] .device-availability.capacity-partial {
    background: linear-gradient(90deg, rgba(234, 179, 8, .22) 0%, rgba(234, 179, 8, .06) 60%) !important;
    border-left-color: var(--warning) !important;
    color: #fef3c7 !important;
}

html[data-theme="dark"] .device-availability.capacity-full {
    background: linear-gradient(90deg, rgba(239, 68, 68, .22) 0%, rgba(239, 68, 68, .06) 60%) !important;
    border-left-color: var(--danger) !important;
    color: #fee2e2 !important;
}

.device-info {
    position: relative;
    flex: 1;
    width: 100%;
    min-width: 0;
    line-height: 1.05 !important;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: start;
}
.device-info .capacity-bar,
.device-info .reserved-inline-list {
    grid-column: 1 / -1;
}

.device-name,
.device-qty {
    font-size: .78rem !important;
    line-height: 1.05 !important;
}

.equipment-icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: -.15em;
    flex-shrink: 0;
}

.device-type-icon {
    display: inline-flex;
    align-items: flex-start;
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: start;
    margin-right: .25em;
    padding-top: .08em;
    color: inherit;
}
.device-type-icon .equipment-icon {
    width: .95rem;
    height: .95rem;
}

.icon-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2.2rem;
    height: 2.2rem;
    border: 1px solid var(--pico-border-color, #ddd);
    border-radius: .4rem;
    background: var(--pico-card-background-color, #f8fafc);
    color: var(--school-blue, #1e3a5f);
}

.icon-preview .equipment-icon {
    width: 1.4rem;
    height: 1.4rem;
    display: block;
}

.icon-cell .equipment-icon {
    width: 1.3rem;
    height: 1.3rem;
    display: block;
}

.device-name {
    display: block;
    grid-column: 2;
    grid-row: 1;
    font-weight: 600;
    letter-spacing: .01em;
    text-align: left;
}

.device-qty {
    display: block;
    grid-column: 2;
    grid-row: 2;
    text-align: left;
    font-weight: 700;
    white-space: nowrap !important;
    margin-top: .05rem !important;
}

.capacity-bar {
    height: 3px !important;
    background: #e5e7eb;
    border-radius: 999px;
    margin-top: .12rem !important;
    overflow: hidden;
}

.capacity-fill { height: 100%; }
.device-availability.capacity-free .capacity-fill { background: var(--success); }
.device-availability.capacity-partial .capacity-fill { background: var(--warning); }
.device-availability.capacity-full .capacity-fill { background: var(--danger); }

.device-actions,
.reserve-btn,
.cancel-btn { display: none; }


/* ---------- Info popover ---------- */
.info-btn {
    position: absolute !important;
    top: auto;
    bottom: .28rem;
    right: .28rem;
    z-index: 10;

    display: inline-flex !important;
    align-items: center;
    justify-content: center;

    width: 25px !important;
    height: 25px !important;
    min-width: 25px !important;
    min-height: 25px !important;

    padding: 0 !important;

    border-radius: 50%;
    border: 1px solid #cbd5e1;

    background: #ffffff;
    color: #045A88;

    font-size: 9px !important;
    font-weight: 700;
    line-height: 1;

    box-shadow: 0 1px 2px rgba(0,0,0,.08);

    cursor: pointer;
}

.device-availability:has(.popover[aria-hidden="false"]) {
    z-index: 1000000 !important;
}

.info-btn:hover {
    background: #f8fafc;
}

html[data-theme="dark"] .info-btn {
    background: #1e293b;
    color: #93c5fd;
    border: 1px solid #475569;
}

html[data-theme="dark"] .info-btn:hover {
    background: #334155;
}

.popover {
    position: fixed;
    top: 0;
    left: 0;
    right: auto;
    bottom: auto;
    z-index: 999999 !important;
    min-width: 240px;
    max-width: min(340px, calc(100vw - 2rem));
    padding: .75rem 1rem;
    background: #ffffff;
    color: #1f2937;
    border: 1px solid #dbe3ee;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(15, 23, 42, .18);
    white-space: normal;
    text-align: left;
    display: none;
    pointer-events: auto;
}

.popover[aria-hidden="false"] { display: block !important; }
.popover[aria-hidden="true"] { display: none !important; }

.popover-header {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #64748b;
    margin-bottom: .5rem;
    padding-bottom: .4rem;
    border-bottom: 1px solid #e2e8f0;
}

.popover-list {
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

.popover-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: .75rem;
}

.popover-name {
    font-size: .73rem;
    font-weight: 500;
    color: #1f2937;
}

.popover-detail {
    font-size: .75rem;
    color: #64748b;
    white-space: nowrap;
    flex-shrink: 0;
}

html[data-theme="dark"] .popover {
    background: #111827;
    color: #e5e7eb;
    border-color: #334155;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .5);
}

html[data-theme="dark"] .popover-header {
    color: #94a3b8;
    border-bottom-color: #1e293b;
}

html[data-theme="dark"] .popover-name { color: #e5e7eb; }
html[data-theme="dark"] .popover-detail { color: #94a3b8; }

/* ---------- Dialog / reservation actions ---------- */
.cancel-chip {
    position: relative;
    width: 2rem !important;
    height: 2rem;
    min-width: 2rem;
    padding: 0 !important;
    margin: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}

.cancel-chip:hover { background: #dc2626; }

.cancel-chip::after {
    content: attr(aria-label);
    position: absolute;
    right: calc(100% + .55rem);
    top: 50%;
    transform: translateY(-50%) scale(.98);
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
    padding: .28rem .5rem;
    border-radius: 8px;
    background: #111827;
    color: #fff;
    font-size: .78rem;
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .18);
    transition: opacity .08s ease, transform .08s ease;
    z-index: 40;
}

.cancel-chip:hover::after,
.cancel-chip:focus-visible::after {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

html[data-theme="dark"] .cancel-chip::after {
    background: #e5e7eb;
    color: #111827;
}
.modal {
    max-width: min(760px, 92vw);
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.modal article {
    border-radius: 14px;
}

.reservation-dialog article {
    font-size: .92rem;
    line-height: 1.4;
}

.reservation-dialog[open] {
    position: fixed;
    inset: 1rem 0 auto 0;
    margin: 0 auto;
    max-height: calc(100dvh - 1.5rem);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.reservation-dialog::backdrop {
    background: rgba(0, 0, 0, .35);
}

.install-dialog {
    max-width: min(580px, 92vw);
}

.install-dialog article section {
    overflow-y: auto;
    max-height: calc(100dvh - 10rem);
}

.install-dialog .modal-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
    padding-top: .75rem;
    border-top: 1px solid var(--border-color, #e2e8f0);
}

.reservation-dialog article > header {
    background: linear-gradient(135deg, #0A2F8F 0%, #1558C5 58%, #1E73E8 100%) !important;
    color: #FFFFFF !important;
    border-radius: 14px 14px 0 0 !important;
    padding: .72rem 1rem !important;
}

.reservation-dialog article > header h3 {
    color: #FFFFFF !important;
    font-size: 1.18rem;
    line-height: 1.2;
    margin: 0;
    text-shadow: 0 1px 2px rgba(10, 47, 143, .28);
}

.reservation-dialog article > header button[rel="prev"] {
    color: #FFFFFF !important;
    opacity: .78;
}

.reservation-dialog article > header button[rel="prev"]:hover {
    opacity: 1;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: .55rem;
    flex-wrap: wrap;
    margin-top: .85rem;
}
.modal-actions button,
.modal-actions a {
    width: auto !important;
    flex: 0 0 auto;
}

#manageModal .manage-status-card {
    display: grid;
    gap: .35rem;
    padding: .75rem .85rem;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    background: var(--bg-secondary, #f8fafc);
    margin-bottom: .9rem;
}

#manageModal .manage-status-pill {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: .18rem .55rem;
    border-radius: 999px;
    font-weight: 800;
}

#manageModal .manage-status-pill.is-free {
    background: #dcfce7;
    color: #166534;
}

#manageModal .manage-status-pill.is-partial {
    background: #fef3c7;
    color: #92400e;
}

#manageModal .manage-status-pill.is-full {
    background: #fee2e2;
    color: #991b1b;
}

#listEditModal .manage-status-card {
    display: grid;
    gap: .35rem;
    padding: .75rem .85rem;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: .5rem;
    margin: .4rem 0 .5rem;
    background: var(--card-background-color, #fff);
}
#listEditModal .manage-status-pill { display: inline-flex; align-items: center; width: fit-content; padding: .15rem .55rem; border-radius: 99px; font-size: .82rem; font-weight: 800; }
#listEditModal .manage-status-pill.is-free    { background: #dcfce7; color: #166534; }
#listEditModal .manage-status-pill.is-partial { background: #fef3c7; color: #92400e; }
#listEditModal .manage-status-pill.is-full    { background: #fee2e2; color: #991b1b; }

#manageModal input[type="number"],
#listEditModal input[type="number"] {
    max-width: 180px;
    -moz-appearance: textfield;
}
#manageModal input[type="number"]::-webkit-inner-spin-button,
#manageModal input[type="number"]::-webkit-outer-spin-button,
#listEditModal input[type="number"]::-webkit-inner-spin-button,
#listEditModal input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#manageModal #mmAddForm,
#manageModal #mmEditForm {
    max-width: 320px;
}


#listEditModal #listEditForm {
    max-width: 320px;
}

#listEditCurrentQty {
    grid-column: 1;
    grid-row: 2;
    align-self: baseline;
    white-space: nowrap;
}

.is-hidden {
    display: none !important;
}

.conflict-box {
    border-left: 4px solid #e2e8f0;
    padding: .6rem .8rem;
    margin: .5rem 0;
    border-radius: 0 .4rem .4rem 0;
    background: #f8fafc;
}
.conflict-box.conflict-success { border-left-color: #22c55e; background: #f0fdf4; }
.conflict-box.conflict-warning { border-left-color: #f59e0b; background: #fffbeb; }
.conflict-box.conflict-error   { border-left-color: #ef4444; background: #fef2f2; }
.conflict-box.conflict-skipped { border-left-color: #94a3b8; background: #f1f5f9; }

html[data-theme="dark"] .conflict-box.conflict-success { border-left-color: #16a34a; background: rgba(34,197,94,.08); }
html[data-theme="dark"] .conflict-box.conflict-warning { border-left-color: #d97706; background: rgba(245,158,11,.08); }
html[data-theme="dark"] .conflict-box.conflict-error   { border-left-color: #dc2626; background: rgba(239,68,68,.08); }
html[data-theme="dark"] .conflict-box.conflict-skipped { border-left-color: #64748b; background: rgba(100,116,139,.08); }

.reservation-dialog .conflict-box strong,
#conflictModal .conflict-box strong {
    display: block;
    margin-bottom: .45rem;
}

.reservation-dialog .conflict-box ul,
#conflictModal ul,
#listSuccessModal ul {
    list-style: none !important;
    list-style-type: none !important;
    padding: 0 !important;
    margin: .15rem 0 0 0;
}
.reservation-dialog .conflict-box ul li::marker,
#conflictModal ul li::marker,
#listSuccessModal ul li::marker {
    content: '' !important;
    display: none !important;
}

.reservation-dialog .conflict-box li,
#conflictModal .conflict-box li {
    margin-top: .25rem;
}

.conflict-resolve-item + .conflict-resolve-item {
    margin-top: .85rem;
    padding-top: .85rem;
    border-top: 1px solid var(--border-color);
}

.conflict-action-btn { width: auto !important; align-self: flex-start; }
.conflict-qty-input { width: 80px; }

#confirmReservationText p {
    margin: .5rem 0 0;
}

#confirmReservationText p:first-child {
    margin-top: .35rem;
}

.confirm-qty-change {
    margin-top: .7rem !important;
    font-size: 1.05rem;
}

.confirm-qty-weeks {
    font-size: .85rem;
    font-weight: 400;
    color: var(--muted-color, #64748b);
    margin-left: .3rem;
}

.confirm-datetime {
    display: inline-block;
    background: #dbeafe;
    color: #1e40af;
    border-radius: .4rem;
    padding: .18rem .6rem;
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: .01em;
}

html[data-theme="dark"] .confirm-datetime {
    background: #1e3a5f;
    color: #93c5fd;
}

/* ---------- Reservations / tabs ---------- */
.reservation-tabs a {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    padding: .32rem .75rem;
    border-radius: 2rem;
    border: 1.5px solid #c7d2e0;
    background: #f3f6fa;
    color: #4b5563;
    font-size: .82rem;
    font-weight: 500;
    line-height: 1.4;
    margin: 0;
    transition: background .15s, border-color .15s, color .15s;
}

.reservation-tabs a:hover,
.reservation-tabs a:focus-visible {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #1d4ed8;
}

.reservation-tabs a.active {
    background: var(--school-blue);
    border-color: var(--school-blue);
    color: #fff;
    font-weight: 700;
}

.my-reservations-page {
    width: 100%;
}

.my-reservations-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
    margin: 0 0 .5rem;
    padding: .35rem 0 0;
}

.my-reservations-header h3 {
    margin: 0;
    color: #0A2F8F;
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.2;
}

.my-reservations-header .reservation-period-filter {
    align-items: center;
    justify-content: flex-end;
    flex-direction: row;
    flex-wrap: wrap;
}

html[data-theme="dark"] .my-reservations-header h3 {
    color: #DBEAFE;
}

.my-reservations-controls {
    display: grid;
    grid-template-columns: max-content minmax(280px, 1fr);
    align-items: center;
    gap: .75rem;
    margin: .4rem 0 .5rem;
    padding: .45rem .7rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

html[data-theme="dark"] .my-reservations-controls {
    background: #111827;
    border-color: #334155;
}

.reservation-right-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .5rem;
    flex-wrap: wrap;
}

.reservation-tabs-stacked {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .45rem;
}

.reservation-period-filter {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    align-self: center;
    gap: .25rem;
    margin: 0;
}

.reservation-period-picker {
    position: relative;
}

.reservation-period-btn {
    min-width: 180px;
    padding: .45rem .8rem;
    justify-content: center;
    gap: .35rem;
    border-radius: .7rem;
    font-weight: 500;
}

.reservation-period-panel {
    position: absolute;
    z-index: 30;
    top: calc(100% + .45rem);
    right: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .85rem;
    min-width: 420px;
    padding: 1rem;
    background: var(--bg-secondary, #fff);
    border: 1px solid #cbd5e1;
    border-radius: 18px;
    box-shadow: 0 16px 36px rgba(15, 23, 42, .16);
}

.reservation-period-panel[hidden] {
    display: none;
}

.reservation-date-field {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.date-field-label {
    font-size: .84rem;
    font-weight: 700;
    color: var(--text-muted, #64748b);
}

.date-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: .45rem;
    padding: 0 .75rem;
    height: 38px;
    box-sizing: border-box;
    border: 1.5px solid #c7d2e0;
    border-radius: 8px;
    background: #f8fafc;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, background .15s;
}

.date-input-wrap:hover {
    border-color: #93c5fd;
    background: #eff6ff;
}

.date-input-wrap:focus-within {
    border-color: #1E73E8;
    box-shadow: 0 0 0 3px rgba(30, 115, 232, .16);
    background: #fff;
    outline: none;
}

.date-input-cal {
    flex-shrink: 0;
    width: 15px;
    height: 15px;
    color: #6b7280;
}

.date-input-text {
    flex: 1;
    font-size: inherit;
    font-weight: 500;
    color: #111827;
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
    text-align: left;
}

.date-input-text.is-placeholder {
    color: #9ca3af;
    font-weight: 400;
}


.reservation-period-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: .55rem;
    justify-content: flex-end;
    flex-wrap: wrap;
    padding-top: .15rem;
}

.reservation-period-actions .admin-btn {
    min-width: 145px;
    justify-content: center;
}

.reservation-period-clear {
    font-size: .82rem;
    color: var(--text-muted, #64748b);
    text-decoration: none;
}

.reservation-period-clear:hover {
    color: var(--school-blue);
    text-decoration: underline;
}

td.actions-cell {
    text-align: right;
    white-space: nowrap;
}

.my-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    vertical-align: middle;
}

.my-actions form {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 0;
}

.my-action-link,
.my-action-cancel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    width: auto;
    height: 34px;
    box-sizing: border-box;
    padding: 0 14px;
    font-size: .78rem;
    font-weight: 500;
    border-radius: 5px;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1;
    text-decoration: none;
    box-shadow: none;
    transition: background .15s, color .15s, border-color .15s;
}

.my-action-link {
    background: transparent;
    border: 1px solid #1558C5;
    color: #1558C5;
}

.my-action-link:hover {
    background: rgba(21, 88, 197, .07);
    color: #0A2F8F;
    border-color: #0A2F8F;
    text-decoration: none;
}

.my-action-cancel {
    background: transparent;
    border: none;
    color: #b91c1c;
    text-decoration: none;
}

.my-action-cancel:hover {
    color: #991b1b;
    text-decoration: underline;
}

.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.reservations-table { min-width: 850px; }

.reservations-table-wrap table th,
.reservations-table-wrap table td {
    padding: 3px .4rem;
    font-size: .78rem;
    vertical-align: middle;
    line-height: 1.15;
}

.reservation-search-wrap {
    margin: 0;
}

.reservation-search-top {
    flex: none;
    align-self: center;
}

.reservation-search-icon-wrap {
    display: flex;
    align-items: center;
    width: 330px;
    border: 1px solid #C9D9F8;
    border-radius: 8px;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}

.reservation-search-icon-wrap:focus-within {
    border-color: #1E73E8;
    box-shadow: 0 0 0 3px rgba(30, 115, 232, .18);
}

.reservation-search-icon {
    flex-shrink: 0;
    margin-left: .65rem;
    width: 15px;
    height: 15px;
    color: #94a3b8;
    pointer-events: none;
}

.reservation-search-icon-wrap input {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    flex: 1;
    min-width: 0;
    width: 100% !important;
    margin: 0 !important;
    padding-left: .45rem !important;
}

.bulk-reservation-form {
    display: none;
}

.bulk-row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: .4rem;
    margin: 0;
}

.bulk-row-actions [hidden] {
    display: none !important;
}

.bulk-select-all {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .25rem;
    margin: 0;
    font-size: .76rem;
    font-weight: 700;
    color: var(--text-muted, #64748b);
    white-space: nowrap;
}

.bulk-select-all input,
.bulk-reservation-checkbox {
    width: 1.05rem;
    height: 1.05rem;
    margin: 0;
}

.bulk-select-col {
    display: none;
    width: 64px;
    text-align: center;
}

.bulk-mode-active .bulk-select-col {
    display: table-cell;
}

.bulk-mode-control {
    display: none !important;
}

.bulk-mode-active .bulk-mode-control:not([hidden]) {
    display: inline-flex !important;
}

.bulk-mode-active #bulkSelectionCount:not([hidden]) {
    display: inline !important;
}

.bulk-row-actions .admin-btn {
    min-height: 34px;
    height: auto;
    padding: .3rem .55rem !important;
    font-size: .8rem !important;
}

.reservation-actions-heading {
    min-width: 210px;
}

.bulk-mode-btn {
    background: transparent !important;
    border: 1px solid #b91c1c !important;
    color: #b91c1c !important;
    box-shadow: none !important;
    font-weight: 600 !important;
    width: auto !important;
}

.bulk-mode-btn:hover {
    background: rgba(185, 28, 28, .07) !important;
    border-color: #991b1b !important;
    color: #991b1b !important;
    box-shadow: none !important;
}

html[data-theme="dark"] .bulk-mode-btn {
    border-color: #f87171 !important;
    color: #f87171 !important;
    background: transparent !important;
}

html[data-theme="dark"] .bulk-mode-btn:hover {
    background: rgba(248, 113, 113, .1) !important;
}

html[data-theme="dark"] .my-action-link {
    border-color: #60a5fa;
    color: #93c5fd;
}

html[data-theme="dark"] .my-action-link:hover {
    background: rgba(96, 165, 250, .1);
    color: #bfdbfe;
}

html[data-theme="dark"] .my-action-cancel {
    border-color: #f87171;
    color: #f87171;
}

html[data-theme="dark"] .my-action-cancel:hover {
    background: rgba(248, 113, 113, .1);
    color: #fca5a5;
}

.bulk-row-actions .admin-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.bulk-row-actions #bulkSelectionCount {
    font-size: .78rem;
}

/* ---------- Activity filters ---------- */
.activity-filter-card {
    background: var(--bg-secondary, #f8fafc);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 14px;
    padding: 1rem;
    margin-bottom: 1.2rem;
}

.users-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
    margin: .4rem 0 .5rem;
    padding: .45rem .7rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

html[data-theme="dark"] .users-toolbar {
    background: #111827;
    border-color: #334155;
}

.users-toolbar-left {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

.users-toolbar-right {
    margin: 0;
}

.admin-table th,
.admin-table td {
    padding: 5px .45rem;
    font-size: .82rem;
    vertical-align: middle;
    line-height: 1.2;
}

.activity-detail-cell {
    max-width: 380px;
    word-break: break-word;
    white-space: normal;
    color: var(--text-muted, #555);
}

.activity-chip {
    display: inline-block;
    padding: .15rem .5rem;
    border-radius: 999px;
    font-size: .73rem;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: .01em;
}

.activity-chip--login {
    background: #F1F5F9;
    color: #64748B;
}

.activity-chip--create {
    background: #DCFCE7;
    color: #166534;
}

.activity-chip--change {
    background: #FEF9C3;
    color: #854D0E;
}

.activity-chip--delete {
    background: #FEE2E2;
    color: #991B1B;
}

.activity-chip--conflict {
    background: #FEE2E2;
    color: #7F1D1D;
    border: 1px solid #FECACA;
}

.activity-email-warn {
    display: inline-block;
    margin-left: .4rem;
    padding: .1rem .4rem;
    border-radius: 6px;
    font-size: .7rem;
    font-weight: 600;
    background: #FEF3C7;
    color: #92400E;
    border: 1px solid #FCD34D;
    white-space: nowrap;
}

html[data-theme="dark"] .activity-chip--login   { background: #1E293B; color: #94A3B8; }
html[data-theme="dark"] .activity-chip--create  { background: #14532D; color: #86EFAC; }
html[data-theme="dark"] .activity-chip--change  { background: #422006; color: #FDE68A; }
html[data-theme="dark"] .activity-chip--delete  { background: #450A0A; color: #FCA5A5; }
html[data-theme="dark"] .activity-chip--conflict{ background: #450A0A; color: #FCA5A5; border-color: #7F1D1D; }
html[data-theme="dark"] .activity-email-warn    { background: #422006; color: #FDE68A; border-color: #92400E; }

.admin-table .admin-btn {
    height: 29px !important;
    width: auto !important;
    padding: 0 .63rem !important;
    font-size: .63rem !important;
    border-radius: .42rem !important;
}

.admin-reservations-table-wrap .admin-table th,
.admin-reservations-table-wrap .admin-table td {
    padding: 3px .4rem;
    font-size: .78rem;
    line-height: 1.15;
}

.admin-table-input {
    height: 29px !important;
    font-size: .82rem !important;
    padding: 0 .45rem !important;
    margin: 0 !important;
    border: 1px solid var(--border, #d1d5db) !important;
    border-radius: .35rem !important;
    box-sizing: border-box !important;
}

.admin-table tbody tr:last-child td {
    padding-bottom: .6rem;
}

.user-search-row {
    display: block;
    white-space: nowrap;
}

.user-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .6rem 1.5rem;
    max-width: 680px;
    margin-bottom: 1.2rem;
}

.user-form-grid label {
    display: block;
    margin-bottom: .25rem;
    font-size: .875rem;
    font-weight: 600;
}

.user-form-grid input,
.user-form-grid select {
    width: 100% !important;
    margin: 0 !important;
}

button.user-form-submit {
    width: auto !important;
}

.admin-device-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
    margin-bottom: .8rem;
}

.admin-device-filters {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-wrap: wrap;
}

.admin-device-select {
    width: auto !important;
    min-width: 130px !important;
    padding-right: 2rem !important;
}

/* ---------- Import layout ---------- */
.import-layout {
    display: grid;
    grid-template-columns: minmax(260px, 320px) 1fr;
    gap: 1.2rem;
    align-items: start;
    margin-bottom: 1.5rem;
}

.import-upload-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.2rem;
}

.import-upload-card h4 {
    margin: 0 0 .9rem;
    font-size: .95rem;
    color: var(--text-heading);
}

.import-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .55rem;
    padding: 1.4rem 1rem;
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    background: var(--bg-primary);
    text-align: center;
    transition: border-color .15s, background .15s;
    margin-bottom: .9rem;
    color: var(--text-muted);
}

.import-dropzone.is-dragging {
    border-color: var(--school-blue, #1E73E8);
    background: #eff6ff;
}

.import-dropzone-hint {
    font-size: .82rem;
    margin: 0;
    color: var(--text-muted);
}

.import-file-btn {
    cursor: pointer;
}

.import-upload-card input[type="file"] {
    display: none !important;
}

.import-file-name {
    font-size: .78rem;
    color: var(--text-muted);
    margin: 0;
    word-break: break-all;
}

.import-file-name.has-file {
    color: var(--text-primary);
    font-weight: 600;
}

.import-card-actions {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

/* Instructions */
.import-instructions {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1rem 1.1rem;
}

.import-instructions h4 {
    margin: 0 0 .5rem;
    font-size: .95rem;
    color: var(--text-heading);
}

.import-instructions h4:not(:first-child) {
    margin-top: 1rem;
}

.import-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 1rem 0;
}

.import-instructions-sub {
    font-size: .82rem;
    color: var(--text-muted);
    margin: 0 0 .5rem;
}

.import-sample-actions {
    display: flex;
    gap: .5rem;
    margin-top: .6rem;
    flex-wrap: wrap;
}

.import-instructions-note {
    font-size: .82rem;
    color: var(--text-muted);
    margin: .6rem 0 0;
}

.import-fields-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .82rem;
}

.import-fields-table th,
.import-fields-table td {
    padding: 5px .7rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.import-fields-table th {
    font-weight: 700;
    color: var(--text-secondary);
    background: var(--bg-primary);
}

.import-fields-table code {
    background: var(--bg-tertiary, #f1f5f9);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: .79rem;
}

.import-badge {
    display: inline-block;
    font-size: .72rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 20px;
    background: var(--bg-primary);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.import-badge.is-required {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.import-instructions pre {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: .65rem .85rem;
    font-size: .8rem;
    margin: .4rem 0 0;
    overflow-x: auto;
    line-height: 1.6;
}

.import-excel-preview {
    margin: .5rem 0 .4rem;
    overflow-x: auto;
    border-radius: 6px;
    border: 1px solid #c7d2de;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.import-excel-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .8rem;
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: #fff;
}

.import-excel-table thead tr {
    background: #217346;
    color: #fff;
}

.import-excel-table th {
    padding: 5px 10px;
    font-weight: 700;
    text-align: left;
    border-right: 1px solid #1a5c38;
    letter-spacing: .02em;
}

.import-excel-table th:last-child {
    border-right: none;
}

.import-excel-table tbody tr:nth-child(even) {
    background: #f0f7ee;
}

.import-excel-table tbody tr:nth-child(odd) {
    background: #fff;
}

.import-excel-table td {
    padding: 4px 10px;
    border-right: 1px solid #d0ddd8;
    border-bottom: 1px solid #d0ddd8;
    color: #1a1a1a;
    white-space: nowrap;
}

.import-excel-table td:last-child {
    border-right: none;
}

.import-excel-table td:empty::after {
    content: '—';
    color: #bbb;
    font-style: italic;
}

html[data-theme="dark"] .import-excel-preview {
    border-color: #2d4a3e;
}
html[data-theme="dark"] .import-excel-table {
    background: #0f1f18 !important;
}
html[data-theme="dark"] .import-excel-table tbody tr:nth-child(even) {
    background: #152b1f !important;
}
html[data-theme="dark"] .import-excel-table tbody tr:nth-child(odd) {
    background: #0f1f18 !important;
}
html[data-theme="dark"] .import-excel-table td {
    color: #d1e8d6 !important;
    border-color: #1e3a2b !important;
}
html[data-theme="dark"] .import-excel-table td:empty::after {
    color: #4a6a55;
}

/* Result card */
.import-result-card {
    background: #fff8e1;
    border: 1px solid #f59e0b;
    border-radius: 12px;
    padding: 1rem 1.1rem;
    margin-bottom: 1.1rem;
}

.import-result-card.is-success {
    background: #f0fdf4;
    border-color: #86efac;
}

.import-result-header {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .95rem;
    margin-bottom: .5rem;
}

.import-result-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #f59e0b;
    color: #fff;
    font-size: .75rem;
    font-weight: 900;
    flex-shrink: 0;
}

.import-result-card.is-success .import-result-icon {
    background: #22c55e;
}

.import-result-list {
    margin: .3rem 0 0 1.2rem;
    font-size: .83rem;
    line-height: 1.7;
}

.import-result-list.is-warning {
    color: #92400e;
}

.import-result-skipped-label {
    margin: .6rem 0 0;
    font-size: .88rem;
}


@media (max-width: 700px) {
    .import-layout {
        grid-template-columns: 1fr;
    }
}

.user-search-row input {
    display: inline-block !important;
    vertical-align: middle;
    width: 220px !important;
    max-width: 220px !important;
    margin: 0 .4rem 0 0 !important;
}

.user-search-row .admin-btn {
    display: inline-flex !important;
    vertical-align: middle;
}

.user-search-row button.admin-btn {
    width: auto !important;
    height: 38px !important;
    line-height: 1 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin: 0 .4rem 0 0 !important;
}

.activity-filter-card h4 {
    margin-top: 0;
    margin-bottom: .8rem;
}

.activity-filters {
    display: grid;
    grid-template-columns: minmax(180px, 1.4fr) minmax(180px, 1.2fr) minmax(150px, .9fr) minmax(150px, .9fr);
    gap: .8rem;
    align-items: end;
    margin-bottom: 1rem;
}

.activity-filters label {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    font-weight: 600;
}

.activity-filters input,
.activity-filters select {
    width: 100%;
    max-width: 220px;
}

.activity-filter-actions {
    display: flex;
    gap: .6rem;
    flex-wrap: wrap;
    grid-column: 1 / -1;
}

/* ---------- Statistics ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin: 1rem 0 1.5rem;
}

.stat-card {
    background: var(--bg-secondary, #fff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 16px;
    padding: 1.2rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
}

.stat-title {
    color: var(--text-muted, #64748b);
    font-size: .95rem;
    margin-bottom: .4rem;
}

.stat-number {
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--text-primary, #0f172a);
}

.stat-bar-row {
    display: grid;
    grid-template-columns: minmax(160px, 240px) 1fr 70px;
    gap: .8rem;
    align-items: center;
    margin-bottom: .55rem;
}

.stat-label { font-weight: 600; }

.stat-bar {
    height: 18px;
    background: rgba(148, 163, 184, .22);
    border-radius: 999px;
    overflow: hidden;
}

.stat-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #1F44B6, #60a5fa);
    border-radius: 999px;
}

.stat-value {
    text-align: right;
    font-weight: 700;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
    .footer-content {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    .footer-compact {
        grid-template-columns: 1fr;
        grid-template-areas:
            "brand"
            "links"
            "help";
        gap: .45rem;
        padding-right: 3rem;
        min-height: auto;
    }

    .footer-compact .footer-links {
        justify-content: flex-start;
    }

    .footer-help {
        justify-self: start;
        margin-right: 0;
    }

    .footer-bottom {
        flex-direction: column-reverse;
        text-align: center;
    }

    .app-footer .footer-bottom {
        align-items: flex-start !important;
        text-align: left;
    }

    .app-footer .footer-card:last-child {
        justify-self: start;
        max-width: none;
    }
}

@media (max-width: 768px) {
    .schedule-filters .legend {
        margin-left: 0;
        margin-top: .5rem;
    }
}

/* ---------- Admin reservations filters ---------- */
.admin-reservation-legacy-filter {
    display: none !important;
}

.admin-reservation-filter-panel {
    width: 100%;
    margin: .75rem 0 1rem;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 16px;
    background: var(--bg-secondary, #fff);
    overflow: hidden;
}

.admin-reservation-filter-panel:not([open]) {
    width: fit-content;
    min-width: 180px;
}

.admin-reservation-filter-panel summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    min-height: 48px;
    padding: .75rem 1rem;
    color: var(--text-primary, #334155);
    font-weight: 800;
    cursor: pointer;
    list-style: none;
}

.admin-reservation-filter-panel summary::-webkit-details-marker {
    display: none;
}

.admin-reservation-filter-panel summary::after {
    content: "";
    width: .45rem;
    height: .45rem;
    border-right: 2px solid var(--text-muted, #64748b);
    border-bottom: 2px solid var(--text-muted, #64748b);
    transform: rotate(45deg);
    transition: transform .18s ease;
}

.admin-reservation-filter-panel[open] summary {
    border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.admin-reservation-filter-panel[open] summary::after {
    transform: rotate(225deg);
}

.admin-reservation-filter-pill {
    margin-left: auto;
    padding: .18rem .55rem;
    border-radius: 999px;
    background: #fff7ed;
    color: #9a3412;
    font-size: .74rem;
    font-weight: 800;
}

.admin-reservation-filter {
    margin: 0;
    padding: 1rem;
    border: 0;
    background: transparent;
}

.admin-reservation-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: .8rem;
    align-items: end;
}


.admin-reservation-filter label {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    margin: 0;
    font-size: .82rem;
    font-weight: 700;
    color: var(--text-muted, #64748b);
}

.admin-reservation-filter input,
.admin-reservation-filter select {
    width: 100%;
    margin: 0;
}

.admin-reservation-filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: .55rem;
    flex-wrap: wrap;
    margin-top: .85rem;
}

.admin-reservation-filter-actions .admin-btn {
    width: auto !important;
    height: 29px !important;
    padding: 0 .75rem !important;
    font-size: .82rem !important;
}

.admin-reservation-device-meta {
    display: block;
    margin-top: .15rem;
    font-size: .78rem;
}

html[data-theme="dark"] .admin-reservation-filter-panel {
    background: #111827;
    border-color: #334155;
}

html[data-theme="dark"] .admin-reservation-filter-panel[open] summary {
    border-bottom-color: #334155;
}

html[data-theme="dark"] .admin-reservation-filter-pill {
    background: rgba(180, 83, 9, .2);
    color: #fcd34d;
}

@media (max-width: 600px) {
    .desktop-text { display: none !important; }
    .mobile-text { display: inline !important; }

    .schedule-container { margin: 0 -.5rem; }

    .schedule-container h3 {
        font-size: 1.15rem !important;
        line-height: 1.15;
        margin-bottom: .9rem;
    }

    .schedule-select {
        width: 100% !important;
        min-height: 42px !important;
        padding: .15rem .45rem !important;
        border-radius: 10px !important;
    }

    .week-nav {
        gap: .5rem;
        margin-bottom: .75rem;
    }

    .week-nav a {
        font-size: .85rem !important;
        line-height: 1;
        padding: .25rem .15rem !important;
    }

    .lesson-col {
        width: 62px !important;
    }

    .schedule-grid th:first-child,
    .schedule-grid td:first-child {
        width: 62px !important;
        min-width: 62px !important;
        max-width: 62px !important;
        padding: .12rem !important;
        white-space: normal !important;
    }

    .schedule-grid td:first-child strong {
        display: block !important;
        font-size: .68rem !important;
        line-height: 1.05 !important;
        margin: 0 !important;
        text-align: center !important;
        white-space: nowrap !important;
    }

    .schedule-grid td:first-child .lesson-time {
        display: block !important;
        margin-top: 4px !important;
        font-size: .58rem !important;
        font-weight: 400 !important;
        line-height: 1.18 !important;
        text-align: center !important;
        white-space: normal !important;
    }

    .schedule-container .device-qty,
    .schedule-container .capacity-bar,
    .schedule-container .status-badge,
    .schedule-container .reserved-inline-list,
    .schedule-container .info-btn,
    .schedule-container .popover { display: none !important; }

    .schedule-container .device-name {
        font-size: 0 !important;
        line-height: 0 !important;
    }

    .schedule-container .device-name::before {
        content: attr(data-shortname);
        font-size: .72rem !important;
        line-height: 1 !important;
        font-weight: 700;
    }
}

@media (max-width: 480px) {
    .legend {
        display: flex;
        flex-wrap: nowrap;
        justify-content: center;
        gap: .35rem;
        overflow-x: auto;
    }

    .legend-item {
        min-width: auto;
        flex: 0 0 auto;
    }

    .legend-box {
        padding: .2rem .45rem !important;
        font-size: .85rem;
    }
}

@media (max-width: 1400px) {
    .header-inner {
        align-items: flex-start;
    }

    .nav-links {
        max-width: 700px;
    }
}

.navbar-toggler,
.menu-toggle { display: none !important; }

.button.disabled {
    opacity: .4;
    pointer-events: none;
    cursor: not-allowed;
}

.admin-page {
    display: grid;
    gap: 1rem;
}

.admin-page-header,
.admin-section-header,
.admin-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
}

.admin-page-header {
    margin: .25rem 0 .35rem;
}

.admin-page-header h2,
.admin-section-header h3 {
    margin: 0;
}

.admin-section-header h3 {
    display: flex;
    align-items: center;
    gap: .45rem;
    font-size: 1.06rem !important;
    font-weight: 700;
    color: #0A2F8F;
    letter-spacing: 0;
}

.admin-section-header h3::before {
    content: "";
    width: .28rem;
    height: 1rem;
    border-radius: 999px;
    background: linear-gradient(180deg, #1E73E8, #0A2F8F);
    flex-shrink: 0;
}

html[data-theme="dark"] .admin-section-header h3 {
    color: #DBEAFE;
}


.admin-collapsible-section > summary:hover {
    background: rgba(30, 115, 232, .04);
    border-radius: 14px;
}

.admin-page-header .section-description,
.admin-section-header .section-description {
    margin: .25rem 0 0;
}

.admin-section-card,
.admin-card {
    min-width: 0;
    padding: 1rem;
    border: 1px solid #D7E5FB;
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .97), rgba(248, 251, 255, .97));
    box-shadow: 0 10px 26px rgba(10, 47, 143, .07);
}

.admin-section-card {
    display: grid;
    gap: 1rem;
}

.admin-collapsible-section {
    gap: 0;
}

.admin-collapsible-section > summary {
    display: flex !important;
    cursor: pointer;
    list-style: none !important;
    list-style-type: none !important;
    -webkit-appearance: none;
    appearance: none;
}

.admin-collapsible-section > summary::-webkit-details-marker,
.admin-collapsible-section > summary::before {
    display: none !important;
    content: none !important;
}

.admin-collapsible-section > summary::marker {
    display: none !important;
    content: none !important;
}

.admin-collapsible-section > summary::after {
    display: none;
}

.section-chevron {
    flex-shrink: 0;
    margin-left: auto;
    transition: transform .22s ease;
}

.admin-collapsible-section[open] > summary .section-chevron {
    transform: rotate(180deg);
}

html[data-theme="dark"] .section-chevron {
    stroke: #60A5FA;
}

.admin-collapsible-section:not([open]) {
    padding-bottom: .85rem;
}

.admin-collapsible-section:not([open]) > summary .section-description {
    margin-bottom: 0;
}

.admin-collapsible-content {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

/* Filter summary – compact toolbar look, not a section subheading */
.admin-filter-summary {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
    padding: .45rem .6rem;
    margin: -.55rem -.55rem 0;
    border-radius: 14px 14px 0 0;
    background: rgba(30, 115, 232, .045);
    border-bottom: 1px solid transparent;
    transition: background .15s;
}

.admin-collapsible-section[open] > .admin-filter-summary {
    border-bottom-color: #D7E5FB;
    border-radius: 14px 14px 0 0;
}

.admin-collapsible-section:has(> .admin-filter-summary) > .admin-collapsible-content {
    margin-top: .75rem;
}

.admin-filter-summary:hover {
    background: rgba(30, 115, 232, .08) !important;
}

.admin-filter-summary .filter-summary-label {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .82rem;
    font-weight: 600;
    color: #374151;
    letter-spacing: 0;
}

html[data-theme="dark"] .admin-filter-summary {
    background: rgba(96, 165, 250, .07);
}

html[data-theme="dark"] .admin-filter-summary .filter-summary-label {
    color: #CBD5E1;
}

html[data-theme="dark"] .admin-collapsible-section[open] > .admin-filter-summary {
    border-bottom-color: rgba(96, 165, 250, .25);
}

.admin-card-form {
    margin: 0;
}

.admin-form-grid,
.blocked-form-grid {
    display: grid;
    gap: .8rem;
    align-items: start;
    margin-bottom: 0;
}

.admin-form-grid-lock {
    grid-template-columns: minmax(190px, 1.25fr) minmax(170px, .9fr) minmax(180px, .8fr) minmax(180px, .8fr);
}

.admin-form-grid-capacity {
    grid-template-columns: minmax(180px, 1.15fr) minmax(220px, 1.35fr) minmax(140px, .75fr) minmax(180px, .8fr) minmax(180px, .8fr);
}

.admin-form-grid label,
.blocked-form-grid label {
    display: flex;
    flex-direction: column;
    gap: .28rem;
    margin: 0;
    color: #52637A;
    font-size: .84rem;
    font-weight: 800;
}

.admin-form-grid input,
.admin-form-grid select,
.admin-form-grid textarea,
.blocked-form-grid input,
.blocked-form-grid select,
.blocked-form-grid textarea {
    width: 100%;
    min-height: 42px;
    margin: 0;
}

.capacity-preview {
    display: block;
    min-height: 2.35rem;
    margin-top: .15rem;
    color: #52637A;
    font-size: .78rem;
    font-weight: 700;
    line-height: 1.25;
    white-space: pre-line;
}

.admin-actions {
    justify-content: flex-end;
    margin-top: .85rem;
    padding-top: .75rem;
    border-top: 1px solid var(--pico-muted-border-color, rgba(0,0,0,.08));
}

.admin-actions .admin-btn {
    width: auto;
    min-width: 11rem;
}

.admin-inline-form {
    display: inline-flex;
    margin: 0;
}

.admin-section-table {
    margin-top: .15rem;
}

.admin-alert {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    padding: .7rem .85rem;
    border-radius: 12px;
    border: 1px solid #C9DBF5;
    background: #F4F8FF;
    color: #334155;
    font-weight: 700;
    line-height: 1.35;
}

.admin-alert-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 7px;
    background: #1558C5;
    color: #FFFFFF;
    font-weight: 900;
    line-height: 1;
}

.admin-alert-error {
    border-color: #E6B8B8;
    background: #FFF4F4;
    color: #7B3434;
}

.admin-alert-error .admin-alert-icon {
    background: #B85A5A;
}

.admin-alert .admin-alert-icon.is-warning {
    background: #B85A5A;
}

.admin-conflict-dialog {
    max-width: min(760px, calc(100vw - 2rem));
    overflow-x: hidden;
}

.admin-capacity-conflict-dialog {
    max-width: min(700px, calc(100vw - 2rem));
}

.admin-conflict-dialog article {
    max-height: inherit !important;
    overflow: auto !important;
    box-sizing: border-box;
}

.admin-conflict-dialog section {
    max-width: 100%;
    overflow: visible !important;
    box-sizing: border-box;
}

.admin-conflict-list {
    display: grid;
    gap: .65rem;
    max-height: none;
    overflow: visible;
    padding-right: 0;
}

.admin-conflict-step {
    margin: -.15rem 0 .55rem;
    color: #52637A;
    font-size: .82rem;
    font-weight: 750;
}

.admin-conflict-card {
    display: grid;
    gap: .55rem;
    padding: .6rem;
    min-width: 0;
    max-width: 100%;
    border: 1px solid #D7E5FB;
    border-radius: 12px;
    background: #FFFFFF;
    box-shadow: 0 8px 20px rgba(10, 47, 143, .055);
}

.admin-lock-conflict-card {
    padding: .55rem;
}

.admin-conflict-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .7rem .9rem;
}

.admin-conflict-summary div {
    min-width: 0;
}

.admin-conflict-summary span {
    display: block;
    margin-bottom: .15rem;
    color: #6B7C90;
    font-size: .74rem;
    font-weight: 800;
    text-transform: uppercase;
}

.admin-conflict-summary strong {
    display: block;
    color: #2F3746;
    font-size: .94rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.admin-conflict-overview {
    padding: .58rem .7rem;
    border-radius: 10px;
    background: #F4F8FF;
    border-left: 4px solid #1E73E8;
}

.admin-conflict-kicker {
    display: block;
    margin-bottom: .16rem;
    color: #52637A;
    font-size: .68rem;
    font-weight: 850;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.admin-conflict-title {
    display: block;
    color: #1F2937;
    font-size: .92rem;
    line-height: 1.25;
}

.admin-conflict-device {
    display: block;
    margin-top: .12rem;
    color: #52637A;
    font-size: .86rem;
    font-weight: 750;
}

.admin-conflict-overview small {
    display: block;
    margin-top: .25rem;
    color: #6B7C90;
    font-size: .72rem;
    font-weight: 700;
    line-height: 1.35;
}

.admin-conflict-numbers {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .45rem;
    margin: .55rem 0 0;
}

.admin-conflict-numbers div {
    min-width: 0;
    padding: .48rem .55rem;
    border: 1px solid #D7E5FB;
    border-radius: 10px;
    background: #FFFFFF;
}

.admin-conflict-numbers dt {
    margin: 0 0 .18rem;
    color: #6B7C90;
    font-size: .68rem;
    font-weight: 850;
    line-height: 1.2;
    text-transform: uppercase;
}

.admin-conflict-numbers dd {
    margin: 0;
    color: #0A2F8F;
    font-size: 1.08rem;
    font-weight: 900;
    line-height: 1.1;
}

.admin-conflict-details {
    margin-top: .35rem;
}

.admin-conflict-details summary {
    cursor: pointer;
    color: #1558C5;
    font-size: .76rem;
    font-weight: 800;
}

.admin-conflict-details p {
    margin: .25rem 0 0;
    color: #6B7C90;
    font-size: .72rem;
    font-weight: 700;
    line-height: 1.35;
}

.admin-conflict-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: .65rem;
    align-items: start;
}

.admin-conflict-action-form {
    display: grid;
    grid-template-columns: minmax(130px, .34fr) minmax(260px, 1fr);
    gap: .4rem;
    align-items: end;
    margin: 0;
    padding: .5rem;
    border: 1px solid #D7E5FB;
    border-radius: 10px;
    background: #F8FBFF;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

.admin-conflict-lock-form {
    grid-template-columns: 1fr;
}

.admin-conflict-action-form label {
    display: grid;
    gap: .25rem;
    margin: 0;
    color: #52637A;
    font-size: .74rem;
    font-weight: 800;
}

.admin-conflict-action-form label small {
    color: #6B7C90;
    font-size: .72rem;
    font-weight: 650;
    line-height: 1.3;
}

.admin-conflict-action-form input,
.admin-conflict-action-form textarea {
    width: 100%;
    max-width: 100%;
    margin: 0;
    box-sizing: border-box;
}

.admin-conflict-action-form .admin-btn {
    width: 100%;
    justify-content: center;
    grid-column: 1 / -1;
}

.admin-conflict-reason {
    display: grid;
    gap: .35rem;
    grid-column: 1 / -1;
    min-width: 0;
}

.admin-conflict-reason textarea {
    min-height: 74px;
    font-size: .84rem;
    line-height: 1.35;
}

.admin-conflict-reason small {
    display: block;
    margin-top: .05rem;
}

.admin-conflict-bulk-form {
    grid-template-columns: 1fr;
}

.admin-conflict-table {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin: 0;
    table-layout: fixed;
    border-collapse: collapse;
    overflow-wrap: anywhere;
    box-sizing: border-box;
}

.admin-conflict-table th,
.admin-conflict-table td {
    padding: .38rem .45rem;
    border-bottom: 1px solid #E6EEF9;
    text-align: left;
    vertical-align: top;
}

.admin-conflict-table th {
    color: #52637A;
    font-size: .75rem;
    font-weight: 700;
}

.admin-conflict-table td {
    color: #2F3746;
    font-size: .8rem;
    font-weight: 650;
}

.admin-lock-conflict-table th:nth-child(1),
.admin-lock-conflict-table td:nth-child(1) {
    width: 7.2rem;
}

.admin-lock-conflict-table th:nth-child(2),
.admin-lock-conflict-table td:nth-child(2),
.admin-lock-conflict-table th:nth-child(5),
.admin-lock-conflict-table td:nth-child(5) {
    width: 5.2rem;
    text-align: left;
}

.admin-lock-conflict-table th:nth-child(4),
.admin-lock-conflict-table td:nth-child(4) {
    width: auto;
}

/* 5 cols: Datum in ura | Uporabnik | Trenutno | Nova kapaciteta | Nova količina */
.admin-capacity-conflict-table th:nth-child(1),
.admin-capacity-conflict-table td:nth-child(1) {
    width: 6.5rem;
}

.admin-capacity-conflict-table th:nth-child(2),
.admin-capacity-conflict-table td:nth-child(2) {
    width: auto;
}

.admin-capacity-conflict-table th:nth-child(3),
.admin-capacity-conflict-table th:nth-child(4),
.admin-capacity-conflict-table td:nth-child(3),
.admin-capacity-conflict-table td:nth-child(4) {
    width: 6rem;
    text-align: right;
}

.admin-capacity-conflict-table th:nth-child(5),
.admin-capacity-conflict-table td:nth-child(5) {
    width: 7rem;
    text-align: right;
}

.admin-slot-ura {
    color: var(--muted-color, #64748b);
    font-size: .8em;
    font-weight: 600;
}

.admin-qty-warning {
    display: block;
    margin-top: .2rem;
    color: #B91C1C;
    font-size: .72rem;
    font-weight: 700;
    min-height: 1em;
}

html[data-theme="dark"] .admin-qty-warning {
    color: #FCA5A5;
}

.admin-conflict-table input {
    width: 4rem;
    max-width: 100%;
    min-height: 32px;
    padding-inline: .4rem;
    text-align: right;
}

.admin-conflict-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: .55rem;
    flex-wrap: wrap;
    margin-top: .2rem;
}

.admin-conflict-form-actions .admin-btn {
    width: auto;
    grid-column: auto;
}

.admin-conflict-user-list {
    display: grid;
    gap: .55rem;
}

.admin-conflict-device-card {
    padding: .55rem .75rem;
    border-radius: .45rem;
    border: 1px solid #DBEAFE;
    background: #F0F6FF;
    margin-bottom: .65rem;
}

.admin-conflict-device-card strong {
    display: block;
    font-size: .9rem;
    color: #1E3A5F;
    margin-bottom: .18rem;
}

.admin-conflict-device-card span {
    font-size: .78rem;
    color: #52637A;
}

html[data-theme="dark"] .admin-conflict-device-card {
    border-color: #1E3A5F;
    background: #0F1E33;
}

html[data-theme="dark"] .admin-conflict-device-card strong {
    color: #93C5FD;
}

html[data-theme="dark"] .admin-conflict-device-card span {
    color: #94A3B8;
}

.conflict-warning-box {
    padding: .6rem .85rem;
    border-radius: .45rem;
    border: 1px solid #FDE68A;
    background: #FFFBEB;
    margin-bottom: .65rem;
}

.conflict-warning-box strong {
    display: block;
    font-size: .78rem;
    font-weight: 800;
    color: #92400E;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: .2rem;
}

.conflict-warning-box p {
    margin: 0;
    font-size: .85rem;
    color: #78350F;
}

html[data-theme="dark"] .conflict-warning-box {
    border-color: #78350F;
    background: #1C0F00;
}

html[data-theme="dark"] .conflict-warning-box strong {
    color: #FCD34D;
}

html[data-theme="dark"] .conflict-warning-box p {
    color: #FDE68A;
}

.admin-conflict-reason-section {
    padding: .65rem .75rem;
    border-radius: .45rem;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    margin-top: .5rem;
}

html[data-theme="dark"] .admin-conflict-reason-section {
    background: #0F172A;
    border-color: #25364D;
}

.admin-conflict-note {
    margin: -.15rem 0 0;
    color: #52637A;
    font-size: .78rem;
    font-weight: 700;
    line-height: 1.35;
}

.admin-conflict-user-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: .5rem;
    align-items: center;
    padding: .6rem .7rem;
    border: 1px solid #D7E5FB;
    border-radius: 10px;
    background: #FFFFFF;
}

.admin-conflict-user-row > span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .8rem;
    flex-wrap: wrap;
}

.admin-conflict-user-row small {
    color: #6B7C90;
    font-size: .78rem;
    font-weight: 700;
}

.admin-conflict-user-row input {
    min-height: 36px;
}

.admin-conflict-inline-delete {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto;
    gap: .5rem;
    align-items: end;
    margin: 0;
}

.admin-conflict-inline-delete .admin-btn {
    min-height: 36px;
}

.admin-btn:disabled {
    opacity: .48;
    cursor: not-allowed;
    box-shadow: none;
}

.admin-mail-draft-list {
    display: grid;
    gap: .65rem;
}

.admin-mail-draft-card {
    display: grid;
    gap: .55rem;
    padding: .6rem;
    border: 1px solid #D7E5FB;
    border-radius: 12px;
    background: #FFFFFF;
    box-shadow: 0 8px 20px rgba(10, 47, 143, .055);
}

.admin-mail-draft-text {
    display: grid;
    gap: .3rem;
    margin: 0;
    color: #52637A;
    font-size: .76rem;
    font-weight: 800;
}

.admin-mail-draft-text textarea {
    width: 100%;
    min-height: 172px;
    margin: 0;
    resize: vertical;
    font-size: .72rem;
    font-weight: 400;
    line-height: 1.42;
    color: #334155;
    background: #F8FBFF;
}

.admin-mail-draft-preview {
    position: relative;
}

.admin-mail-draft-preview.is-collapsed .admin-mail-draft-text {
    max-height: 5.5rem;
    overflow: hidden;
}

.admin-mail-draft-fade {
    display: none;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3.5rem;
    background: linear-gradient(to bottom, transparent, #F8FBFF);
    cursor: pointer;
    border-radius: 0 0 .3rem .3rem;
}

.admin-mail-draft-preview.is-collapsed .admin-mail-draft-fade {
    display: block;
}

.admin-form-grid input::placeholder,
.blocked-form-grid input::placeholder,
.admin-form-grid textarea::placeholder,
.blocked-form-grid textarea::placeholder {
    color: #9AA8B8;
    opacity: 1;
}

.admin-form-grid input[type="date"],
.blocked-form-grid input[type="date"] {
    background: #F8FAFD;
    color: #334155;
    appearance: auto !important;
    -webkit-appearance: auto !important;
    background-image: none !important;
    padding-right: .75rem !important;
}

.admin-form-grid input[type="date"]:invalid,
.blocked-form-grid input[type="date"]:invalid {
    color: #8A98AA;
}

html[data-theme="dark"] .admin-section-card,
html[data-theme="dark"] .admin-card {
    border-color: #25364D;
    background: linear-gradient(180deg, #111827, #162033);
    box-shadow: none;
}

html[data-theme="dark"] .admin-collapsible-section > summary::after {
    border-color: #CBD5E1;
}

html[data-theme="dark"] .admin-section-card .section-description,
html[data-theme="dark"] .admin-card .section-description {
    border-left-color: #60A5FA;
    background: #0F172A;
    color: #CBD5E1;
}

html[data-theme="dark"] .admin-form-grid label,
html[data-theme="dark"] .blocked-form-grid label {
    color: #CBD5E1;
}

html[data-theme="dark"] .capacity-preview {
    color: #CBD5E1;
}

html[data-theme="dark"] .admin-alert {
    border-color: #25364D;
    background: #111827;
    color: #E5E7EB;
}

html[data-theme="dark"] .admin-alert-error {
    border-color: rgba(201, 120, 120, .46);
    background: rgba(201, 120, 120, .14);
    color: #F1C7C7;
}

html[data-theme="dark"] .admin-alert-error .admin-alert-icon {
    background: #9D4B4B;
}

html[data-theme="dark"] .admin-conflict-action-form {
    border-color: #25364D;
    background: #111827;
}

html[data-theme="dark"] .admin-conflict-card {
    border-color: #25364D;
    background: #162033;
    box-shadow: none;
}

html[data-theme="dark"] .admin-mail-draft-card {
    border-color: #25364D;
    background: #162033;
    box-shadow: none;
}

html[data-theme="dark"] .admin-conflict-user-row {
    border-color: #25364D;
    background: #0F172A;
}

html[data-theme="dark"] .admin-conflict-note {
    color: #CBD5E1;
}

html[data-theme="dark"] .admin-conflict-step {
    color: #CBD5E1;
}

html[data-theme="dark"] .admin-conflict-summary span {
    color: #94A3B8;
}

html[data-theme="dark"] .admin-conflict-summary strong {
    color: #E5E7EB;
}

html[data-theme="dark"] .admin-conflict-overview {
    border-left-color: #60A5FA;
    background: #0F172A;
}

html[data-theme="dark"] .admin-conflict-title {
    color: #E5E7EB;
}

html[data-theme="dark"] .admin-conflict-kicker,
html[data-theme="dark"] .admin-conflict-device,
html[data-theme="dark"] .admin-conflict-overview small {
    color: #94A3B8;
}

html[data-theme="dark"] .admin-conflict-numbers div {
    border-color: #25364D;
    background: #162033;
}

html[data-theme="dark"] .admin-conflict-numbers dt {
    color: #94A3B8;
}

html[data-theme="dark"] .admin-conflict-numbers dd {
    color: #93C5FD;
}

html[data-theme="dark"] .admin-conflict-details summary {
    color: #93C5FD;
}

html[data-theme="dark"] .admin-conflict-details p {
    color: #94A3B8;
}

html[data-theme="dark"] .admin-conflict-table th,
html[data-theme="dark"] .admin-conflict-table td {
    border-bottom-color: #25364D;
}

html[data-theme="dark"] .admin-conflict-table th {
    color: #94A3B8;
}

html[data-theme="dark"] .admin-conflict-table td {
    color: #E5E7EB;
}

html[data-theme="dark"] .admin-conflict-action-form label {
    color: #CBD5E1;
}

html[data-theme="dark"] .admin-conflict-action-form label small {
    color: #94A3B8;
}

html[data-theme="dark"] .admin-mail-draft-text {
    color: #CBD5E1;
}

html[data-theme="dark"] .admin-mail-draft-text textarea {
    color: #E5E7EB;
    background: #0F172A;
    border-color: #25364D;
}

html[data-theme="dark"] .admin-mail-draft-fade {
    background: linear-gradient(to bottom, transparent, #162033);
}

html[data-theme="dark"] .admin-form-grid input::placeholder,
html[data-theme="dark"] .blocked-form-grid input::placeholder,
html[data-theme="dark"] .admin-form-grid textarea::placeholder,
html[data-theme="dark"] .blocked-form-grid textarea::placeholder {
    color: #7F8EA3;
}

html[data-theme="dark"] .admin-form-grid input[type="date"],
html[data-theme="dark"] .blocked-form-grid input[type="date"] {
    background: #0F172A;
    color: #E5E7EB;
}

html[data-theme="dark"] .admin-form-grid input[type="date"]:invalid,
html[data-theme="dark"] .blocked-form-grid input[type="date"]:invalid {
    color: #94A3B8;
}

@media (max-width: 1100px) {
    .admin-form-grid-lock,
    .admin-form-grid-capacity {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }
}

@media (max-width: 820px) {
    .mobile-only {
        display: block;
        margin-bottom: .75rem;
    }

    .schedule-grid {
        font-size: .9rem;
    }

    .schedule-grid th {
        top: 0;
        z-index: 2;
        font-size: .85rem;
    }

    .schedule-grid td.schedule-slot { min-width: auto; }

    .admin-conflict-summary,
    .admin-conflict-numbers,
    .admin-conflict-actions,
    .admin-conflict-action-form,
    .admin-conflict-inline-delete {
        grid-template-columns: 1fr;
    }

    .admin-conflict-reason {
        grid-column: 1 / -1;
    }

    .admin-conflict-table,
    .admin-conflict-table thead,
    .admin-conflict-table tbody,
    .admin-conflict-table tr,
    .admin-conflict-table th,
    .admin-conflict-table td {
        display: block;
        width: 100% !important;
    }

    .admin-conflict-table thead {
        display: none;
    }

    .admin-conflict-table tr {
        padding: .55rem 0;
        border-bottom: 1px solid #E6EEF9;
    }

    .admin-conflict-table td {
        display: flex;
        justify-content: space-between;
        gap: .75rem;
        padding: .22rem 0;
        border-bottom: 0;
        text-align: right !important;
    }

    .admin-conflict-table td::before {
        content: attr(data-label);
        color: #6B7C90;
        font-size: .72rem;
        font-weight: 850;
        text-align: left;
        text-transform: uppercase;
    }

    .admin-conflict-table input {
        width: 6rem;
    }

    html[data-theme="dark"] .admin-conflict-table tr {
        border-bottom-color: #25364D;
    }

    html[data-theme="dark"] .admin-conflict-table td::before {
        color: #94A3B8;
    }
}

.holiday-cell,
.blocked-cell {
    word-break: break-word;
    overflow-wrap: anywhere;
}

.holiday-cell div,
.blocked-cell div {
    max-width: 100%;
    font-size: .8rem;
    line-height: 1.15;
}

.schedule-grid {
    table-layout: fixed !important;
    width: 100%;
}

.lesson-col {
    width: 72px !important;
}


.lesson-desktop {
    display: block;
}

.lesson-label {
    width: 95px;   /* prej je verjetno okoli 70px */
    min-width: 95px;
}

.lesson-time {
    display: block;
    margin-top: 2px;
    font-size: 0.75rem;
    font-weight: 400 !important;
    line-height: 1.15;
    color: var(--text-secondary);
}

html[data-theme="dark"] .lesson-time {
    color: rgba(255, 255, 255, .8);
}

/* Weekly schedule — named break rows */
.ws-break-row td {
    padding: 0 !important;
    height: 20px;
}
.ws-break-first-cell {
    font-size: .57rem;
    font-style: italic;
    font-weight: 500;
    color: #6B7280;
    text-align: center;
    vertical-align: middle;
    padding: 0 4px !important;
    white-space: nowrap;
    background: #f0f4ff;
}
.ws-break-day-cell {
    background: #f0f4ff;
}
html[data-theme="dark"] .ws-break-first-cell {
    background: rgba(99, 102, 241, .10);
    color: rgba(200, 210, 255, .75);
}
html[data-theme="dark"] .ws-break-day-cell {
    background: rgba(99, 102, 241, .07);
}

.schedule-grid th:not(:first-child),
.schedule-grid td.schedule-slot {
    width: calc((100% - 72px) / 5) !important;
    max-width: calc((100% - 72px) / 5) !important;
}

.hidden-info {
    visibility: hidden;
}

.holiday-cell,
.blocked-cell {
    width: auto !important;
    max-width: none !important;
}

.holiday-cell div,
.blocked-cell div {
    max-width: 100%;
    white-space: normal !important;
    overflow-wrap: break-word !important;
    word-break: normal !important;
    font-size: .78rem;
    line-height: 1.15;
}

.holiday-cell {
    background: #F1EBF9 !important;
    border-color: #C4A8DE !important;
}

.blocked-cell {
    background: #F2F4F7 !important;
    border-color: #C4CDD8 !important;
}

.holiday-cell .holiday-note {
    text-align: center;
    color: #5A2D82;
    font-weight: 600;
    padding: .25rem;
    font-size: .68rem;
    line-height: 1.05;
}

.blocked-cell .holiday-note {
    text-align: center;
    color: #5C697A;
    font-weight: 600;
    padding: .25rem;
    font-size: .68rem;
    line-height: 1.05;
}

html[data-theme="dark"] .holiday-cell {
    background: rgba(146, 101, 200, .14) !important;
    border-color: rgba(196, 168, 222, .28) !important;
}

html[data-theme="dark"] .holiday-cell .holiday-note {
    color: #D4BAEE !important;
}

html[data-theme="dark"] .blocked-cell {
    background: rgba(100, 116, 139, .14) !important;
    border-color: rgba(148, 163, 184, .28) !important;
}

html[data-theme="dark"] .blocked-cell .holiday-note {
    color: #94A3B8 !important;
}

.holiday-note small {
    font-size: .62rem;
    line-height: 1;
}

.holiday-icon {
    display: block;
    margin: 0 auto .3rem;
    width: 26px;
    height: 26px;
    flex-shrink: 0;
}

.holiday-note {
    font-size: .68rem;
}

.holiday-note strong {
    display: block;
    margin-bottom: .15rem;
}

.schedule-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.schedule-title-row h3 {
    margin: 0;
}

.week-jump {
    display: flex;
    align-items: center;
    margin: 0;
}

.week-jump input[type="date"] {
    width: 180px;
    min-height: 38px;
    padding: .25rem .45rem;
    font-size: .95rem;
}


.date-picker-wrapper {
    position: relative;
    display: inline-block;
}

.date-picker-btn {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .3rem .65rem;
    border-radius: .7rem;
    font-size: .82rem;
    font-weight: 500;
    cursor: pointer;
}

.date-picker-wrapper input[type="date"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

input[type="date"] {
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: .35rem .65rem;
    font-weight: 500;
}

input[type="date"]:focus {
    border-color: var(--school-blue);
    box-shadow: 0 0 0 3px rgba(4, 90, 136, .18);
}

input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: .75;
}

.past-slot {
    opacity: .45;
    cursor: not-allowed !important;
    filter: grayscale(.4);
}

.past-admin-row {
    opacity: .5;
}

.past-admin-row td {
    background: #f8fafc !important;
}

html[data-theme="dark"] .past-admin-row td {
    background: rgba(148, 163, 184, .08) !important;
}

.footer-card p,
.footer-card a,
.footer-links a,
.footer-note {
    font-size: 0.82rem !important;
}

.footer-card h4 {
    font-size: 0.9rem !important;
}

.footer-bottom small {
    font-size: 0.75rem !important;
}

.empty-state {
    padding: 1rem;
    text-align: center;
    font-style: italic;
    opacity: 0.8;
}


/* ---------- Statistics dashboard final ---------- */

.stats-filter-compact,
form.stats-filter.stats-filter-compact {
    display: flex !important;
    align-items: flex-end !important;
    gap: .65rem !important;
    flex-wrap: wrap !important;
    margin: .5rem 0 1rem !important;
    padding: .75rem !important;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 14px;
    background: var(--bg-secondary, #fff);
}

.stats-filter-compact .filter-field,
form.stats-filter.stats-filter-compact .filter-field {
    flex: 0 0 220px !important;
    width: 220px !important;
    max-width: 220px !important;
}

.stats-filter-compact label {
    display: block;
    margin-bottom: .2rem !important;
    font-size: .82rem !important;
    font-weight: 700;
    color: var(--text-muted, #64748b);
}

.stats-filter-compact select,
form.stats-filter.stats-filter-compact .filter-field select {
    width: 220px !important;
    max-width: 220px !important;
    min-height: 36px !important;
    margin: 0 !important;
    padding: .25rem .55rem !important;
    font-size: .9rem !important;
}

.stats-actions {
    display: flex;
    gap: .6rem;
    flex-wrap: wrap;
    margin: 0 0 1rem;
}

.stats-summary-row {
    margin-bottom: 1rem;
}

.stat-summary-card {
    max-width: 260px;
    padding: 1rem 1.4rem !important;
    background: linear-gradient(135deg, #0A2F8F 0%, #1E73E8 100%) !important;
    border: none !important;
    box-shadow: 0 8px 24px rgba(10, 47, 143, .22) !important;
}

.stat-summary-card .stat-title {
    color: rgba(255,255,255,.75) !important;
    font-size: .8rem !important;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.stat-summary-card .stat-number {
    font-size: 2.4rem !important;
    line-height: 1;
    color: #fff !important;
}

.stats-filter-field {
    display: flex;
    flex-direction: column;
    gap: .2rem;
}

.stats-filter-field label {
    font-size: .78rem;
    font-weight: 700;
    color: #52637A;
    margin: 0;
}

.stat-summary-inline {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .1rem;
    line-height: 1.1;
}

.stat-summary-label {
    font-size: .72rem;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.stat-summary-number {
    font-size: 1.6rem;
    font-weight: 800;
    color: #0A2F8F;
    line-height: 1;
}

.stats-dashboard {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
}

.stats-section-card,
.stats-pie-card {
    min-width: 0;
    background: var(--bg-secondary, #fff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 16px;
    padding: .9rem;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .07);
}

.stats-section-card h3,
.stats-pie-card h3 {
    margin: 0 0 .65rem !important;
    font-size: 1rem !important;
    line-height: 1.2;
}

.stats-section-wide {
    grid-column: span 2;
}

.stat-bar-row.compact,
.stats-section-card .stat-bar-row {
    display: grid;
    grid-template-columns: minmax(88px, 1.2fr) minmax(70px, 1fr) auto !important;
    gap: .45rem !important;
    align-items: center !important;
    margin-bottom: .38rem !important;
}

.stats-section-card .stat-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .86rem !important;
    font-weight: 600;
}

/* ===== SVG statistični diagrami ===== */

.pie-wrap{
    display:flex;
    align-items:center;
    gap:2rem;
    flex-wrap:wrap;
}

.donut-chart{
    width: 180px;
    height: 180px;
    transform: rotate(-90deg);
    overflow: visible;
    flex-shrink: 0;
}

.donut-segment {
    transition: opacity .2s ease, stroke-width .2s ease;
    cursor: pointer;
}

.donut-hole {
    fill: var(--bg-secondary, #ffffff);
}

.donut-center-number {
    font-size: 7px;
    font-weight: 800;
    fill: #0f172a;
    text-anchor: middle;
    dominant-baseline: middle;
    transform: rotate(90deg);
    transform-origin: 21px 21px;
}

.donut-center-label {
    font-size: 3.2px;
    font-weight: 600;
    fill: #64748b;
    text-anchor: middle;
    dominant-baseline: middle;
    transform: rotate(90deg);
    transform-origin: 21px 21px;
}

.pie-legend {
    display: flex;
    flex-direction: column;
    gap: .45rem;
    min-width: 0;
}

.pie-legend-row {
    display: grid;
    grid-template-columns: 10px 1fr auto auto;
    align-items: center;
    gap: .5rem;
    font-size: .83rem;
    cursor: default;
    transition: opacity .2s ease;
    border-radius: 4px;
    padding: .1rem .2rem;
}

.pie-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pie-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #334155;
}

.pie-legend-pct {
    font-weight: 700;
    color: #0f172a;
    font-size: .8rem;
    white-space: nowrap;
}

.pie-legend-count {
    color: #94a3b8;
    font-size: .75rem;
    white-space: nowrap;
    min-width: 1.8rem;
    text-align: right;
}

/* ----- linijski diagram ----- */

.line-chart{
    width:100%;
    height:auto;
}

.line-axis{
    stroke:#cbd5e1;
    stroke-width:1;
}

.line-area {
    fill: url(#lineAreaGrad);
}

.line-polyline{
    fill: none;
    stroke: #1E73E8;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.line-point{
    fill: #fff;
    stroke: #1E73E8;
    stroke-width: 1.5;
}

.line-value{
    font-size: 10px;
    fill: #475569;
    font-weight: 600;
}

.line-labels{
    display:flex;
    justify-content:space-between;
    margin-top:.5rem;
    font-size:.9rem;
}


.flash-message {
    margin: 1rem 0;
    padding: .9rem 1rem;
    border-radius: 12px;
    background: #ecfdf5;
    border: 1px solid #bbf7d0;
    color: #14532d;
    font-weight: 600;
    line-height: 1.45;
}

html[data-theme="dark"] .flash-message {
    background: rgba(34, 197, 94, .14);
    border-color: rgba(34, 197, 94, .35);
    color: #dcfce7;
}

.flash-warning {
    margin: 1rem 0;
    padding: .9rem 1rem;
    border-radius: 12px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #78350f;
    font-weight: 600;
    line-height: 1.45;
}

html[data-theme="dark"] .flash-warning {
    background: rgba(234, 179, 8, .14);
    border-color: rgba(234, 179, 8, .35);
    color: #fef08a;
}

.qty-hint-warning {
    color: #92400e !important;
    font-weight: 600;
}

html[data-theme="dark"] .qty-hint-warning {
    color: #fcd34d !important;
}

/* ---------- Cookies notice ---------- */
.cookies-page {
    max-width: 980px;
    margin: 1.5rem auto 2rem;
    padding: 1.2rem;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 14px;
    background: var(--bg-secondary, #fff);
    box-shadow: 0 6px 22px rgba(15, 23, 42, .08);
}

.cookies-page h3 {
    margin-top: 0;
}

.cookies-page h4 {
    margin-top: 1.4rem;
}

.cookies-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
}

.cookies-table {
    margin: 0;
    min-width: 720px;
}

.cookies-table th,
.cookies-table td {
    padding: .75rem .9rem;
    vertical-align: top;
}

.cookies-table th {
    font-size: .86rem;
    color: var(--text-muted, #64748b);
}

.cookies-note {
    margin-top: 1rem;
    color: var(--text-muted, #64748b);
}

.cookie-banner {
    position: fixed;
    left: 50%;
    right: auto;
    bottom: 1rem;
    z-index: 1000;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: .7rem;
    width: min(760px, calc(100vw - 2rem));
    padding: .65rem .75rem;
    border: 1px solid rgba(4, 90, 136, .18);
    border-radius: 14px;
    background: #f0f8ff;
    box-shadow: 0 10px 28px rgba(4, 90, 136, .16);
    transform: translateX(-50%);
}

.cookie-banner[hidden] {
    display: none;
}

.cookie-banner p {
    margin: 0;
    color: #334155;
    font-size: .9rem;
    line-height: 1.35;
}

.cookie-banner a {
    color: var(--school-blue);
    font-weight: 700;
}

.cookie-banner-button {
    margin: 0;
    padding: .38rem .75rem;
    border: 1px solid rgba(4, 90, 136, .2);
    border-radius: 999px;
    background: #fff;
    color: var(--school-blue);
    box-shadow: none;
    font-size: .82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .02em;
}

.cookie-banner-button:hover {
    background: var(--school-blue);
    color: #fff;
}

.cookie-banner-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 31% 33%, #fff 0 3px, transparent 3.5px),
        radial-gradient(circle at 62% 28%, #fff 0 2.5px, transparent 3px),
        radial-gradient(circle at 55% 62%, #fff 0 3px, transparent 3.5px),
        radial-gradient(circle at 29% 67%, #fff 0 2px, transparent 2.5px),
        var(--school-blue);
}

html[data-theme="dark"] .cookies-page,
html[data-theme="dark"] .cookie-banner {
    background: #102a43;
    border-color: rgba(147, 197, 253, .25);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .28);
}

html[data-theme="dark"] .cookie-banner p,
html[data-theme="dark"] .cookie-banner-button {
    color: #e5e7eb;
}

html[data-theme="dark"] .cookie-banner a {
    color: #93c5fd;
}

html[data-theme="dark"] .cookie-banner-button {
    background: #1e293b;
    border-color: rgba(147, 197, 253, .28);
}

html[data-theme="dark"] .cookie-banner-button:hover {
    background: #93c5fd;
    color: #102a43;
}

/* ---------- User guide ---------- */
.user-guide-page {
    max-width: 1180px;
    margin: 1.5rem auto 2rem;
}

.guide-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.5rem 1.8rem;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 20px;
    background: var(--bg-secondary, #fff);
    box-shadow: 0 4px 24px rgba(15, 23, 42, .07);
    position: relative;
    overflow: hidden;
}

.guide-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 20px 20px 0 0;
    background: linear-gradient(90deg, #0A2F8F 0%, #1558C5 50%, #1E73E8 100%);
}

.guide-hero-content {
    flex: 1;
    min-width: 0;
}

.guide-hero-aside {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
    flex-shrink: 0;
}

.guide-kicker {
    margin: 0 0 .25rem !important;
    color: var(--school-blue);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-size: .72rem !important;
}

.guide-hero h3 {
    margin: 0 0 .3rem;
    font-size: 1.5rem;
}

.guide-hero p {
    margin: 0;
    color: var(--text-muted, #64748b);
    max-width: 42ch;
    line-height: 1.45;
    font-size: .9rem;
}

.guide-logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
    border-radius: 18px;
}

.guide-back-btn {
    white-space: nowrap;
    font-size: .82rem !important;
}

.guide-workflow {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .3rem;
    margin-top: 1rem;
}

.guide-wf-chip {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .26rem .6rem;
    border-radius: 999px;
    border: 1.5px solid #c9d9f8;
    background: #f4f8ff;
    color: #1558C5;
    font-size: .76rem;
    font-weight: 700;
    white-space: nowrap;
}

.guide-wf-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 50%;
    background: #1558C5;
    color: #fff;
    font-size: .6rem;
    font-weight: 900;
    flex-shrink: 0;
}

.guide-wf-arr {
    color: #c9d9f8;
    font-size: .8rem;
    line-height: 1;
}

.guide-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.1rem;
    margin-top: 1.1rem;
}

.guide-step {
    display: grid;
    grid-template-columns: minmax(260px, 1.1fr) minmax(0, 1.2fr);
    gap: 1.2rem;
    align-items: start;
    padding: 1.2rem;
    border: 1px solid var(--border-color, #e2e8f0);
    border-top: 3px solid var(--school-blue, #1558C5);
    border-radius: 16px;
    background: var(--bg-secondary, #fff);
    box-shadow: 0 2px 12px rgba(15, 23, 42, .05);
    transition: box-shadow .18s ease, transform .18s ease;
    position: relative;
}

.guide-step:hover {
    box-shadow: 0 6px 24px rgba(15, 23, 42, .1);
    transform: translateY(-2px);
}

.guide-step-wide {
    grid-template-columns: minmax(0, 2.2fr) minmax(240px, .7fr);
}

.guide-step h4 {
    display: flex;
    align-items: center;
    gap: .45rem;
    margin: 0 0 .5rem;
    font-size: .98rem;
    font-weight: 800;
    color: var(--text-color, #0f172a);
    line-height: 1.2;
}

.g-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.65rem;
    height: 1.65rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #1558C5, #0A2F8F);
    color: #fff;
    font-size: .75rem;
    font-weight: 900;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(21, 88, 197, .28);
    line-height: 1;
}

.guide-step p {
    margin: .28rem 0;
    color: var(--text-muted, #64748b);
    line-height: 1.5;
    font-size: .88rem;
}

.guide-note {
    padding: .5rem .65rem .5rem .9rem;
    border-radius: 10px;
    background: rgba(21, 88, 197, .05);
    border: 1px solid rgba(21, 88, 197, .12);
    border-left: 3px solid #1558C5;
    color: #1e3a8a;
    font-size: .82rem;
    margin-top: .45rem;
    line-height: 1.5;
    overflow-wrap: break-word;
    word-break: break-word;
}

.guide-step-text {
    min-width: 0;
    overflow-wrap: break-word;
}

.guide-visual {
    min-height: 230px;
    padding: .9rem;
    border: 1px solid rgba(15, 23, 42, .09);
    border-radius: 14px;
    background: #f9fafb;
    color: #334155;
    box-shadow: inset 0 1px 4px rgba(15, 23, 42, .04);
}

.guide-login-card,
.guide-modal-card {
    max-width: 260px;
    margin: 0 auto;
}

.guide-window-bar {
    width: 70%;
    height: 14px;
    margin-bottom: .75rem;
    border-radius: 999px;
    background: #dbeafe;
}

.guide-field,
.guide-select,
.guide-search,
.guide-row,
.guide-small-field {
    padding: .45rem .55rem;
    margin-bottom: .45rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    font-size: .86rem;
}

.guide-pin {
    letter-spacing: .18em;
}

.guide-button {
    display: inline-flex;
    justify-content: center;
    min-width: 120px;
    padding: .42rem .65rem;
    border-radius: 10px;
    background: #dbeafe;
    color: var(--school-blue);
    font-weight: 800;
}

.guide-button.danger {
    background: #fee2e2;
    color: #991b1b;
}

.guide-calendar-button {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: .45rem .7rem;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    background: #fff;
    font-weight: 800;
}

.guide-schedule-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .7rem;
}

.guide-schedule-title-row strong {
    color: #334155;
    font-size: .9rem;
}

.guide-week-nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: .5rem;
    align-items: center;
    margin-bottom: .7rem;
    color: var(--school-blue);
    font-size: .82rem;
}

.guide-week-nav strong {
    justify-self: center;
    text-decoration: underline;
}

.guide-week-nav span:last-child {
    justify-self: end;
}

.guide-week-preview {
    display: grid;
    grid-template-columns: 72px repeat(5, minmax(70px, 1fr));
    gap: .25rem;
    min-width: 0;
}

.guide-day-head {
    padding: .52rem .3rem;
    border-radius: 10px;
    background: var(--school-blue);
    color: #fff;
    font-weight: 800;
    text-align: center;
    font-size: .82rem;
}

.guide-time-cell {
    padding: .45rem .3rem;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #fff;
    color: #334155;
    font-weight: 800;
    text-align: center;
    font-size: .78rem;
    line-height: 1.2;
}

.guide-time-cell small {
    color: #64748b;
    font-weight: 500;
}

.guide-mini-slot,
.guide-device-card {
    min-height: 52px;
    padding: .38rem;
    border-radius: 9px;
    text-align: center;
    font-weight: 800;
    line-height: 1.12;
    font-size: .8rem;
}

.guide-mini-slot.is-free,
.guide-device-card.is-free {
    border: 1px solid #86efac;
    border-left: 5px solid var(--success);
    background: #f0fdf4;
    color: #166534;
}

.guide-mini-slot.is-partial,
.guide-device-card.is-partial {
    border: 1px solid #facc15;
    border-left: 5px solid var(--warning);
    background: #fffbeb;
    color: #854d0e;
}

.guide-mini-slot.is-full,
.guide-device-card.is-full {
    border: 1px solid #fecaca;
    border-left: 5px solid var(--danger);
    background: #fef2f2;
    color: #991b1b;
}

.guide-calendar-button::before {
    content: "";
    width: 20px;
    height: 20px;
    margin-right: .45rem;
    border-radius: 5px;
    background: linear-gradient(#60a5fa 0 35%, #e0e7ff 35% 100%);
}

.guide-week-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: .3rem;
    margin-top: 1.1rem;
}

.guide-week-row span {
    padding: .45rem .2rem;
    border-radius: 8px;
    background: var(--school-blue);
    color: #fff;
    font-weight: 800;
    text-align: center;
}

.guide-checkline {
    margin-bottom: .35rem;
    font-weight: 700;
}

.guide-filter-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .65rem;
    padding: .85rem;
    border: 1px solid #dbe3ee;
    border-radius: 14px;
    background: #f8fafc;
}

.guide-filter-card span {
    color: #64748b;
    font-size: .75rem;
    font-weight: 800;
}

.guide-filter-checks {
    display: grid;
    gap: .35rem;
}

.guide-checkbox {
    position: relative;
    padding-left: 1.6rem;
    font-size: .82rem;
    font-weight: 800;
    color: #64748b;
}

.guide-checkbox::before {
    content: "";
    position: absolute;
    left: 0;
    top: .04rem;
    width: 1.05rem;
    height: 1.05rem;
    border: 2px solid #cbd5e1;
    border-radius: 5px;
    background: #fff;
}

.guide-checkbox.is-checked::before {
    border-color: var(--school-blue);
    background: var(--school-blue);
    box-shadow: inset 0 0 0 3px #fff;
}

.guide-filter-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: .35rem;
}

.guide-filter-legend span {
    padding: .18rem .45rem;
    border-radius: 999px;
    font-size: .76rem;
}

.legend-free {
    border-left: 5px solid var(--success);
    background: #f0fdf4;
    color: #166534 !important;
}

.legend-partial {
    border-left: 5px solid var(--warning);
    background: #fffbeb;
    color: #854d0e !important;
}

.legend-full {
    border-left: 5px solid var(--danger);
    background: #fef2f2;
    color: #991b1b !important;
}

.legend-blocked {
    border-left: 5px solid #94a3b8;
    background: #f8fafc;
    color: #64748b !important;
}

.guide-device-card.is-blocked,
.guide-mini-slot.is-blocked {
    border: 1px solid #e2e8f0;
    border-left: 5px solid #94a3b8;
    background: #f8fafc;
    color: #64748b;
}

.guide-filter-pills {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}

.guide-filter-pill {
    padding: .28rem .65rem;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #fff;
    font-size: .78rem;
    font-weight: 700;
    color: #334155;
    white-space: nowrap;
}

.guide-slot {
    padding: .45rem;
    margin-bottom: .45rem;
    border-radius: 9px;
    text-align: center;
    font-weight: 700;
}

.guide-slot.is-free {
    border: 1px solid #86efac;
    background: #f0fdf4;
    color: #166534;
}

.guide-slot.is-partial {
    border: 1px solid #facc15;
    background: #fffbeb;
    color: #854d0e;
}

.guide-slot.is-full {
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.guide-slot-visual {
    display: grid;
    align-content: center;
    gap: .45rem;
}

.guide-modal-title {
    margin-bottom: .6rem;
    font-weight: 900;
    font-size: 1.05rem;
}

.guide-status-pill {
    display: inline-flex;
    margin-bottom: .55rem;
    padding: .2rem .55rem;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-weight: 900;
}

.guide-status-line {
    margin-bottom: .4rem;
    font-weight: 700;
}

.guide-modal-muted {
    margin-bottom: .6rem;
    color: #64748b;
    font-size: .84rem;
}

.guide-result {
    padding: .5rem .6rem;
    margin-bottom: .45rem;
    border-radius: 10px;
    font-weight: 900;
}

.guide-result.ok {
    background: #dcfce7;
    color: #166534;
}

.guide-result.warn {
    background: #fef3c7;
    color: #92400e;
}

.guide-result.fail {
    background: #fee2e2;
    color: #991b1b;
}

.guide-tabs {
    display: flex;
    gap: .45rem;
    margin-bottom: .6rem;
}

.guide-tabs span,
.guide-tabs strong {
    padding: .35rem .55rem;
    border-radius: 999px;
    background: #e2e8f0;
}

.guide-tabs strong {
    background: var(--school-blue);
    color: #fff;
}

.guide-cancel {
    float: right;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    background: #ef4444;
    color: #fff;
    font-weight: 900;
}

.guide-confirm {
    margin: .65rem 0;
    color: #64748b;
    font-weight: 700;
}

.guide-actions {
    display: flex;
    justify-content: flex-end;
    gap: .65rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.guide-tip-bar {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-top: 1.1rem;
    padding: .9rem 1.2rem;
    border-radius: 14px;
    background: linear-gradient(90deg, #f4f8ff, #eef4ff);
    border: 1px solid #c9d9f8;
    color: #1e3a8a;
    font-size: .88rem;
    font-weight: 600;
}

.guide-tip-bar-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

html[data-theme="dark"] .guide-hero,
html[data-theme="dark"] .guide-step {
    background: #111827;
    border-color: #334155;
}

html[data-theme="dark"] .guide-step {
    border-top-color: #2563eb;
}

html[data-theme="dark"] .guide-hero h3 { color: #f8fafc; }
html[data-theme="dark"] .guide-step h4 { color: #f8fafc; }

html[data-theme="dark"] .guide-note {
    background: rgba(37, 99, 235, .12);
    border-color: rgba(96, 165, 250, .2);
    border-left-color: #3b82f6;
    color: #93c5fd;
}

html[data-theme="dark"] .guide-wf-chip {
    background: #1e293b;
    border-color: #334155;
    color: #93c5fd;
}

html[data-theme="dark"] .guide-wf-arr { color: #334155; }

html[data-theme="dark"] .guide-tip-bar {
    background: linear-gradient(90deg, #1e293b, #172334);
    border-color: #334155;
    color: #93c5fd;
}

html[data-theme="dark"] .guide-visual {
    background: #0f172a;
    border-color: #334155;
    color: #e5e7eb;
    box-shadow: none;
}

html[data-theme="dark"] .guide-field,
html[data-theme="dark"] .guide-select,
html[data-theme="dark"] .guide-search,
html[data-theme="dark"] .guide-row,
html[data-theme="dark"] .guide-small-field,
html[data-theme="dark"] .guide-calendar-button,
html[data-theme="dark"] .guide-time-cell,
html[data-theme="dark"] .guide-filter-card {
    background: #1e293b;
    border-color: #334155;
    color: #e5e7eb;
}

html[data-theme="dark"] .guide-schedule-title-row strong,
html[data-theme="dark"] .guide-time-cell small,
html[data-theme="dark"] .guide-modal-muted {
    color: #cbd5e1;
}

html[data-theme="dark"] .guide-filter-pill {
    background: #1e293b;
    border-color: #334155;
    color: #e5e7eb;
}

/* ---------- Guide: Realistic visual components (grv-) ---------- */

.grv-app-bar {
    display: flex; align-items: center; justify-content: space-between;
    padding: .38rem .6rem;
    margin: -.85rem -.85rem .75rem;
    border-radius: 13px 13px 0 0;
    background: linear-gradient(135deg, #0A2F8F 0%, #1558C5 60%, #0A2F8F 100%);
    color: #fff; font-weight: 800; font-size: .82rem;
}
.grv-app-bar-n { font-weight: 900; font-size: 1rem; }
.grv-theme-pill-preview { width: 30px; height: 16px; border-radius: 999px; background: rgba(255,255,255,.22); }

.grv-login-wrap {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
    padding: .85rem; max-width: 230px; margin: 0 auto;
    box-shadow: 0 4px 18px rgba(15,23,42,.12);
}
.grv-login-title { font-weight: 800; font-size: .95rem; color: #0f172a; margin-bottom: .08rem; }
.grv-login-sub { font-size: .72rem; color: #64748b; margin-bottom: .65rem; }
.grv-field-label { font-size: .72rem; font-weight: 700; color: #374151; margin-bottom: .18rem; display: block; }
.grv-field-input {
    height: 32px; width: 100%; border: 1.5px solid #cbd5e1; border-radius: 7px;
    background: #fff; margin-bottom: .45rem; display: flex; align-items: center;
    padding: 0 .5rem; font-size: .82rem; color: #94a3b8; letter-spacing: .15em; box-sizing: border-box;
}
.grv-primary-btn {
    display: flex; justify-content: center; align-items: center;
    height: 36px; width: 100%; border-radius: 8px;
    background: linear-gradient(135deg, #1558C5, #0A2F8F); color: #fff;
    font-weight: 800; font-size: .88rem; margin-top: .15rem;
}
.grv-danger-btn {
    display: flex; justify-content: center; align-items: center;
    height: 34px; width: 100%; border-radius: 7px;
    background: #9D4B4B; color: #fff; font-weight: 800; font-size: .85rem;
}

.grv-sched-title-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: .55rem; gap: .5rem; }
.grv-sched-week-label { font-weight: 800; font-size: .88rem; color: #1e293b; }
.grv-sched-week-label span { color: #1558C5; border-left: 3px solid #1558C5; padding-left: .4rem; margin-right: .3rem; }
.grv-date-btn {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .28rem .65rem; border-radius: 8px;
    background: linear-gradient(135deg, #1558C5, #0A2F8F);
    color: #fff; font-size: .76rem; font-weight: 700; white-space: nowrap;
}
.grv-week-nav { display: grid; grid-template-columns: 1fr auto 1fr; gap: .4rem; align-items: center; margin-bottom: .6rem; font-size: .8rem; color: #1558C5; }
.grv-week-nav-mid { text-align: center; font-weight: 700; text-decoration: underline; }
.grv-week-nav-right { text-align: right; }

.grv-table { display: grid; grid-template-columns: 62px repeat(3, 1fr); gap: .22rem; }
.grv-th { padding: .42rem .25rem; border-radius: 7px; background: linear-gradient(135deg, #0A2F8F 0%, #1558C5 100%); color: #fff; font-weight: 700; text-align: center; font-size: .76rem; line-height: 1.2; }
.grv-th-empty { background: transparent !important; }
.grv-td-time { padding: .35rem .2rem; border: 1px solid #e2e8f0; border-radius: 7px; background: #fff; color: #334155; font-weight: 700; text-align: center; font-size: .72rem; line-height: 1.2; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.grv-td-time small { color: #64748b; font-weight: 500; font-size: .65rem; }
.grv-td-cell { display: flex; flex-direction: column; gap: .18rem; padding: .25rem; border: 1px solid #e2e8f0; border-radius: 7px; background: #fafafa; }
.grv-slot { display: flex; flex-direction: column; gap: .06rem; padding: .18rem .32rem .18rem .5rem; border-radius: 5px; font-size: .72rem; font-weight: 600; line-height: 1.15; }
.grv-slot.is-free  { background: linear-gradient(90deg, #F3FBF7 0%, #fff 70%); border-left: 3px solid #2F8F63; color: #145C3A; }
.grv-slot.is-partial { background: linear-gradient(90deg, #FFF8E8 0%, #fff 70%); border-left: 3px solid #B98514; color: #6E4A08; }
.grv-slot.is-full  { background: linear-gradient(90deg, #FFF2F2 0%, #fff 70%); border-left: 3px solid #A95757; color: #783232; }
.grv-slot.is-blocked { background: linear-gradient(90deg, #F2F4F7 0%, #f8fafc 70%); border-left: 3px solid #C4CDD8; color: #5C697A; font-style: italic; }
.grv-slot-bar { height: 2px; border-radius: 999px; background: rgba(0,0,0,.08); overflow: hidden; margin-top: .06rem; }
.grv-slot-bar span { display: block; height: 100%; border-radius: 999px; }
.grv-slot.is-free .grv-slot-bar span { background: #2F8F63; width: 100%; }
.grv-slot.is-partial .grv-slot-bar span { background: #B98514; width: 45%; }

.grv-filters { padding: .6rem .7rem; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; }
.grv-filter-label { font-size: .68rem; font-weight: 700; color: #64748b; margin-bottom: .18rem; display: block; }
.grv-select { display: flex; align-items: center; justify-content: space-between; padding: .3rem .5rem; border: 1.5px solid #e2e8f0; border-radius: 8px; background: #fff; font-size: .78rem; font-weight: 600; color: #374151; }
.grv-select::after { content: "▾"; color: #94a3b8; font-size: .68rem; }
.grv-toggles { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .3rem; }
.grv-toggle-pill { padding: .28rem .62rem; border: 1.5px solid #c7d2e0; border-radius: 2rem; background: #f3f6fa; color: #4b5563; font-size: .74rem; font-weight: 500; }
.grv-toggle-pill.active { background: #2563eb; border-color: #2563eb; color: #fff; font-weight: 600; }

.grv-status-legend { display: grid; gap: .3rem; }
.grv-status-card { display: flex; align-items: center; gap: .55rem; padding: .35rem .55rem .35rem .65rem; border-radius: 8px; font-size: .8rem; font-weight: 600; }
.grv-status-card .grv-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.grv-status-card .grv-sc-right { margin-left: auto; font-size: .72rem; font-weight: 700; opacity: .8; }
.grv-status-card.is-free    { background: linear-gradient(90deg, #F3FBF7 0%, #fff 70%); border-left: 3px solid #2F8F63; color: #145C3A; }
.grv-status-card.is-free .grv-dot { background: #2F8F63; }
.grv-status-card.is-partial { background: linear-gradient(90deg, #FFF8E8 0%, #fff 70%); border-left: 3px solid #B98514; color: #6E4A08; }
.grv-status-card.is-partial .grv-dot { background: #B98514; }
.grv-status-card.is-full    { background: linear-gradient(90deg, #FFF2F2 0%, #fff 70%); border-left: 3px solid #A95757; color: #783232; }
.grv-status-card.is-full .grv-dot { background: #A95757; }
.grv-status-card.is-blocked { background: linear-gradient(90deg, #F2F4F7 0%, #f8fafc 70%); border-left: 3px solid #C4CDD8; color: #5C697A; }
.grv-status-card.is-blocked .grv-dot { background: #C4CDD8; }

.grv-modal-wrap { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; box-shadow: 0 8px 28px rgba(15,23,42,.15); overflow: hidden; }
.grv-modal-header { display: flex; align-items: center; justify-content: space-between; padding: .55rem .75rem; background: linear-gradient(135deg, #0A2F8F 0%, #1558C5 100%); color: #fff; }
.grv-modal-header h5 { margin: 0; font-size: .9rem; font-weight: 800; color: #fff; }
.grv-modal-header-close { width: 20px; height: 20px; border-radius: 50%; background: rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center; font-size: .75rem; color: rgba(255,255,255,.8); }
.grv-modal-body { padding: .7rem .75rem; }
.grv-modal-device { font-weight: 800; font-size: .9rem; margin-bottom: .2rem; color: #0f172a; }
.grv-modal-datetime { display: inline-block; background: #dbeafe; color: #1e40af; border-radius: .4rem; padding: .15rem .55rem; font-size: .76rem; font-weight: 700; margin-bottom: .6rem; }
.grv-modal-status-card { padding: .45rem .6rem; border: 1px solid #e2e8f0; border-radius: 10px; background: #f8fafc; margin-bottom: .65rem; display: flex; align-items: center; gap: .5rem; font-size: .82rem; }
.grv-modal-status-pill { display: inline-flex; align-items: center; padding: .18rem .55rem; border-radius: 999px; font-weight: 800; font-size: .8rem; }
.grv-modal-status-pill.is-free { background: #dcfce7; color: #166534; }
.grv-modal-section-label { font-size: .72rem; font-weight: 700; color: #64748b; margin-bottom: .4rem; display: flex; align-items: center; gap: .35rem; }
.grv-modal-section-label::after { content: "›"; margin-left: auto; }
.grv-form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .35rem; margin-bottom: .55rem; }
.grv-form-col { display: flex; flex-direction: column; gap: .18rem; }
.grv-form-col label { font-size: .65rem; font-weight: 700; color: #64748b; margin-bottom: 0; }
.grv-input-num { border: 1.5px solid #cbd5e1; border-radius: 6px; padding: .28rem .35rem; font-size: .8rem; text-align: center; background: #fff; font-weight: 700; color: #374151; }
.grv-form-col.span3 { grid-column: 1 / -1; }
.grv-form-col.span3 .grv-input-num { text-align: left; }

.grv-result-ok { display: flex; flex-direction: column; gap: .1rem; padding: .55rem .7rem; border-radius: 10px; background: #f0fdf4; border: 1px solid #bbf7d0; border-left: 4px solid #22c55e; margin-bottom: .4rem; }
.grv-result-ok-title { display: flex; align-items: center; gap: .35rem; font-weight: 800; font-size: .88rem; color: #166534; }
.grv-result-ok-check { width: 18px; height: 18px; border-radius: 50%; background: #22c55e; display: flex; align-items: center; justify-content: center; color: #fff; font-size: .7rem; font-weight: 900; flex-shrink: 0; }
.grv-result-ok-date { font-size: .76rem; color: #166534; opacity: .85; }
.grv-result-ok-badge { display: inline-block; background: #dbeafe; color: #1e40af; border-radius: .35rem; padding: .1rem .45rem; font-size: .7rem; font-weight: 700; }
.grv-close-btn { display: flex; justify-content: flex-end; margin-top: .55rem; }
.grv-close-btn span { padding: .3rem .75rem; border: 1px solid #c9d9f8; border-radius: 7px; background: linear-gradient(180deg, #fff, #f4f8ff); color: #0A2F8F; font-size: .8rem; font-weight: 700; }

.grv-tabs { display: flex; gap: .4rem; margin-bottom: .55rem; flex-wrap: wrap; }
.grv-tab { display: inline-flex; align-items: center; padding: .3rem .72rem; border-radius: 2rem; border: 1.5px solid #c7d2e0; background: #f3f6fa; color: #4b5563; font-size: .8rem; font-weight: 500; }
.grv-tab.active { background: #1558C5; border-color: #1558C5; color: #fff; font-weight: 700; }
.grv-search-bar { display: flex; align-items: center; gap: .4rem; padding: .32rem .55rem; border: 1.5px solid #e2e8f0; border-radius: 8px; background: #fff; font-size: .78rem; color: #94a3b8; margin-bottom: .5rem; }
.grv-list-table { width: 100%; border-collapse: collapse; font-size: .75rem; }
.grv-list-table th { padding: .3rem .4rem; background: #f8fafc; border-bottom: 2px solid #e2e8f0; font-weight: 700; color: #374151; text-align: left; white-space: nowrap; }
.grv-list-table td { padding: .32rem .4rem; border-bottom: 1px solid #f1f5f9; color: #334155; vertical-align: middle; }
.grv-list-table tr:last-child td { border-bottom: none; }
.grv-list-edit-btn { display: inline-flex; padding: .18rem .45rem; border: 1px solid #c9d9f8; border-radius: 6px; background: linear-gradient(180deg,#fff,#f4f8ff); color: #0A2F8F; font-size: .7rem; font-weight: 700; white-space: nowrap; }
.grv-list-del-btn { display: inline-flex; padding: .18rem .45rem; border: 1px solid #e4b8b8; border-radius: 6px; background: #9D4B4B; color: #fff; font-size: .7rem; font-weight: 700; margin-left: .2rem; white-space: nowrap; }
.grv-list-cancel-lnk { display: inline-flex; padding: .18rem .35rem; font-size: .7rem; font-weight: 700; color: #9D4B4B; margin-left: .15rem; white-space: nowrap; }
html[data-theme="dark"] .grv-list-cancel-lnk { color: #f87171; }

.grv-cancel-section { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: .65rem .75rem; }
.grv-cancel-res { display: flex; align-items: center; justify-content: space-between; padding: .38rem .5rem; border: 1px solid #e2e8f0; border-radius: 8px; background: #f8fafc; font-size: .82rem; font-weight: 700; margin-bottom: .55rem; color: #334155; }
.grv-cancel-x { width: 22px; height: 22px; border-radius: 50%; background: #ef4444; color: #fff; display: flex; align-items: center; justify-content: center; font-size: .78rem; font-weight: 900; flex-shrink: 0; }
.grv-cancel-confirm { font-size: .78rem; color: #64748b; margin-bottom: .5rem; font-weight: 600; }

/* Dark mode — grv- components */
html[data-theme="dark"] .grv-login-wrap,
html[data-theme="dark"] .grv-filters,
html[data-theme="dark"] .grv-td-cell,
html[data-theme="dark"] .grv-modal-wrap,
html[data-theme="dark"] .grv-modal-status-card,
html[data-theme="dark"] .grv-cancel-section { background: #1e293b; border-color: #334155; }
html[data-theme="dark"] .grv-field-input,
html[data-theme="dark"] .grv-select,
html[data-theme="dark"] .grv-input-num,
html[data-theme="dark"] .grv-res-row,
html[data-theme="dark"] .grv-cancel-res,
html[data-theme="dark"] .grv-td-time { background: #0f172a; border-color: #334155; color: #e5e7eb; }
html[data-theme="dark"] .grv-login-title,
html[data-theme="dark"] .grv-modal-device,
html[data-theme="dark"] .grv-res-row-name,
html[data-theme="dark"] .grv-cancel-res { color: #f8fafc; }
html[data-theme="dark"] .grv-login-sub,
html[data-theme="dark"] .grv-field-label,
html[data-theme="dark"] .grv-filter-label,
html[data-theme="dark"] .grv-res-row-date,
html[data-theme="dark"] .grv-cancel-confirm { color: #94a3b8; }
html[data-theme="dark"] .grv-toggle-pill { background: #1e293b; border-color: #334155; color: #94a3b8; }
html[data-theme="dark"] .grv-toggle-pill.active { background: #2563eb; border-color: #2563eb; color: #fff; }
html[data-theme="dark"] .grv-sched-week-label { color: #e5e7eb; }
html[data-theme="dark"] .grv-slot.is-free    { background: linear-gradient(90deg, rgba(34,197,94,.2) 0%, rgba(34,197,94,.05) 70%); color: #86efac; }
html[data-theme="dark"] .grv-slot.is-partial { background: linear-gradient(90deg, rgba(234,179,8,.2) 0%, rgba(234,179,8,.05) 70%); color: #fde68a; }
html[data-theme="dark"] .grv-slot.is-full    { background: linear-gradient(90deg, rgba(239,68,68,.2) 0%, rgba(239,68,68,.05) 70%); color: #fca5a5; }
html[data-theme="dark"] .grv-slot.is-blocked { background: linear-gradient(90deg, rgba(100,116,139,.18) 0%, rgba(100,116,139,.05) 70%); color: #94a3b8; }
html[data-theme="dark"] .grv-status-card.is-free    { background: linear-gradient(90deg, rgba(34,197,94,.18) 0%, rgba(34,197,94,.04) 70%); color: #86efac; }
html[data-theme="dark"] .grv-status-card.is-partial { background: linear-gradient(90deg, rgba(234,179,8,.18) 0%, rgba(234,179,8,.04) 70%); color: #fde68a; }
html[data-theme="dark"] .grv-status-card.is-full    { background: linear-gradient(90deg, rgba(239,68,68,.18) 0%, rgba(239,68,68,.04) 70%); color: #fca5a5; }
html[data-theme="dark"] .grv-status-card.is-blocked { background: linear-gradient(90deg, rgba(100,116,139,.15) 0%, rgba(100,116,139,.04) 70%); color: #94a3b8; }
html[data-theme="dark"] .grv-modal-datetime { background: #1e3a5f; color: #93c5fd; }
html[data-theme="dark"] .grv-result-ok { background: rgba(34,197,94,.1); border-color: rgba(34,197,94,.3); border-left-color: #22c55e; }
html[data-theme="dark"] .grv-result-ok-title,
html[data-theme="dark"] .grv-result-ok-date { color: #86efac; }
html[data-theme="dark"] .grv-close-btn span { background: #1e293b; border-color: #334155; color: #93c5fd; }
html[data-theme="dark"] .grv-tab { background: #1e293b; border-color: #334155; color: #94a3b8; }
html[data-theme="dark"] .grv-tab.active { background: #1558C5; border-color: #1558C5; color: #fff; }
html[data-theme="dark"] .grv-search-bar { background: #0f172a; border-color: #334155; color: #475569; }
html[data-theme="dark"] .grv-list-table th { background: #1e293b; border-color: #334155; color: #cbd5e1; }
html[data-theme="dark"] .grv-list-table td { border-color: #1e293b; color: #e2e8f0; }
html[data-theme="dark"] .grv-list-edit-btn { background: #1e293b; border-color: #334155; color: #93c5fd; }

/* Guide: dark-mode-safe utility classes for inline sections */
.grv-box {
    padding: .45rem .55rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-top: .55rem;
}

.grv-section-lbl {
    font-size: .65rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: .28rem;
}

.grv-chip-row { display: flex; flex-wrap: wrap; gap: .25rem; }

.grv-chip-blue {
    padding: .2rem .5rem;
    border: 1px solid #c9d9f8;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    color: #1558C5;
    background: #f4f8ff;
}

.grv-chip-gray {
    padding: .2rem .5rem;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 600;
    color: #64748b;
    background: #f8fafc;
}

.grv-divider {
    margin-top: .55rem;
    padding-top: .45rem;
    border-top: 1px solid #e2e8f0;
}

.grv-cancel-back {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 32px;
    border: 1px solid #e2e8f0;
    border-radius: 7px;
    font-size: .78rem;
    font-weight: 700;
    color: #64748b;
    background: #fff;
}

html[data-theme="dark"] .grv-box { background: #1e293b; border-color: #334155; }
html[data-theme="dark"] .grv-section-lbl { color: #4b5563; }
html[data-theme="dark"] .grv-chip-blue { background: #1a2f52; border-color: #1e4080; color: #93c5fd; }
html[data-theme="dark"] .grv-chip-gray { background: #1e293b; border-color: #334155; color: #64748b; }
html[data-theme="dark"] .grv-divider { border-top-color: #334155; }
html[data-theme="dark"] .grv-cancel-back { background: #1e293b; border-color: #334155; color: #94a3b8; }

@media (max-width: 1050px) {
    .admin-reservation-filter-grid {
        grid-template-columns: repeat(2, minmax(160px, 1fr));
    }

    .guide-grid {
        grid-template-columns: 1fr;
    }

    .guide-step-wide {
        grid-template-columns: 1fr;
    }

    .guide-week-preview {
        overflow-x: auto;
        grid-template-columns: 72px repeat(5, 112px);
    }
}

@media (max-width: 650px) {
    .admin-reservation-filter-panel:not([open]) {
        width: 100%;
    }

    .admin-reservation-filter {
        padding: .85rem;
    }

    .admin-reservation-filter-grid {
        grid-template-columns: 1fr;
        gap: .65rem;
    }

    .admin-reservation-filter-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .admin-reservation-filter-actions .admin-btn {
        width: 100%;
        justify-content: center;
    }

    .guide-hero {
        flex-direction: column;
        padding: 1.1rem 1.2rem;
    }

    .guide-hero-aside {
        flex-direction: row;
        width: 100%;
        justify-content: space-between;
        align-items: center;
    }

    .guide-step {
        grid-template-columns: 1fr;
    }

    .guide-workflow {
        gap: .25rem;
    }

    .guide-logo {
        width: 54px;
        height: 54px;
    }

    .guide-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .guide-schedule-title-row,
    .guide-week-nav,
    .guide-filter-card {
        grid-template-columns: 1fr;
    }

    .guide-week-nav span:last-child,
    .guide-week-nav strong {
        justify-self: start;
    }
}

/* ---------- Statistics mobile polish ---------- */

/* ---------- Dan državnosti zastava ---------- */
.holiday-flag {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    margin-left: .3rem;
    opacity: .95;
}

.holiday-flag svg {
    width: 36px;
    height: auto;
    display: block;
    border-radius: 2px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, .30), 0 0 0 .5px rgba(255, 255, 255, .18);
}

.app-title.nurnit-brand .holiday-flag {
    margin-left: .55rem;
}

.holiday-icon {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    margin-left: .3rem;
}

.holiday-icon svg {
    width: 22px;
    height: 22px;
    display: block;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .28));
}

.app-title.nurnit-brand .holiday-icon {
    margin-left: .55rem;
}

/* ---------- Emoji holiday icons ---------- */
.holiday-emoji {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    margin-left: .3rem;
    font-size: 1.25rem;
    line-height: 1;
}

.app-title.nurnit-brand .holiday-emoji {
    margin-left: .55rem;
}

/* ---------- nurNit brand pass ---------- */

/* nurNit wordmark v glavi (nelogiran) */
.nurnit-wordmark {
    height: 50px;
    width: auto;
    display: block;
}
.app-title.nurnit-brand {
    gap: 0;
}

@media (max-width: 950px) {
    .nurnit-wordmark { height: 44px; }
}
@media (max-width: 760px) {
    .nurnit-wordmark { height: 38px; }
}
@media (max-width: 560px) {
    .nurnit-wordmark { height: 32px; }
}

a,
.week-nav a,
.footer-links a,
.footer-card a,
.login-status a {
    color: var(--nurnit-blue, #1558C5);
}

a:hover,
a:focus-visible,
.week-nav a:hover,
.footer-links a:hover,
.footer-card a:hover,
.login-status a:hover {
    color: var(--nurnit-blue-dark, #0A2F8F);
}

.nav-links a,
.admin-subnav a,
.admin-menu-toggle {
    color: var(--nurnit-blue-dark, #0A2F8F);
}

.nav-links a:hover,
.nav-links a.active,
.admin-subnav a:hover,
.admin-subnav a.active,
.admin-menu-toggle:hover,
.admin-menu-toggle:focus-visible {
    background: linear-gradient(135deg, #F4F8FF, #EAF2FF);
    color: var(--nurnit-blue-dark, #0A2F8F);
    box-shadow: inset 0 0 0 1px rgba(30, 115, 232, .12);
}


.schedule-title-row h3 {
    color: #111827;
}

.schedule-filters,
.my-reservations-controls {
    border-color: #D7E5FB;
    background:
        linear-gradient(180deg, rgba(255,255,255,.96), rgba(244,248,255,.96)),
        radial-gradient(circle at 8% 0%, rgba(30,115,232,.08), transparent 32%);
    box-shadow: 0 10px 28px rgba(10, 47, 143, .07);
}

.schedule-filter-item label {
    color: #52637A;
}

.schedule-select,
.location-select,
.reservation-search-wrap input {
    border-color: #C9D9F8 !important;
    background: #FFFFFF !important;
    color: #111827 !important;
}

.login-fields input {
    width: 100%;
    font-size: 1rem;
    background: #EEF3FF !important;
    border-color: #AABFE8 !important;
    color: #111827 !important;
    outline: none !important;
    transition: border-color .15s, box-shadow .15s, background .15s !important;
    margin-bottom: 0 !important;
}

.schedule-select:focus,
.location-select:focus,
.login-fields input:focus,
.reservation-search-wrap input:focus {
    border-color: #1E73E8 !important;
    box-shadow: 0 0 0 3px rgba(30, 115, 232, .18) !important;
    outline: none !important;
    background: #ffffff !important;
}

/* fokus za icon-wrap: obroč na wrapperju, ne na inputu */
.reservation-search-icon-wrap input:focus {
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

.week-nav {
    align-items: center;
}

.week-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: .18rem .6rem;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: #1558C5;
    font-weight: 600;
    font-size: .88rem;
    text-decoration: none;
}

.week-nav a:hover,
.week-nav a:focus-visible {
    border-color: #C9D9F8;
    background: #F4F8FF;
    color: #0A2F8F;
    text-decoration: none;
}

.schedule-grid th {
    background: linear-gradient(135deg, #1558C5, #0A2F8F) !important;
    box-shadow: 0 8px 18px rgba(10, 47, 143, .16);
}

.schedule-grid th.today {
    background: linear-gradient(135deg, #1E73E8, #1558C5) !important;
}

.schedule-grid td:first-child {
    border-color: #D7E5FB;
    background: linear-gradient(180deg, #FFFFFF, #F7FAFF);
    color: #1F2937;
}

.schedule-grid td.schedule-slot {
    border-color: #E3E8F2;
    background: rgba(255, 255, 255, .72);
}

.schedule-grid td.schedule-slot.today {
    background-color: #F4F8FF;
}

.device-availability {
    border-radius: 4px !important;
    box-shadow: none;
}

.device-availability.clickable:hover {
    box-shadow: none;
}

.capacity-bar {
    background: rgba(10, 47, 143, .12);
}

.legend {
    border-color: #D7E5FB;
    box-shadow: 0 4px 12px rgba(10, 47, 143, .05);
}

.theme-toggle-header {
    border-color: #C9D9F8 !important;
    color: #1558C5 !important;
    box-shadow: 0 3px 10px rgba(10, 47, 143, .08);
}

html[data-theme="dark"] a,
html[data-theme="dark"] .week-nav a,
html[data-theme="dark"] .footer-links a,
html[data-theme="dark"] .footer-card a,
html[data-theme="dark"] .login-status a {
    color: #93C5FD !important;
}

html[data-theme="dark"] .schedule-filters,
html[data-theme="dark"] .my-reservations-controls,
html[data-theme="dark"] .schedule-grid td:first-child {
    background: linear-gradient(180deg, #111827, #172334);
    border-color: #24456B;
}


html[data-theme="dark"] .date-picker-btn,
html[data-theme="dark"] .reservation-period-btn {
    background: linear-gradient(180deg, #172334, #111827);
    border-color: #24456B;
    color: #DBEAFE;
}

.reservation-period-filter,
.reservation-search-top {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}



.schedule-grid th {
    background: linear-gradient(135deg, #0A2F8F 0%, #1558C5 58%, #0A2F8F 100%) !important;
}

.schedule-grid th.today {
    background: linear-gradient(135deg, #1558C5 0%, #1E73E8 52%, #0A2F8F 100%) !important;
}

.schedule-grid th:not(:first-child) {
    color: #FFFFFF !important;
}

/* ---------- Schedule color tuning ---------- */
:root {
    --schedule-free: #2F8F63;
    --schedule-free-bg: #F3FBF7;
    --schedule-free-border: #BFE3CF;
    --schedule-free-text: #145C3A;
    --schedule-partial: #B98514;
    --schedule-partial-bg: #FFF8E8;
    --schedule-partial-border: #E9CF82;
    --schedule-partial-text: #6E4A08;
    --schedule-full: #A95757;
    --schedule-full-bg: #FFF2F2;
    --schedule-full-border: #E4B8B8;
    --schedule-full-text: #783232;
    --schedule-holiday-bg: #F1EBF9;
    --schedule-holiday-border: #C4A8DE;
    --schedule-holiday-text: #5A2D82;
    --schedule-blocked-bg: #F2F4F7;
    --schedule-blocked-border: #C4CDD8;
    --schedule-blocked-text: #5C697A;
    --schedule-muted-slot-bg: #F3F6FA;
    --schedule-muted-slot-border: #D9E2EE;
    --schedule-muted-slot-text: #62748A;
}



.device-availability.capacity-free .capacity-fill { background: var(--schedule-free) !important; }
.device-availability.capacity-partial .capacity-fill { background: var(--schedule-partial) !important; }
.device-availability.capacity-full .capacity-fill { background: var(--schedule-full) !important; }

.capacity-bar {
    background: rgba(10, 47, 143, .11) !important;
}

.schedule-grid th.holiday {
    background: linear-gradient(135deg, #9265C8, #6B3BAD) !important;
    color: #FFFFFF !important;
    box-shadow: 0 8px 18px rgba(90, 45, 130, .16);
}

.schedule-grid th.blocked-day {
    background: linear-gradient(135deg, #7A8FA3, #546678) !important;
    color: #FFFFFF !important;
    box-shadow: 0 8px 18px rgba(84, 102, 120, .14);
}

.schedule-grid td.holiday-cell {
    background: var(--schedule-holiday-bg) !important;
    border-color: var(--schedule-holiday-border) !important;
    color: var(--schedule-holiday-text) !important;
    opacity: 1 !important;
}

.schedule-grid td.blocked-cell {
    background: var(--schedule-blocked-bg) !important;
    border-color: var(--schedule-blocked-border) !important;
    color: var(--schedule-blocked-text) !important;
    opacity: 1 !important;
}

.holiday-cell .holiday-note,
.blocked-cell .holiday-note,
.holiday-note.capacity-note {
    color: var(--schedule-holiday-text) !important;
}

.blocked-cell .holiday-note {
    color: var(--schedule-blocked-text) !important;
}

.holiday-note.capacity-note {
    background: var(--schedule-muted-slot-bg);
    border: 1px solid var(--schedule-muted-slot-border);
    border-radius: 8px;
    color: var(--schedule-muted-slot-text) !important;
}

.past-slot {
    opacity: .62;
    filter: saturate(.8);
}

html[data-theme="dark"] {
    --schedule-free: #57C28D;
    --schedule-free-bg: rgba(87, 194, 141, .13);
    --schedule-free-border: rgba(87, 194, 141, .34);
    --schedule-free-text: #BFEFD6;
    --schedule-partial: #D3A64C;
    --schedule-partial-bg: rgba(211, 166, 76, .14);
    --schedule-partial-border: rgba(211, 166, 76, .34);
    --schedule-partial-text: #F5DEAA;
    --schedule-full: #C97878;
    --schedule-full-bg: rgba(201, 120, 120, .14);
    --schedule-full-border: rgba(201, 120, 120, .34);
    --schedule-full-text: #F1C7C7;
    --schedule-holiday-bg: rgba(146, 101, 200, .15);
    --schedule-holiday-border: rgba(196, 168, 222, .30);
    --schedule-holiday-text: #D4BAEE;
    --schedule-blocked-bg: rgba(100, 116, 139, .16);
    --schedule-blocked-border: rgba(148, 163, 184, .28);
    --schedule-blocked-text: #94A3B8;
    --schedule-muted-slot-bg: rgba(100, 116, 139, .12);
    --schedule-muted-slot-border: rgba(148, 163, 184, .24);
    --schedule-muted-slot-text: #AEBAC9;
}

html[data-theme="dark"] .schedule-container {
    color: #E5E7EB;
}

html[data-theme="dark"] .schedule-title-row h3 {
    color: #E5E7EB !important;
}

html[data-theme="dark"] .schedule-filter-item label,
html[data-theme="dark"] .schedule-toggle-group label {
    color: #CBD5E1 !important;
}

html[data-theme="dark"] .schedule-select,
html[data-theme="dark"] .location-select {
    background: #0F172A !important;
    border-color: #334155 !important;
    color: #E5E7EB !important;
}

html[data-theme="dark"] .login-fields input,
html[data-theme="dark"] .reservation-search-wrap input,
html[data-theme="dark"] .date-input-wrap {
    background: #0F172A !important;
    border-color: #334155 !important;
    color: #E5E7EB !important;
}

html[data-theme="dark"] .date-input-wrap:hover {
    border-color: #60a5fa;
    background: #111827;
}

html[data-theme="dark"] .date-input-wrap:focus-within {
    border-color: #60A5FA;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, .18);
    background: #111827;
}

html[data-theme="dark"] .date-input-text {
    color: #E5E7EB;
}

html[data-theme="dark"] .date-input-text.is-placeholder {
    color: #4b5563;
}

html[data-theme="dark"] .date-input-cal {
    color: #4b5563;
}

html[data-theme="dark"] .schedule-select:focus,
html[data-theme="dark"] .location-select:focus {
    border-color: #60A5FA !important;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, .18) !important;
}

html[data-theme="dark"] .reservation-search-icon-wrap {
    background: #0F172A !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .reservation-search-icon-wrap:focus-within {
    border-color: #60A5FA;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, .18);
}

html[data-theme="dark"] .reservation-search-icon {
    color: #64748b;
}

html[data-theme="dark"] .reservation-search-wrap input::placeholder,
html[data-theme="dark"] .reservation-search-icon-wrap input::placeholder {
    color: #4b5563 !important;
}

html[data-theme="dark"] .schedule-grid th {
    background: linear-gradient(135deg, #081D59 0%, #0A2F8F 56%, #071945 100%) !important;
    border-color: #193A68 !important;
    box-shadow: none;
}

html[data-theme="dark"] .schedule-grid th.today {
    background: linear-gradient(135deg, #0A2F8F 0%, #1558C5 55%, #081D59 100%) !important;
}

html[data-theme="dark"] .schedule-grid th.holiday {
    background: linear-gradient(135deg, #4A2876, #6B3BAD) !important;
    border-color: rgba(196, 168, 222, .28) !important;
}

html[data-theme="dark"] .schedule-grid th.blocked-day {
    background: linear-gradient(135deg, #334155, #1E293B) !important;
    border-color: rgba(148, 163, 184, .30) !important;
}

html[data-theme="dark"] .schedule-grid td:first-child {
    background: linear-gradient(180deg, #111827, #162033) !important;
    border-color: #25364D !important;
    color: #E5E7EB !important;
}

html[data-theme="dark"] .schedule-grid td.schedule-slot {
    background: rgba(15, 23, 42, .78) !important;
    border-color: #263449 !important;
}

html[data-theme="dark"] .schedule-grid td.schedule-slot.today {
    background: rgba(21, 88, 197, .16) !important;
}

html[data-theme="dark"] .schedule-grid td.holiday-cell {
    background: var(--schedule-holiday-bg) !important;
    border-color: var(--schedule-holiday-border) !important;
}

html[data-theme="dark"] .schedule-grid td.blocked-cell {
    background: var(--schedule-blocked-bg) !important;
    border-color: var(--schedule-blocked-border) !important;
}

html[data-theme="dark"] .schedule-filters,
html[data-theme="dark"] .my-reservations-controls,
html[data-theme="dark"] .legend {
    background: linear-gradient(180deg, #111827, #162033) !important;
    border-color: #25364D !important;
    box-shadow: none;
}

html[data-theme="dark"] .device-availability {
    box-shadow: none;
}

html[data-theme="dark"] .device-availability.clickable:hover {
    box-shadow: none;
    filter: brightness(1.08);
}

html[data-theme="dark"] .capacity-bar {
    background: rgba(226, 232, 240, .14) !important;
}

html[data-theme="dark"] .holiday-note.capacity-note {
    background: var(--schedule-muted-slot-bg);
    border-color: var(--schedule-muted-slot-border);
    color: var(--schedule-muted-slot-text) !important;
}

/* ---------- Status badge (pillo) ---------- */
.status-badge {
    position: absolute;
    top: .28rem;
    right: .38rem;
    z-index: 5;
    font-size: .58rem;
    font-weight: 500;
    letter-spacing: .01em;
    padding: .08rem .4rem;
    border-radius: 10rem;
    border: 1px solid;
    line-height: 1.6;
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
}
.device-availability:has(.status-badge) .device-info {
    padding-right: 2.6rem;
}
.device-availability .capacity-bar {
    display: none !important;
}
.capacity-free .status-badge {
    background: var(--schedule-free-bg);
    border-color: var(--schedule-free-border);
    color: var(--schedule-free);
}
.capacity-partial .status-badge {
    background: var(--schedule-partial-bg);
    border-color: var(--schedule-partial-border);
    color: var(--schedule-partial);
}
.capacity-full .status-badge {
    background: var(--schedule-full-bg);
    border-color: var(--schedule-full-border);
    color: var(--schedule-full);
}
.capacity-partial .info-btn,
.capacity-full .info-btn {
    display: none !important;
}
.status-badge--trigger {
    cursor: pointer;
    pointer-events: auto;
}
.status-badge--trigger:focus {
    outline: none;
}
.status-badge--trigger:hover {
    filter: brightness(.9);
}
html[data-theme="dark"] .capacity-free .status-badge {
    background: rgba(87, 194, 141, .12);
    border-color: rgba(87, 194, 141, .35);
    color: var(--schedule-free);
}
html[data-theme="dark"] .capacity-partial .status-badge {
    background: rgba(234, 179, 8, .12);
    border-color: rgba(234, 179, 8, .35);
    color: var(--schedule-partial);
}
html[data-theme="dark"] .capacity-full .status-badge {
    background: rgba(239, 68, 68, .12);
    border-color: rgba(239, 68, 68, .35);
    color: var(--schedule-full);
}
@media (max-width: 850px) {
    .status-badge { display: none; }
    .device-availability:has(.status-badge) .device-info { padding-right: 0; }
}

/* ---------- Show-mine quantity inline ---------- */
.device-availability.show-mine-qty .device-info {
    grid-template-columns: auto 1fr;
    align-items: start;
}
.device-availability.show-mine-qty .device-type-icon {
    grid-row: 1 / span 2;
    align-self: start;
}
.device-availability.show-mine-qty .device-name {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
}
.device-availability.show-mine-qty .device-qty {
    grid-column: 2;
    grid-row: 2;
    margin-top: .05rem;
    margin-left: 0;
    text-align: left;
    font-size: .78rem;
    font-weight: 700;
    white-space: nowrap;
    align-self: start;
    min-height: 1em;
}

/* Pico CSS :user-invalid/:invalid borders so disabled — we use .is-invalid + .field-validation-message */
input:user-invalid,
select:user-invalid,
textarea:user-invalid,
input:invalid,
select:invalid,
textarea:invalid {
    border-color: inherit !important;
    box-shadow: none !important;
    outline: none !important;
}

/* ---------- Schedule distinction and inline validation ---------- */
:root {
    --schedule-partial: #D19000;
    --schedule-partial-bg: #FFF6D8;
    --schedule-partial-border: #E7BE4A;
    --schedule-partial-text: #6F4A00;
    --schedule-holiday-bg: #F1EBF9;
    --schedule-holiday-border: #C4A8DE;
    --schedule-holiday-text: #5A2D82;
    --schedule-blocked-bg: #EFF4FA;
    --schedule-blocked-border: #CAD8E8;
    --schedule-blocked-text: #52637A;
}

.schedule-grid th.holiday {
    background: linear-gradient(135deg, #9265C8, #6B3BAD) !important;
    color: #FFFFFF !important;
    box-shadow: 0 8px 18px rgba(90, 45, 130, .14);
}

.schedule-grid th.blocked-day {
    background: linear-gradient(135deg, #64748B, #475569) !important;
    color: #FFFFFF !important;
    box-shadow: 0 8px 18px rgba(71, 85, 105, .12);
}

.holiday-cell .holiday-note {
    color: var(--schedule-holiday-text) !important;
}

.blocked-cell .holiday-note {
    color: var(--schedule-blocked-text) !important;
}

#manageModal .manage-status-pill.is-free {
    background: var(--schedule-free-bg) !important;
    color: var(--schedule-free-text) !important;
}

#manageModal .manage-status-pill.is-partial {
    background: var(--schedule-partial-bg) !important;
    color: var(--schedule-partial-text) !important;
}

#manageModal .manage-status-pill.is-full {
    background: var(--schedule-full-bg) !important;
    color: var(--schedule-full-text) !important;
}

input.is-invalid,
select.is-invalid,
textarea.is-invalid {
    border-color: #C98282 !important;
    box-shadow: 0 0 0 3px rgba(157, 75, 75, .14) !important;
}


/* Validation message takes NO layout space — it's a floating sticker over content */
.field-validation-message {
    display: block;
    height: 0;
    overflow: visible;
    margin: 0;
    padding: 0;
    position: relative;
    z-index: 50;
    visibility: hidden;
    pointer-events: none;
}

.field-validation-message.is-shown {
    visibility: visible;
}

.field-validation-message[hidden] {
    display: block !important;
    visibility: hidden !important;
}

/* Floating validation badge — appears over content, takes no layout space */
.fvm-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #ffffff;
    border: 1.5px solid #f87171;
    border-radius: 8px;
    padding: 3px 10px 4px 7px;
    color: #b91c1c;
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: none;
    white-space: nowrap;
    box-shadow: 0 3px 12px rgba(0, 0, 0, .2);
    transform: translateY(-6px);
    line-height: 1.2;
}

.fvm-pill::before {
    /* \fe0e forces text rendering so CSS color applies (not emoji color) */
    content: "\26a0\fe0e";
    color: #f59e0b;
    font-size: .78rem;
    line-height: 1;
}

html[data-theme="dark"] {
    --schedule-partial: #E0B34F;
    --schedule-partial-bg: rgba(224, 179, 79, .16);
    --schedule-partial-border: rgba(224, 179, 79, .42);
    --schedule-partial-text: #F5DFA7;
    --schedule-holiday-bg: rgba(146, 101, 200, .15);
    --schedule-holiday-border: rgba(196, 168, 222, .30);
    --schedule-holiday-text: #D4BAEE;
    --schedule-blocked-bg: rgba(100, 116, 139, .18);
    --schedule-blocked-border: rgba(148, 163, 184, .30);
    --schedule-blocked-text: #CBD5E1;
}

html[data-theme="dark"] .schedule-grid th.holiday {
    background: linear-gradient(135deg, #4A2876, #6B3BAD) !important;
    border-color: rgba(196, 168, 222, .28) !important;
}

html[data-theme="dark"] .schedule-grid th.blocked-day {
    background: linear-gradient(135deg, #334155, #1E293B) !important;
    border-color: rgba(148, 163, 184, .30) !important;
}

html[data-theme="dark"] input.is-invalid,
html[data-theme="dark"] select.is-invalid,
html[data-theme="dark"] textarea.is-invalid {
    border-color: #C97878 !important;
    box-shadow: 0 0 0 3px rgba(201, 120, 120, .16) !important;
}

html[data-theme="dark"] .fvm-pill {
    background: #0f1e30;
    border-color: rgba(248, 113, 113, .55);
    color: #fca5a5;
    box-shadow: 0 3px 14px rgba(0, 0, 0, .45);
}

/* ---------- Admin: featured (star) device toggle button ---------- */
.device-feature-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 42px !important;
    width: 36px !important;
    padding: 0 !important;
    margin: 0 !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    font-size: 1rem !important;
    line-height: 1 !important;
    color: #9ca3af !important;
    cursor: pointer;
    border-radius: 6px;
    transition: color .15s, background .15s;
    vertical-align: middle;
}
.device-feature-btn:hover {
    color: #f59e0b !important;
    background: rgba(245, 158, 11, .1) !important;
}
.device-feature-btn.is-featured {
    color: #f59e0b !important;
}
.device-feature-btn.is-featured:hover {
    color: #b45309 !important;
    background: rgba(245, 158, 11, .12) !important;
}

/* ---------- Schedule: featured mode select ---------- */
.schedule-select.is-featured-mode {
    color: #92400e !important;
    font-weight: 600;
}
html[data-theme="dark"] .schedule-select.is-featured-mode {
    color: #fbbf24 !important;
}
html[data-theme="dark"] .dt-featured {
    background: rgba(245,158,11,.28) !important;
    color: #fbbf24 !important;
}

/* ---------- Unavailable device cards ---------- */
.device-availability.capacity-unavailable {
    background: var(--schedule-muted-slot-bg) !important;
    border-color: var(--schedule-muted-slot-border) !important;
    border-left-color: #8EA3BA !important;
    color: var(--schedule-muted-slot-text) !important;
    cursor: default;
    box-shadow: 0 3px 10px rgba(10, 47, 143, .045);
}

.device-availability.capacity-unavailable .device-name {
    color: #52637A !important;
}

.device-availability.capacity-unavailable small {
    color: #64748B !important;
    font-weight: 700;
}

.device-availability.capacity-unavailable .device-info > small:last-child,
.device-availability.capacity-unavailable .unavailable-label {
    display: block;
    margin-top: .12rem;
    color: #6B7C90 !important;
    font-size: .68rem;
    font-weight: 700;
    line-height: 1.05;
    text-align: left;
}

html[data-theme="dark"] .device-availability.capacity-unavailable {
    background: var(--schedule-muted-slot-bg) !important;
    border-color: var(--schedule-muted-slot-border) !important;
    border-left-color: #64748B !important;
    color: var(--schedule-muted-slot-text) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .14);
}

html[data-theme="dark"] .device-availability.capacity-unavailable .device-name,
html[data-theme="dark"] .device-availability.capacity-unavailable small,
html[data-theme="dark"] .device-availability.capacity-unavailable .device-info > small:last-child,
html[data-theme="dark"] .device-availability.capacity-unavailable .unavailable-label {
    color: #B7C3D2 !important;
}

/* ---------- nurNit blue header ---------- */
header {
    background:
        linear-gradient(135deg, #0B2A80 0%, #0F3E91 55%, #082266 100%) !important;
    border: none !important;
    padding: .45rem 1.25rem !important;
    border-radius: 0 0 1rem 1rem !important;
    box-shadow: 0 8px 22px rgba(10, 47, 143, .14) !important;
}

html[data-theme="dark"] header {
    background:
        linear-gradient(135deg, #061540 0%, #0A2F8F 58%, #061540 100%) !important;
}

header::before {
    opacity: .18;
}

.app-title h2,
header .app-title h2 {
    color: #FFFFFF !important;
    text-shadow: 0 2px 10px rgba(0, 0, 0, .16);
}

header .app-title {
    gap: .5rem;
    font-size: 1.3rem;
    align-items: center;
}

header .brand-title-n {
    color: #FFFFFF !important;
    font-weight: 700;
    font-size: 1em;
}

header .brand-title-text {
    color: #93C5FD !important;
    font-weight: 600;
    opacity: 1;
}

.school-logo {
    width: 76px !important;
    height: 76px !important;
    border-radius: .75rem !important;
    background: rgba(255, 255, 255, .96) !important;
    border: 1px solid rgba(255, 255, 255, .55);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .14) !important;
}

.school-logo.product-logo {
    background: rgba(255, 255, 255, .10) !important;
    border-color: rgba(255, 255, 255, .18);
}

.nav-links a,
.admin-subnav a,
.admin-menu-toggle {
    color: rgba(255, 255, 255, .90) !important;
}

.nav-links a:hover,
.nav-links a:focus-visible,
.admin-subnav a:hover,
.admin-subnav a:focus-visible,
.admin-menu-toggle:hover,
.admin-menu-toggle:focus-visible {
    background: rgba(255, 255, 255, .13) !important;
    color: #FFFFFF !important;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .20) !important;
}

.nav-links a {
    padding: .22rem .52rem !important;
    border-radius: .42rem !important;
    font-size: .84rem;
}

.nav-links a.active,
.admin-subnav a.active {
    background: rgba(255, 255, 255, .86) !important;
    color: #0A2F8F !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .10) !important;
}

.admin-menu-toggle {
    border-color: rgba(255, 255, 255, .22) !important;
}

.login-status,
.login-status small {
    color: rgba(255, 255, 255, .60) !important;
    font-size: .77rem;
}

.login-status strong {
    color: rgba(255, 255, 255, .82) !important;
    font-weight: 600;
}

.login-status a,
header .login-status a {
    color: rgba(255, 255, 255, .50) !important;
    font-weight: 400;
    text-decoration-color: rgba(255, 255, 255, .22);
}

.login-status a:hover,
header .login-status a:hover {
    color: rgba(219, 234, 254, .85) !important;
    text-decoration-color: rgba(219, 234, 254, .55);
}

header .theme-toggle-pill {
    margin-left: .5rem;
}

header .theme-toggle-pill::before {
    content: '';
    position: absolute;
    left: -.65rem;
    top: 18%;
    height: 64%;
    width: 1px;
    background: rgba(255, 255, 255, .18);
}

.theme-toggle-header {
    background: rgba(255, 255, 255, .94) !important;
    border-color: rgba(255, 255, 255, .65) !important;
    color: #1558C5 !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .16) !important;
}

.theme-toggle-header:hover {
    background: #FFFFFF !important;
    color: #0A2F8F !important;
    transform: translateY(-1px);
}

html[data-theme="dark"] .nav-links a,
html[data-theme="dark"] .admin-subnav a,
html[data-theme="dark"] .admin-menu-toggle {
    color: rgba(219, 234, 254, .92) !important;
}

html[data-theme="dark"] .nav-links a.active,
html[data-theme="dark"] .admin-subnav a.active {
    background: rgba(219, 234, 254, .94) !important;
    color: #071945 !important;
    border-color: rgba(219, 234, 254, .45) !important;
}

html[data-theme="dark"] .login-status,
html[data-theme="dark"] .login-status small,
html[data-theme="dark"] .login-status strong,
html[data-theme="dark"] .login-status a {
    color: #F8FAFC !important;
}

html[data-theme="dark"] .theme-toggle-header {
    background: rgba(15, 23, 42, .82) !important;
    border-color: rgba(147, 197, 253, .35) !important;
    color: #DBEAFE !important;
}

/* ---------- Schedule title strip ---------- */
.schedule-title-row,
.my-reservations-header,
.admin-page-header {
    align-items: center !important;
    margin: .35rem 0 .5rem !important;
    padding: .68rem .75rem !important;
    border-radius: 12px !important;
    border: 1px solid #D7E5FB;
     background:
        linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(244, 248, 255, .96)),
        radial-gradient(circle at 5% 0%, rgba(30, 115, 232, .08), transparent 36%);
    box-shadow: 0 4px 14px rgba(10, 47, 143, .06);
}

.schedule-title-row h3,
.my-reservations-header h3,
.admin-page-header h2,
.admin-page-header h3 {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .3rem .5rem;
    min-height: 34px !important;
    font-size: 1.16rem !important;
    margin: 0 !important;
    padding: 0 .35rem;
    color: #0A2F8F !important;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0;
}

.schedule-title-row h3::before,
.my-reservations-header h3::before,
.admin-page-header h2::before,
.admin-page-header h3::before {
    content: "";
    width: .45rem;
    height: 1.4rem;
    border-radius: 999px;
    background: linear-gradient(180deg, #1E73E8, #0A2F8F);
    box-shadow: 0 2px 8px rgba(10, 47, 143, .18);
}

.schedule-title-row .week-jump,
.my-reservations-header .reservation-period-filter {
    align-self: center;
}

.schedule-title-row .date-picker-btn,
.my-reservations-header .date-picker-btn {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.holiday-note small,
.holiday-cell .holiday-note small,
.device-availability.capacity-unavailable .device-info > small:last-child,
.device-availability.capacity-unavailable .unavailable-label {
    font-size: .68rem !important;
    line-height: 1.08 !important;
    font-weight: 700 !important;
}

html[data-theme="dark"] .schedule-title-row,
html[data-theme="dark"] .my-reservations-header,
html[data-theme="dark"] .admin-page-header {
    border-color: #25364D;
    background: linear-gradient(180deg, #111827, #162033);
    box-shadow: none;
}

html[data-theme="dark"] .schedule-title-row h3,
html[data-theme="dark"] .my-reservations-header h3,
html[data-theme="dark"] .admin-page-header h2,
html[data-theme="dark"] .admin-page-header h3 {
    color: #DBEAFE !important;
}

@media (max-width: 700px) {
    .my-reservations-header {
        align-items: flex-start;
    }

    .my-reservations-header .reservation-period-filter {
        width: 100%;
        align-items: stretch;
        justify-content: flex-start;
        flex-direction: column;
    }

    .my-reservations-header .reservation-period-picker,
    .my-reservations-header .reservation-period-btn {
        width: 100%;
    }

    .my-reservations-controls {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .reservation-period-filter {
        justify-self: stretch;
        align-items: flex-start;
    }

    .reservation-right-controls {
        justify-content: stretch;
    }

    .reservation-search-top {
        order: 2;
    }

    .reservation-period-filter {
        order: 3;
    }

    .reservation-period-picker,
    .reservation-period-btn {
        width: 100%;
    }

    .reservation-search-wrap input {
        max-width: none;
    }

    .reservation-period-panel {
        left: 0;
        right: auto;
        width: min(100%, 420px);
        min-width: 0;
        grid-template-columns: 1fr;
    }

    .schedule-filters {
        grid-template-columns: 1fr 1fr;
        padding: .75rem;
        gap: .6rem;
    }

    .schedule-filter-item:has(#hideFullToggle),
    .schedule-filters .legend {
        grid-column: 1 / -1;
        justify-self: start;
        padding-top: 0;
    }

    .schedule-grid {
        table-layout: fixed !important;
        font-size: .72rem;
    }

    .schedule-grid th,
    .schedule-grid td { padding: .18rem !important; }

    .schedule-grid td.schedule-slot {
        width: 38px !important;
        min-width: 38px !important;
        max-width: 38px !important;
    }

    .device-availability {
        padding: .12rem .15rem !important;
        margin-bottom: .08rem !important;
        min-width: 0 !important;
        gap: .08rem !important;
    }

    .device-info { gap: 0 !important; }

    .device-qty {
        font-size: .68rem !important;
        line-height: 1 !important;
        word-break: normal;
    }

    .info-btn { display: none !important; }

    .stat-bar-row {
        grid-template-columns: 1fr;
        gap: .25rem;
        padding: .6rem 0;
        border-bottom: 1px solid var(--border-color, #e2e8f0);
    }

    .stat-value { text-align: left; }

    .reservations-table-wrap table thead,
    .admin-table thead { display: none; }

    .reservations-table-wrap table,
    .reservations-table-wrap table tbody,
    .reservations-table-wrap table tr,
    .reservations-table-wrap table td,
    .admin-table,
    .admin-table tbody,
    .admin-table tr,
    .admin-table td {
        display: block;
        width: 100%;
    }

    .reservation-row,
    .admin-table tr {
        margin-bottom: 1rem;
        padding: .85rem;
        border: 1px solid var(--border-color);
        border-radius: .8rem;
        background: var(--bg-secondary);
    }

    .reservation-row td,
    .admin-table td {
        display: flex;
        justify-content: space-between;
        gap: 1rem;
        padding: .45rem 0;
        border-bottom: 1px solid rgba(148, 163, 184, .25);
    }

    .reservation-row td::before,
    .admin-table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--text-muted);
    }

    .reservation-row td:last-child,
    .admin-table td:last-child { border-bottom: 0; }

    .reservation-row td:last-child { display: block; }

    .reservation-row td:last-child::before {
        display: block;
        margin-bottom: .5rem;
    }

    .my-actions { gap: .3rem; min-width: 0; width: 100%; }

    .reservations-table { font-size: .85rem; }

    .reservations-table th,
    .reservations-table td {
        padding: .35rem;
        white-space: nowrap;
    }

    .reservations-table .admin-btn {
        padding: .3rem .5rem;
        font-size: .8rem;
    }

    .activity-filters {
        display: flex !important;
        flex-direction: column !important;
        gap: .75rem;
    }

    .activity-filters label,
    .activity-filters input,
    .activity-filters select { width: 100%; }

    .activity-filter-actions {
        display: flex;
        flex-direction: column;
        gap: .5rem;
    }

.activity-filter-actions .admin-btn { width: 100%; }

    .admin-page-header,
    .admin-section-header,
    .admin-actions {
        align-items: stretch;
    }

    .admin-page-header > *,
    .admin-section-header > *,
    .admin-actions .admin-btn {
        width: 100%;
    }

    .admin-form-grid,
    .blocked-form-grid,
    .admin-form-grid-lock,
    .admin-form-grid-capacity {
        grid-template-columns: 1fr;
    }

    .lesson-col {
        width: 46px !important;
    }

    .schedule-grid th:not(:first-child),
    .schedule-grid td.schedule-slot {
        width: calc((100% - 46px) / 5) !important;
        max-width: calc((100% - 46px) / 5) !important;
    }

    .schedule-title-row {
        align-items: flex-start;
    }

    .holiday-note {
        font-size: 0 !important;
        line-height: 0 !important;
        padding: .25rem !important;
        min-height: 34px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .holiday-note * {
        display: none !important;
    }

    .holiday-note::before {
        content: "×";
        display: block;
        font-size: 1.3rem;
        line-height: 1;
        color: #5A2D82;
        font-weight: 700;
    }

    .blocked-cell .holiday-note::before {
        color: #5C697A;
    }

    .holiday-note.capacity-note {
        font-size: 0 !important;
        line-height: 0 !important;
        padding: .25rem !important;
        min-height: 34px;
        display: flex !important;
        align-items: center;
        justify-content: center;
    }

    .holiday-note.capacity-note * {
        display: none !important;
    }

    .holiday-note.capacity-note::before {
        content: "×";
        display: block !important;
        font-size: 1.3rem !important;
        line-height: 1;
        color: #045A88;
        font-weight: 700;
    }

    .cookie-banner {
        grid-template-columns: auto minmax(0, 1fr);
        align-items: start;
        gap: .55rem;
        padding: .6rem;
    }

    .cookie-banner-button {
        grid-column: 1 / -1;
        justify-self: end;
        padding: .32rem .65rem;
    }

    .stats-filter-compact,
    form.stats-filter.stats-filter-compact {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: .75rem !important;
        padding: .85rem !important;
        margin: .75rem 0 1rem !important;
    }

    .stats-filter-compact .filter-field,
    form.stats-filter.stats-filter-compact .filter-field,
    .stats-filter-compact select,
    form.stats-filter.stats-filter-compact .filter-field select {
        width: 100% !important;
        max-width: none !important;
        flex: 1 1 auto !important;
    }

    .stats-actions {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: .55rem !important;
    }

    .stats-actions .admin-btn {
        width: 100%;
        justify-content: center;
    }

    .stats-summary-row {
        display: block;
    }

    .stat-summary-card {
        max-width: none;
        width: 100%;
    }

    .stats-dashboard {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: .85rem !important;
        width: 100%;
    }

    .stats-section-card,
    .stats-pie-card,
    .stats-section-wide {
        grid-column: 1 / -1 !important;
        width: 100%;
        max-width: 100%;
        padding: .8rem !important;
        border-radius: 14px;
        overflow: hidden;
    }

    .stat-bar-row.compact,
    .stats-section-card .stat-bar-row {
        grid-template-columns: minmax(0, 1fr) auto !important;
        gap: .35rem .5rem !important;
        align-items: center !important;
    }

    .stats-section-card .stat-label {
        grid-column: 1 / -1;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        line-height: 1.25;
    }

    .stats-section-card .stat-bar {
        min-width: 0;
        width: 100%;
    }

    .stats-section-card .stat-value {
        min-width: auto !important;
        font-size: .8rem !important;
    }

    .pie-wrap {
        display: grid !important;
        grid-template-columns: 1fr !important;
        justify-items: center;
        gap: .75rem !important;
    }

    .donut-chart,
    .pie-chart {
        width: min(180px, 70vw) !important;
        height: auto !important;
        max-width: 100%;
    }

    .pie-legend {
        width: 100%;
    }

    .pie-legend-row {
        font-size: .88rem !important;
    }

    .line-chart-wrap {
        overflow-x: auto;
        padding-bottom: .25rem;
    }

    .line-chart {
        min-width: 420px;
    }

    .schedule-title-row {
        padding: .65rem;
    }

    .schedule-title-row h3 {
        width: 100%;
        min-height: auto;
        padding: .15rem .2rem;
        font-size: 1.05rem !important;
    }

    .schedule-title-row .week-jump {
        width: 100%;
    }

    .schedule-title-row .date-picker-wrapper,
    .schedule-title-row .date-picker-btn {
        width: auto;
    }
}

/* ---------- Header logo visual style ---------- */
.school-logo {
    width: 76px !important;
    height: 76px !important;
    padding: .38rem !important;
    background: linear-gradient(135deg, rgba(30, 115, 232, .28), rgba(10, 47, 143, .34)) !important;
    border: 1px solid rgba(255, 255, 255, .30) !important;
    border-radius: .75rem !important;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .13), 0 6px 18px rgba(0, 0, 0, .14) !important;
}

.school-logo.product-logo {
    width: 68px !important;
    height: 68px !important;
    padding: .38rem !important;
}

header .app-title {
    gap: .5rem !important;
}

.app-title h2 {
    font-size: clamp(1.2rem, 1.6vw, 1.45rem) !important;
    font-weight: 750 !important;
}

@media (display-mode: standalone) {
    body {
        width: 100%;
        max-width: 100vw;
        margin: 0;
    }

    header {
        width: 100%;
        margin: 0;
        border-top: none !important;
        border-radius: 0 0 1.25rem 1.25rem !important;
        padding-left: max(1rem, 2vw);
        padding-right: max(1rem, 2vw);
    }

    header .header-content {
        width: min(1600px, 96vw);
        max-width: 100%;
        margin: 0 auto;
    }

    main,
    .app-footer {
        width: min(1600px, 96vw);
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }

    .theme-toggle-header {
        right: max(1rem, calc((100vw - min(1600px, 96vw)) / 2 + 1rem));
    }
}

@media (max-width: 950px) and (min-width: 761px) {
    .school-logo {
        width: 90px !important;
        height: 90px !important;
    }

    .app-title {
        font-size: 1.25rem !important;
        gap: .75rem !important;
    }

    .header-content { align-items: center; }

    .top-nav {
        flex: 1;
        justify-content: flex-end;
        gap: .5rem;
    }

    .nav-links {
        gap: .35rem;
        justify-content: flex-end;
    }

    .nav-links a {
        font-size: .92rem;
        padding: .25rem .4rem;
    }

    .login-status {
        width: 100%;
        justify-content: flex-end;
        font-size: .85rem;
    }

    .school-logo {
        width: 82px !important;
        height: 82px !important;
    }

    .app-title h2 {
        font-size: 1.18rem !important;
    }
}

@media (max-width: 760px) {
    body { padding: 0 1rem; }

    header {
        padding: .65rem !important;
        border-radius: 0 0 .8rem .8rem;
    }

    header.admin-menu-open {
        border-radius: 0 0 0 .8rem !important;
    }

    .admin-subnav.is-open {
        padding: .35rem .65rem .5rem;
        border-radius: 0 0 .8rem .8rem;
    }

    header.admin-menu-open ~ main {
        padding-top: 2.5rem !important;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: .55rem !important;
    }

    .theme-toggle-pill {
        position: absolute;
        top: .65rem;
        right: .65rem;
    }

    .app-title {
        flex-direction: row !important;
        align-items: center !important;
        gap: .65rem !important;
        font-size: 1.15rem !important;
        line-height: 1.1;
    }

    .app-title h2,
    header h2 {
        font-size: 1.15rem !important;
        line-height: 1.05 !important;
        margin-bottom: 0;
    }

    .school-logo {
        width: 72px !important;
        height: 72px !important;
        padding: .2rem !important;
        border-radius: .75rem !important;
    }

    .top-nav,
    .login-status {
        width: 100%;
        justify-content: space-between;
    }

    .nav-area {
        width: 100%;
    }

    .login-status small { font-size: .8rem !important; }

    .mobile-nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        min-height: 38px !important;
        padding: .25rem !important;
    }

    .nav-links {
        width: 100%;
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        align-items: center;
        gap: .5rem;
        margin-top: .75rem;
        padding: 0 0 .25rem;
        background: transparent;
        border: 0;
        border-radius: 0;
    }

    .nav-links.mobile-hidden { display: none; }

    .nav-links a {
        display: inline-flex;
        width: auto;
        padding: .35rem .55rem;
        border-bottom: 0;
    }

    .nav-links a:last-child { border-bottom: none; }

    .admin-menu-toggle {
        min-height: 34px;
        padding: .25rem .55rem;
        font-size: .92rem;
    }

    .admin-subnav.is-open {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        align-items: center;
        justify-content: flex-start;
        gap: .35rem;
        margin-top: .35rem;
        padding: 0 0 .25rem;
        border: 0;
        border-radius: 0;
        background: transparent;
    }

    .admin-subnav a {
        width: auto;
        flex-shrink: 0;
        white-space: nowrap;
        justify-content: flex-start;
        padding: .3rem .55rem;
    }

    .header-content {
        padding-right: 2.8rem;
    }

    .top-nav,
    .login-status {
        color: rgba(255, 255, 255, .90) !important;
    }

    .nav-links a,
    .admin-menu-toggle,
    .admin-subnav a {
        background: rgba(255, 255, 255, .08);
        border: 1px solid rgba(255, 255, 255, .14);
    }

    .school-logo,
    .school-logo.product-logo {
        width: 68px !important;
        height: 68px !important;
        padding: .25rem !important;
        border-radius: .85rem !important;
    }

    .app-title h2 {
        font-size: 1.18rem !important;
    }
}

.section-description {
    margin: .2rem 0 0;
    padding: 0;
    border-left: none;
    background: none;
    color: #64748b;
    font-size: 0.82rem;
    line-height: 1.4;
    border-radius: 0;
}

body:has(dialog.modal[open]) {
    overflow: hidden;
}

dialog.modal[open] {
    position: fixed;
    inset: 1rem 0 auto 0;
    margin: 0 auto;
    max-height: calc(100dvh - 1.5rem);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

dialog.modal::backdrop {
    background: rgba(0, 0, 0, .35);
}

dialog.modal article {
    max-width: min(900px, calc(100vw - 2rem));
    display: flex;
    flex-direction: column;
    max-height: inherit;
    overflow: hidden;
}

dialog.modal article > header {
    min-height: auto;
    flex-shrink: 0;
}

dialog.modal section {
    padding: .6rem 1rem .8rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    flex: 1 1 auto;
}


.schedule-manage-dialog {
    max-width: min(900px, calc(100vw - 2rem));
}

.schedule-manage-dialog article {
    font-size: .9rem;
}

.schedule-manage-dialog section > p {
    margin: .25rem 0 .55rem;
}

.schedule-manage-dialog .manage-status-card {
    margin: .4rem 0 .5rem;
    padding: .45rem .7rem;
}

.mm-capacity-bar-wrap {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin: .4rem 0 .2rem;
}

.mm-capacity-bar {
    flex: 1;
    height: 7px;
    border-radius: 4px;
    background: #e2e8f0;
    overflow: hidden;
}

.mm-capacity-bar .capacity-fill {
    height: 100%;
    background: var(--schedule-partial, var(--warning, #f59e0b));
    border-radius: 4px;
    transition: width .3s ease;
}

.mm-capacity-bar.is-free .capacity-fill { background: var(--schedule-free, var(--success, #22c55e)); }
.mm-capacity-bar.is-full .capacity-fill { background: var(--schedule-full, var(--danger, #ef4444)); }

.mm-capacity-label {
    font-size: .78rem;
    color: #64748b;
    white-space: nowrap;
}

.schedule-manage-dialog details {
    padding: .4rem 0;
}

.schedule-manage-dialog details + details {
    border-top: 1px solid var(--border-color, #e2e8f0);
}

.schedule-manage-dialog summary {
    font-size: .95rem;
    font-weight: 750;
}

.manage-reservation-form {
    display: grid;
    gap: .4rem;
    margin: .35rem 0 0;
}

.manage-form-grid {
    display: grid;
    grid-template-columns: 8rem 8rem minmax(11rem, 1fr);
    gap: .4rem .7rem;
    align-items: start;
}

.manage-reservation-form label {
    display: grid;
    gap: .28rem .28rem;
    row-gap: .28rem;
    margin: 0;
    color: var(--text-primary, #334155);
    font-size: .86rem;
    font-weight: 700;
}

.manage-reservation-form label small {
    margin-top: .25rem;
}

.manage-reservation-form {
    --pico-form-element-spacing-vertical: .28rem;
    --pico-form-element-spacing-horizontal: .5rem;
}

.manage-reservation-form input,
.manage-reservation-form select {
    width: 100%;
    margin: 0;
    font-size: .85rem;
}

.manage-reservation-form input[type="number"] {
    max-width: 100%;
}

.manage-reservation-form small {
    font-size: .74rem;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.mm-edit-form.manage-reservation-form {
    grid-template-columns: 1fr minmax(10rem, 13rem);
    gap: .35rem 3rem;
}

.mm-edit-title {
    grid-column: 1;
    grid-row: 1;
    align-self: baseline;
    font-size: .9rem;
    font-weight: 700;
    color: var(--text-primary, #334155);
    white-space: nowrap;
    margin: 0;
}

.mm-edit-qty-label {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: start;
    padding: .55rem .75rem .6rem;
    border: 1px solid #dbe3ee;
    border-radius: .6rem;
    background: #f8fafc;
}

.mm-edit-qty-label small {
    display: block;
    min-height: 1.3em;
}

html[data-theme="dark"] .mm-edit-qty-label {
    background: #1e293b;
    border-color: #334155;
}

#mmMyCurrentQty {
    grid-column: 1;
    grid-row: 2;
    align-self: baseline;
    white-space: nowrap;
}

#mmEditDetails.mm-cancel-only #mmMyCurrentQty {
    grid-column: 1 / -1;
}

.mm-edit-form > button[type="submit"] {
    grid-column: 1 / -1;
    grid-row: 3;
}

#mmEditDetails.mm-cancel-only .mm-edit-title {
    display: none !important;
}

#mmEditDetails.mm-cancel-only .mm-edit-qty-label,
#mmEditDetails.mm-cancel-only .mm-edit-form > button[type="submit"] {
    display: none !important;
}

@media (max-width: 500px) {
    .mm-edit-form.manage-reservation-form {
        grid-template-columns: 1fr;
    }
    .mm-edit-qty-label {
        grid-column: 1;
        grid-row: auto;
    }
    .mm-edit-form > button[type="submit"] {
        grid-row: auto;
    }
}

#mmCancelForm {
    margin-top: .5rem;
    display: flex;
}

#mmCancelForm .admin-btn {
    font-size: .78rem;
    padding: .28rem .7rem !important;
    height: auto;
    width: auto !important;
}

.manage-class-row label:first-child {
    min-width: 0;
}

.manage-class-row label[hidden] {
    display: none;
}

.schedule-manage-dialog .mm-list {
    display: grid;
    gap: .35rem;
    margin-top: .45rem;
}

html[data-theme="dark"] .schedule-manage-dialog details + details {
    border-top-color: #25364D;
}

@media (max-width: 640px) {
    .manage-form-grid {
        grid-template-columns: 1fr;
    }

    .manage-reservation-form input[type="number"] {
        max-width: 100%;
    }
}

/* ---------- Icon Picker Widget ---------- */
.ipw {
    position: relative;
    display: inline-block;
    width: 100%;
}

.ipw--inline {
    display: block;
    width: 100%;
}

.ipw-inline-grid {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
    padding: .4rem;
    border: 1px solid #cbd5e1;
    border-radius: .5rem;
    max-height: 140px;
    overflow-y: auto;
    background: #f8fafc;
}

html[data-theme="dark"] .ipw-inline-grid {
    background: #111827;
    border-color: #334155;
}

.ipw-selected-label {
    display: flex;
    align-items: center;
    gap: .35rem;
    margin-top: .3rem;
    font-size: .78rem;
    color: #475569;
}

.ipw-selected-label .ipw-preview {
    width: 1.1rem;
    height: 1.1rem;
    flex-shrink: 0;
}

html[data-theme="dark"] .ipw-selected-label {
    color: #94a3b8;
}

.ipw-trigger {
    display: flex;
    align-items: center;
    gap: .4rem;
    width: 100%;
    padding: .3rem .5rem;
    border: 1px solid var(--pico-border-color, #334155);
    border-radius: .4rem;
    background: var(--pico-background-color, #0f172a);
    color: inherit;
    cursor: pointer;
    text-align: left;
    font-size: .82rem;
}

.ipw-trigger:hover {
    border-color: var(--school-blue, #1558C5);
}

.ipw-preview {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    color: var(--school-blue, #1558C5);
}

.ipw-preview .equipment-icon {
    width: 1.2rem;
    height: 1.2rem;
    display: block;
}

.ipw-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ipw-caret {
    flex-shrink: 0;
    opacity: .45;
}

.ipw-drop {
    position: absolute;
    top: calc(100% + 3px);
    left: 0;
    z-index: 2000;
    background: var(--pico-card-background-color, #1e293b);
    border: 1px solid var(--pico-border-color, #334155);
    border-radius: .5rem;
    box-shadow: 0 6px 20px rgba(0,0,0,.35);
    padding: .5rem .6rem;
    min-width: 260px;
    max-height: 340px;
    overflow-y: auto;
}

.ipd-group {
    margin-bottom: .5rem;
}

.ipd-group-label {
    font-size: .6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-muted, #aaa);
    margin-bottom: .2rem;
    padding: 0 .15rem;
}

.ipd-row {
    display: flex;
    flex-wrap: wrap;
    gap: .2rem;
}

.ipd-btn {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: .35rem;
    background: none;
    cursor: pointer;
    color: var(--text-primary, #ddd);
    padding: .25rem;
    transition: background .1s, border-color .1s;
}

.ipd-btn:hover {
    background: var(--bg-tertiary, #334155);
    border-color: var(--pico-border-color, #334155);
}

.ipd-btn--active {
    background: rgba(21, 88, 197, .22);
    border-color: var(--school-blue, #1558C5);
    color: var(--school-blue-light, #EAF2FF);
}

.ipd-btn .equipment-icon {
    width: 1.15rem;
    height: 1.15rem;
    display: block;
}

html[data-theme="light"] .ipw-trigger {
    background: #fff;
    border-color: var(--pico-border-color, #ccc);
    color: #1e293b;
}

html[data-theme="light"] .ipw-drop {
    background: #fff;
    border-color: var(--pico-border-color, #ddd);
    box-shadow: 0 6px 20px rgba(0,0,0,.12);
}

html[data-theme="light"] .ipd-btn {
    color: #1e3a5f;
}

html[data-theme="light"] .ipd-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

html[data-theme="light"] .ipd-btn--active {
    background: #dbeafe;
    border-color: var(--school-blue, #1558C5);
    color: var(--school-blue, #1558C5);
}

/* ---------- Dark mode fixes ---------- */
html[data-theme="dark"] #listEditModal .manage-status-card {
    background: #162033;
    border-color: #25364D;
}

html[data-theme="dark"] #listEditModal .manage-status-pill.is-free {
    background: rgba(34, 197, 94, .16);
    color: #dcfce7;
}

html[data-theme="dark"] #listEditModal .manage-status-pill.is-partial {
    background: rgba(234, 179, 8, .16);
    color: #fef3c7;
}

html[data-theme="dark"] #listEditModal .manage-status-pill.is-full {
    background: rgba(239, 68, 68, .16);
    color: #fee2e2;
}

html[data-theme="dark"] .mm-capacity-label {
    color: #94a3b8;
}

html[data-theme="dark"] .section-description {
    background: #162033;
    color: #cbd5e1;
    border-left-color: #60a5fa;
}

/* Login page — canvas vidno skozi nogo */
html:not([data-theme="dark"]) body.page-login .app-footer {
    background: rgba(220, 235, 255, 0.04) !important;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

body.page-login .app-footer .footer-card,
body.page-login .app-footer .footer-content,
body.page-login .app-footer .footer-bottom {
    background: transparent !important;
}

/* ---------- Login hero (krovna stran) ---------- */
.login-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: stretch;
    align-content: center;
    min-height: calc(100dvh - 160px);
    padding: 2.5rem 1.5rem 3rem;
    max-width: 900px;
    margin: 0 auto;
}

/* Left panel */
.login-hero-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: rgba(255, 255, 255, .72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(21, 88, 197, .14);
    border-radius: 1.1rem;
    box-shadow:
        0 4px 24px rgba(10, 47, 143, .10),
        0 1px 4px rgba(10, 47, 143, .06);
    padding: 1.6rem 1.9rem;
}

html[data-theme="dark"] .login-hero-panel {
    background: rgba(30, 41, 59, .70);
    border-color: rgba(147, 197, 253, .12);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, .35),
        0 1px 4px rgba(0, 0, 0, .18);
}

.login-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .24rem .7rem;
    border-radius: 999px;
    background: rgba(21, 88, 197, .10);
    border: 1px solid rgba(21, 88, 197, .18);
    color: var(--nurnit-blue, #1558C5);
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: uppercase;
    margin-bottom: .75rem;
}

html[data-theme="dark"] .login-hero-badge {
    background: rgba(147, 197, 253, .12);
    border-color: rgba(147, 197, 253, .22);
    color: #93c5fd;
}

.login-hero-heading {
    margin: 0 0 .4rem;
    font-size: clamp(1.15rem, 1.8vw, 1.4rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -.02em;
    color: var(--nurnit-blue-dark, #0A2F8F);
}

html[data-theme="dark"] .login-hero-heading {
    color: #e2e8f0;
}

.login-hero-desc {
    margin: 0 0 .9rem;
    font-size: .85rem;
    line-height: 1.45;
    color: var(--text-secondary, #475569);
    max-width: 38ch;
}

.login-hero-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .45rem;
}

.login-hero-feature {
    display: flex;
    align-items: center;
    gap: .55rem;
    font-size: .8rem;
    color: var(--text-secondary, #475569);
}

html[data-theme="dark"] .login-hero-feature { color: #94a3b8; }

.login-hero-feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: .5rem;
    background: rgba(21, 88, 197, .08);
    border: 1px solid rgba(21, 88, 197, .12);
    color: var(--nurnit-blue, #1558C5);
}

html[data-theme="dark"] .login-hero-feature-icon {
    background: rgba(147, 197, 253, .1);
    border-color: rgba(147, 197, 253, .18);
    color: #93c5fd;
}

.school-picker {
    margin-top: .9rem;
    padding-top: .9rem;
    border-top: 1px solid rgba(21, 88, 197, .12);
}

html[data-theme="dark"] .school-picker {
    border-top-color: rgba(147, 197, 253, .14);
}

.school-picker-label {
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted);
    margin-bottom: .5rem;
}

.school-picker-list {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.school-pill {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .35rem .75rem;
    border-radius: 999px;
    border: 1px solid rgba(21, 88, 197, .18);
    background: rgba(21, 88, 197, .05);
    color: var(--text-secondary);
    font-size: .8rem;
    font-weight: 500;
    text-decoration: none;
    transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}

.school-pill:hover {
    background: rgba(21, 88, 197, .13);
}

.school-pill-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(21, 88, 197, .4);
    flex-shrink: 0;
}

.school-pill-active {
    background: linear-gradient(135deg, #0A2F8F 0%, #1558C5 55%, #1E73E8 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 12px rgba(10, 47, 143, .28);
}

.school-pill-active .school-pill-dot { background: #fff; }

html[data-theme="dark"] .school-pill {
    border-color: rgba(147, 197, 253, .18);
    background: rgba(147, 197, 253, .06);
    color: #94a3b8;
}

html[data-theme="dark"] .school-pill:hover {
    background: rgba(147, 197, 253, .14);
}

html[data-theme="dark"] .school-pill-dot {
    background: rgba(147, 197, 253, .45);
}

html[data-theme="dark"] .school-pill-active {
    background: linear-gradient(135deg, #0A2F8F 0%, #1558C5 55%, #1E73E8 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .35);
}

html[data-theme="dark"] .school-pill-active .school-pill-dot {
    background: #fff;
}

@media (max-width: 720px) {
    .school-picker-list { justify-content: center; }
}

/* Right panel — login card */
.login-hero-form-wrap {
    display: flex;
    justify-content: center;
    align-items: stretch;
}

.login-card {
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    border-radius: 1.1rem;
    border: 1px solid rgba(21, 88, 197, .14);
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow:
        0 4px 24px rgba(10, 47, 143, .10),
        0 1px 4px rgba(10, 47, 143, .06);
    overflow: hidden;
}

html[data-theme="dark"] .login-card {
    background: rgba(30, 41, 59, .88);
    border-color: rgba(147, 197, 253, .12);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, .35),
        0 1px 4px rgba(0, 0, 0, .18);
}

.login-card-header {
    padding: 1.25rem 1.5rem 1.1rem;
    background: linear-gradient(135deg, #0A2F8F 0%, #1558C5 55%, #1E73E8 100%);
}

.login-card-title {
    margin: 0 0 .2rem;
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -.02em;
}

.login-card-subtitle {
    margin: 0;
    font-size: .82rem;
    color: rgba(255, 255, 255, .72);
    line-height: 1.4;
}

.login-card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.login-card .login-form {
    margin: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.login-card .login-fields {
    width: 100%;
    margin: 0;
}

.login-card .login-actions {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.login-submit-btn {
    width: 100% !important;
    justify-content: center !important;
    height: 44px !important;
    font-size: .95rem !important;
}

/* Responsive: stack on small screens */
@media (max-width: 720px) {
    .login-hero {
        grid-template-columns: 1fr;
        min-height: unset;
        padding: 1.5rem 1rem 2rem;
        gap: 1.75rem;
    }

    .login-hero-panel {
        text-align: center;
        padding: 1.25rem 1.25rem 1.4rem;
    }

    .login-hero-features {
        align-items: center;
    }

    .login-hero-desc { max-width: 100%; }

    .login-hero-form-wrap {
        justify-content: center;
    }

    .login-card {
        max-width: 100%;
    }
}
