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

:root {
    --navy: #0A2647;
    --navy-soft: #13315C;
    --blue: #2454E8;
    --blue-dark: #1B3FB8;
    --gold: #E8A317;

    --ink: #101828;
    --text: #1D2939;
    --text-muted: #667085;
    --text-faint: #98A2B3;

    --bg: #F7F8FA;
    --card: #FFFFFF;
    --border: #E5E8EE;
    --border-soft: #EEF0F4;

    --danger: #D92D20;
    --danger-bg: #FEF2F1;
    --success: #12805C;
    --success-bg: #EBFAF3;
    --warn: #B5540C;
    --warn-bg: #FEF6E9;

    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;

    --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
    --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.04);
    --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.08);
    --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.14);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: 'Sora', sans-serif; letter-spacing: -0.01em; }

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

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

.sidebar {
    width: 248px;
    background: var(--navy);
    padding: 20px 0 24px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar .brand {
    font-family: 'Sora', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    padding: 4px 20px 20px;
    display: flex;
    align-items: center;
    gap: 9px;
    letter-spacing: -0.01em;
}

.sidebar .brand .mark {
    width: 30px;
    height: 27px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.25));
}

.sidebar nav {
    flex: 1;
    padding: 4px 12px;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin-top: 4px;
    padding-top: 12px;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    padding: 9px 12px;
    color: #A9B7D1;
    font-size: 13.5px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    margin-bottom: 2px;
    transition: background 0.12s ease, color 0.12s ease;
}

.sidebar nav a:hover {
    background: rgba(255,255,255,0.06);
    color: #fff;
}

.sidebar nav a.active {
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--gold);
}

.sidebar .userbox {
    padding: 14px 20px 4px;
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 12.5px;
    color: #7C8CAB;
}

.sidebar .userbox strong {
    color: #fff;
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 1px;
}

.sidebar .userbox .role {
    display: inline-block;
    margin-top: 2px;
    margin-bottom: 10px;
}

.sidebar .userbox a {
    color: #7C8CAB;
    font-size: 12.5px;
}
.sidebar .userbox a:hover { color: #fff; }

.main {
    flex: 1;
    padding: 36px 44px;
    max-width: 1240px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 14px;
}

.page-header h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    color: var(--ink);
}
.page-header p {
    margin: 5px 0 0;
    color: var(--text-muted);
    font-size: 13.5px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 13.5px;
    font-family: 'Inter', sans-serif;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.12s ease;
    line-height: 1.4;
}
.btn:hover { text-decoration: none; }

.btn-primary {
    background: var(--blue);
    color: #fff;
    box-shadow: var(--shadow-xs);
}
.btn-primary:hover { background: var(--blue-dark); color: #fff; box-shadow: var(--shadow-sm); transform: translateY(-1px); }

.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: #D0930F; color: var(--navy); }

.btn-outline {
    background: var(--card);
    color: var(--text);
    border-color: var(--border);
}
.btn-outline:hover { background: #FAFAFB; border-color: #D0D5DD; color: var(--text); }

.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-danger { background: var(--danger); color: #fff; }

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-xs);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    box-shadow: var(--shadow-xs);
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.stat-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.stat-card .num {
    font-family: 'Sora', sans-serif;
    font-size: 26px;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.1;
    letter-spacing: -0.02em;
}
.stat-card .label {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-top: 6px;
    font-weight: 500;
}
.stat-card.gold .num { color: var(--warn); }
.stat-card.danger .num { color: var(--danger); }

table { width: 100%; border-collapse: collapse; }
th {
    text-align: left;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-faint);
    font-weight: 600;
    padding: 0 12px 10px;
    border-bottom: 1px solid var(--border);
}
td {
    padding: 13px 12px;
    border-bottom: 1px solid var(--border-soft);
    font-size: 13.5px;
    color: var(--text);
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: #FAFBFC; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px 3px 8px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    background: #EEF2FF;
    color: var(--blue-dark);
    white-space: nowrap;
}
.badge::before {
    content: '';
    width: 5px; height: 5px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}
.badge.gold { background: var(--warn-bg); color: var(--warn); }
.badge.green { background: var(--success-bg); color: var(--success); }
.badge.red { background: var(--danger-bg); color: var(--danger); }
.badge.gray { background: #F2F4F7; color: #475467; }

label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}
input, select, textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-family: inherit;
    margin-bottom: 16px;
    background: #fff;
    color: var(--text);
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(36, 84, 232, 0.12);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.form-section-title {
    font-family: 'Sora', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    margin: 6px 0 14px;
    padding-top: 18px;
    border-top: 1px solid var(--border-soft);
}
.form-section-title:first-child { border-top: none; padding-top: 0; margin-top: 0; }

.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--navy);
    background-image:
        radial-gradient(circle at 15% 20%, rgba(232,163,23,0.10), transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(36,84,232,0.18), transparent 45%);
    position: relative;
}
.login-card {
    background: #fff;
    padding: 40px 36px 32px;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 368px;
    box-shadow: var(--shadow-lg);
    border-top: 3px solid var(--gold);
    text-align: center;
}
.login-card form { text-align: left; }
.login-card .brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    color: var(--ink);
    font-family: 'Sora', sans-serif;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 3px;
}
.login-card .sub { color: var(--text-muted); font-size: 13px; margin-bottom: 26px; }
.login-card .btn { width: 100%; justify-content: center; padding: 10px; margin-top: 4px; }

.alert {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
    border: 1px solid transparent;
}
.alert-error { background: var(--danger-bg); color: var(--danger); border-color: #FDA29B; }
.alert-success { background: var(--success-bg); color: var(--success); border-color: #A6E9C8; }

.muted { color: var(--text-muted); font-size: 13px; }
.empty-state {
    text-align: center;
    padding: 44px 20px;
    color: var(--text-muted);
    font-size: 13.5px;
}

.switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
}
