* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #f1f5f9;
    color: #0f172a;
    min-height: 100vh;
}

/* ── Auth Screen ── */

.auth-screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0a1628 0%, #1a2a4a 50%, #0a1628 100%);
    z-index: 1000;
    padding: 1rem;
}

.auth-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 50%, rgba(59,130,246,0.08) 0%, transparent 60%),
                radial-gradient(ellipse at 70% 50%, rgba(16,185,129,0.06) 0%, transparent 60%);
}

.auth-box {
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 2.5rem 2rem 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.06);
    animation: auth-fade-in 0.5s ease-out;
    position: relative;
}

@keyframes auth-fade-in {
    from { opacity: 0; transform: translateY(24px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-box h1 {
    text-align: center;
    font-size: 1.65rem;
    font-weight: 800;
    background: linear-gradient(135deg, #0a1628, #2563eb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.03em;
    margin-bottom: 0.15rem;
}

.auth-box .auth-sub {
    text-align: center;
    font-size: 0.82rem;
    color: #64748b;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.auth-box form {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.auth-box input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.9rem;
    background: #f8fafc;
    transition: all 0.2s;
    outline: none;
    color: #0f172a;
}

.auth-box input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59,130,246,0.12);
    background: #fff;
}

.auth-box input::placeholder {
    color: #94a3b8;
}

.auth-box button[type="submit"] {
    padding: 0.8rem;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 0.15rem;
    letter-spacing: 0.02em;
}

.auth-box button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37,99,235,0.35);
}

.auth-box button[type="submit"]:active {
    transform: translateY(0);
}

.auth-error {
    text-align: center;
    font-size: 0.82rem;
    font-weight: 600;
    color: #dc2626;
    background: #fef2f2;
    padding: 0.55rem 0.75rem;
    border-radius: 10px;
    border: 1px solid #fecaca;
}

.auth-hint {
    text-align: center;
    font-size: 0.78rem;
    color: #94a3b8;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
}

.auth-hint strong {
    color: #3b82f6;
    font-weight: 600;
}

.hidden {
    display: none !important;
}

/* ── Dashboard Layout ── */

.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ── */

.sidebar {
    width: 220px;
    min-width: 220px;
    background: #0f172a;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-brand {
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-brand h2 {
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
}

.sidebar-sub {
    font-size: 0.7rem;
    color: #64748b;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.sidebar-nav {
    flex: 1;
    padding: 0.75rem 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 1.25rem;
    color: #94a3b8;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    border-left: 3px solid transparent;
    text-decoration: none;
}

.nav-item:hover {
    color: #e2e8f0;
    background: rgba(255,255,255,0.04);
}

.nav-item.active {
    color: #fff;
    background: rgba(59,130,246,0.12);
    border-left-color: #3b82f6;
    font-weight: 600;
}

.nav-icon {
    font-size: 0.55rem;
    opacity: 0.5;
    color: #64748b;
}

.nav-item.active .nav-icon {
    opacity: 1;
    color: #3b82f6;
}

.sidebar-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.sidebar-user {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 0.8rem;
    color: #94a3b8;
    font-weight: 500;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-logout {
    padding: 0.3rem 0.65rem;
    background: none;
    color: #64748b;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.sidebar-logout:hover {
    color: #fca5a5;
    border-color: rgba(252,165,165,0.3);
}

/* ── Main Content ── */

.main-content {
    flex: 1;
    padding: 1.5rem 2rem 2rem;
    max-width: calc(100vw - 220px);
    overflow-x: hidden;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
    animation: section-fade 0.2s ease;
}

@keyframes section-fade {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.section-header h2 {
    font-size: 1.3rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.section-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.market-badge {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

/* ── Overview Grid ── */

.overview-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.25rem;
}

/* ── Cards ── */

.card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.04);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
    border: 1px solid rgba(226,232,240,0.6);
    transition: box-shadow 0.2s;
}

.card:hover {
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.06);
}

.card h2 {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.card-icon {
    font-size: 0.8rem;
    opacity: 0.6;
}

.ai-card {
    border-left: 4px solid #3b82f6;
}

.ai-card h2 {
    margin-bottom: 0.65rem;
}

.health-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.45rem 0.75rem;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
}

.health-label {
    color: #64748b;
    font-weight: 500;
}

.health-value {
    color: #0f172a;
    font-weight: 700;
}

.health-unit {
    color: #94a3b8;
    font-size: 0.8rem;
}

#ai-loading {
    font-size: 0.85rem;
    color: #64748b;
    padding: 0.4rem 0.75rem;
}

.portfolio-card {
    overflow-x: auto;
}

.portfolio-card h2 {
    margin-bottom: 0.65rem;
}

/* ── Tables ── */

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
}

thead tr {
    background: #f8fafc;
}

th {
    padding: 0.65rem 0.75rem;
    text-align: left;
    font-weight: 700;
    color: #475569;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    vertical-align: middle;
}

tbody tr {
    transition: background 0.12s;
}

tbody tr:hover {
    background: #f8fafc;
}

tbody tr:last-child td {
    border-bottom: none;
}

.profit {
    color: #059669;
    font-weight: 700;
}

.loss {
    color: #dc2626;
    font-weight: 700;
}

.current-price {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.price-up {
    color: #059669;
}

.price-down {
    color: #dc2626;
}

.flash {
    animation: flash-bg 1s ease-out;
}

@keyframes flash-bg {
    0% { background-color: rgba(5,150,105,0.2); }
    100% { background-color: transparent; }
}

.price-down.flash {
    animation-name: flash-bg-red;
}

@keyframes flash-bg-red {
    0% { background-color: rgba(220,38,38,0.15); }
    100% { background-color: transparent; }
}

.vol {
    font-variant-numeric: tabular-nums;
    color: #64748b;
    font-size: 0.8rem;
}

.ai-signal {
    font-weight: 700;
    font-size: 0.78rem;
    text-align: center;
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    min-width: 44px;
    text-align: center;
}

.signal-buy {
    color: #059669;
    background: #ecfdf5;
}

.signal-hold {
    color: #d97706;
    background: #fffbeb;
}

.signal-sell {
    color: #dc2626;
    background: #fef2f2;
}

/* ── Inline Forms ── */

.inline-form {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    align-items: center;
}

.inline-form input, .inline-form select {
    padding: 0.55rem 0.8rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 9px;
    font-size: 0.84rem;
    background: #f8fafc;
    outline: none;
    transition: all 0.2s;
    color: #0f172a;
    min-width: 0;
    flex: 1;
}

.inline-form input:focus, .inline-form select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
    background: #fff;
}

.inline-form input::placeholder {
    color: #94a3b8;
}

.inline-form select {
    cursor: pointer;
    flex: 0 0 auto;
}

.btn-add {
    padding: 0.55rem 1.4rem;
    background: linear-gradient(135deg, #059669, #10b981);
    color: #fff;
    border: none;
    border-radius: 9px;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-add:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(5,150,105,0.3);
}

.btn-buy {
    padding: 0.55rem 1.4rem;
    background: linear-gradient(135deg, #d97706, #f59e0b);
    color: #fff;
    border: none;
    border-radius: 9px;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-buy:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(217,119,6,0.3);
}

.btn-alert {
    padding: 0.55rem 1.4rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border: none;
    border-radius: 9px;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-alert:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99,102,241,0.3);
}

.delete-btn {
    padding: 0.25rem 0.65rem;
    background: none;
    color: #94a3b8;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.15s;
}

.delete-btn:hover {
    color: #dc2626;
    border-color: #fecaca;
    background: #fef2f2;
}

.sell-btn {
    padding: 0.25rem 0.75rem;
    background: none;
    color: #059669;
    border: 1px solid #a7f3d0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.15s;
}

.sell-btn:hover {
    background: #ecfdf5;
    border-color: #059669;
}

#form-message, #intra-message {
    margin-top: 0.5rem;
    font-size: 0.82rem;
    font-weight: 600;
}

#form-message.success, #intra-message.success {
    color: #059669;
}

#form-message.error, #intra-message.error {
    color: #dc2626;
}

/* ── Intraday Summary ── */

.intraday-summary {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.55rem 0.85rem;
    background: #f8fafc;
    border-radius: 9px;
    margin-bottom: 0.85rem;
    font-size: 0.8rem;
    color: #475569;
    border: 1px solid #f1f5f9;
}

.intraday-summary span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.intraday-summary strong {
    color: #0f172a;
    font-weight: 700;
}

/* ── Autocomplete ── */

.autocomplete {
    position: relative;
    flex: 1;
    min-width: 120px;
}

.autocomplete input {
    width: 100%;
}

.suggestions {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 10px 10px;
    z-index: 100;
    max-height: 210px;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.suggestions.show {
    display: block;
}

.suggestion-item {
    padding: 0.5rem 0.8rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.1s;
}

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

.suggestion-item:hover {
    background: #eef2ff;
}

.s-ticker {
    font-weight: 700;
    color: #0f172a;
    font-size: 0.84rem;
}

.s-name {
    color: #94a3b8;
    font-size: 0.76rem;
    margin-left: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Stock Screener ── */

.screener-form {
    margin-bottom: 0;
}

.screener-row {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.screener-field {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 110px;
    flex: 1;
}

.screener-field label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.screener-field select {
    padding: 0.5rem 0.65rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.8rem;
    background: #f8fafc;
    color: #334155;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
}

.screener-field select:focus {
    border-color: #3b82f6;
}

.screener-action {
    flex: 0 0 auto;
    min-width: auto;
}

.screener-action button {
    padding: 0.5rem 1.25rem;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.screener-action button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37,99,235,0.3);
}

.screener-results {
    margin-top: 0.75rem;
}

.screener-loading {
    font-size: 0.85rem;
    color: #64748b;
    padding: 0.5rem 0;
}

.screener-empty {
    font-size: 0.85rem;
    color: #94a3b8;
    padding: 1rem 0;
    text-align: center;
}

.screener-count {
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.5rem;
    padding: 0.3rem 0.65rem;
    background: #f1f5f9;
    border-radius: 6px;
    display: inline-block;
}

.screener-results table {
    font-size: 0.8rem;
}

.screener-results th {
    font-size: 0.7rem;
    padding: 0.5rem 0.6rem;
}

.screener-results td {
    padding: 0.4rem 0.6rem;
}

/* ── Alerts ── */

.alert-list {
    margin-top: 0.75rem;
}

.alert-empty {
    font-size: 0.82rem;
    color: #94a3b8;
    padding: 0.5rem 0;
}

.alert-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.85rem;
    background: #f8fafc;
    border-radius: 10px;
    margin-bottom: 0.4rem;
    border: 1px solid #f1f5f9;
    transition: background 0.15s;
}

.alert-item:hover {
    background: #f1f5f9;
}

.alert-ticker {
    font-weight: 700;
    color: #0f172a;
    font-size: 0.86rem;
    min-width: 85px;
}

.alert-direction {
    font-size: 0.76rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 5px;
}

.alert-direction.above {
    color: #059669;
    background: #ecfdf5;
}

.alert-direction.below {
    color: #dc2626;
    background: #fef2f2;
}

.alert-target {
    font-size: 0.84rem;
    font-weight: 600;
    color: #334155;
    font-variant-numeric: tabular-nums;
    flex: 1;
}

.alert-delete {
    background: none;
    border: none;
    font-size: 1.1rem;
    color: #94a3b8;
    cursor: pointer;
    padding: 0 0.2rem;
    line-height: 1;
    transition: color 0.15s;
}

.alert-delete:hover {
    color: #dc2626;
}

#alert-message {
    margin-top: 0.5rem;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.45rem 0.75rem;
    border-radius: 8px;
}

#alert-message.success {
    color: #059669;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
}

#alert-message.error {
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

#alert-message.alert-fired {
    color: #7c3aed;
    background: #f5f3ff;
    border: 1px solid #ddd6fe;
    animation: alert-pulse 1s ease-in-out 3;
}

@keyframes alert-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ── Chart ── */

.chart-filters {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.chart-filters select {
    padding: 0.35rem 0.6rem;
    border: 1px solid #e2e8f0;
    border-radius: 7px;
    font-size: 0.8rem;
    background: #f8fafc;
    color: #334155;
    outline: none;
    cursor: pointer;
}

.chart-filters label {
    font-size: 0.76rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    transition: all 0.15s;
}

.chart-filters label:has(input:checked) {
    background: #eef2ff;
    border-color: #6366f1;
    color: #4f46e5;
}

.chart-filters input[type="checkbox"] {
    accent-color: #6366f1;
}

.chart-info {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
    color: #64748b;
    padding: 0.45rem 0.75rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #f1f5f9;
}

.chart-info strong {
    color: #0f172a;
}

#price-chart {
    max-height: 350px;
    width: 100%;
    border-radius: 8px;
}

.prediction-box {
    background: linear-gradient(135deg, #f0f9ff, #fff);
    border: 1px solid #e0f2fe;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-top: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.prediction-box h3 {
    font-size: 0.88rem;
    color: #0f172a;
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 700;
}

.prediction-box h3::before {
    content: '\2606';
    color: #f59e0b;
    font-size: 1rem;
}

.prediction-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.4rem;
}

.prediction-signal {
    font-size: 0.95rem;
    padding: 0.15rem 0.8rem;
    border-radius: 7px;
    font-weight: 700;
}

.prediction-signal.signal-buy {
    background: #d1fae5;
    color: #059669;
}

.prediction-signal.signal-sell {
    background: #fef2f2;
    color: #dc2626;
}

.prediction-signal.signal-hold {
    background: #fef3c7;
    color: #d97706;
}

.prediction-score {
    font-size: 0.84rem;
    color: #475569;
}

.prediction-reasons {
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 0.45rem;
    line-height: 1.5;
}

.prediction-detail {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.76rem;
    color: #94a3b8;
    padding-top: 0.5rem;
    border-top: 1px solid #f1f5f9;
}

/* ── Admin ── */

.role-select {
    padding: 0.25rem 0.45rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.8rem;
    background: #f8fafc;
    color: #334155;
    cursor: pointer;
    outline: none;
}

.admin-create-user {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e2e8f0;
}

.admin-create-user h3 {
    font-size: 0.88rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.75rem;
}

.admin-create-user .inline-form input {
    flex: 1;
    min-width: 130px;
    padding: 0.5rem 0.75rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 9px;
    font-size: 0.82rem;
    background: #f8fafc;
    outline: none;
    transition: all 0.2s;
    color: #0f172a;
}

.admin-create-user .inline-form input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
    background: #fff;
}

.admin-create-user .inline-form button {
    padding: 0.5rem 1.25rem;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff;
    border: none;
    border-radius: 9px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.admin-create-user .inline-form button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37,99,235,0.3);
}

#admin-create-msg {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
}

#admin-create-msg.success {
    color: #059669;
}

#admin-create-msg.error {
    color: #dc2626;
}

/* ── Scrollbar ── */

::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ── Responsive ── */

@media (max-width: 900px) {
    .sidebar {
        width: 180px;
        min-width: 180px;
    }
    .main-content {
        max-width: calc(100vw - 180px);
        padding: 1rem 1.25rem;
    }
    .overview-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .dashboard-layout {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        min-width: 0;
        height: auto;
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 0.5rem 0.75rem;
    }
    .sidebar-brand {
        padding: 0.25rem 0;
        border-bottom: none;
        margin-right: 1rem;
    }
    .sidebar-brand h2 {
        font-size: 1rem;
    }
    .sidebar-sub { display: none; }
    .sidebar-nav {
        display: flex;
        gap: 0.25rem;
        padding: 0;
        overflow-x: auto;
        flex: 1;
    }
    .nav-item {
        padding: 0.35rem 0.6rem;
        border-left: none;
        border-bottom: 2px solid transparent;
        font-size: 0.78rem;
        white-space: nowrap;
    }
    .nav-item.active {
        border-left: none;
        border-bottom-color: #3b82f6;
    }
    .nav-icon { display: none; }
    .sidebar-footer {
        padding: 0.25rem 0 0;
        border-top: none;
        width: 100%;
    }
    .main-content {
        max-width: 100%;
        padding: 0.75rem 1rem;
    }
    .inline-form {
        flex-direction: column;
    }
    .inline-form input,
    .inline-form .autocomplete {
        width: 100%;
    }
}
