/* ================= Admin back-office stylesheet ================= */
:root {
    --a-primary: #0b2545;
    --a-accent: #c9a24b;
    --a-bg: #f2f4f8;
    --a-border: #e1e5ec;
    --a-text: #1c2733;
    --a-muted: #6b7787;
}
* { box-sizing: border-box; }
body.admin-body {
    margin: 0;
    font-family: 'Sarabun', 'Noto Sans Thai', sans-serif;
    background: var(--a-bg);
    color: var(--a-text);
}
.admin-wrap { display: flex; min-height: 100vh; }

/* ---- Sidebar ---- */
.admin-sidebar {
    width: 250px;
    background: var(--a-primary);
    color: #dbe4f0;
    flex-shrink: 0;
    padding: 20px 0;
}
.admin-sidebar .brand {
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    margin-bottom: 14px;
    font-weight: 800;
    color: #fff;
    font-size: 16px;
}
.admin-sidebar .brand small { display: block; font-weight: 400; font-size: 12px; color: #9db0c9; }
.admin-sidebar a {
    display: block;
    color: #dbe4f0;
    text-decoration: none;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-left: 3px solid transparent;
}
.admin-sidebar a:hover, .admin-sidebar a.active {
    background: rgba(255,255,255,0.08);
    border-left-color: var(--a-accent);
    color: #fff;
}
.admin-sidebar .group-title {
    padding: 16px 20px 6px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #7d90ac;
}

/* ---- Main content ---- */
.admin-main { flex: 1; min-width: 0; }
.admin-topbar {
    background: #fff;
    border-bottom: 1px solid var(--a-border);
    padding: 14px 26px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.admin-topbar .user-box { font-size: 14px; color: var(--a-muted); }
.admin-content { padding: 26px; max-width: 1200px; }

h1.a-title { font-size: 22px; color: var(--a-primary); margin: 0 0 20px; }

.a-card {
    background: #fff;
    border: 1px solid var(--a-border);
    border-radius: 10px;
    padding: 22px;
    margin-bottom: 22px;
}

.a-grid { display: grid; gap: 18px; }
.a-grid-4 { grid-template-columns: repeat(4, 1fr); }
.stat-card { text-align: center; }
.stat-card .num { font-size: 30px; font-weight: 800; color: var(--a-primary); }
.stat-card .lbl { font-size: 13px; color: var(--a-muted); margin-top: 4px; }

table.a-table { width: 100%; border-collapse: collapse; }
table.a-table th, table.a-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--a-border);
    font-size: 14px;
    text-align: left;
    vertical-align: middle;
}
table.a-table th { background: #f7f9fc; color: var(--a-muted); font-weight: 700; font-size: 12.5px; text-transform: uppercase; }
table.a-table tr:hover { background: #fafbfd; }

.btn {
    display: inline-block;
    background: var(--a-primary);
    color: #fff !important;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 13.5px;
    border: none;
    cursor: pointer;
    text-decoration: none;
}
.btn:hover { background: #133a6b; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-danger { background: #b3261e; }
.btn-danger:hover { background: #8f1e18; }
.btn-outline { background: #fff; color: var(--a-primary) !important; border: 1px solid var(--a-primary); }
.btn-accent { background: var(--a-accent); color: var(--a-primary) !important; }

.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; flex-wrap: wrap; gap: 10px; }

form .form-row { margin-bottom: 16px; }
form label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 13.5px; }
form .hint { color: var(--a-muted); font-size: 12.5px; margin-top: 4px; }
form input[type=text], form input[type=number], form input[type=date],
form input[type=datetime-local], form input[type=email], form input[type=password],
form select, form textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--a-border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
}
form textarea { min-height: 140px; resize: vertical; }
.bi-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bi-pair .bi-col span { display: block; font-size: 12px; color: var(--a-muted); margin-bottom: 4px; font-weight: 700; }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; }
.current-file { font-size: 13px; color: var(--a-muted); margin-bottom: 6px; }
.current-file img { max-width: 120px; border-radius: 6px; margin-top: 6px; display: block; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge-green { background: #e7f6ec; color: #1e7a3e; }
.badge-gray { background: #eef1f5; color: #6b7787; }
.badge-red { background: #fdeaea; color: #a31f1f; }

.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; font-size: 14px; }
.alert-success { background: #e7f6ec; color: #1e7a3e; border: 1px solid #b7e3c4; }
.alert-error { background: #fdeaea; color: #a31f1f; border: 1px solid #f3bcbc; }

.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0b2545, #1c4d8f);
}
.login-box {
    background: #fff;
    padding: 40px 36px;
    border-radius: 12px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.25);
}
.login-box h1 { font-size: 18px; color: var(--a-primary); margin-bottom: 4px; }
.login-box p.sub { color: var(--a-muted); font-size: 13px; margin-bottom: 22px; }

.pagination { display: flex; gap: 6px; margin-top: 20px; }
.pagination a, .pagination span { padding: 6px 11px; border: 1px solid var(--a-border); border-radius: 6px; font-size: 13px; background: #fff; }
.pagination .current { background: var(--a-primary); color: #fff; border-color: var(--a-primary); }

@media (max-width: 900px) {
    .admin-sidebar { display: none; }
    .a-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .bi-pair { grid-template-columns: 1fr; }
}
