@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@600;700&family=IBM+Plex+Sans:wght@400;500;600&display=swap');

:root {
  --ink: #12181f; --navy: #0a0a0d; --navy-deep: #000000; --navy-mid: #1c1c22;
  --green: #5cfd02; --green-deep: #46c400; --purple: #aa0fff; --purple-deep: #7d0cc4;
  --canvas: #f6f8fa; --panel: #ffffff; --steel: #5b6b7c; --line: #d8e3ee;
  --font-display: 'Rajdhani', sans-serif; --font-body: 'IBM Plex Sans', sans-serif;
  --radius: 4px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font-body); color: var(--ink); background: var(--canvas); }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-display); color: var(--ink); margin: 0 0 0.4em; font-weight: 700; }

.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar { width: 230px; background: #000; color: #fff; flex-shrink: 0; padding: 22px 0; }
.admin-sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 0 22px 22px; border-bottom: 1px solid rgba(255,255,255,0.1); margin-bottom: 14px; }
.admin-sidebar .brand img { height: 30px; width: auto; }
.admin-sidebar .brand span { font-family: var(--font-display); font-weight: 700; font-size: 1rem; text-transform: uppercase; }
.admin-sidebar .brand span em { color: var(--green); font-style: normal; }
.admin-nav a { display: flex; align-items: center; gap: 10px; padding: 11px 22px; font-size: 0.92rem; color: #b9c6d6; font-weight: 500; border-left: 3px solid transparent; }
.admin-nav a:hover { color: #fff; background: rgba(255,255,255,0.04); }
.admin-nav a.active { color: #fff; border-left-color: var(--green); background: rgba(255,255,255,0.06); }
.admin-nav .divider { margin: 14px 22px; border-top: 1px solid rgba(255,255,255,0.1); }

.admin-main { flex: 1; min-width: 0; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; padding: 16px 30px; background: var(--panel); border-bottom: 1px solid var(--line); }
.admin-topbar .who { font-size: 0.9rem; color: var(--steel); }
.admin-topbar .who a { color: var(--green-deep); font-weight: 600; }
.admin-content { padding: 30px; max-width: 1100px; }

.page-title-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px; border-radius: var(--radius); font-weight: 600; font-size: 0.9rem; border: 1px solid transparent; cursor: pointer; font-family: var(--font-body); }
.btn--primary { background: var(--green); color: #fff; }
.btn--primary:hover { background: var(--green-deep); }
.btn--ghost { background: var(--panel); border-color: var(--line); color: var(--navy); }
.btn--ghost:hover { border-color: var(--navy); }
.btn--danger { background: #fdecea; color: #9c4a3a; border-color: #f7cfc8; }
.btn--danger:hover { background: #f7cfc8; }
.btn--sm { padding: 6px 12px; font-size: 0.82rem; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 22px; }

table.admin-table { width: 100%; border-collapse: collapse; }
table.admin-table th { text-align: left; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--steel); padding: 10px 14px; border-bottom: 2px solid var(--line); }
table.admin-table td { padding: 13px 14px; border-bottom: 1px solid var(--line); font-size: 0.92rem; vertical-align: middle; }
table.admin-table tr:hover td { background: var(--canvas); }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.76rem; font-weight: 600; }
.badge--published { background: #e3f7ee; color: var(--green-deep); }
.badge--draft { background: #f1f3f5; color: var(--steel); }
.badge--unread { background: #fdecea; color: #9c4a3a; }

.form-grid { display: grid; gap: 18px; }
.form-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.field label { display: block; font-size: 0.86rem; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.field .hint { font-size: 0.8rem; color: var(--steel); margin-top: 4px; }
.field input[type=text], .field input[type=email], .field input[type=password], .field input[type=number], .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); font-family: var(--font-body); font-size: 0.94rem; background: #fff;
}
.field textarea { resize: vertical; min-height: 100px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(15,169,104,0.15); }
.field-inline { display: flex; align-items: center; gap: 8px; }

.alert { padding: 13px 16px; border-radius: var(--radius); margin-bottom: 20px; font-size: 0.92rem; }
.alert--success { background: #e3f7ee; color: var(--green-deep); border: 1px solid #b7ecd3; }
.alert--error { background: #fdecea; color: #9c4a3a; border: 1px solid #f7cfc8; }

.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 26px; }
.stat-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.stat-card strong { display: block; font-family: var(--font-display); font-size: 1.9rem; color: var(--navy); }
.stat-card span { font-size: 0.84rem; color: var(--steel); }

.login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--navy-deep); }
.login-card { background: #fff; border-radius: 10px; padding: 40px; width: 100%; max-width: 380px; }
.login-card .brand { font-family: var(--font-display); font-weight: 700; color: var(--navy); font-size: 1.2rem; margin-bottom: 4px; }
.login-card .brand span { color: var(--green); }
.login-card p.sub { color: var(--steel); font-size: 0.9rem; margin: 0 0 24px; }

.thumb-preview { width: 64px; height: 44px; border-radius: 4px; background: var(--navy); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.thumb-preview img, .thumb-preview svg { width: 80%; height: 80%; object-fit: contain; }

.editor-toolbar { display: flex; gap: 4px; flex-wrap: wrap; padding: 8px; background: var(--canvas); border: 1px solid var(--line); border-bottom: none; border-radius: var(--radius) var(--radius) 0 0; }
.editor-btn { min-width: 32px; height: 32px; padding: 0 8px; border: 1px solid var(--line); background: #fff; border-radius: 4px; cursor: pointer; font-family: var(--font-body); font-size: 0.85rem; font-weight: 600; color: var(--navy); }
.editor-btn:hover { border-color: var(--green); color: var(--green-deep); }
.editor-surface {
  min-height: 220px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius);
  background: #fff; font-size: 0.95rem; line-height: 1.6; overflow-y: auto;
}
.editor-surface:focus { outline: none; border-color: var(--green); }
.editor-surface h2 { font-size: 1.2rem; margin: 0.6em 0 0.3em; }
.editor-surface p { margin: 0 0 0.8em; }
.editor-surface ul, .editor-surface ol { margin: 0 0 0.8em 1.3em; }

@media (max-width: 820px) {
  .admin-shell { flex-direction: column; }
  .admin-sidebar { width: 100%; padding: 14px 0; }
  .admin-nav { display: flex; overflow-x: auto; }
  .admin-nav .divider { display: none; }
  .form-grid.cols-2 { grid-template-columns: 1fr; }
}
