:root {
    --accent: #d97757;
    --accent-hover: #c2603f;
    --bg: #0b0d12;
    --surface: #14161d;
    --surface-2: #1b1e27;
    --sidebar-bg: #0f1117;
    --border: rgba(255, 255, 255, .07);
    --muted: #9aa4b2;
    --sidebar-width: 248px;
}

html, body {
    min-height: 100vh;
}

body {
    background: var(--bg);
    color: #e6e8ec;
}

/* ---------- Shell ---------- */
.app-shell {
    display: flex;
    min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    z-index: 1040;
}

.sidebar .brand {
    padding: 1.15rem 1.35rem;
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: .3px;
    border-bottom: 1px solid var(--border);
    color: #fff;
}

.sidebar .brand .dot {
    color: var(--accent);
}

.sidebar .nav {
    padding: .75rem .5rem;
    overflow-y: auto;
}

.sidebar .nav-link {
    color: var(--muted);
    border-radius: .6rem;
    margin: .12rem .3rem;
    padding: .6rem .85rem;
    display: flex;
    align-items: center;
    gap: .7rem;
    font-size: .94rem;
    transition: background .15s, color .15s;
}

.sidebar .nav-link i {
    font-size: 1.1rem;
    width: 1.2rem;
    text-align: center;
}

.sidebar .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, .05);
}

.sidebar .nav-link.active {
    color: #fff;
    background: var(--accent);
    box-shadow: 0 4px 14px rgba(217, 119, 87, .35);
}

.sidebar .nav-section {
    color: #5c6573;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    padding: .9rem 1rem .3rem;
}

/* ---------- Main ---------- */
.main {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    height: 62px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
    position: sticky;
    top: 0;
    background: rgba(15, 17, 23, .8);
    backdrop-filter: blur(10px);
    z-index: 1030;
}

.topbar .page-title {
    font-weight: 600;
    font-size: 1.05rem;
    margin: 0;
}

.content {
    padding: 1.6rem;
    flex: 1;
}

/* ---------- Surfaces ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: .85rem;
}

.card .card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
}

.stat-card {
    border-radius: .9rem;
    overflow: hidden;
}

.stat-card .stat-value {
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1.1;
}

.stat-card .stat-label {
    color: var(--muted);
    font-size: .82rem;
}

.stat-card .stat-icon {
    font-size: 1.6rem;
    opacity: .35;
}

.table {
    --bs-table-bg: transparent;
    margin-bottom: 0;
}

.table > :not(caption) > * > * {
    border-bottom-color: var(--border);
}

.form-control, .form-select {
    background: var(--surface-2);
    border-color: var(--border);
    color: #e6e8ec;
}

.form-control:focus, .form-select:focus {
    background: var(--surface-2);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 0 0 .2rem rgba(217, 119, 87, .25);
}

.btn-accent {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.btn-accent:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #fff;
}

.badge-soft-success { background: rgba(34, 197, 94, .15); color: #4ade80; }
.badge-soft-danger { background: rgba(239, 68, 68, .15); color: #f87171; }
.badge-soft-info { background: rgba(56, 189, 248, .15); color: #38bdf8; }
.badge-soft-muted { background: rgba(148, 163, 184, .15); color: #cbd5e1; }

a { color: #e8a17f; }
a:hover { color: #f2bda6; }

/* ---------- Auth (login) ---------- */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(1200px 600px at 50% -10%, rgba(217, 119, 87, .18), transparent), var(--bg);
    padding: 1rem;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .45);
}

/* ---------- Validation ---------- */
.validation-summary-valid { display: none; }
.field-validation-error { color: #f87171; }
.input-validation-error { border-color: #ef4444 !important; }

/* ---------- Mobile ---------- */
.sidebar-backdrop {
    display: none;
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform .2s ease;
    }
    .sidebar.show {
        transform: none;
    }
    .main {
        margin-left: 0;
    }
    .sidebar-backdrop.show {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, .5);
        z-index: 1039;
    }
}
