:root {
    --bob-orange: #F5821F;
    --bob-orange-dark: #D9691A;
    --bob-navy: #0B2E5C;
    --bob-navy-light: #123B76;
    --bg: #F4F6F9;
    --card-bg: #FFFFFF;
    --border: #E4E9F0;
    --text: #1E2733;
    --text-muted: #5B6674;
    --success: #1E7B34;
    --success-bg: #E6F4EA;
    --danger: #B3261E;
    --danger-bg: #FBE9E7;
    --warning: #8A5A00;
    --warning-bg: #FFF3DA;
    --info-bg: #E7EEF9;
    --peach-bg: #FDEEE0;
    --sidebar-w: 230px;
    --header-h: 64px;
    --radius: 8px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ---------- Header (orange top bar) ---------- */
.topbar {
    background: var(--bob-orange);
    height: var(--header-h);
    display: flex;
    align-items: center;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 20;
}
.topbar-inner {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo-img {
    height: 40px;
    width: auto;
    flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-title { color: #fff; font-size: 0.95rem; font-weight: 700; }
.brand-sub { color: rgba(255,255,255,0.85); font-size: 0.72rem; }

.topbar-right { display: flex; align-items: center; gap: 10px; }
.user-pill {
    background: rgba(255,255,255,0.22);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 999px;
}
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: rgba(255,255,255,0.22);
    color: #fff;
    text-decoration: none;
    border: none;
    cursor: pointer;
}
.icon-btn:hover { background: rgba(255,255,255,0.35); }
.icon-btn svg { width: 16px; height: 16px; }

/* ---------- App shell: sidebar + content ---------- */
.app-shell { display: flex; min-height: calc(100vh - var(--header-h)); }

.sidebar {
    width: var(--sidebar-w);
    background: #fff;
    border-right: 1px solid var(--border);
    flex-shrink: 0;
    padding: 18px 0;
    display: flex;
    flex-direction: column;
}
.sidebar-section-label {
    text-transform: uppercase;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #9AA5B1;
    padding: 0 20px;
    margin: 18px 0 8px;
}
.sidebar-section-label:first-child { margin-top: 0; }
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 20px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.87rem;
    font-weight: 500;
    border-left: 3px solid transparent;
}
.sidebar-link svg { width: 17px; height: 17px; flex-shrink: 0; color: #8792A0; }
.sidebar-link:hover { background: #F7F9FC; }
.sidebar-link.active {
    background: var(--peach-bg);
    border-left-color: var(--bob-orange);
    color: var(--bob-orange-dark);
    font-weight: 700;
}
.sidebar-link.active svg { color: var(--bob-orange-dark); }

.content {
    flex: 1;
    padding: 28px 32px;
    min-width: 0;
}

.footer {
    text-align: center;
    padding: 16px;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
    background: var(--card-bg);
}

.flash-wrap { margin-bottom: 18px; }
.flash {
    padding: 10px 16px;
    border-radius: var(--radius);
    margin-bottom: 8px;
    font-size: 0.9rem;
}
.flash-success { background: var(--success-bg); color: var(--success); }
.flash-danger { background: var(--danger-bg); color: var(--danger); }
.flash-warning { background: var(--warning-bg); color: var(--warning); }
.flash-info { background: var(--info-bg); color: var(--bob-navy); }

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
}

.card h1, .card h2 { margin-top: 0; color: var(--bob-navy); }

h1.page-title {
    color: var(--bob-navy);
    font-size: 1.5rem;
    margin-bottom: 4px;
}
p.page-sub { color: var(--text-muted); margin-top: 0; margin-bottom: 20px; }

label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text); margin-bottom: 4px; margin-top: 14px; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.92rem;
    background: #fff;
    color: var(--text);
}
input:focus, select:focus, textarea:focus {
    outline: 2px solid var(--bob-orange);
    outline-offset: 1px;
    border-color: var(--bob-orange);
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: var(--radius);
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}
.btn-primary { background: var(--bob-orange); color: #fff; }
.btn-primary:hover { background: var(--bob-orange-dark); }
.btn-secondary { background: var(--bob-navy); color: #fff; }
.btn-secondary:hover { background: var(--bob-navy-light); }
.btn-approve { background: var(--success); color: #fff; }
.btn-reject { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-block { width: 100%; margin-top: 20px; }

table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--bob-navy); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; background: #F7F9FC; }
tr:hover td { background: #FAFBFD; }

.badge { padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; }
.badge-Pending { background: var(--warning-bg); color: var(--warning); }
.badge-Approved { background: var(--success-bg); color: var(--success); }
.badge-Rejected { background: var(--danger-bg); color: var(--danger); }

/* ---------- Peach stat cards ---------- */
.stat-row { display: flex; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.stat-box {
    background: var(--peach-bg);
    border-radius: var(--radius);
    padding: 16px 20px;
    min-width: 160px;
    flex: 1;
}
.stat-box .lbl { font-size: 0.8rem; color: #8A5A2E; margin-bottom: 4px; }
.stat-box .num { font-size: 1.7rem; font-weight: 700; color: var(--text); }

.filters { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 18px; }
.filters .field { min-width: 160px; }
.filters label { margin-top: 0; }

.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }

.review-form { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.review-form textarea { min-height: 34px; font-size: 0.82rem; }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; margin: 16px 0; }
.detail-grid .k { color: var(--text-muted); font-size: 0.78rem; }
.detail-grid .v { font-weight: 600; }

.total-row td { font-weight: 700; color: var(--bob-navy); background: #F7F9FC; }
.cap-hint { color: var(--text-muted); font-size: 0.78rem; }

/* ---------- Login page ---------- */
.auth-page {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
    background: linear-gradient(160deg, #F5821F 0%, #C5581A 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.auth-card {
    background: #fff;
    border-radius: 16px;
    padding: 40px 36px 30px;
    width: 100%;
    max-width: 380px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}
.auth-logo-img {
    height: 90px;
    width: auto;
    margin: 0 auto 16px;
    display: block;
}
.auth-card h1 { color: var(--bob-navy); font-size: 1.2rem; margin: 0 0 4px; }
.auth-card .auth-sub { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 22px; }
.auth-card label { text-align: left; }
.auth-card .btn-block { margin-top: 22px; }
.auth-copyright { margin-top: 20px; color: #A6AEB8; font-size: 0.72rem; }

.flash-wrap-auth { margin-bottom: 14px; text-align: left; }

@media (max-width: 900px) {
    .app-shell { flex-direction: column; }
    .sidebar {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
        padding: 8px 4px;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .sidebar-section-label { display: none; }
    .sidebar-link { flex-direction: column; gap: 4px; font-size: 0.7rem; padding: 8px 14px; border-left: none; border-bottom: 3px solid transparent; white-space: nowrap; }
    .sidebar-link.active { border-left-color: transparent; border-bottom-color: var(--bob-orange); }
    .content { padding: 20px 16px; }
}

@media (max-width: 640px) {
    .detail-grid { grid-template-columns: 1fr; }
    table, thead, tbody, th, td, tr { display: block; }
    thead { display: none; }
    tr { margin-bottom: 12px; border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; }
    td { border: none; padding: 6px 8px; }
    td::before { content: attr(data-label); display: block; font-size: 0.7rem; color: var(--text-muted); font-weight: 600; }
    .brand-sub { display: none; }
}
