/* ===== Layag Newsroom Dashboard — shared design system ===== */
:root {
  /* Layag brand: royal blue + gold */
  --navy: #16357e;      /* deep royal */
  --navy-2: #24499a;
  --sail: #f3f6fc;
  --sea: #2b54a6;       /* primary royal blue (actions) */
  --sea-2: #3a67c4;     /* lighter royal (hover) */
  --wave: #e23b4e;      /* breaking red */
  --gold: #f0c04a;      /* crest gold */
  --gold-2: #d9a92f;
  --ink: #16202b;
  --muted: #5b6b7b;
  --line: #dde3ee;
  --card: #ffffff;
  --bg: #eef1f8;
  --shadow: 0 1px 2px rgba(22,53,126,.06), 0 6px 22px rgba(22,53,126,.09);
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --sail: #0f1a2e; --ink: #e8eef7; --muted: #9fb0c8; --line: #253356;
    --card: #14203a; --bg: #0a1122; --navy: #12285f; --navy-2: #1c3a80;
    --sea: #4d78d8; --sea-2: #6d92e4;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 26px rgba(0,0,0,.35);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

/* ---- Top bar ---- */
.topbar {
  background: linear-gradient(135deg, var(--navy), var(--navy-2));
  color: #fff;
  padding: 0 20px;
  display: flex; align-items: center; gap: 18px;
  height: 60px;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 2px 14px rgba(11,42,74,.25);
  border-bottom: 3px solid var(--gold);
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 800; font-size: 20px; letter-spacing: .3px; }
.brand .logo { width: 34px; height: 34px; }
.brand .logo.crest { object-fit: contain; border-radius: 6px; background: #dbe7f5; padding: 1px; }
.brand small { font-weight: 500; opacity: .7; font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; }
.nav { display: flex; gap: 4px; margin-left: 10px; flex-wrap: wrap; }
.nav a {
  color: #cfe0f0; text-decoration: none; padding: 8px 13px; border-radius: 9px;
  font-size: 14px; font-weight: 600; transition: all .15s; white-space: nowrap;
}
.nav a:hover { background: rgba(255,255,255,.1); color: #fff; }
.nav a.active { background: rgba(255,255,255,.16); color: #fff; }
.topbar .spacer { flex: 1; }
.topbar .date { font-size: 13px; opacity: .8; }
.topbar .logout { margin-left: 14px; background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px; font-size: 12px; font-weight: 600; padding: 6px 12px; cursor: pointer; font-family: var(--font); }
.topbar .logout:hover { background: rgba(255,255,255,.22); }

/* ---- Layout ---- */
.wrap { max-width: 1200px; margin: 0 auto; padding: 26px 20px 60px; }
.page-head { margin-bottom: 22px; }
.page-head h1 { font-size: 26px; margin: 0 0 4px; letter-spacing: -.3px; }
.page-head p { color: var(--muted); margin: 0; max-width: 720px; }

/* ---- Cards ---- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card.pad { padding: 20px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font-weight: 650; font-size: 14px;
  cursor: pointer; transition: all .15s; text-decoration: none; font-family: var(--font);
}
.btn:hover { border-color: var(--sea); transform: translateY(-1px); }
.btn.primary { background: var(--sea); border-color: var(--sea); color: #fff; }
.btn.primary:hover { background: var(--sea-2); border-color: var(--sea-2); }
.btn.accent { background: var(--wave); border-color: var(--wave); color: #fff; }
.btn.accent:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; }
.btn.lg { padding: 13px 22px; font-size: 15px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ---- Forms ---- */
label.fld { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin: 0 0 5px; letter-spacing: .2px; }
input[type=text], input[type=search], input[type=date], textarea, select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 14px;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--sea); outline-offset: -1px; border-color: var(--sea); }
textarea { resize: vertical; min-height: 70px; line-height: 1.5; }
.field { margin-bottom: 14px; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }

/* ---- Chips / tags ---- */
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px;
  border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--bg);
  border: 1px solid var(--line); color: var(--muted); cursor: pointer;
}
.chip.on { background: var(--sea); color: #fff; border-color: var(--sea); }
.chip.beat { background: rgba(31,122,140,.12); color: var(--sea); border-color: transparent; cursor: default; }

/* ---- Stat tiles ---- */
.stat { padding: 16px 18px; }
.stat .n { font-size: 30px; font-weight: 800; letter-spacing: -1px; }
.stat .l { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; font-weight: 700; }

/* ---- Meter ---- */
.meter { height: 9px; background: var(--bg); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.meter > i { display: block; height: 100%; background: linear-gradient(90deg, var(--sea), var(--sea-2)); border-radius: 999px; }
.meter.warn > i { background: linear-gradient(90deg, var(--gold), var(--wave)); }

/* ---- misc ---- */
.muted { color: var(--muted); }
.pill { font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: .5px; }
.pill.breaking { background: var(--wave); color: #fff; }
.pill.draft { background: var(--bg); color: var(--muted); }
.divider { height: 1px; background: var(--line); margin: 18px 0; border: 0; }
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--navy); color: #fff; padding: 12px 20px; border-radius: 12px;
  font-weight: 600; box-shadow: var(--shadow); opacity: 0; transition: all .25s; z-index: 100; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.empty { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty .ico { font-size: 40px; opacity: .5; }
a.link { color: var(--sea); font-weight: 600; }
