:root {
  --brand: #0f766e;
  --brand-dark: #115e59;
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --danger: #dc2626;
  --amber: #d97706;
  --green: #059669;
}
* { box-sizing: border-box; margin: 0; }
body { font-family: -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
button { cursor: pointer; font: inherit; }

/* login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: linear-gradient(160deg, var(--brand) 0%, var(--brand-dark) 60%, #134e4a 100%); }
.login-card { background: var(--card); border-radius: 16px; padding: 36px 32px; width: 100%; max-width: 400px;
  box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.logo { font-size: 28px; font-weight: 800; color: var(--brand); letter-spacing: -.5px; }
.logo span { color: var(--text); }
.tagline { color: var(--muted); margin: 4px 0 24px; font-size: 14px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
input, select, textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font: inherit; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); border-color: transparent; }
.btn { background: var(--brand); color: #fff; border: 0; border-radius: 8px; padding: 11px 18px; font-weight: 600; width: 100%; }
.btn:hover { background: var(--brand-dark); }
.btn-sm { width: auto; padding: 7px 14px; font-size: 13px; }
.btn-ghost { background: transparent; color: var(--brand); border: 1px solid var(--brand); }
.btn-danger { background: var(--danger); }
.error { color: var(--danger); font-size: 13px; margin-bottom: 10px; }

/* shell */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.sidebar { background: #0b3b38; color: #d1fae5; padding: 20px 12px; display: flex; flex-direction: column; }
.sidebar .logo { color: #5eead4; padding: 0 10px 18px; }
.sidebar .logo span { color: #fff; }
.nav-item { display: block; width: 100%; text-align: left; background: none; border: 0; color: #a7f3d0;
  padding: 11px 12px; border-radius: 8px; font-size: 15px; margin-bottom: 2px; }
.nav-item:hover { background: rgba(255,255,255,.08); }
.nav-item.active { background: var(--brand); color: #fff; font-weight: 600; }
.sidebar-footer { margin-top: auto; padding: 10px; font-size: 13px; color: #99f6e4; }
.lang-switch { display: flex; gap: 6px; margin-bottom: 10px; }
.lang-switch button { flex: 1; background: rgba(255,255,255,.1); color: #d1fae5; border: 0; border-radius: 6px; padding: 6px; }
.lang-switch button.on { background: #5eead4; color: #0b3b38; font-weight: 700; }

.main { padding: 26px 30px; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.page-head h1 { font-size: 22px; }

/* cards & tables */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 18px; }
.stat .num { font-size: 30px; font-weight: 800; color: var(--brand); }
.stat .lbl { color: var(--muted); font-size: 13px; margin-top: 2px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; padding: 12px 14px; background: #f9fafb; color: var(--muted); font-size: 12px;
  text-transform: uppercase; letter-spacing: .4px; border-bottom: 1px solid var(--border); }
td { padding: 12px 14px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: 0; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.active, .badge.completed { background: #d1fae5; color: var(--green); }
.badge.published { background: #e0e7ff; color: #4338ca; }
.badge.in_progress { background: #fef3c7; color: var(--amber); }
.badge.inactive { background: #f3f4f6; color: var(--muted); }
.empty { padding: 30px; text-align: center; color: var(--muted); }

/* modal */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center;
  justify-content: center; padding: 16px; z-index: 50; }
.modal { background: var(--card); border-radius: 14px; padding: 24px; width: 100%; max-width: 480px;
  max-height: 90vh; overflow: auto; }
.modal h2 { margin-bottom: 16px; font-size: 18px; }
.modal .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px; padding: 10px; }
  .sidebar .logo { padding: 0 8px; font-size: 20px; }
  .nav-item { width: auto; }
  .sidebar-footer { margin: 0 0 0 auto; display: flex; gap: 8px; align-items: center; }
  .main { padding: 16px; }
  .modal .row { grid-template-columns: 1fr; }
}
