@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 300 800;
    font-display: swap;
    src: url('../fonts/outfit/outfit-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 300 800;
    font-display: swap;
    src: url('../fonts/outfit/outfit-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99,102,241,0.35);
    --accent: #818cf8;
    --success: #10b981;
    --danger: #f43f5e;
    --warning: #f59e0b;
    --bg-main: #f1f5f9;
    --bg-card: #ffffff;
    --bg-sidebar: #1e1b4b;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow: 0 4px 24px -4px rgba(15,23,42,0.10);
    --shadow-lg: 0 12px 40px -8px rgba(15,23,42,0.18);
    --radius: 1rem;
    --radius-sm: 0.625rem;
    --sidebar-text: rgba(255,255,255,0.75);
    --sidebar-active-bg: rgba(99,102,241,0.25);
    --sidebar-active-text: #ffffff;
    --sidebar-hover-bg: rgba(255,255,255,0.08);
    --font: 'Outfit', sans-serif;
}

[data-theme='dark'] {
    --bg-main: #0b0f1a;
    --bg-card: rgba(22,28,48,0.80);
    --bg-sidebar: #080c18;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --border: rgba(99,102,241,0.14);
    --shadow: 0 4px 24px -4px rgba(0,0,0,0.45);
    --shadow-lg: 0 16px 48px -12px rgba(0,0,0,0.65);
    --sidebar-active-bg: rgba(99,102,241,0.30);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background-color: var(--bg-main);
    color: var(--text-main);
    transition: background-color 0.35s, color 0.35s;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    max-width: 100%;
}

img, video, canvas, svg { max-width: 100%; height: auto; }

/* Fixed sidebar must not also occupy flex space (that double-offsets main and overflows). */
body:has(> .sidebar) {
    display: block !important;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    width: 260px;
    height: 100vh;
    position: fixed;
    left: 0; top: 0;
    background: var(--bg-sidebar);
    background-image: linear-gradient(180deg, #1e1b4b 0%, #151232 100%);
    border-right: 1px solid rgba(99,102,241,0.12);
    padding: 1.25rem 0.85rem 0.85rem;
    z-index: 50;
    transition: transform 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

[data-theme='dark'] .sidebar {
    background-image: linear-gradient(180deg, #0c1020 0%, #080c18 100%);
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.3); border-radius: 99px; }

.sidebar nav { flex: 1; overflow-y: auto; padding: 0 0.15rem 0.5rem; }
.sidebar nav::-webkit-scrollbar { width: 4px; }
.sidebar nav::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.3); border-radius: 99px; }

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.875rem;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: var(--radius-sm);
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
    cursor: pointer;
    border: none;
    width: 100%;
    text-align: left;
    background: transparent;
}

.sidebar-link:hover {
    background: var(--sidebar-hover-bg);
    color: #fff;
    transform: translateX(3px);
}

.sidebar-link.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    box-shadow: inset 2px 0 0 var(--primary);
}

.sidebar-link i {
    width: 18px;
    text-align: center;
    opacity: 0.85;
    flex-shrink: 0;
}

/* Mobile sidebar */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        width: min(280px, 86vw);
        z-index: 60;
    }
    .sidebar.open { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,0.4); }
    main, .main-content { margin-left: 0 !important; width: 100%; }
    .sidebar-overlay {
        display: none; position: fixed; inset: 0;
        background: rgba(0,0,0,0.55); z-index: 55;
        opacity: 0; transition: opacity 0.3s;
    }
    .sidebar-overlay.show { display: block; opacity: 1; }
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 2rem;
    min-height: 100vh;
    transition: margin-left 0.3s;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

@media (max-width: 640px) {
    .main-content, main { padding: 1rem !important; }
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: box-shadow 0.2s, border-color 0.2s;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    max-width: 100%;
    min-width: 0;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    border-color: rgba(99, 102, 241, 0.22);
}

.card:has(table):hover,
.card.p-0:hover,
.card.overflow-hidden:hover {
    transform: none;
    box-shadow: var(--shadow);
}

.glass {
    background: rgba(255,255,255,0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.25);
}

[data-theme='dark'] .glass {
    background: rgba(15,19,36,0.75);
    border: 1px solid rgba(99,102,241,0.15);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: #fff;
    padding: 0.6rem 1.375rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    box-shadow: 0 4px 14px -4px var(--primary-glow);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px -6px var(--primary-glow);
    filter: brightness(1.08);
}
.btn-primary:active { transform: scale(0.97); }

.btn-secondary {
    background: transparent;
    color: var(--text-muted);
    padding: 0.6rem 1.375rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(99,102,241,0.06);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    padding: 0.6rem 1.375rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.btn-danger:hover { filter: brightness(1.1); transform: translateY(-1px); }

.btn-sm { padding: 0.35rem 0.875rem; font-size: 0.8rem; }

/* ============================================================
   FORM CONTROLS
   ============================================================ */
input, select, textarea {
    color: var(--text-main);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

input::placeholder, textarea::placeholder { color: var(--text-muted); opacity: 0.7; }

[data-theme='dark'] input,
[data-theme='dark'] select,
[data-theme='dark'] textarea {
    background: rgba(255,255,255,0.05);
    color: #e2e8f0;
    border-color: rgba(99,102,241,0.18);
}

[data-theme='dark'] input::placeholder { color: #64748b; }

/* Autofill fix */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 30px var(--bg-card) inset !important;
    -webkit-text-fill-color: var(--text-main) !important;
}
[data-theme='dark'] input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 30px #1a2035 inset !important;
}

/* Number spinner */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }

.hf-num-spinner { display: inline-flex; align-items: stretch; gap: 0.35rem; }
.hf-num-spinner.hf-num-spinner--block { display: flex; width: 100%; }
.hf-num-spinner input { flex: 1 1 auto; min-width: 0; width: 4.75rem; text-align: center; }
.hf-num-spinner.hf-num-spinner--block input { width: 100%; }

.hf-num-btn {
    width: 2.25rem;
    min-height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    background: var(--bg-card);
    border: 1px solid var(--border);
    cursor: pointer;
    font-size: 1.05rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
    user-select: none;
}
.hf-num-btn:hover { background: rgba(99,102,241,0.1); border-color: var(--primary); }
.hf-num-btn:active { background: rgba(99,102,241,0.2); }
.hf-num-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ============================================================
   TABLES
   ============================================================ */
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
thead tr { border-bottom: 2px solid var(--border); }
thead th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}
tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(99,102,241,0.04); }
td { padding: 0.875rem 1rem; color: var(--text-main); }

@media (max-width: 768px) {
    table { display: block; overflow-x: auto; white-space: nowrap; }
}

/* ============================================================
   TOAST
   ============================================================ */
.toast-container { position: fixed; bottom: 2rem; right: 2rem; z-index: 9999; }

.toast {
    background: var(--bg-card);
    color: var(--text-main);
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    border-left: 3px solid var(--primary);
    margin-top: 0.625rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    backdrop-filter: blur(12px);
    animation: slideIn 0.3s cubic-bezier(0.4,0,0.2,1);
    font-size: 0.875rem;
    font-weight: 500;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideIn {
    from { transform: translateX(110%); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}
@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 var(--primary-glow); }
    50%       { box-shadow: 0 0 0 8px transparent; }
}

.animate-fade-in { animation: fadeIn 0.4s cubic-bezier(0.4,0,0.2,1) forwards; }

/* ============================================================
   STATUS BADGES
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
@media (max-width: 640px) {
    .toast-container { right: 1rem; left: 1rem; bottom: 1rem; }
    .toast { min-width: 0; width: 100%; }
}

.badge-success { background: rgba(16,185,129,0.12); color: #059669; border: 1px solid rgba(16,185,129,0.2); }
.badge-warning { background: rgba(245,158,11,0.12); color: #d97706; border: 1px solid rgba(245,158,11,0.2); }
.badge-danger  { background: rgba(244,63,94,0.12);  color: #e11d48; border: 1px solid rgba(244,63,94,0.2); }
.badge-info    { background: rgba(99,102,241,0.12); color: #4f46e5; border: 1px solid rgba(99,102,241,0.2); }
.badge-pending { background: rgba(245,158,11,0.12); color: #d97706; border: 1px solid rgba(245,158,11,0.2); }
.badge-processing { background: rgba(59,130,246,0.12); color: #2563eb; border: 1px solid rgba(59,130,246,0.2); }
.badge-complete { background: rgba(16,185,129,0.12); color: #059669; border: 1px solid rgba(16,185,129,0.2); }
.badge-archived { background: rgba(100,116,139,0.12); color: #475569; border: 1px solid rgba(100,116,139,0.2); }
.badge-urgent { background: rgba(244,63,94,0.12); color: #e11d48; border: 1px solid rgba(244,63,94,0.2); }

[data-theme='dark'] .badge-success,
[data-theme='dark'] .badge-complete { color: #34d399; }
[data-theme='dark'] .badge-warning,
[data-theme='dark'] .badge-pending { color: #fbbf24; }
[data-theme='dark'] .badge-danger,
[data-theme='dark'] .badge-urgent { color: #fb7185; }
[data-theme='dark'] .badge-info { color: #a5b4fc; }

/* ============================================================
   APP SHELL — headers, tabs, empty states, confirm, user chip
   ============================================================ */
.hf-brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.15rem 0.65rem 1.1rem;
    color: #fff;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}
.hf-brand-mark {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 0.7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6366f1, #7c3aed);
    box-shadow: 0 8px 18px -10px rgba(99,102,241,0.9);
    font-size: 0.9rem;
}
.hf-brand-sub {
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.45);
    margin-top: 0.05rem;
}

.hf-nav-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.38);
    padding: 0.85rem 0.875rem 0.35rem;
}

.hf-sidebar-footer {
    margin-top: auto;
    padding: 0.75rem 0.35rem 0.15rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

.hf-user-chip {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.7rem;
    margin-bottom: 0.35rem;
    border-radius: 0.85rem;
    background: rgba(255,255,255,0.06);
}
.hf-user-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #818cf8, #6366f1);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.hf-user-meta { min-width: 0; }
.hf-user-name {
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hf-user-role {
    color: rgba(255,255,255,0.5);
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.hf-header-user {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.3rem 0.75rem 0.3rem 0.3rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    box-shadow: var(--shadow);
    flex-shrink: 0;
}
.hf-header-user .hf-user-name { color: var(--text-main); }
.hf-header-user .hf-user-role { color: var(--text-muted); }

.hf-count {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.02em;
}

td .hf-empty { padding: 2.25rem 1rem; }

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.9;
}

.main-content > header,
.main-content header {
    gap: 1rem;
}
.hf-page-heading {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    min-width: 0;
    max-width: 100%;
    gap: 0.15rem;
}
.main-content h2,
.page-title,
.hf-page-heading h2 {
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.2;
    display: block;
    max-width: 100%;
    overflow-wrap: anywhere;
}
.page-kicker {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 0.15rem;
    line-height: 1.2;
}
.main-content > header + p,
.page-subtitle {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.925rem;
}

.icon-btn {
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
}
.icon-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(99,102,241,0.06);
}

.hf-tab {
    padding: 0.9rem 0.15rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    transition: color 0.15s, border-color 0.15s;
}
.hf-tab:hover { color: var(--text-main); }
.hf-tab.is-active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.hf-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}
.hf-empty i {
    display: block;
    font-size: 2.25rem;
    margin-bottom: 0.85rem;
    opacity: 0.35;
    color: var(--primary);
}
.hf-empty strong {
    display: block;
    color: var(--text-main);
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}
.hf-empty p { font-size: 0.85rem; }

.hf-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: rgba(248,250,252,0.7);
}
[data-theme='dark'] .hf-toolbar { background: rgba(15,23,42,0.35); }

.hf-confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.hf-confirm {
    width: 100%;
    max-width: 26rem;
    background: var(--bg-card);
    color: var(--text-main);
    border-radius: 1rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    padding: 1.35rem 1.35rem 1.15rem;
}
.hf-confirm h3 { font-size: 1.05rem; font-weight: 800; margin-bottom: 0.5rem; }
.hf-confirm p { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 1.15rem; line-height: 1.45; }
.hf-confirm-actions { display: flex; justify-content: flex-end; gap: 0.5rem; }

/* ============================================================
   AUTH PAGES (login / register)
   ============================================================ */
body.hf-auth {
    min-height: 100vh;
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: #080c18 !important;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
}
.hf-auth-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.18;
    pointer-events: none;
}
.hf-auth-orb-1 { width: 520px; height: 520px; background: #6366f1; top: -120px; left: -140px; }
.hf-auth-orb-2 { width: 380px; height: 380px; background: #7c3aed; bottom: -100px; right: -100px; }
.hf-auth-orb-3 { width: 260px; height: 260px; background: #0ea5e9; top: 50%; left: 50%; transform: translate(-50%,-50%); opacity: 0.08; }
body.hf-auth .hf-auth-card {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 420px;
    margin: 1.5rem 1rem 5rem;
    background: rgba(30, 41, 79, 0.94);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(165,180,252,0.45);
    border-radius: 1.5rem;
    padding: 2.5rem 2rem;
    box-shadow: 0 24px 80px -16px rgba(0,0,0,0.7), 0 0 0 1px rgba(99,102,241,0.12);
}
body.hf-auth .hf-auth-submit {
    width: 100%;
    padding: 0.9rem;
    background: linear-gradient(135deg, #818cf8, #4f46e5);
    color: #fff !important;
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    margin-top: 0.35rem;
    box-shadow: 0 8px 28px -8px rgba(129,140,248,0.85);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.hf-auth-logo {
    width: 72px; height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(99,102,241,0.25), rgba(124,58,237,0.15));
    border: 1px solid rgba(99,102,241,0.3);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1.25rem;
    box-shadow: 0 0 30px rgba(99,102,241,0.2);
}
.hf-auth-card h1 { color: #f8fafc; font-size: 1.6rem; font-weight: 800; letter-spacing: -0.03em; text-align: center; }
.hf-auth-card .hf-auth-sub { color: #cbd5e1; font-size: 0.875rem; text-align: center; margin-top: 0.35rem; margin-bottom: 1.5rem; }
.hf-auth-field { position: relative; margin-bottom: 1.15rem; }
.hf-auth-field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: #e2e8f0;
    margin-bottom: 0.45rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.hf-auth-field input,
.hf-auth-field select {
    width: 100%;
    padding: 0.8rem 0.875rem 0.8rem 2.75rem;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(148,163,184,0.35);
    border-radius: 0.75rem;
    color: #f8fafc;
    font-size: 0.95rem;
    font-family: var(--font);
}
.hf-auth-field select { padding-left: 0.875rem; }
.hf-auth-field input::placeholder { color: #cbd5e1; opacity: 1; }
.hf-auth-field input:focus,
.hf-auth-field select:focus {
    border-color: #818cf8;
    background: rgba(99,102,241,0.12);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
    outline: none;
}
.hf-auth-icon {
    position: absolute;
    left: 0.875rem;
    bottom: 0.9rem;
    color: #a5b4fc;
    font-size: 0.875rem;
    pointer-events: none;
}
.hf-auth-submit:hover { filter: brightness(1.08); }
.hf-auth-foot {
    margin-top: 1.35rem;
    padding-top: 1.15rem;
    border-top: 1px solid rgba(148,163,184,0.2);
    text-align: center;
    font-size: 0.875rem;
    color: #cbd5e1;
}
.hf-auth-foot a { color: #c7d2fe; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.hf-auth-foot a:hover { color: #fff; }
.hf-auth-legal {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    padding: 0.75rem;
    text-align: center;
    z-index: 5;
    background: rgba(8,12,24,0.75);
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(99,102,241,0.12);
    font-size: 0.75rem;
    color: #94a3b8;
}

.hf-identity {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0 0 1.25rem;
    padding: 0.85rem 1.1rem;
    border-radius: 0.85rem;
    border: 1px solid rgba(99,102,241,0.28);
    background: rgba(99,102,241,0.08);
}
.hf-identity.is-missing {
    border-color: rgba(245,158,11,0.45);
    background: rgba(245,158,11,0.12);
}
.hf-identity-lab {
    font-family: ui-monospace, Consolas, monospace;
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: 0.04em;
    color: var(--primary);
    flex-shrink: 0;
}
.hf-identity-meta {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}
.hf-identity-meta strong {
    font-size: 0.95rem;
    color: var(--text-main);
}
.hf-identity-meta span {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.hf-identity-status {
    font-weight: 600;
}

.hf-scan-flash {
    position: fixed;
    top: 1.15rem;
    left: 50%;
    transform: translateX(-50%) translateY(-0.6rem);
    z-index: 80;
    min-width: min(92vw, 28rem);
    max-width: 94vw;
    padding: 1.05rem 1.4rem 1.15rem;
    border-radius: 1rem;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 22px 50px -18px rgba(15, 23, 42, 0.55);
}
.hf-scan-flash.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    transition: opacity 0.14s ease, transform 0.14s ease;
}
.hf-scan-flash.is-ok {
    background: #065f46;
    color: #ecfdf5;
    border: 1px solid rgba(167, 243, 208, 0.35);
}
.hf-scan-flash.is-bad {
    background: #9f1239;
    color: #fff1f2;
    border: 1px solid rgba(254, 205, 211, 0.35);
}
.hf-scan-flash-lab {
    font-family: ui-monospace, Consolas, monospace;
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    line-height: 1.15;
}
.hf-scan-flash-msg {
    margin-top: 0.2rem;
    font-size: 1.05rem;
    font-weight: 600;
}

.dash-queue-link {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.dash-queue-link:hover {
    border-color: rgba(79, 70, 229, 0.45);
    transform: translateY(-2px);
    box-shadow: 0 12px 28px -18px rgba(15, 23, 42, 0.4);
}
.dash-queue-link:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ============================================================
   MEDICAL THEME — landing, dashboard, analytics
   ============================================================ */
:root {
    --med-teal: #0d9488;
    --med-cyan: #0891b2;
    --med-sky: #0284c7;
    --med-indigo: #4f46e5;
}

.hf-rise {
    opacity: 0;
    animation: fadeIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.hf-rise-1 { animation-delay: 0.05s; }
.hf-rise-2 { animation-delay: 0.12s; }
.hf-rise-3 { animation-delay: 0.19s; }
.hf-rise-4 { animation-delay: 0.26s; }
.hf-rise-5 { animation-delay: 0.33s; }
.hf-rise-6 { animation-delay: 0.4s; }

.hf-kpi {
    position: relative;
    overflow: hidden;
    border-radius: 1.15rem;
    padding: 1.25rem 1.3rem 1.35rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}
.hf-kpi::after {
    content: "";
    position: absolute;
    inset: auto -20% -40% auto;
    width: 8rem;
    height: 8rem;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.07;
    pointer-events: none;
}
.hf-kpi:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.hf-kpi-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
}
.hf-kpi-value {
    font-size: 2.05rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-top: 0.85rem;
}
.hf-kpi-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 0.2rem;
}
.hf-kpi.is-teal { color: #0f766e; border-color: rgba(13, 148, 136, 0.28); }
.hf-kpi.is-teal .hf-kpi-icon { background: #ccfbf1; color: #0f766e; }
.hf-kpi.is-cyan { color: #0e7490; border-color: rgba(8, 145, 178, 0.28); }
.hf-kpi.is-cyan .hf-kpi-icon { background: #cffafe; color: #0e7490; }
.hf-kpi.is-sky { color: #0369a1; border-color: rgba(2, 132, 199, 0.28); }
.hf-kpi.is-sky .hf-kpi-icon { background: #e0f2fe; color: #0369a1; }
.hf-kpi.is-indigo { color: #4338ca; border-color: rgba(79, 70, 229, 0.28); }
.hf-kpi.is-indigo .hf-kpi-icon { background: #e0e7ff; color: #4338ca; }
.hf-kpi.is-amber { color: #b45309; border-color: rgba(245, 158, 11, 0.3); }
.hf-kpi.is-amber .hf-kpi-icon { background: #fef3c7; color: #b45309; }
.hf-kpi.is-rose { color: #be123c; border-color: rgba(244, 63, 94, 0.28); }
.hf-kpi.is-rose .hf-kpi-icon { background: #ffe4e6; color: #be123c; }
.hf-kpi.is-violet { color: #6d28d9; border-color: rgba(124, 58, 237, 0.28); }
.hf-kpi.is-violet .hf-kpi-icon { background: #ede9fe; color: #6d28d9; }
.hf-kpi.is-emerald { color: #047857; border-color: rgba(16, 185, 129, 0.28); }
.hf-kpi.is-emerald .hf-kpi-icon { background: #d1fae5; color: #047857; }

.hf-stage-tile {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1rem 1.05rem 1.1rem;
    border-radius: 1rem;
    text-decoration: none;
    color: inherit;
    border: 1px solid transparent;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-height: 7.25rem;
}
.hf-stage-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.hf-stage-tile .hf-stage-kicker {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.8;
}
.hf-stage-tile .hf-stage-num {
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-top: auto;
}
.hf-stage-embed { background: linear-gradient(160deg, #ccfbf1 0%, #f0fdfa 100%); color: #115e59; }
.hf-stage-micro { background: linear-gradient(160deg, #cffafe 0%, #ecfeff 100%); color: #155e75; }
.hf-stage-stain { background: linear-gradient(160deg, #ede9fe 0%, #f5f3ff 100%); color: #5b21b6; }
.hf-stage-alloc { background: linear-gradient(160deg, #e0e7ff 0%, #eef2ff 100%); color: #3730a3; }
.hf-stage-arch { background: linear-gradient(160deg, #e2e8f0 0%, #f8fafc 100%); color: #334155; }
.hf-stage-overdue { background: linear-gradient(160deg, #ffe4e6 0%, #fff1f2 100%); color: #9f1239; }

[data-theme='dark'] .hf-kpi.is-teal .hf-kpi-icon { background: rgba(13,148,136,0.22); color: #5eead4; }
[data-theme='dark'] .hf-kpi.is-cyan .hf-kpi-icon { background: rgba(8,145,178,0.22); color: #67e8f9; }
[data-theme='dark'] .hf-kpi.is-sky .hf-kpi-icon { background: rgba(2,132,199,0.22); color: #7dd3fc; }
[data-theme='dark'] .hf-kpi.is-indigo .hf-kpi-icon { background: rgba(79,70,229,0.22); color: #a5b4fc; }
[data-theme='dark'] .hf-kpi.is-amber .hf-kpi-icon { background: rgba(245,158,11,0.22); color: #fcd34d; }
[data-theme='dark'] .hf-kpi.is-rose .hf-kpi-icon { background: rgba(244,63,94,0.22); color: #fda4af; }
[data-theme='dark'] .hf-kpi.is-violet .hf-kpi-icon { background: rgba(124,58,237,0.22); color: #c4b5fd; }
[data-theme='dark'] .hf-kpi.is-emerald .hf-kpi-icon { background: rgba(16,185,129,0.22); color: #6ee7b7; }
[data-theme='dark'] .hf-kpi.is-teal,
[data-theme='dark'] .hf-kpi.is-cyan,
[data-theme='dark'] .hf-kpi.is-sky,
[data-theme='dark'] .hf-kpi.is-indigo,
[data-theme='dark'] .hf-kpi.is-amber,
[data-theme='dark'] .hf-kpi.is-rose,
[data-theme='dark'] .hf-kpi.is-violet,
[data-theme='dark'] .hf-kpi.is-emerald { color: var(--text-main); }

[data-theme='dark'] .hf-stage-embed { background: linear-gradient(160deg, rgba(13,148,136,0.28), rgba(15,23,42,0.4)); color: #99f6e4; }
[data-theme='dark'] .hf-stage-micro { background: linear-gradient(160deg, rgba(8,145,178,0.28), rgba(15,23,42,0.4)); color: #a5f3fc; }
[data-theme='dark'] .hf-stage-stain { background: linear-gradient(160deg, rgba(124,58,237,0.28), rgba(15,23,42,0.4)); color: #ddd6fe; }
[data-theme='dark'] .hf-stage-alloc { background: linear-gradient(160deg, rgba(79,70,229,0.28), rgba(15,23,42,0.4)); color: #c7d2fe; }
[data-theme='dark'] .hf-stage-arch { background: linear-gradient(160deg, rgba(51,65,85,0.45), rgba(15,23,42,0.4)); color: #cbd5e1; }
[data-theme='dark'] .hf-stage-overdue { background: linear-gradient(160deg, rgba(190,18,60,0.32), rgba(15,23,42,0.4)); color: #fecdd3; }

.hf-med-page {
    background:
        radial-gradient(1200px 420px at 8% -10%, rgba(13, 148, 136, 0.14), transparent 55%),
        radial-gradient(900px 380px at 100% 0%, rgba(79, 70, 229, 0.12), transparent 50%),
        var(--bg-main);
}
.hf-landing {
    min-height: 100vh;
    background:
        radial-gradient(900px 420px at 0% 0%, rgba(13, 148, 136, 0.16), transparent 55%),
        radial-gradient(800px 360px at 100% 8%, rgba(8, 145, 178, 0.14), transparent 50%),
        linear-gradient(180deg, #f8fafc 0%, #eef2ff 48%, #f0fdfa 100%);
    color: #0f172a;
}
[data-theme='dark'] .hf-landing {
    background:
        radial-gradient(900px 420px at 0% 0%, rgba(13, 148, 136, 0.18), transparent 55%),
        radial-gradient(800px 360px at 100% 8%, rgba(79, 70, 229, 0.16), transparent 50%),
        var(--bg-main);
    color: var(--text-main);
}
.hf-landing-nav {
    position: sticky;
    top: 0;
    z-index: 40;
    backdrop-filter: blur(14px);
    background: rgba(248, 250, 252, 0.82);
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}
@media (max-width: 640px) {
    .hf-landing-nav .max-w-6xl { padding-left: 1rem; padding-right: 1rem; padding-top: 0.75rem; padding-bottom: 0.75rem; }
}
[data-theme='dark'] .hf-landing-nav { background: rgba(8, 12, 24, 0.78); }
.hf-med-card {
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 1.15rem;
    box-shadow: 0 10px 30px -18px rgba(15, 23, 42, 0.35);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
[data-theme='dark'] .hf-med-card {
    background: var(--bg-card);
    border-color: var(--border);
}
.hf-med-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 22px 40px -20px rgba(13, 148, 136, 0.35);
}
.hf-icon-tile {
    width: 3.1rem;
    height: 3.1rem;
    border-radius: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

@media (prefers-reduced-motion: reduce) {
    .hf-rise, .animate-fade-in { animation: none !important; opacity: 1; }
    .hf-kpi:hover, .hf-stage-tile:hover, .hf-med-card:hover { transform: none; }
}

.hf-stain-pick {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(8, 12, 24, 0.55);
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.hf-stain-pick.is-visible { display: flex !important; }
.hf-stain-pick-card {
    width: 100%;
    max-width: 24rem;
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.25rem 1.2rem 1rem;
}
.hf-stain-pick-card h3 { font-size: 1.1rem; font-weight: 800; margin-bottom: 0.25rem; }
.hf-stain-pick-card p { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 0.85rem; }
.hf-stain-pick-btns { display: flex; flex-direction: column; gap: 0.5rem; }
.hf-stain-pick-btns button {
    padding: 0.7rem 0.85rem;
    border-radius: 0.7rem;
    border: 1px solid var(--border);
    background: var(--bg-main);
    font-weight: 700;
    cursor: pointer;
}
.hf-stain-pick-btns button:hover { border-color: var(--primary); }

.hf-bench-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: end;
    margin-bottom: 1.25rem;
    padding: 1rem 1.1rem;
}
.hf-bench-bar > div > label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}
.hf-bench-bar label:has(input[type="radio"]) {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
}

.hf-h-timeline-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.25rem 0 0.35rem;
    width: 100%;
    max-width: 100%;
}
.hf-h-timeline {
    display: flex;
    width: 100%;
    min-width: 0;
    list-style: none;
    margin: 0;
    padding: 0.15rem 0 0;
}
.hf-h-step {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0 0.2rem;
}
.hf-h-rail {
    display: flex;
    align-items: center;
    width: 100%;
    margin-bottom: 0.55rem;
}
.hf-h-line {
    flex: 1;
    height: 3px;
    background: rgba(148, 163, 184, 0.28);
    border-radius: 99px;
}
.hf-h-step.is-done .hf-h-line,
.hf-h-step.is-now .hf-h-line-left {
    background: rgba(45, 212, 191, 0.7);
}
.hf-h-step:first-child .hf-h-line-left,
.hf-h-step:last-child .hf-h-line-right {
    visibility: hidden;
}
.hf-h-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    flex-shrink: 0;
    box-shadow: 0 8px 18px -10px rgba(0, 0, 0, 0.45);
    border: 2px solid rgba(255, 255, 255, 0.12);
}
.hf-h-step.is-wait .hf-h-icon {
    background: #334155 !important;
    color: #94a3b8;
    box-shadow: none;
}
[data-theme='light'] .hf-h-step.is-wait .hf-h-icon {
    background: #e2e8f0 !important;
    color: #64748b;
}
.hf-h-step.is-now .hf-h-icon {
    box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.28), 0 8px 18px -10px rgba(0, 0, 0, 0.45);
}
.hf-h-label {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.2;
}
.hf-h-status {
    font-size: 0.7rem;
    font-weight: 700;
    margin-top: 0.12rem;
}
.hf-h-step.is-done .hf-h-status { color: #34d399; }
.hf-h-step.is-now .hf-h-status { color: #fbbf24; }
.hf-h-step.is-wait .hf-h-status { color: var(--text-muted); }
.hf-h-meta {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
    line-height: 1.3;
    max-width: 100%;
    overflow-wrap: anywhere;
}
.hf-h-tech {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.hf-idle-lock {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgba(8, 12, 24, 0.78);
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.hf-idle-lock.is-visible { display: flex; }
.hf-idle-card {
    width: 100%;
    max-width: 22rem;
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.5rem 1.35rem 1.2rem;
}
.hf-idle-card h3 { font-size: 1.15rem; font-weight: 800; margin-bottom: 0.35rem; }
.hf-idle-card p { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 0.65rem; }
.hf-idle-user { color: var(--text-main) !important; font-weight: 700; }
.hf-idle-card input[type="password"] {
    width: 100%;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 0.7rem;
    background: var(--bg-main);
    color: var(--text-main);
    margin-bottom: 0.75rem;
}
.hf-idle-card .hf-auth-submit {
    width: 100%;
    padding: 0.75rem;
    background: #4f46e5;
    color: #fff;
    border: none;
    border-radius: 0.7rem;
    font-weight: 700;
    cursor: pointer;
}
.hf-idle-logout {
    display: block;
    width: 100%;
    margin-top: 0.65rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    text-decoration: underline;
}

.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-danger:focus-visible,
.sidebar-link:focus-visible,
.icon-btn:focus-visible,
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}

thead th {
    font-weight: 600 !important;
    letter-spacing: 0.06em !important;
    font-size: 0.7rem !important;
}

.hf-menu-btn,
#mobileMenuBtn {
    display: none;
    width: 2.5rem;
    height: 2.5rem;
    min-width: 2.5rem;
    min-height: 2.5rem;
    align-items: center;
    justify-content: center;
    border-radius: 0.65rem;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-main);
    flex-shrink: 0;
    cursor: pointer;
}
.hf-mobile-bar { display: none; align-items: center; margin-bottom: 0.75rem; }

.card, .hf-kpi, .hf-stage-tile, .hf-med-card {
    max-width: 100%;
    min-width: 0;
}

@media (max-width: 1024px) {
    .hf-menu-btn,
    #mobileMenuBtn { display: inline-flex !important; }
    .hf-mobile-bar { display: flex; }
    main header,
    .main-content header {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 0.75rem;
    }
}

@media (max-width: 900px) {
    .hf-h-timeline { min-width: 34rem; }
    .hf-h-step { min-width: 6.4rem; }
    .hf-h-icon { width: 2.6rem; height: 2.6rem; font-size: 1rem; border-radius: 0.75rem; }
}

@media (max-width: 768px) {
    .card { padding: 1.05rem; }
    .hf-kpi-value { font-size: 1.55rem; }
    .hf-kpi { padding: 1rem 1.05rem 1.1rem; }
    .main-content h2, .page-title, .hf-page-heading h2 { font-size: 1.28rem; }
    .hf-toolbar { padding: 0.75rem 0.85rem; }
    .hf-bench-bar { padding: 0.85rem; }
    .hf-bench-bar > div { min-width: 0; flex: 1 1 12rem; }
    body.hf-auth .hf-auth-card { padding: 1.75rem 1.2rem; margin: 1rem 0.75rem 4.5rem; }
    .hf-confirm-actions { flex-wrap: wrap; }
    .hf-confirm-actions button { flex: 1 1 auto; justify-content: center; }
    #tatDisplay { font-size: 1.35rem !important; line-height: 1.25; overflow-wrap: anywhere; }
}

@media (max-width: 640px) {
    .hf-h-timeline { min-width: 30rem; }
    .hf-h-icon {
        width: 2.25rem;
        height: 2.25rem;
        font-size: 0.9rem;
        border-radius: 0.65rem;
    }
    .hf-h-label { font-size: 0.7rem; }
    .hf-h-status { font-size: 0.62rem; }
    .hf-h-meta, .hf-h-tech { font-size: 0.6rem; }
    .hf-h-step.is-now .hf-h-icon { box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.28); }
    .hf-landing h1 { font-size: 1.85rem !important; line-height: 1.15; }
    .hf-icon-tile { width: 2.6rem; height: 2.6rem; font-size: 1rem; }
    input, select, textarea { max-width: 100%; }
    .hf-stage-tile { min-height: 5.75rem; }
    .hf-stage-tile .hf-stage-num { font-size: 1.5rem; }
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
    body { background: white !important; color: black !important; }
    aside, main, header, .card, .toast-container, #adminLink { display: none !important; }
    #printContainer { display: block !important; width: 45mm; margin: 0; padding: 0; }
    .label-wrapper {
        width: 45mm; height: 15mm; padding: 1mm;
        display: flex; align-items: center;
        page-break-after: always; overflow: hidden;
    }
    @page { size: 45mm 15mm; margin: 0; }
}

#printContainer { display: none; }

.label-content { display: flex; width: 100%; height: 100%; gap: 2mm; overflow: hidden; position: relative; }
.label-barcode  { width: 12mm; height: 12mm; flex-shrink: 0; }
.label-text     { flex: 1; display: flex; flex-direction: column; justify-content: center; font-size: 7pt; line-height: 1.1; overflow: hidden; color: black; }
.label-lab-number { font-weight: bold; font-size: 12pt; }
.label-patient  { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.label-date     { font-size: 6pt; }
.label-index    { position: absolute; bottom: 1mm; right: 1.5mm; font-size: 14pt; font-weight: 800; color: black; line-height: 1; }
