:root {
    --adm-red: #E30613;
    --adm-dark: #14161A;
    --adm-bg: #F3F4F6;
    --adm-card: #FFFFFF;
    --adm-border: #E5E7EB;
    --adm-text: #111827;
    --adm-muted: #6B7280;
}

*, *::before, *::after { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, sans-serif;
    background: var(--adm-bg);
    color: var(--adm-text);
    font-size: 14.5px;
    line-height: 1.5;
}
a { color: #1D4ED8; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Login Page */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #14161A 0%, #2A0A0D 100%);
    padding: 20px;
}
.login-card {
    width: 100%;
    max-width: 400px;
    background: #fff;
    padding: 32px;
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.35);
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.login-brand h1 { margin: 0; font-size: 22px; }
.login-brand p { margin: 2px 0 0; color: var(--adm-muted); font-size: 13px; }
.brand-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 40px;
    background: var(--adm-red);
    color: #fff;
    font-weight: 900;
    font-size: 20px;
    border-radius: 4px;
}
.login-footer { margin-top: 18px; text-align: center; font-size: 13px; }

/* Shell */
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
    width: 250px;
    background: var(--adm-dark);
    color: #E5E7EB;
    display: flex;
    flex-direction: column;
    padding: 20px 14px;
    flex-shrink: 0;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 6px 18px;
    border-bottom: 1px solid #262A33;
    margin-bottom: 14px;
}
.sidebar-brand strong { display: block; color: #fff; font-size: 16px; }
.sidebar-brand small { color: #9CA3AF; font-size: 12px; }

.sidebar-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 6px;
    color: #D1D5DB;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
    background: var(--adm-red);
    color: #FFFFFF;
}
.pill-count {
    background: #FEF08A;
    color: #111827;
    padding: 1px 7px;
    border-radius: 12px;
    font-size: 11.5px;
    font-weight: 800;
}
.sidebar-footer { padding-top: 14px; border-top: 1px solid #262A33; }
.logout-link { display: block; text-align: center; color: #9CA3AF; font-size: 12.5px; margin-top: 10px; }
.logout-link:hover { color: #fff; }

.admin-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.admin-topbar {
    background: #fff;
    border-bottom: 1px solid var(--adm-border);
    padding: 16px 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.admin-topbar h1 { margin: 0; font-size: 22px; }
.admin-content { padding: 24px 26px; max-width: 1320px; width: 100%; }

/* Cards & Panels */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.kpi-card {
    background: var(--adm-card);
    border: 1px solid var(--adm-border);
    border-radius: 8px;
    padding: 18px 20px;
}
.kpi-card.highlight { border-left: 4px solid var(--adm-red); }
.kpi-card span { display: block; color: var(--adm-muted); font-size: 13px; font-weight: 600; }
.kpi-card strong { display: block; font-size: 30px; margin-top: 6px; }

.panel {
    background: var(--adm-card);
    border: 1px solid var(--adm-border);
    border-radius: 8px;
    padding: 20px 22px;
    margin-bottom: 20px;
}
.panel h2 { margin: 0 0 14px; font-size: 17px; }
.panel h3 { margin: 0 0 12px; font-size: 15px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; }
.panel-head h2 { margin: 0; }

/* Forms */
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 5px; color: #374151; }
.field input[type="text"], .field input[type="password"], .field input[type="email"],
.field input[type="url"], .field input[type="number"], .field input[type="datetime-local"],
.field input[type="search"], .field select, .field textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    background: #fff;
}
.code-editor { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.form-row-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.split-2 { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 20px; align-items: start; }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.checkbox-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.check-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-weight: 500; cursor: pointer; }

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 6px;
    padding: 6px;
    background: #F9FAFB;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
}
.editor-toolbar button {
    background: #fff;
    border: 1px solid #D1D5DB;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12.5px;
}
.editor-toolbar button:hover { background: #E5E7EB; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 13.5px;
    border: 1px solid #D1D5DB;
    background: #fff;
    color: var(--adm-text);
    cursor: pointer;
    text-decoration: none;
}
.btn:hover { background: #F9FAFB; text-decoration: none; }
.btn-primary { background: var(--adm-red); border-color: var(--adm-red); color: #fff; }
.btn-primary:hover { background: #B91C1C; }
.btn-green { background: #15803D; border-color: #15803D; color: #fff; }
.btn-green:hover { background: #166534; }
.btn-warn { background: #D97706; border-color: #D97706; color: #fff; }
.btn-danger { background: #DC2626; border-color: #DC2626; color: #fff; }
.btn-outline { background: transparent; color: inherit; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn.full { width: 100%; }

/* Tables & Filters */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.filter-bar input, .filter-bar select { padding: 8px 10px; border: 1px solid #D1D5DB; border-radius: 6px; }
.filter-bar input { flex: 1; min-width: 200px; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--adm-border);
    vertical-align: middle;
}
.data-table th { font-size: 12px; text-transform: uppercase; color: var(--adm-muted); background: #F9FAFB; }
.actions-cell { white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.inline-form { display: inline-flex; gap: 5px; margin: 0; }
.cat-inline-form { display: flex; align-items: center; gap: 6px; margin: 0; }

/* Tags & Status */
.tag-pill {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    background: #E5E7EB;
    margin-left: 4px;
}
.tag-pill.red { background: #FEE2E2; color: #B91C1C; }
.tag-pill.purple { background: #F3E8FF; color: #783C96; }
.status-dot {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
}
.status-dot.published, .status-dot.approved { background: #DCFCE7; color: #166534; }
.status-dot.draft, .status-dot.pending { background: #FEF3C7; color: #92400E; }
.status-dot.rejected { background: #FEE2E2; color: #991B1B; }

/* Moderation Cards */
.tabs-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; border-bottom: 1px solid var(--adm-border); padding-bottom: 12px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs a { padding: 7px 14px; border-radius: 6px; font-weight: 600; color: var(--adm-muted); text-decoration: none; }
.tabs a.active { background: var(--adm-dark); color: #fff; }
.mod-list { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.mod-card { border: 1px solid var(--adm-border); border-radius: 8px; padding: 16px; background: #FAFAFA; }
.mod-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.mod-article { font-size: 13px; margin-bottom: 8px; color: var(--adm-muted); }
.mod-body { background: #fff; border: 1px solid var(--adm-border); padding: 12px; border-radius: 6px; margin: 0 0 12px; }
.mod-reply-form { display: flex; gap: 8px; margin-bottom: 10px; }
.mod-reply-form input { flex: 1; padding: 7px 10px; border: 1px solid #D1D5DB; border-radius: 6px; }
.mod-actions { display: flex; gap: 8px; }

.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-weight: 600; }
.alert.success { background: #DCFCE7; color: #166534; }
.alert.error { background: #FEE2E2; color: #991B1B; }
.muted { color: var(--adm-muted); }

@media (max-width: 960px) {
    .admin-shell { flex-direction: column; }
    .admin-sidebar { width: 100%; }
    .kpi-grid, .form-row-2, .form-row-3, .split-2, .editor-grid, .checkbox-grid { grid-template-columns: 1fr; }
}
