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

:root {
    --navy:   #1e2d40;
    --blue:   #2563eb;
    --blue-h: #1d4ed8;
    --green:  #16a34a;
    --red:    #dc2626;
    --amber:  #d97706;
    --cyan:   #0891b2;
    --bg:     #f1f5f9;
    --white:  #ffffff;
    --text:   #1f2937;
    --muted:  #6b7280;
    --border: #e5e7eb;
    --radius: 6px;
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 15px;
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
}

/* ── NAVBAR ─────────────────────────────────────────────────── */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--navy);
    padding: 0 24px;
    height: 56px;
    box-shadow: 0 1px 4px rgba(0,0,0,.3);
}

.nav-brand {
    font-weight: 700;
    font-size: 16px;
    color: #fff;
    text-decoration: none;
    letter-spacing: .3px;
    margin-right: 32px;
    white-space: nowrap;
}

.nav-links {
    display: flex;
    gap: 2px;
    flex: 1;
    overflow-x: auto;
}

.nav-links a {
    color: rgba(255,255,255,.75);
    text-decoration: none;
    font-size: 13.5px;
    padding: 8px 14px;
    border-radius: 4px;
    white-space: nowrap;
    transition: background .15s, color .15s;
}

.nav-links a:hover,
.nav-links a.active {
    background: rgba(255,255,255,.12);
    color: #fff;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 16px;
    white-space: nowrap;
}

.nav-name { color: #fff; font-size: 13.5px; font-weight: 500; }
.nav-role { color: rgba(255,255,255,.55); font-size: 12px; }

.btn-logout {
    color: rgba(255,255,255,.7);
    text-decoration: none;
    font-size: 13px;
    padding: 5px 12px;
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 4px;
    transition: background .15s;
}
.btn-logout:hover { background: rgba(255,255,255,.1); }

/* ── LAYOUT ─────────────────────────────────────────────────── */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 24px 64px;
}

.page-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

h1 { font-size: 22px; font-weight: 700; color: var(--text); }
h2 { font-size: 17px; font-weight: 600; margin-bottom: 16px; }

/* ── ALERTS ─────────────────────────────────────────────────── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    font-size: 14px;
    font-weight: 500;
}
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info    { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

/* ── CARDS ──────────────────────────────────────────────────── */
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
}

.card-header {
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 16px;
}

/* ── TABLES ─────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

thead th {
    background: #f8fafc;
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
}

tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f8fafc; }

.empty-row td {
    text-align: center;
    color: var(--muted);
    padding: 32px;
}

/* ── FORMS ──────────────────────────────────────────────────── */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }

label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    background: var(--white);
    transition: border-color .15s, box-shadow .15s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

textarea { resize: vertical; min-height: 80px; }

.hint { font-size: 12px; color: var(--muted); }

/* ── BUTTONS ────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, opacity .15s;
}

.btn-primary  { background: var(--blue);  color: #fff; }
.btn-primary:hover  { background: var(--blue-h); }
.btn-success  { background: var(--green); color: #fff; }
.btn-success:hover  { opacity: .88; }
.btn-danger   { background: var(--red);   color: #fff; }
.btn-danger:hover   { opacity: .88; }
.btn-secondary { background: #e5e7eb; color: var(--text); }
.btn-secondary:hover { background: #d1d5db; }
.btn-sm { padding: 5px 12px; font-size: 13px; }

.btn-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 24px;
    flex-wrap: wrap;
}

/* ── BADGES ─────────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.badge-success   { background: #dcfce7; color: #166534; }
.badge-warning   { background: #fef3c7; color: #92400e; }
.badge-danger    { background: #fee2e2; color: #991b1b; }
.badge-info      { background: #dbeafe; color: #1e40af; }
.badge-secondary { background: #f3f4f6; color: #374151; }

/* ── STATS GRID ─────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.stat-card .stat-value {
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    color: var(--navy);
}

.stat-card .stat-label {
    font-size: 12.5px;
    color: var(--muted);
    margin-top: 6px;
}

/* ── LOGIN ──────────────────────────────────────────────────── */
.login-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg);
}

.login-box {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 24px rgba(0,0,0,.07);
}

.login-box h1 {
    font-size: 22px;
    text-align: center;
    margin-bottom: 6px;
}

.login-box .login-sub {
    text-align: center;
    color: var(--muted);
    font-size: 13.5px;
    margin-bottom: 28px;
}

.login-box .form-group { margin-bottom: 18px; }
.login-box .btn { width: 100%; justify-content: center; padding: 11px; }

/* ── MISC ───────────────────────────────────────────────────── */
.text-muted { color: var(--muted); font-size: 13px; }
.text-right { text-align: right; }
.mb-0 { margin-bottom: 0; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

@media (max-width: 700px) {
    .nav-links { display: none; }
    .container { padding: 20px 16px 48px; }
    .form-grid { grid-template-columns: 1fr; }
}
