/* ============================================================
   AMINO ASSET MANAGEMENT — Dark Glassmorphic Theme v2
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Background layers */
    --bg: #080b14;
    --bg-1: #0c1021;
    --bg-2: #111729;
    --bg-3: #161d33;
    --bg-card: rgba(17, 23, 41, 0.65);
    --bg-card-hover: rgba(22, 29, 51, 0.75);
    --bg-elevated: rgba(22, 30, 52, 0.8);
    --bg-input: rgba(12, 16, 33, 0.6);

    /* Borders */
    --border: rgba(60, 80, 130, 0.15);
    --border-light: rgba(80, 110, 170, 0.08);

    /* Text */
    --text: #e4eaf4;
    --text-muted: rgba(170, 185, 210, 0.75);
    --text-2: rgba(170, 185, 210, 0.75);
    --text-3: rgba(120, 140, 175, 0.5);

    /* Accents */
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-light: rgba(59, 130, 246, 0.12);
    --blue: #3b82f6;
    --blue-soft: #5b9cf6;
    --cyan: #22d3ee;
    --cyan-glow: rgba(34, 211, 238, 0.12);
    --green: #34d399;
    --green-glow: rgba(52, 211, 153, 0.12);
    --yellow: #fbbf24;
    --yellow-glow: rgba(251, 191, 36, 0.1);
    --red: #f87171;
    --red-glow: rgba(248, 113, 113, 0.1);
    --purple: #a78bfa;
    --purple-glow: rgba(167, 139, 250, 0.1);

    /* Geometry */
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 2px 8px rgba(0,0,0,0.2), 0 1px 3px rgba(0,0,0,0.15);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.25), 0 2px 6px rgba(0,0,0,0.15);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--blue-soft); text-decoration: none; }
a:hover { color: var(--accent); }

/* --- Layout --- */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar (Desktop) --- */
.sidebar {
    width: 260px;
    background: var(--bg-1);
    border-right: 1px solid var(--border);
    position: fixed;
    top: 0; bottom: 0; left: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.3s ease;
    backdrop-filter: blur(12px);
}

.sidebar-brand {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.3px;
    color: var(--text);
    border-bottom: 1px solid var(--border);
}

.sidebar-brand svg {
    width: 28px; height: 28px;
    stroke: var(--blue); fill: none;
    stroke-width: 2;
}

.nav-links {
    flex: 1;
    padding: 12px 10px;
    overflow-y: auto;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s ease;
    margin-bottom: 2px;
}

.nav-links a:hover {
    background: var(--accent-light);
    color: var(--text);
}

.nav-links a.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.05));
    color: var(--blue-soft);
    font-weight: 600;
}

.nav-icon {
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.nav-icon svg {
    width: 18px; height: 18px;
    stroke: currentColor; fill: none;
    stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
}

.sidebar-footer .btn-primary {
    width: 100%;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 99;
}

/* --- Main Content --- */
.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 28px 32px 100px;
    min-height: 100vh;
    background: var(--bg);
}

/* --- Mobile Nav Toggle --- */
.mobile-nav-toggle {
    display: none;
    position: fixed;
    top: 14px; left: 14px;
    z-index: 200;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    width: 40px; height: 40px;
    cursor: pointer;
    align-items: center; justify-content: center;
    backdrop-filter: blur(12px);
}
.mobile-nav-toggle svg {
    width: 20px; height: 20px;
    stroke: var(--text); fill: none;
    stroke-width: 2; stroke-linecap: round;
}

/* --- Page Header --- */
.page-header {
    margin-bottom: 24px;
}
.page-header h1 {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.3px;
    color: var(--text);
}
.page-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}
.page-header-sub {
    font-size: 12px;
    color: var(--text-3);
    margin-top: 2px;
}
.section-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 10px;
}

/* --- Cards --- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(12px);
}
.card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.04), transparent);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}
.card-header h2, .card-header h3 {
    font-size: 16px;
    font-weight: 700;
}

/* --- Stats Grid --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    backdrop-filter: blur(12px);
    position: relative;
    overflow: hidden;
    transition: border-color 0.15s ease;
}
.stat-card:hover {
    border-color: rgba(60, 80, 130, 0.25);
}
.stat-card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.03), transparent);
}

.stat-icon {
    width: 42px; height: 42px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.stat-icon svg {
    width: 20px; height: 20px;
    stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
    fill: none;
}
.icon-blue { background: var(--accent-light); }
.icon-blue svg { stroke: var(--blue-soft); }
.icon-green { background: var(--green-glow); }
.icon-green svg { stroke: var(--green); }
.icon-red { background: var(--red-glow); }
.icon-red svg { stroke: var(--red); }
.icon-yellow { background: var(--yellow-glow); }
.icon-yellow svg { stroke: var(--yellow); }
.icon-purple { background: var(--purple-glow); }
.icon-purple svg { stroke: var(--purple); }

.stat-info { min-width: 0; }
.stat-value {
    font-size: 22px; font-weight: 800;
    letter-spacing: -0.5px; line-height: 1.1;
}
.stat-label {
    font-size: 11px; font-weight: 500;
    color: var(--text-muted);
    margin-top: 2px;
}

/* --- Alerts --- */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
    border: 1px solid;
}
.alert-warning {
    background: var(--yellow-glow);
    border-color: rgba(251, 191, 36, 0.15);
    color: var(--yellow);
}
.alert-danger {
    background: var(--red-glow);
    border-color: rgba(248, 113, 113, 0.15);
    color: var(--red);
}
.alert-success {
    background: var(--green-glow);
    border-color: rgba(52, 211, 153, 0.15);
    color: var(--green);
}

/* --- Flash Messages --- */
.flash-messages {
    position: fixed;
    top: 16px; right: 16px;
    z-index: 9999;
    display: flex; flex-direction: column; gap: 8px;
}
.flash-msg {
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 500;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow-md);
    animation: flashIn 0.3s ease;
}
.flash-msg.success { border-color: rgba(52, 211, 153, 0.3); color: var(--green); }
.flash-msg.error { border-color: rgba(248, 113, 113, 0.3); color: var(--red); }

@keyframes flashIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Tags --- */
.tag {
    display: inline-block;
    font-size: 10px; font-weight: 600;
    padding: 3px 9px;
    border-radius: 12px;
    text-transform: capitalize;
    letter-spacing: 0.2px;
}
.tag-stack { display: flex; gap: 5px; flex-wrap: wrap; }
.tag-muscles { background: rgba(248,113,113,0.1); color: #f87171; }
.tag-healing { background: rgba(52,211,153,0.1); color: #34d399; }
.tag-weight-loss { background: rgba(251,191,36,0.1); color: #fbbf24; }
.tag-immune-system { background: rgba(34,211,238,0.1); color: #22d3ee; }
.tag-energy { background: rgba(167,139,250,0.1); color: #a78bfa; }
.tag-sleep { background: rgba(99,102,241,0.1); color: #818cf8; }
.tag-skin { background: rgba(244,114,182,0.1); color: #f472b6; }
.tag-cognitive-function { background: rgba(96,165,250,0.1); color: #60a5fa; }
.tag-mood { background: rgba(251,146,60,0.1); color: #fb923c; }
.tag-longevity { background: rgba(45,212,191,0.1); color: #2dd4bf; }
.tag-bones { background: rgba(163,163,163,0.1); color: #a3a3a3; }
.tag-pain { background: rgba(239,68,68,0.1); color: #ef4444; }
.tag-focus { background: rgba(129,140,248,0.1); color: #818cf8; }
.tag-mitochondrial { background: rgba(192,132,252,0.1); color: #c084fc; }

/* --- Tables --- */
.table-wrap { overflow-x: auto; }
.data-table, .log-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table th, .log-table th {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-3);
    padding: 10px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.data-table td, .log-table td {
    padding: 12px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text);
}
.data-table tr:hover td, .log-table tr:hover td {
    background: rgba(59, 130, 246, 0.03);
}
.table-actions {
    display: flex; gap: 8px;
}

/* --- Forms --- */
.form-group {
    margin-bottom: 18px;
}
.form-group label, .label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.form-control {
    width: 100%;
    padding: 11px 14px;
    font-size: 14px;
    font-family: inherit;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-control:focus {
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.08);
}
.form-control::placeholder {
    color: var(--text-3);
}
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(120,140,175,0.5)' stroke-width='2' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}
textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

/* Form sections (collapsible) */
.form-section {
    margin-bottom: 12px;
}
.form-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-light);
    user-select: none;
}
.form-section-header .section-chevron {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-3);
    transition: transform 0.2s ease;
}
.form-section-header.open .section-chevron {
    transform: rotate(180deg);
}
.form-section-body {
    padding: 14px 0;
    display: none;
}
.form-section-header.open + .form-section-body {
    display: block;
}
.form-section-count {
    font-size: 10px;
    color: var(--text-3);
    background: var(--bg-input);
    padding: 2px 8px;
    border-radius: 10px;
}

/* Checkbox */
.checkbox-group {
    display: flex; align-items: center; gap: 10px;
    font-size: 14px; color: var(--text-muted);
}
.checkbox-group input[type="checkbox"] {
    accent-color: var(--accent);
    width: 18px; height: 18px;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    line-height: 1;
}
.btn-primary {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #fff;
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.3);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
}
.btn-secondary {
    background: var(--bg-card);
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    background: var(--bg-card-hover);
    color: var(--text);
}
.btn-danger {
    background: var(--red-glow);
    color: var(--red);
    border: 1px solid rgba(248, 113, 113, 0.15);
}
.btn-danger:hover {
    background: rgba(248, 113, 113, 0.15);
}
.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}
.btn-group {
    display: flex; gap: 8px;
}
.btn-icon {
    padding: 8px;
    min-width: 36px;
}

/* --- Status Badges --- */
.status-badge {
    display: inline-block;
    font-size: 10px; font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.status-unopened { background: var(--accent-light); color: var(--blue-soft); }
.status-reconstituted { background: var(--cyan-glow); color: var(--cyan); }
.status-in_use { background: var(--green-glow); color: var(--green); }
.status-empty { background: rgba(120, 140, 175, 0.08); color: var(--text-3); }

/* --- Protocol Today List --- */
.protocol-today-list {
    display: flex; flex-direction: column; gap: 8px;
    margin-bottom: 20px;
}
.protocol-today-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.15s ease;
}
.protocol-today-item:hover {
    border-color: rgba(60, 80, 130, 0.25);
}
.protocol-today-info { flex: 1; min-width: 0; }
.protocol-today-name {
    font-size: 14px; font-weight: 600; color: var(--text);
    display: flex; align-items: center; gap: 6px;
}
.protocol-today-detail {
    font-size: 12px; color: var(--text-muted); margin-top: 2px;
}
.protocol-today-actions {
    display: flex; gap: 6px; flex-shrink: 0;
}
.protocol-vial-info {
    font-size: 11px; color: var(--text-3); margin-top: 2px;
}

/* --- Protocol Item Cards (new design) --- */
.proto-item {
    display: flex; align-items: center; gap: 12px;
    padding: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
.proto-badge {
    width: 40px; height: 40px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; flex-shrink: 0;
    background: linear-gradient(135deg, rgba(59,130,246,0.12), rgba(59,130,246,0.04));
    border: 1px solid rgba(59,130,246,0.1);
}
.proto-badge svg {
    width: 20px; height: 20px; fill: none; stroke-width: 1.8;
    stroke-linecap: round; stroke-linejoin: round;
}
.proto-badge.peptide svg { stroke: var(--cyan); }
.proto-badge.vitamin svg { stroke: var(--green); }
.proto-badge.vitamin {
    background: linear-gradient(135deg, rgba(52,211,153,0.12), rgba(52,211,153,0.04));
    border-color: rgba(52,211,153,0.1);
}
.proto-badge.peptide {
    background: linear-gradient(135deg, rgba(34,211,238,0.12), rgba(34,211,238,0.04));
    border-color: rgba(34,211,238,0.1);
}
.proto-body { flex: 1; min-width: 0; }
.proto-name { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; color: var(--text); }
.proto-status {
    font-size: 9px; font-weight: 600; padding: 1px 6px;
    border-radius: 6px; text-transform: uppercase; letter-spacing: 0.3px;
}
.proto-status.active { background: rgba(52,211,153,0.1); color: var(--green); }
.proto-status.cycle { background: rgba(34,211,238,0.1); color: var(--cyan); }
.proto-status.paused { background: rgba(251,191,36,0.1); color: var(--amber); }
.proto-detail { font-size: 11px; color: var(--text-2); margin-top: 2px; }
.proto-actions { display: flex; gap: 6px; flex-shrink: 0; }
.pill {
    padding: 5px 10px; border-radius: 16px; font-size: 10px; font-weight: 600;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-2);
    cursor: pointer; text-decoration: none;
    transition: background 0.15s;
}
.pill:hover { background: rgba(59,130,246,0.08); }
.pill.primary {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    border-color: transparent; color: #fff;
}
.pill.primary:hover { background: linear-gradient(135deg, #1d4ed8, #2563eb); }
.pill.success {
    background: linear-gradient(135deg, #059669, #10b981) !important;
    border-color: transparent; color: #fff;
    pointer-events: none;
}

/* --- Inventory Items (new design) --- */
.inv-tabs {
    display: flex; gap: 0; margin-bottom: 16px;
    background: rgba(12,16,33,0.6);
    border-radius: var(--radius-sm); padding: 3px;
    border: 1px solid var(--border);
}
.inv-tab {
    flex: 1; padding: 8px 0; text-align: center;
    font-size: 12px; font-weight: 500; color: var(--text-3);
    border-radius: 8px; cursor: pointer;
    transition: background 0.15s;
}
.inv-tab.on {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #fff; font-weight: 600;
    box-shadow: 0 2px 8px rgba(37,99,235,0.3);
}
.inv-row {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    cursor: pointer;
    transition: border-color 0.15s;
}
.inv-row:hover { border-color: rgba(59,130,246,0.2); }
.vial-graphic {
    width: 32px; height: 44px; border-radius: 6px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    position: relative; overflow: hidden; flex-shrink: 0;
}
.vial-fill {
    position: absolute; bottom: 0; left: 0; right: 0;
    border-radius: 0 0 5px 5px;
}
.vial-fill.high { background: linear-gradient(0deg, rgba(52,211,153,0.4), rgba(52,211,153,0.15)); }
.vial-fill.mid { background: linear-gradient(0deg, rgba(251,191,36,0.4), rgba(251,191,36,0.15)); }
.vial-fill.low { background: linear-gradient(0deg, rgba(248,113,113,0.4), rgba(248,113,113,0.15)); }
.vial-fill.sealed { background: linear-gradient(0deg, rgba(59,130,246,0.15), rgba(59,130,246,0.05)); }
.inv-body { flex: 1; min-width: 0; }
.inv-name { font-size: 14px; font-weight: 600; display: flex; align-items: center; color: var(--text); }
.inv-meta { font-size: 11px; color: var(--text-2); margin-top: 2px; }
.dose-ring {
    width: 34px; height: 34px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700;
    flex-shrink: 0;
}
.dose-ring.high { background: rgba(52,211,153,0.08); color: var(--green); border: 2px solid rgba(52,211,153,0.25); }
.dose-ring.mid { background: rgba(251,191,36,0.08); color: var(--amber); border: 2px solid rgba(251,191,36,0.2); }
.dose-ring.low { background: rgba(248,113,113,0.08); color: var(--red, #f87171); border: 2px solid rgba(248,113,113,0.2); }
.sealed-badge {
    font-size: 10px; font-weight: 600;
    padding: 4px 10px; border-radius: 16px;
    background: rgba(59,130,246,0.08);
    color: var(--blue-soft);
    border: 1px solid rgba(59,130,246,0.1);
}
.low-stock-badge {
    font-size: 9px; font-weight: 700;
    padding: 2px 7px; border-radius: 8px;
    background: rgba(251,191,36,0.1);
    color: var(--amber);
    border: 1px solid rgba(251,191,36,0.15);
    text-transform: uppercase; letter-spacing: 0.3px;
    margin-left: 6px;
}

/* --- Today's Schedule (Dashboard) --- */
.today-schedule { margin-bottom: 24px; }

/* Schedule accordion */
.sched-accordion { margin-bottom: 8px; }
.sched-acc-header {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px; font-weight: 600;
    color: var(--text);
    user-select: none;
}
.sched-acc-header.today {
    border-color: rgba(59, 130, 246, 0.2);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.06), rgba(59, 130, 246, 0.02));
}
.sched-chevron {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-3);
    transition: transform 0.2s ease;
}
.sched-acc-body {
    display: none;
    padding: 8px 0 0;
}

/* --- Syringe Visualization --- */
.syringe-container {
    display: flex;
    align-items: flex-end;
    gap: 24px;
    margin: 20px 0;
}
.syringe {
    width: 60px; height: 300px;
    position: relative;
    border: 2px solid var(--border);
    border-radius: 0 0 8px 8px;
    background: rgba(12, 16, 33, 0.4);
    overflow: hidden;
}
.syringe-fill {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: linear-gradient(to top, rgba(59, 130, 246, 0.6), rgba(59, 130, 246, 0.2));
    transition: height 0.4s ease;
    border-radius: 0 0 6px 6px;
}
.syringe-needle {
    width: 4px; height: 30px;
    background: var(--text-3);
    margin: 0 auto;
    border-radius: 2px 2px 0 0;
}
.syringe-plunger {
    width: 50px; height: 10px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: 4px;
    margin: 0 auto;
}
.syringe-marks {
    position: absolute; top: 0; bottom: 0; right: 4px;
    display: flex; flex-direction: column;
    justify-content: space-between;
    padding: 4px 0;
}

/* Horizontal syringe (calculator) */
.calc-syringe-hz {
    position: relative;
    margin: 20px auto;
    max-width: 360px;
}
.syringe-hz-body {
    height: 36px;
    background: rgba(12, 16, 33, 0.5);
    border: 1.5px solid var(--border);
    border-radius: 4px 18px 18px 4px;
    position: relative;
    overflow: hidden;
}
.syringe-hz-fill {
    position: absolute; top: 0; left: 0; bottom: 0;
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.4), rgba(59, 130, 246, 0.15));
    border-radius: 4px 18px 18px 4px;
    transition: width 0.4s ease;
}
.syringe-hz-marks {
    position: absolute; top: 0; bottom: 0; left: 0; right: 0;
    display: flex; justify-content: space-between;
    padding: 0 8px;
    align-items: flex-end;
}
.syringe-hz-label {
    font-size: 9px; color: var(--text-3);
    text-align: center; padding-top: 4px;
}
.syringe-hz-plunger {
    position: absolute; top: 4px; bottom: 4px; left: -8px;
    width: 10px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: 3px;
}
.syringe-hz-tip {
    position: absolute; top: 50%; right: -16px;
    transform: translateY(-50%);
    width: 16px; height: 4px;
    background: var(--text-3);
    border-radius: 0 2px 2px 0;
}

/* --- Calculator --- */
.calc-layout {
    display: flex; gap: 24px;
}
.calc-step {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 12px;
    display: flex; gap: 14px;
    align-items: flex-start;
}
.calc-step-num {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--blue-soft);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700;
    flex-shrink: 0;
}
.calc-step-body { flex: 1; }

.calc-chips {
    display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px;
}
.calc-chip {
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px; font-weight: 600;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}
.calc-chip.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.calc-dropdown {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    max-height: 200px; overflow-y: auto;
    z-index: 50;
    box-shadow: var(--shadow-md);
}
.calc-dropdown-item {
    padding: 10px 14px;
    font-size: 13px;
    cursor: pointer;
    color: var(--text);
    transition: background 0.1s ease;
}
.calc-dropdown-item:hover {
    background: var(--accent-light);
}

.calc-hint {
    font-size: 11px; color: var(--text-3); margin-top: 4px;
}

.calc-results {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
    margin-bottom: 16px;
}
.calc-result-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
}

.calc-summary {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(59, 130, 246, 0.02));
    border: 1px solid rgba(59, 130, 246, 0.12);
    border-radius: var(--radius);
    padding: 18px;
}
.calc-summary-title {
    font-size: 12px; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.5px;
    margin-bottom: 12px;
}
.calc-summary-row {
    display: flex; justify-content: space-between;
    padding: 6px 0; font-size: 13px;
    border-bottom: 1px solid var(--border-light);
}
.calc-summary-row:last-child { border-bottom: none; }

/* --- Calendar --- */
.calendar { margin-bottom: 24px; }
.calendar-nav {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 12px;
}
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}
.calendar-header-cell {
    font-size: 10px; font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-3);
    text-align: center;
    padding: 8px 0;
}
.calendar-cell {
    min-height: 72px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 6px;
    font-size: 12px;
}
.calendar-cell.today {
    border-color: rgba(59, 130, 246, 0.3);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.06), transparent);
}
.calendar-cell.empty { background: transparent; border-color: transparent; }
.day-number {
    font-weight: 600; font-size: 12px; margin-bottom: 4px;
}
.calendar-cell.today .day-number { color: var(--blue-soft); }
.cal-peptide {
    font-size: 9px; font-weight: 500;
    padding: 2px 5px; border-radius: 4px;
    margin-bottom: 2px;
    background: var(--accent-light);
    color: var(--blue-soft);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Day Picker --- */
.day-picker {
    display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px;
}
.day-chip {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 600;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}
.day-chip.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* --- Collapsible (Library ref) --- */
.collapsible-header {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px; font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}
.collapse-icon {
    margin-left: auto;
    font-size: 14px; color: var(--text-3);
    transition: transform 0.2s ease;
}
.collapsible-content {
    display: none;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.7;
}
.reference-list {
    list-style: none; padding: 0;
}
.reference-list li {
    padding: 6px 0;
    border-bottom: 1px solid var(--border-light);
}
.reference-list li:last-child { border-bottom: none; }

/* --- Filter Bar --- */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.view-toggle {
    display: flex; gap: 0;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 3px;
    border: 1px solid var(--border);
}
.view-toggle button {
    padding: 6px 14px;
    font-size: 12px; font-weight: 500;
    border: none;
    background: transparent;
    color: var(--text-3);
    border-radius: 7px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
}
.view-toggle button.active {
    background: var(--accent-light);
    color: var(--blue-soft);
    font-weight: 600;
}

/* --- Reorder Panel --- */
.reorder-panel {
    background: var(--yellow-glow);
    border: 1px solid rgba(251, 191, 36, 0.15);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-3);
}
.empty-state .icon {
    font-size: 32px;
    margin-bottom: 12px;
    opacity: 0.4;
}

/* --- Chart Container --- */
.chart-placeholder, .weight-chart-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    min-height: 200px;
    margin-bottom: 16px;
}

/* --- Install Banner --- */
.install-banner {
    display: none;
    position: fixed;
    bottom: 80px; left: 16px; right: 16px;
    z-index: 500;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow-md);
}
.install-banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* --- Bottom Nav (Mobile) --- */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 100;
    background: rgba(8, 11, 20, 0.92);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    padding: 6px 12px 8px;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
}

.bottom-nav-item {
    display: flex; flex-direction: column;
    align-items: center; gap: 3px;
    padding: 6px 0;
    color: var(--text-3);
    cursor: pointer;
    font-size: 10px; font-weight: 500;
    transition: color 0.15s ease;
    flex: 1;
    text-align: center;
    text-decoration: none;
}
.bottom-nav-item.active {
    color: var(--blue-soft);
}
.bottom-nav-icon {
    display: flex; align-items: center; justify-content: center;
}
.bottom-nav-icon svg {
    width: 22px; height: 22px;
    stroke: currentColor; fill: none;
    stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.bottom-nav-label {
    font-size: 10px; font-weight: 500;
    letter-spacing: 0.2px;
}

/* Bottom nav FAB (center Log button) */
.bottom-nav-fab {
    position: relative;
    display: flex; flex-direction: column;
    align-items: center;
    flex: 1;
    margin-top: -28px;
}
.bottom-nav-fab .fab-btn {
    width: 50px; height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    display: flex; align-items: center; justify-content: center;
    box-shadow:
        0 4px 16px rgba(37, 99, 235, 0.4),
        0 0 24px rgba(59, 130, 246, 0.15);
    border: 2px solid rgba(96, 165, 250, 0.2);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.bottom-nav-fab .fab-btn:hover {
    transform: scale(1.05);
    box-shadow:
        0 6px 20px rgba(37, 99, 235, 0.5),
        0 0 30px rgba(59, 130, 246, 0.2);
}
.bottom-nav-fab .fab-btn svg {
    width: 24px; height: 24px;
    stroke: #fff; fill: none;
    stroke-width: 2.2; stroke-linecap: round;
}
.bottom-nav-fab .fab-label {
    font-size: 9px; font-weight: 600;
    color: var(--blue-soft);
    margin-top: 3px;
    letter-spacing: 0.3px;
}

/* --- More Menu --- */
.more-menu {
    position: fixed;
    bottom: 0; right: 0;
    width: 260px;
    background: var(--bg-elevated);
    border-left: 1px solid var(--border);
    border-top: 1px solid var(--border);
    border-radius: var(--radius) 0 0 0;
    z-index: 150;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    backdrop-filter: blur(16px);
    padding: 12px 0;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
}
.more-menu.open {
    transform: translateY(0);
}
.more-menu-item {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 20px;
    color: var(--text-muted);
    font-size: 14px; font-weight: 500;
    cursor: pointer;
    transition: background 0.1s ease, color 0.1s ease;
    text-decoration: none;
}
.more-menu-item:hover {
    background: var(--accent-light);
    color: var(--text);
}
.more-icon {
    display: flex; align-items: center; justify-content: center;
}
.more-icon svg {
    width: 18px; height: 18px;
    stroke: currentColor; fill: none;
    stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.more-menu-backdrop {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 149;
}
.more-menu-backdrop.open {
    display: block;
}

/* --- Confirmation Modal --- */
.confirm-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    z-index: 9998;
    display: flex; align-items: center; justify-content: center;
    animation: fadeIn 0.15s ease;
}
.confirm-modal {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    max-width: 340px;
    width: 90%;
    box-shadow: var(--shadow-md);
    animation: scaleIn 0.2s ease;
}
.confirm-modal h3 {
    font-size: 16px; font-weight: 700;
    margin-bottom: 8px;
}
.confirm-modal p {
    font-size: 13px; color: var(--text-muted);
    margin-bottom: 20px; line-height: 1.5;
}
.confirm-btns {
    display: flex; gap: 10px;
}
.confirm-btns .btn { flex: 1; }

@keyframes fadeIn {
    from { opacity: 0; } to { opacity: 1; }
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* --- Undo Toast --- */
.undo-toast {
    position: fixed;
    bottom: 100px; left: 50%;
    transform: translateX(-50%);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 20px;
    display: flex; align-items: center; gap: 14px;
    z-index: 9999;
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow-md);
    animation: toastIn 0.3s ease;
}
.undo-msg {
    font-size: 13px; color: var(--text);
}
.undo-btn {
    font-size: 13px; font-weight: 700;
    color: var(--blue-soft);
    cursor: pointer;
    background: none; border: none;
    font-family: inherit;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.15s ease;
}
.undo-btn:hover {
    background: var(--accent-light);
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* --- Page Transitions --- */
.page-enter {
    animation: pageIn 0.2s ease;
}
@keyframes pageIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Marker Autocomplete (Bloodwork) --- */
.marker-autocomplete {
    position: relative;
}
.marker-suggestions {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    max-height: 200px; overflow-y: auto;
    z-index: 50;
    box-shadow: var(--shadow-md);
}
.marker-suggestion {
    padding: 10px 14px;
    font-size: 13px; cursor: pointer;
    color: var(--text);
    transition: background 0.1s ease;
}
.marker-suggestion:hover {
    background: var(--accent-light);
}

/* --- Badge (done/check) --- */
.badge { display: inline-block; }
.badge-done {
    background: var(--green-glow);
    color: var(--green);
    font-size: 10px; font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
}
.check-mark {
    color: var(--green);
    font-size: 16px;
}

/* --- Misc --- */
.text-muted { color: var(--text-muted); }
.value { font-weight: 700; }
.unit { font-size: 12px; color: var(--text-muted); }
.w3 { font-weight: 300; }
.org { color: var(--yellow); }
.critical { color: var(--red); font-weight: 600; }
.done { opacity: 0.5; }
.arrow { color: var(--text-3); }

/* Scrollbar styling */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(60, 80, 130, 0.2);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(60, 80, 130, 0.35);
}

/* --- Responsive: Mobile --- */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-overlay.open {
        display: block;
    }
    .mobile-nav-toggle {
        display: flex;
    }
    .main-content {
        margin-left: 0;
        padding: 60px 16px 100px;
    }
    .bottom-nav {
        display: flex;
        align-items: flex-end;
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .calc-layout {
        flex-direction: column;
    }
    .calc-results {
        grid-template-columns: 1fr;
    }
    .calendar-cell {
        min-height: 56px;
    }
    .form-control {
        min-height: 44px;
        font-size: 16px;
    }
    .btn {
        min-height: 44px;
    }
    .syringe-container {
        flex-direction: column;
        align-items: center;
    }
    .data-table th, .data-table td,
    .log-table th, .log-table td {
        padding: 10px 8px;
    }
    .install-banner {
        bottom: 80px;
    }
}

/* Touch interactions */
@media (pointer: coarse) {
    .btn, .nav-links a, .bottom-nav-item, .more-menu-item {
        -webkit-tap-highlight-color: rgba(59, 130, 246, 0.1);
    }
    .btn, .nav-links a {
        user-select: none;
    }
}

/* iOS Standalone PWA */
.ios-standalone .main-content {
    padding-top: calc(60px + env(safe-area-inset-top));
}
.ios-standalone .sidebar {
    padding-top: env(safe-area-inset-top);
}
.ios-standalone .mobile-nav-toggle {
    top: calc(14px + env(safe-area-inset-top));
}

/* Loading state */
.loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: var(--text-3);
    font-size: 14px;
}

/* --- Welcome / Onboarding --- */
.welcome-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.welcome-container {
    max-width: 560px;
    width: 100%;
    animation: welcomeFadeIn 0.6s ease-out;
}

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

.welcome-header {
    text-align: center;
    margin-bottom: 32px;
}

.welcome-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    backdrop-filter: blur(20px);
    margin-bottom: 16px;
}

.welcome-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.welcome-subtitle {
    font-size: 14px;
    color: var(--text-muted);
}

.welcome-terms-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(20px);
    padding: 20px;
    margin-bottom: 20px;
}

.welcome-terms-box h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
}

.welcome-terms-scroll {
    max-height: 320px;
    overflow-y: auto;
    padding-right: 8px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-muted);
}

.welcome-terms-scroll h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin: 16px 0 6px;
}

.welcome-terms-scroll h4:first-child {
    margin-top: 0;
}

.welcome-terms-scroll p {
    margin-bottom: 8px;
}

.welcome-terms-scroll::-webkit-scrollbar {
    width: 4px;
}

.welcome-terms-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.welcome-terms-scroll::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.welcome-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--text);
    transition: border-color 0.2s;
}

.welcome-checkbox-label:hover {
    border-color: var(--primary);
}

.welcome-checkbox-label input[type="checkbox"] {
    margin-top: 2px;
    accent-color: var(--primary);
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.welcome-btn {
    width: 100%;
    padding: 14px;
    font-size: 15px;
    font-weight: 600;
}

.welcome-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.welcome-pin-setup {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(20px);
    padding: 24px;
}

.welcome-pin-setup h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

/* Step indicator dots */
.welcome-steps-indicator {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
}

.step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
    transition: background 0.3s, transform 0.3s;
}

.step-dot.active {
    background: var(--primary);
    transform: scale(1.2);
}

/* Email step box */
.welcome-email-box,
.welcome-code-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(20px);
    padding: 24px;
}

.welcome-email-box h3,
.welcome-code-box h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

/* Code input group */
.code-input-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 24px 0;
}

.code-digit {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    font-family: monospace;
    color: var(--text);
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s;
    -webkit-appearance: none;
}

.code-digit:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.15);
}

.code-dash {
    color: var(--text-3);
    font-size: 20px;
    font-weight: 300;
    margin: 0 2px;
}

/* Text highlight (email display) */
.text-highlight {
    color: var(--primary);
    font-weight: 500;
}

/* Resend code area */
.welcome-resend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

/* Link-style buttons */
.btn-link {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 13px;
    cursor: pointer;
    padding: 4px 0;
    text-decoration: none;
}

.btn-link:hover {
    text-decoration: underline;
}

.btn-link:disabled {
    color: var(--text-3);
    cursor: not-allowed;
    text-decoration: none;
}

/* Spinner */
.welcome-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 0;
    color: var(--text-muted);
    font-size: 14px;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* Mobile adjustments for code input */
@media (max-width: 480px) {
    .code-digit {
        width: 40px;
        height: 48px;
        font-size: 20px;
    }
    .code-input-group {
        gap: 5px;
    }
}
