:root {
  --navy: #0F2C55;
  --navy-deep: #0A1F3D;
  --blue: #1E5FA8;
  --sky: #EAF2FB;
  --white: #FFFFFF;
  --paper: #F5F9FD;
  --text: #1B2733;
  --text-soft: #64748B;
  --line: #E1E9F2;
  --danger: #C0392B;
  --success: #1E8E5A;
  --radius: 12px;
  --font-body: "Plus Jakarta Sans", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--text);
}
a { text-decoration: none; color: inherit; }

/* ---- Login ---- */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 20% 20%, #16386B, var(--navy-deep) 60%);
  padding: 20px;
}
.login-card {
  background: var(--white);
  width: 100%;
  max-width: 380px;
  border-radius: 18px;
  padding: 40px 34px;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.4);
}
.login-card .brand-mark {
  width: 50px; height: 50px;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--navy), var(--blue));
  color: var(--white);
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 18px;
}
.login-card h1 { font-size: 1.3rem; margin: 0 0 4px; }
.login-card p.sub { color: var(--text-soft); font-size: .9rem; margin: 0 0 26px; }

.field { margin-bottom: 18px; }
.field label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-size: .95rem;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(30,95,168,.15);
}
.field-hint { font-size: .78rem; color: var(--text-soft); margin-top: 5px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: .92rem;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all .15s ease;
}
.btn-block { width: 100%; }
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--blue); }
.btn-outline { border-color: var(--line); color: var(--text); background: var(--white); }
.btn-outline:hover { border-color: var(--blue); color: var(--blue); }
.btn-danger { background: #FDECEA; color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: var(--white); }
.btn-sm { padding: 7px 14px; font-size: .82rem; }

.alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: .88rem;
  margin-bottom: 18px;
}
.alert-error { background: #FDECEA; color: var(--danger); }
.alert-success { background: #EAF7F0; color: var(--success); }

/* ---- Layout admin ---- */
.admin-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px;
  background: var(--navy-deep);
  color: #C6D5E8;
  flex-shrink: 0;
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  font-weight: 700;
  padding: 0 10px 24px;
  font-size: .98rem;
}
.sidebar .brand-mark {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: linear-gradient(145deg, var(--blue), #6FA8DC);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--navy-deep);
}
.sidebar .brand-logo {
  width: 34px; height: 34px;
  border-radius: 9px;
  object-fit: cover;
  background: var(--white);
}
.sidebar nav { display: grid; gap: 4px; }
.sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 9px;
  font-size: .89rem;
  font-weight: 500;
  color: #C6D5E8;
}
.sidebar a:hover { background: rgba(255,255,255,.06); color: var(--white); }
.sidebar a.active { background: var(--blue); color: var(--white); }
.sidebar .logout { margin-top: 30px; border-top: 1px solid rgba(255,255,255,.1); padding-top: 16px; }

.main { flex: 1; min-width: 0; }
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar h1 { font-size: 1.15rem; margin: 0; }
.topbar .who { font-size: .85rem; color: var(--text-soft); }
.content { padding: 28px 32px 60px; }

.cards-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 28px; }
.stat-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.stat-card .num { font-size: 1.7rem; font-weight: 700; color: var(--navy); }
.stat-card .label { font-size: .82rem; color: var(--text-soft); }

.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.panel-head h2 { font-size: 1.02rem; margin: 0; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 10px; font-size: .88rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--text-soft); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
tr:last-child td { border-bottom: none; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 700; }
.badge-terbit, .badge-published { background: #EAF7F0; color: var(--success); }
.badge-draft { background: #FDF3E7; color: #B5710C; }
.thumb-sm { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; background: var(--sky); }
.row-actions { display: flex; gap: 8px; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-soft); font-size: .9rem; }

@media (max-width: 900px) {
  .admin-layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .cards-row { grid-template-columns: repeat(2, 1fr); }
  .content { padding: 20px; }
}
