/* ===== Berita JWC - Admin ===== */

:root {
    --ms-blue: #0067b8;
    --ms-accent: #0078d4;
    --ms-sidebar: #1b2a41;
    --ms-sidebar-hover: #243755;
    --ms-text: #1b1b1b;
    --ms-muted: #6b6b6b;
    --ms-border: #e1e1e1;
    --font: "Segoe UI", "Segoe UI Variable Text", "Helvetica Neue", Arial, sans-serif;
}

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

body {
    font-family: var(--font);
    color: var(--ms-text);
    background: #f4f6f9;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--ms-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Layout ===== */
.admin-shell { display: flex; min-height: 100vh; }

.admin-sidebar {
    width: 248px;
    background: var(--ms-sidebar);
    color: #c7d2e0;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}
@media (max-width: 860px) {
    .admin-shell { flex-direction: column; }
    .admin-sidebar { width: 100%; height: auto; position: static; }
    .admin-sidebar .side-nav { flex-wrap: wrap; }
}

.side-brand {
    display: flex; align-items: center; gap: 10px;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.side-brand .brand-logo {
    min-width: 32px; height: 32px; padding: 0 6px; border-radius: 7px;
    background: linear-gradient(135deg, #0078d4, #38b6ff);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 11px; letter-spacing: 0.3px;
}
.side-brand .brand-text { color: #fff; font-size: 15px; font-weight: 600; }
.side-brand .brand-sub { color: #8fa3bb; font-size: 11px; }

.side-nav { padding: 14px 0; }
.side-nav .nav-label {
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px;
    color: #6f83a0; padding: 10px 20px 6px; font-weight: 700;
}
.side-nav a {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 20px; color: #c7d2e0; font-size: 13.5px; font-weight: 500;
}
.side-nav a:hover { background: var(--ms-sidebar-hover); text-decoration: none; color: #fff; }
.side-nav a.active { background: var(--ms-accent); color: #fff; box-shadow: inset 3px 0 0 #38b6ff; }
.side-nav svg { flex-shrink: 0; }

.side-footer { margin-top: auto; padding: 14px 20px; border-top: 1px solid rgba(255,255,255,0.08); font-size: 11.5px; color: #6f83a0; }

.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.admin-topbar {
    background: #fff; border-bottom: 1px solid var(--ms-border);
    padding: 0 26px; height: 60px;
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 50;
}
.admin-topbar .page-title { font-size: 16.5px; font-weight: 600; }
.admin-user { display: flex; align-items: center; gap: 12px; }
.admin-user .avatar {
    width: 34px; height: 34px; border-radius: 50%; background: var(--ms-accent);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-weight: 600;
}
.admin-user .user-name { font-size: 13px; font-weight: 600; }
.admin-user .user-role { font-size: 11.5px; color: var(--ms-muted); }

.admin-content { padding: 26px; flex: 1; }

/* ===== Cards ===== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; margin-bottom: 24px; }
.stat-card {
    background: #fff; border: 1px solid var(--ms-border); border-radius: 8px;
    padding: 20px; display: flex; align-items: center; gap: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.stat-card .stat-ic {
    width: 46px; height: 46px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; flex-shrink: 0;
}
.stat-card .stat-num { font-size: 24px; font-weight: 700; line-height: 1.1; }
.stat-card .stat-label { color: var(--ms-muted); font-size: 12.5px; }

.panel {
    background: #fff; border: 1px solid var(--ms-border); border-radius: 8px;
    margin-bottom: 22px; overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.panel-head {
    padding: 15px 20px; border-bottom: 1px solid var(--ms-border);
    display: flex; justify-content: space-between; align-items: center;
}
.panel-head h3 { font-size: 15px; font-weight: 600; }
.panel-body { padding: 20px; }

/* ===== Tables ===== */
.table-wrap { overflow-x: auto; }
table.data {
    width: 100%; border-collapse: collapse; font-size: 13.5px;
}
table.data th {
    text-align: left; background: #f8f9fb; color: var(--ms-muted);
    font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px;
    padding: 11px 16px; border-bottom: 1px solid var(--ms-border); white-space: nowrap;
}
table.data td { padding: 12px 16px; border-bottom: 1px solid #eef0f3; vertical-align: middle; }
table.data tr:hover td { background: #fafcff; }
table.data .thumb-td img { width: 84px; height: 48px; object-fit: cover; border-radius: 4px; display: block; }
table.data .thumb-td .noimg { width: 84px; height: 48px; border-radius: 4px; background: #eef0f3; }
.news-title-cell { font-weight: 600; max-width: 300px; }
.news-title-cell a { color: var(--ms-text); }
.news-title-cell a:hover { color: var(--ms-accent); }
.cell-muted { color: var(--ms-muted); font-size: 12.5px; }

/* ===== Badges ===== */
.badge {
    display: inline-block; padding: 3px 10px; border-radius: 12px;
    font-size: 11.5px; font-weight: 600;
}
.badge-green { background: #e6f4e6; color: #107c10; }
.badge-gray { background: #f0f0f0; color: #6b6b6b; }
.badge-blue { background: #e8f0ff; color: #0067b8; }
.badge-cat { font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; font-weight: 700; }

/* ===== Buttons ===== */
.btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 16px; border-radius: 5px;
    font-size: 13.5px; font-weight: 600; font-family: var(--font);
    border: 1px solid transparent; cursor: pointer;
    transition: background 0.12s ease;
    text-decoration: none;
}
.btn:not(a) { line-height: 1.2; }
.btn-primary { background: var(--ms-accent); color: #fff; }
.btn-primary:hover { background: #0165b5; text-decoration: none; color: #fff; }
.btn-secondary { background: #fff; border-color: #c7c7c7; color: #333; }
.btn-secondary:hover { background: #f5f5f5; text-decoration: none; color: #333; }
.btn-danger { background: #d13438; color: #fff; }
.btn-danger:hover { background: #b52024; text-decoration: none; color: #fff; }
.btn-success { background: #107c10; color: #fff; }
.btn-success:hover { background: #0b620b; color: #fff; text-decoration: none; }
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 4px; }

/* ===== Forms ===== */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px;
    color: #333;
}
.form-control {
    width: 100%; padding: 9px 12px;
    border: 1px solid #c7c7c7; border-radius: 5px;
    font-size: 14px; font-family: var(--font);
    background: #fff; color: #333;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.form-control:focus {
    outline: none; border-color: var(--ms-accent);
    box-shadow: 0 0 0 3px rgba(0,120,212,0.18);
}
textarea.form-control { min-height: 140px; resize: vertical; line-height: 1.6; }
select.form-control { appearance: auto; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.form-actions { display: flex; gap: 10px; margin-top: 22px; }
.form-check { display: flex; align-items: center; gap: 9px; margin-top: 6px; }
.form-check input { width: 17px; height: 17px; accent-color: var(--ms-accent); }
.form-hint { font-size: 12px; color: var(--ms-muted); margin-top: 5px; }
.alert-error { color: #a4262c; background: #fde7e9; border: 1px solid #f5c6cb; border-radius: 5px; padding: 10px 14px; margin-bottom: 14px; font-size: 13.5px; }

/* ===== Filter bar ===== */
.filter-bar {
    display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end;
    padding: 16px 20px; background: #fff; border: 1px solid var(--ms-border);
    border-radius: 8px; margin-bottom: 18px;
}
.filter-bar .filter-item { flex: 1; min-width: 160px; }
.filter-bar .filter-item label { font-size: 12px; font-weight: 600; color: var(--ms-muted); display: block; margin-bottom: 4px; }

/* ===== Flash ===== */
.flash { margin: 0 0 18px; }
.flash-success { background: #e6f4e6; color: #107c10; border: 1px solid #b7e0b7; padding: 11px 16px; border-radius: 5px; font-size: 14px; }

/* ===== Login ===== */
.login-body { background: linear-gradient(135deg, #0f2138 0%, #1b3a5c 60%, #25597f 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card {
    background: #fff; border-radius: 10px; width: 100%; max-width: 420px;
    padding: 38px 36px; box-shadow: 0 18px 50px rgba(0,0,0,0.28);
}
.login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.login-logo .logo-box {
    min-width: 42px; height: 42px; padding: 0 8px; border-radius: 10px;
    background: linear-gradient(135deg, #0078d4, #38b6ff);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 13px; letter-spacing: 0.3px;
}
.login-logo h1 { font-size: 20px; font-weight: 700; }
.login-sub { color: var(--ms-muted); font-size: 13.5px; margin-bottom: 18px; }
.login-hint {
    background: #f3f8fd; border: 1px solid #c7dff3; border-radius: 6px;
    padding: 12px 14px; margin-bottom: 20px; font-size: 13.5px; line-height: 1.7;
}
.login-hint-label { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: #0078d4; margin-bottom: 2px; }
.login-hint span { display: inline-block; width: 72px; color: var(--ms-muted); }
.login-card .btn-primary { width: 100%; justify-content: center; padding: 11px; font-size: 14px; }
.login-input { padding: 11px 12px; }
.link-back { display: block; text-align: center; margin-top: 16px; font-size: 13px; }

/* ===== Empty state ===== */
.empty-state { text-align: center; padding: 46px 20px; color: var(--ms-muted); }
.empty-state .big { font-size: 15px; font-weight: 600; color: #444; margin-bottom: 4px; }

/* ===== Pagination ===== */
.pager-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 20px; border-top: 1px solid var(--ms-border); flex-wrap: wrap;
}
.pager-meta { font-size: 13px; color: var(--ms-muted); }
.pagination { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 20px; flex-wrap: wrap; }
.pagination a, .pagination > span {
    display: inline-flex; align-items: center; justify-content: center; min-width: 34px;
    padding: 6px 12px; border: 1px solid var(--ms-border); border-radius: 4px;
    font-size: 13px; color: #333; background: #fff; text-decoration: none; line-height: 1.2;
}
.pagination a:hover { border-color: var(--ms-accent); color: var(--ms-accent); }
.pagination .active { background: var(--ms-accent); color: #fff; border-color: var(--ms-accent); font-weight: 600; }
.pagination .disabled { opacity: 0.45; pointer-events: none; }
.pagination svg { width: 14px; height: 14px; display: block; }

/* ===== Responsive ===== */
@media (max-width: 640px) {
    .admin-content { padding: 16px; }
    .admin-topbar { padding: 0 16px; }
    .admin-user .user-meta { display: none; }
}