/* ================================================================
   CycleOS — 2026 Dark Glass UI
   Modern design system: glassmorphism, fluid typography, mobile-first
   ================================================================ */

/* ================================== */
/* 1. DESIGN TOKENS                   */
/* ================================== */
:root {
    /* Core Palette */
    --background: #09090b;
    --foreground: #fafafa;

    --card: rgba(14, 14, 20, 0.7);
    --card-solid: #0e0e14;
    --card-foreground: #fafafa;

    --popover: #111118;
    --popover-foreground: #fafafa;

    /* Violet Primary */
    --primary: #7c3aed;
    --primary-hover: #6d28d9;
    --primary-foreground: #fafafa;
    --primary-glow: rgba(124, 58, 237, 0.20);
    --primary-subtle: rgba(124, 58, 237, 0.08);

    /* Secondary */
    --secondary: #18181b;
    --secondary-foreground: #fafafa;

    /* Muted */
    --muted: #1c1c22;
    --muted-foreground: #a1a1aa;

    /* Accent */
    --accent: #1c1c22;
    --accent-foreground: #fafafa;

    /* Semantic */
    --destructive: #dc2626;
    --destructive-bg: rgba(220, 38, 38, 0.12);
    --destructive-foreground: #fafafa;
    --success: #22c55e;
    --success-bg: rgba(34, 197, 94, 0.12);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.12);

    /* Surfaces */
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --input: rgba(255, 255, 255, 0.06);
    --ring: #7c3aed;

    /* Radius */
    --radius: 0.75rem;
    --radius-sm: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 1.25rem;

    /* Typography */
    --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px var(--primary-glow);

    /* Transitions */
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --transition-fast: 120ms var(--ease-out);
    --transition-base: 200ms var(--ease-out);
    --transition-slow: 350ms var(--ease-out);

    /* Layout */
    --header-height: 4rem;
    --bottom-nav-height: 4.5rem;
    --sidebar-width: 240px;
    --content-max: 1280px;
}

/* ================================== */
/* 2. RESET & BASE                    */
/* ================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    border-color: var(--border);
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
    color-scheme: dark;
}

body {
    background-color: var(--background);
    color: var(--foreground);
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    line-height: 1.6;
    min-height: 100dvh;
    overflow-x: hidden;
}

/* Subtle background texture */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 50% -20%, rgba(124, 58, 237, 0.08), transparent),
        radial-gradient(ellipse 60% 50% at 80% 50%, rgba(59, 130, 246, 0.04), transparent);
    pointer-events: none;
    z-index: 0;
}

/* ================================== */
/* 3. ACCESSIBILITY                   */
/* ================================== */
.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    background: var(--primary);
    color: var(--primary-foreground);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    z-index: 9999;
    transition: top var(--transition-base);
    text-decoration: none;
}

.skip-link:focus {
    top: 1rem;
}

:focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
}

/* Remove outline for mouse users */
:focus:not(:focus-visible) {
    outline: none;
}

/* ================================== */
/* 4. TYPOGRAPHY                      */
/* ================================== */
h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight: 600;
    letter-spacing: -0.025em;
    color: var(--foreground);
    line-height: 1.3;
}

h1 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; }
h2 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }
h3 { font-size: 1.125rem; }
h4 { font-size: 1rem; }

p { margin: 0; }

a { color: inherit; text-decoration: none; }

/* ================================== */
/* 5. LAYOUT                          */
/* ================================== */
.app-container {
    position: relative;
    z-index: 1;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 1rem 1.25rem;
    padding-bottom: calc(var(--bottom-nav-height) + 2rem);
}

@media (min-width: 768px) {
    .app-container {
        padding: 1.5rem 2rem 3rem;
        padding-bottom: 3rem;
    }
}

main {
    position: relative;
}

/* ================================== */
/* 6. HEADER                          */
/* ================================== */
header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(9, 9, 11, 0.85);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    margin-left: -1.25rem;
    margin-right: -1.25rem;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

@media (min-width: 768px) {
    header {
        margin-left: -2rem;
        margin-right: -2rem;
        padding-left: 2rem;
        padding-right: 2rem;
        padding: 1rem 2rem;
        margin-bottom: 2rem;
    }
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.logo {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    white-space: nowrap;
}

@media (min-width: 768px) {
    .logo { font-size: 1.5rem; }
}

.user-status {
    display: none;
}

@media (min-width: 640px) {
    .user-status {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
}

/* ================================== */
/* 7. DESKTOP NAVIGATION              */
/* ================================== */
nav {
    flex: 1;
    display: none;
    justify-content: center;
}

@media (min-width: 768px) {
    nav {
        display: flex;
    }
}

nav ul {
    display: flex;
    list-style: none;
    gap: 0.25rem;
    padding: 0.25rem;
    background: rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 500;
    height: 2.25rem;
    padding: 0 0.875rem;
    color: var(--muted-foreground);
    text-decoration: none;
    transition: all var(--transition-base);
    white-space: nowrap;
    position: relative;
}

nav a:hover {
    color: var(--foreground);
    background: rgba(255, 255, 255, 0.06);
}

nav a.active {
    background: var(--primary);
    color: var(--primary-foreground);
    box-shadow: 0 0 12px var(--primary-glow);
}

nav a .nav-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Logout button */
.btn-logout {
    margin-left: auto;
    flex-shrink: 0;
}

/* ================================== */
/* 8. MOBILE BOTTOM NAVIGATION        */
/* ================================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 40;
    background: rgba(9, 9, 11, 0.9);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid var(--border);
    padding: 0.5rem 0.5rem calc(0.5rem + env(safe-area-inset-bottom, 0px));
    display: flex;
    justify-content: space-around;
    align-items: center;
}

@media (min-width: 768px) {
    .bottom-nav {
        display: none;
    }
}

.bottom-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius);
    color: var(--muted-foreground);
    font-size: 0.625rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-decoration: none;
    transition: all var(--transition-base);
    cursor: pointer;
    background: none;
    border: none;
    min-width: 3.5rem;
}

.bottom-nav-link:hover,
.bottom-nav-link:active {
    color: var(--foreground);
}

.bottom-nav-link.active {
    color: var(--primary);
}

.bottom-nav-link.active .bottom-nav-icon {
    background: var(--primary-subtle);
    color: var(--primary);
}

.bottom-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2rem;
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}

.bottom-nav-icon svg {
    width: 20px;
    height: 20px;
}

.bottom-nav-label {
    display: block;
}

/* ================================== */
/* 9. CARDS                           */
/* ================================== */
.card,
.shadcn-card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--card-foreground);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.shadcn-card:hover {
    border-color: var(--border-hover);
}

.shadcn-card-header {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    margin-bottom: 1rem;
}

.shadcn-card-title,
.shadcn-title {
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.3;
}

.shadcn-card-desc,
.shadcn-desc {
    font-size: 0.8125rem;
    color: var(--muted-foreground);
    line-height: 1.5;
}

.shadcn-card-content {
    padding-top: 0;
}

/* ================================== */
/* 10. BUTTONS                        */
/* ================================== */
.btn,
.shadcn-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 500;
    height: 2.25rem;
    padding: 0 1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
    text-decoration: none;
    white-space: nowrap;
    font-family: inherit;
    line-height: 1;
}

.btn:active,
.shadcn-btn:active {
    transform: scale(0.97);
}

.btn:disabled,
.shadcn-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-lg {
    height: 2.75rem;
    padding: 0 1.5rem;
    font-size: 0.9375rem;
    border-radius: var(--radius);
}

.btn-sm {
    height: 1.75rem;
    padding: 0 0.625rem;
    font-size: 0.75rem;
}

.btn-primary,
.shadcn-btn-primary {
    background: var(--primary);
    color: var(--primary-foreground);
    box-shadow: 0 0 0 0 var(--primary-glow);
}

.btn-primary:hover,
.shadcn-btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 0 16px var(--primary-glow);
}

.btn-secondary,
.shadcn-btn-secondary {
    background: var(--secondary);
    color: var(--secondary-foreground);
    border-color: var(--border);
}

.btn-secondary:hover,
.shadcn-btn-secondary:hover {
    background: var(--muted);
    border-color: var(--border-hover);
}

.btn-danger,
.shadcn-btn-destructive {
    background: var(--destructive-bg);
    color: var(--destructive);
    border-color: rgba(220, 38, 38, 0.2);
}

.btn-danger:hover,
.shadcn-btn-destructive:hover {
    background: var(--destructive);
    color: var(--destructive-foreground);
}

.shadcn-btn-ghost {
    background: transparent;
    color: var(--muted-foreground);
}

.shadcn-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--foreground);
}

.shadcn-btn-outline {
    background: transparent;
    border-color: var(--border);
    color: var(--foreground);
}

.shadcn-btn-outline:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-hover);
}

/* ================================== */
/* 11. FORM INPUTS                    */
/* ================================== */
.form-input,
.form-select,
.shadcn-input,
textarea {
    display: flex;
    width: 100%;
    height: 2.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--foreground);
    font-family: inherit;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

textarea {
    min-height: 2.5rem;
    height: auto;
    resize: vertical;
}

.form-input:hover,
.form-select:hover,
.shadcn-input:hover {
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.04);
}

.form-input:focus,
.form-select:focus,
.shadcn-input:focus,
textarea:focus {
    outline: none;
    border-color: var(--ring);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: rgba(255, 255, 255, 0.04);
}

.form-input::placeholder,
.shadcn-input::placeholder {
    color: var(--muted-foreground);
    opacity: 0.6;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label,
.shadcn-label {
    font-size: 0.8125rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: block;
    color: var(--foreground);
}

.form-row {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

/* Color input override */
input[type="color"] {
    padding: 0.25rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
}

/* Date input */
input[type="date"] {
    color-scheme: dark;
}

/* ================================== */
/* 12. CUSTOM CHECKBOX                */
/* ================================== */
input[type='checkbox'] {
    appearance: none;
    -webkit-appearance: none;
    width: 1.125rem;
    height: 1.125rem;
    border: 1.5px solid var(--muted-foreground);
    border-radius: 4px;
    background: transparent;
    display: inline-grid;
    place-content: center;
    margin: 0;
    cursor: pointer;
    transition: all var(--transition-fast);
    vertical-align: middle;
    flex-shrink: 0;
}

input[type='checkbox']:hover {
    border-color: var(--primary);
}

input[type='checkbox']:checked {
    background: var(--primary);
    border-color: var(--primary);
}

input[type='checkbox']::before {
    content: '';
    width: 0.65rem;
    height: 0.65rem;
    transform: scale(0);
    transition: 120ms transform var(--ease-spring);
    box-shadow: inset 1em 1em var(--primary-foreground);
    transform-origin: center;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

input[type='checkbox']:checked::before {
    transform: scale(1);
}

input[type='checkbox']:focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
}

/* ================================== */
/* 13. CUSTOM SELECT                  */
/* ================================== */
select.shadcn-select-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.shadcn-select-wrapper {
    position: relative;
    width: 100%;
}

.shadcn-select-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 2.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--foreground);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.shadcn-select-trigger:hover {
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.04);
}

.shadcn-select-trigger:focus,
.shadcn-select-trigger:active {
    outline: none;
    border-color: var(--ring);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.shadcn-select-content {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    min-width: 10rem;
    border: 1px solid var(--border-hover);
    border-radius: var(--radius);
    background: var(--popover);
    color: var(--popover-foreground);
    z-index: 50;
    max-height: 280px;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    display: none;
    animation: selectOpen 0.15s var(--ease-out);
    padding: 0.25rem;
}

@keyframes selectOpen {
    from { opacity: 0; transform: translateY(-4px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.shadcn-select-content.open {
    display: block;
}

.shadcn-select-item {
    padding: 0.5rem 0.625rem;
    font-size: 0.8125rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.shadcn-select-item:hover,
.shadcn-select-item.highlighted {
    background: rgba(255, 255, 255, 0.06);
}

.shadcn-select-item.selected {
    background: var(--primary-subtle);
    color: var(--primary);
}

.shadcn-select-label {
    padding: 0.5rem 0.625rem 0.25rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--muted-foreground);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.chevron-down {
    width: 14px;
    height: 14px;
    opacity: 0.5;
    transition: transform var(--transition-base);
    flex-shrink: 0;
}

.shadcn-select-trigger[aria-expanded="true"] .chevron-down {
    transform: rotate(180deg);
}

/* Custom scrollbar for select */
.shadcn-select-content::-webkit-scrollbar {
    width: 6px;
}

.shadcn-select-content::-webkit-scrollbar-track {
    background: transparent;
}

.shadcn-select-content::-webkit-scrollbar-thumb {
    background: var(--muted-foreground);
    border-radius: 3px;
    opacity: 0.3;
}

/* ================================== */
/* 14. BADGES                         */
/* ================================== */
.shadcn-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 9999px;
    border: 1px solid transparent;
    padding: 0.125rem 0.625rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: all var(--transition-fast);
    white-space: nowrap;
    background: var(--primary-subtle);
    color: var(--primary);
    border-color: rgba(124, 58, 237, 0.2);
}

.shadcn-badge.success {
    background: var(--success-bg);
    color: var(--success);
    border-color: rgba(34, 197, 94, 0.2);
}

.shadcn-badge.warning {
    background: var(--warning-bg);
    color: var(--warning);
    border-color: rgba(245, 158, 11, 0.2);
}

/* ================================== */
/* 15. LOGIN OVERLAY                  */
/* ================================== */
.login-overlay {
    position: fixed;
    inset: 0;
    background: var(--background);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

/* Decorative gradient behind login */
.login-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 50% 50% at 50% 30%, rgba(124, 58, 237, 0.12), transparent 70%),
        radial-gradient(ellipse 40% 40% at 70% 60%, rgba(59, 130, 246, 0.06), transparent 70%);
    pointer-events: none;
}

.login-container {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: var(--card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    padding: 2.5rem 2rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg), 0 0 40px rgba(124, 58, 237, 0.05);
    animation: loginAppear 0.5s var(--ease-out);
}

@keyframes loginAppear {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.login-buttons {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.login-buttons .btn {
    flex: 1;
}

.login-error {
    background: var(--destructive-bg);
    color: var(--destructive);
    border: 1px solid rgba(220, 38, 38, 0.2);
    border-radius: var(--radius-sm);
    padding: 0.625rem 0.875rem;
    font-size: 0.8125rem;
    margin-bottom: 0.75rem;
    animation: shake 0.3s ease-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.login-status {
    text-align: center;
    font-size: 0.8125rem;
    color: var(--muted-foreground);
    margin-top: 0.75rem;
    min-height: 1.25rem;
}

.login-footer {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--muted-foreground);
    opacity: 0.7;
}

/* ================================== */
/* 16. DASHBOARD                      */
/* ================================== */
.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0.5;
}

.stat-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.stat-icon svg {
    width: 18px;
    height: 18px;
}

.stat-icon.violet {
    background: var(--primary-subtle);
    color: var(--primary);
}

.stat-icon.blue {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.stat-icon.emerald {
    background: var(--success-bg);
    color: var(--success);
}

/* Progress bar */
.progress-bar-track {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 9999px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 9999px;
    background: linear-gradient(90deg, var(--primary), #a78bfa);
    transition: width 0.6s var(--ease-out);
    position: relative;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 20px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3));
    border-radius: 9999px;
}

/* ================================== */
/* 17. SCHEDULE VIEW                  */
/* ================================== */
.schedule-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.shadcn-table-wrapper {
    position: relative;
    overflow: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

/* Custom scrollbar */
.shadcn-table-wrapper::-webkit-scrollbar,
.schedule-container::-webkit-scrollbar {
    height: 6px;
    width: 6px;
}

.shadcn-table-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.shadcn-table-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.shadcn-table {
    width: 100%;
    caption-side: bottom;
    font-size: 0.8125rem;
    border-collapse: collapse;
}

.shadcn-table thead tr {
    border-bottom: 1px solid var(--border);
}

.shadcn-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background var(--transition-fast);
}

.shadcn-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.shadcn-table td,
.shadcn-table th {
    padding: 0.625rem 0.5rem;
    vertical-align: middle;
    text-align: left;
}

.shadcn-table th {
    height: 2.75rem;
    color: var(--muted-foreground);
    font-weight: 500;
    font-size: 0.75rem;
}

.shadcn-table-row-header {
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--foreground);
    background: rgba(14, 14, 20, 0.5);
    min-width: 100px;
    border-right: 1px solid var(--border);
    position: sticky;
    left: 0;
    z-index: 1;
}

.shadcn-week-header {
    background: var(--secondary);
    font-weight: 700;
    font-size: 0.8125rem;
    text-align: center;
    padding: 0.625rem;
    color: var(--secondary-foreground);
    position: sticky;
    left: 0;
}

/* Current Week & Today Highlights */
.schedule-current-week-header {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.25), rgba(124, 58, 237, 0.08));
    border-left: 3px solid var(--primary);
    position: relative;
}

.schedule-current-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 0.75rem;
    padding: 0.125rem 0.625rem;
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    border-radius: 9999px;
    background: var(--primary);
    color: var(--primary-foreground);
    vertical-align: middle;
    text-transform: uppercase;
}

.schedule-current-week-row {
    background: var(--primary-subtle);
}

.schedule-current-week-row:hover {
    background: rgba(124, 58, 237, 0.08) !important;
}

.schedule-today-header {
    color: var(--primary) !important;
    font-weight: 700 !important;
}

.schedule-today-cell {
    background: rgba(124, 58, 237, 0.08);
    box-shadow: inset 0 0 0 1px rgba(124, 58, 237, 0.2);
}

/* Per-week date sub-header */
.schedule-date-row td {
    padding: 0.375rem 0.5rem;
    border-bottom: 1px solid var(--border);
}

.schedule-date-label {
    background: rgba(14, 14, 20, 0.5);
}

.schedule-date-cell {
    background: rgba(255, 255, 255, 0.02);
}

.schedule-date-dayname {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--foreground);
    line-height: 1.2;
}

.schedule-date-date {
    font-size: 0.625rem;
    color: var(--muted-foreground);
    line-height: 1.2;
}

/* Legacy schedule grid (used by buildDayCardHtml) */
.week-block {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 1rem;
}

.week-header {
    background: var(--muted);
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.week-header h3 {
    margin: 0;
    font-size: 0.9375rem;
}

.week-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--card-solid);
}

.day-column {
    border-right: 1px solid var(--border);
    padding: 0.75rem;
    min-height: 150px;
}

.day-column:last-child {
    border-right: none;
}

.day-header {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--muted-foreground);
    margin-bottom: 0.5rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.day-column.active {
    background: var(--primary-subtle);
}

.item-tag {
    display: inline-flex;
    align-items: center;
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    color: var(--secondary-foreground);
    font-weight: 500;
    transition: background var(--transition-fast);
}

.item-tag:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* ================================== */
/* 18. COMPOUNDS VIEW                 */
/* ================================== */
.compounds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.compound-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    background: var(--card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all var(--transition-base);
}

.compound-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.compound-title {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ================================== */
/* 19. SETTINGS VIEW                  */
/* ================================== */
.settings-list {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--card-solid);
}

.list-item:last-child {
    border-bottom: none;
}

.shadcn-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    background: var(--card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all var(--transition-fast);
    gap: 0.75rem;
}

.shadcn-list-item:hover {
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.03);
}

/* Day Selector */
.day-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.day-selector label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    cursor: pointer;
    color: var(--foreground);
    padding: 0.25rem 0;
}

/* ================================== */
/* 20. PLOTTER VIEW                   */
/* ================================== */
.shadcn-grid {
    display: grid;
    gap: 1rem;
}

.shadcn-row {
    display: grid;
    gap: 0.75rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    position: relative;
    background: rgba(255, 255, 255, 0.02);
    transition: border-color var(--transition-fast);
}

.shadcn-row:hover {
    border-color: var(--border-hover);
}

.shadcn-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    color: var(--muted-foreground);
    cursor: pointer;
    font-size: 1.125rem;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.shadcn-close:hover {
    color: var(--destructive);
    background: var(--destructive-bg);
}

/* ================================== */
/* 21. DIALOG / MODAL                 */
/* ================================== */
.shadcn-dialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: overlayIn 0.15s ease-out;
}

@keyframes overlayIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.shadcn-dialog-content {
    position: relative;
    background: var(--card-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.75rem;
    width: 100%;
    max-width: 28rem;
    box-shadow: var(--shadow-lg);
    animation: dialogIn 0.2s var(--ease-out);
}

@keyframes dialogIn {
    from { opacity: 0; transform: translateY(8px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.shadcn-dialog-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.shadcn-dialog-desc {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.shadcn-dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* ================================== */
/* 22. TOAST                          */
/* ================================== */
.shadcn-toast-container {
    position: fixed;
    bottom: calc(1rem + var(--bottom-nav-height));
    right: 1rem;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: min(380px, calc(100vw - 2rem));
}

@media (min-width: 768px) {
    .shadcn-toast-container {
        bottom: 1.5rem;
        right: 1.5rem;
    }
}

.shadcn-toast {
    background: var(--card-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.875rem 1rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    animation: toastIn 0.3s var(--ease-out);
    transition: all 0.3s var(--ease-out);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.shadcn-toast.destructive {
    border-color: rgba(220, 38, 38, 0.3);
    background: rgba(220, 38, 38, 0.08);
}

.shadcn-toast-title {
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--foreground);
}

.shadcn-toast-desc {
    font-size: 0.8125rem;
    color: var(--muted-foreground);
    margin-top: 0.125rem;
    line-height: 1.4;
}

.shadcn-toast-close {
    margin-left: auto;
    color: var(--muted-foreground);
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    font-size: 1rem;
    transition: color var(--transition-fast);
    flex-shrink: 0;
}

.shadcn-toast-close:hover {
    color: var(--foreground);
}

@keyframes toastIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* ================================== */
/* 23. LOADING STATES                 */
/* ================================== */
.skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 0.875rem;
    width: 60%;
    margin-bottom: 0.5rem;
}

.skeleton-text.sm {
    height: 0.75rem;
    width: 40%;
}

.skeleton-heading {
    height: 1.5rem;
    width: 30%;
    margin-bottom: 0.75rem;
}

.skeleton-card {
    height: 120px;
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ================================== */
/* 24. VIEW TRANSITIONS               */
/* ================================== */
.view-section {
    animation: viewFadeIn 0.25s var(--ease-out);
}

@keyframes viewFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ================================== */
/* 25. UTILITY CLASSES                */
/* ================================== */

/* Hidden */
.hidden { display: none !important; }

/* Text utilities */
.text-secondary, .text-sm { color: var(--muted-foreground); font-size: 0.8125rem; }
.text-accent { color: var(--primary); }
.text-muted-foreground { color: var(--muted-foreground); }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-sm { font-size: 0.8125rem; line-height: 1.25rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-center { text-align: center; }
.uppercase { text-transform: uppercase; }
.tracking-wide { letter-spacing: 0.025em; }
.tracking-tight { letter-spacing: -0.025em; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cursor-pointer { cursor: pointer; }
.select-none { user-select: none; }
.text-emerald-500 { color: #10b981; }

/* Grid */
.grid { display: grid; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .md\:grid-cols-7 { grid-template-columns: repeat(7, minmax(0, 1fr)); }
    .md\:col-span-2 { grid-column: span 2 / span 2; }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Flex */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1 1 0%; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.flex-wrap { flex-wrap: wrap; }

/* Spacing */
.p-0 { padding: 0; }
.p-1 { padding: 0.25rem; }
.p-1\.5 { padding: 0.375rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }
.ml-2 { margin-left: 0.5rem; }
.gap-1 { gap: 0.25rem; }

/* Space-y (stack) */
.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-8 > * + * { margin-top: 2rem; }

/* Sizing */
.h-full { height: 100%; }
.w-full { width: 100%; }
.h-8 { height: 2rem; }
.w-8 { width: 2rem; }
.h-10 { height: 2.5rem; }
.w-10 { width: 2.5rem; }
.w-32 { width: 8rem; }
.max-w-sm { max-width: 24rem; }

/* Borders */
.rounded-md { border-radius: var(--radius); }
.border { border: 1px solid var(--border); }
.border-b { border-bottom: 1px solid var(--border); }
.border-transparent { border-color: transparent; }
.hover\:border-border:hover { border-color: var(--border-hover); }

/* Backgrounds */
.bg-muted\/50 { background: rgba(28, 28, 34, 0.5); }
.bg-muted\/30 { background: rgba(28, 28, 34, 0.3); }

/* Effects */
.transition-colors { transition: color var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast); }

/* Schedule Grid (legacy) */
@media (min-width: 1024px) {
    .schedule-grid { display: grid; grid-template-columns: 80px repeat(7, 1fr); gap: 1rem; }
    .schedule-header { display: contents; font-weight: 600; text-align: center; }
    .week-label { display: flex; align-items: center; justify-content: center; writing-mode: vertical-rl; transform: rotate(180deg); font-weight: 700; letter-spacing: 0.1em; background: var(--muted); border-radius: var(--radius); padding: 1rem 0; height: 100%; border: 1px solid var(--border); }
}

@media (max-width: 1023px) {
    .schedule-grid { display: flex; flex-direction: column; gap: 2rem; }
    .schedule-header { display: none; }
    .week-label { display: block; padding: 0.75rem; background: var(--muted); border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: 0.5rem; text-align: left; writing-mode: horizontal-tb; transform: none; font-weight: 700; }
}

/* Table */
.shadcn-table-wrapper { position: relative; overflow: auto; }

/* ================================== */
/* 26. MOBILE RESPONSIVE              */
/* ================================== */
@media (max-width: 767px) {
    .week-days {
        grid-template-columns: 1fr;
    }

    .day-column {
        border-right: none;
        border-bottom: 1px solid var(--border);
        display: flex;
        gap: 1rem;
        align-items: center;
        min-height: auto;
        padding: 0.625rem;
    }

    .day-header {
        width: 40px;
        text-align: left;
        margin-bottom: 0;
    }

    header {
        justify-content: space-between;
    }

    /* Simplify header on mobile - logo left, logout right */
    .btn-logout {
        margin-left: auto;
    }

    /* Allow table horizontal scroll on mobile */
    .shadcn-table {
        min-width: 700px;
    }

    /* Full-width cards on mobile */
    .shadcn-card {
        padding: 1.25rem;
    }

    /* Stack settings list items on small screens */
    .shadcn-list-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.625rem;
    }

    .shadcn-list-item > .flex.gap-2 {
        align-self: flex-end;
    }
}

@media (max-width: 480px) {
    .app-container {
        padding: 0.75rem;
        padding-bottom: calc(var(--bottom-nav-height) + 1.5rem);
    }

    header {
        margin-left: -0.75rem;
        margin-right: -0.75rem;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .login-container {
        padding: 2rem 1.5rem;
    }
}

/* ================================== */
/* 27. BLOODWORK ANALYSIS             */
/* ================================== */

/* Dropzone */
.bw-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-base);
    text-align: center;
    background: rgba(255, 255, 255, 0.01);
    min-height: 160px;
}

.bw-dropzone:hover {
    border-color: var(--primary);
    background: var(--primary-subtle);
}

.bw-dropzone-active {
    border-color: var(--primary);
    background: rgba(124, 58, 237, 0.08);
    box-shadow: 0 0 20px var(--primary-glow);
}

/* File Preview */
.bw-preview-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.02);
}

.bw-preview-image-wrapper {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.bw-preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bw-preview-pdf {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.bw-preview-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
    flex: 1;
}

.bw-preview-info span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Disclaimer */
.bw-disclaimer-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--warning-bg);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: var(--radius-sm);
}

.bw-disclaimer-text {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    line-height: 1.6;
}

.bw-disclaimer-list {
    list-style: disc;
    padding-left: 1.25rem;
    margin-top: 0.5rem;
}

.bw-disclaimer-list li {
    margin-bottom: 0.375rem;
    font-size: 0.8125rem;
    color: var(--muted-foreground);
    line-height: 1.5;
}

/* Analyzing State */
.bw-analyzing-spinner {
    display: flex;
    justify-content: center;
    padding: 1rem 0;
}

/* Health Flags */
.bw-flag-item {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
}

/* Results / Analysis Content */
.bw-analysis-content {
    font-size: 0.875rem;
    line-height: 1.7;
    color: var(--foreground);
}

.bw-analysis-content h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
    color: var(--foreground);
}

.bw-analysis-content h3 {
    font-size: 1.0625rem;
    font-weight: 600;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--foreground);
}

.bw-analysis-content h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-top: 1rem;
    margin-bottom: 0.375rem;
    color: var(--foreground);
}

.bw-analysis-content p {
    margin-bottom: 0.75rem;
}

.bw-analysis-content ul,
.bw-analysis-content ol {
    padding-left: 1.25rem;
    margin-bottom: 0.75rem;
}

.bw-analysis-content li {
    margin-bottom: 0.375rem;
}

.bw-analysis-content strong {
    color: var(--foreground);
    font-weight: 600;
}

.bw-analysis-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75rem 0;
    font-size: 0.8125rem;
}

.bw-analysis-content table th,
.bw-analysis-content table td {
    border: 1px solid var(--border);
    padding: 0.5rem 0.75rem;
    text-align: left;
}

.bw-analysis-content table th {
    background: var(--muted);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.bw-analysis-content table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.bw-analysis-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1rem 0;
}

.bw-analysis-content blockquote {
    border-left: 3px solid var(--primary);
    padding: 0.5rem 1rem;
    margin: 0.75rem 0;
    background: var(--primary-subtle);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--muted-foreground);
}

.bw-analysis-content code {
    background: var(--muted);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.8125rem;
    font-family: 'Courier New', monospace;
}

/* History List */
.bw-history-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    background: var(--card);
}

.bw-history-item:hover {
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.03);
}

.bw-history-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.bw-badge-red {
    background: var(--destructive-bg);
    color: var(--destructive);
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.bw-badge-yellow {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.bw-badge-green {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

/* Mobile adjustments */
@media (max-width: 767px) {
    .bw-dropzone {
        padding: 1.75rem 1rem;
        min-height: 140px;
    }

    .bw-preview-card {
        flex-wrap: wrap;
    }

    .bw-history-item {
        flex-wrap: wrap;
    }
}

/* ================================== */
/* 28. PRINT                          */
/* ================================== */
@media print {
    .bottom-nav,
    .shadcn-toast-container,
    .btn-logout,
    nav,
    .login-overlay {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .shadcn-card {
        border: 1px solid #ccc;
        background: white;
    }
}
