/* ==========================================================================
   Freedom Worship Global TV — admin.css
   Control room for the channel: login, sidebar, list tables, forms, uploader.
   ========================================================================== */
:root {
  --ink-900: #06070b;
  --ink-800: #0c0e14;
  --ink-700: #12151d;
  --ink-600: #1a1e28;
  --line: rgba(191, 155, 63, 0.22);
  --line-soft: rgba(255, 255, 255, 0.08);
  --cream: #f3efe6;
  --cream-dim: #a9a494;
  --gold: #bf9b3f;
  --gold-2: #e7cd86;
  --ok: #4caf7d;
  --warn: #e0a63c;
  --err: #d8453a;
  --serif: "Playfair Display", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 14px;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--ink-900);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 520px at 12% -10%, rgba(191, 155, 63, 0.16), transparent 60%),
    radial-gradient(700px 460px at 100% 0%, rgba(191, 155, 63, 0.08), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

a { color: var(--gold-2); }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; margin: 0; letter-spacing: 0.2px; }

.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ico--fill { fill: currentColor; stroke: none; }

/* ------------------------------------------------------------------ login */
.gate {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.gate[hidden], [hidden] { display: none !important; }

.gate__card {
  width: min(420px, 100%);
  background: linear-gradient(180deg, rgba(26, 30, 40, 0.96), rgba(12, 14, 20, 0.98));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 34px 30px 30px;
  box-shadow: var(--shadow);
  text-align: center;
}

.gate__logo { width: 70px; height: 70px; border-radius: 50%; border: 1px solid var(--line); padding: 6px; background: rgba(0,0,0,0.35); }
.gate__card h1 { font-size: 1.5rem; margin: 14px 0 4px; }
.gate__card p { color: var(--cream-dim); font-size: 0.9rem; margin: 0 0 22px; }
.gate__card form { text-align: left; }

/* ------------------------------------------------------------------ shell */
.shell { position: relative; z-index: 1; min-height: 100vh; display: grid; grid-template-columns: 258px 1fr; }

.side {
  background: linear-gradient(180deg, rgba(12, 14, 20, 0.98), rgba(6, 7, 11, 0.98));
  border-right: 1px solid var(--line-soft);
  padding: 20px 16px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.side__brand { display: flex; align-items: center; gap: 11px; }
.side__brand img { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); }
.side__brand b { display: block; font-family: var(--serif); font-size: 1rem; line-height: 1.2; }
.side__brand span { font-size: 0.68rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); }

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav__label { font-size: 0.66rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--cream-dim); margin: 12px 0 4px 10px; }

.nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--cream);
  font: inherit;
  font-size: 0.92rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.16s, color 0.16s;
}

.nav button:hover { background: rgba(255, 255, 255, 0.05); }
.nav button.is-on { background: rgba(191, 155, 63, 0.16); color: var(--gold-2); box-shadow: inset 0 0 0 1px var(--line); }
.nav button .pill { margin-left: auto; }

.side__foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; font-size: 0.85rem; }

.main { padding: 26px 30px 70px; min-width: 0; }

.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.head h2 { font-size: 1.55rem; }
.head p { margin: 4px 0 0; color: var(--cream-dim); font-size: 0.9rem; max-width: 62ch; }
.head__actions { display: flex; gap: 9px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ cards */
.card {
  background: linear-gradient(180deg, rgba(26, 30, 40, 0.72), rgba(12, 14, 20, 0.86));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 18px;
}

.card > h3 { font-size: 1.08rem; margin-bottom: 4px; }
.card__hint { color: var(--cream-dim); font-size: 0.86rem; margin: 0 0 14px; }

.grid { display: grid; gap: 14px; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.stat { background: rgba(0, 0, 0, 0.28); border: 1px solid var(--line-soft); border-radius: 12px; padding: 14px 16px; }
.stat b { display: block; font-family: var(--serif); font-size: 1.7rem; color: var(--gold-2); line-height: 1.1; }
.stat span { font-size: 0.8rem; color: var(--cream-dim); }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--cream);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s, border-color 0.15s;
}

.btn:hover { transform: translateY(-1px); background: rgba(255, 255, 255, 0.08); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn--gold { background: linear-gradient(135deg, var(--gold), var(--gold-2)); border-color: transparent; color: #17130a; font-weight: 600; }
.btn--danger { border-color: rgba(216, 69, 58, 0.5); color: #f0a49d; }
.btn--danger:hover { background: rgba(216, 69, 58, 0.16); }
.btn--sm { padding: 6px 12px; font-size: 0.82rem; }
.btn--ghost { border-color: var(--line-soft); }
.btn--block { width: 100%; justify-content: center; }

/* ------------------------------------------------------------------ forms */
.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 0.82rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--cream-dim); margin-bottom: 6px; }
.field small { display: block; color: var(--cream-dim); font-size: 0.79rem; margin-top: 5px; }

input[type="text"], input[type="url"], input[type="password"], input[type="email"],
input[type="number"], input[type="time"], input[type="date"], input[type="datetime-local"],
select, textarea {
  width: 100%;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: rgba(0, 0, 0, 0.35);
  color: var(--cream);
  font: inherit;
  font-size: 0.93rem;
}

input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(191, 155, 63, 0.16); }
textarea { min-height: 96px; resize: vertical; }
select option { background: var(--ink-700); }

.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch__track { width: 46px; height: 26px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); border: 1px solid var(--line-soft); position: relative; transition: background 0.18s; flex: none; }
.switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--cream-dim); transition: transform 0.18s, background 0.18s; }
.switch input:checked + .switch__track { background: rgba(76, 175, 125, 0.35); border-color: rgba(76, 175, 125, 0.6); }
.switch input:checked + .switch__track::after { transform: translateX(20px); background: #fff; }
.switch__text { font-size: 0.92rem; }
.switch__text small { display: block; color: var(--cream-dim); font-size: 0.79rem; }

.switch--live input:checked + .switch__track { background: rgba(216, 69, 58, 0.4); border-color: rgba(216, 69, 58, 0.7); }

.picker { display: flex; gap: 8px; align-items: center; }
.picker input { flex: 1; }
.thumb { width: 74px; height: 46px; border-radius: 8px; border: 1px solid var(--line-soft); background: #000 center/cover no-repeat; flex: none; }

.rowline { display: flex; gap: 12px; flex-wrap: wrap; }
.rowline > * { flex: 1 1 200px; }

/* ------------------------------------------------------------------ table */
.tablewrap { overflow-x: auto; border: 1px solid var(--line-soft); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 620px; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
th { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--cream-dim); background: rgba(0, 0, 0, 0.3); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
td.actions { text-align: right; white-space: nowrap; }
td.actions .btn { margin-left: 6px; }
td b { font-weight: 600; }
td .sub { display: block; color: var(--cream-dim); font-size: 0.82rem; }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; border: 1px solid var(--line-soft); color: var(--cream-dim); }
.pill--on { background: rgba(76, 175, 125, 0.16); border-color: rgba(76, 175, 125, 0.45); color: #8fdcb4; }
.pill--off { background: rgba(255, 255, 255, 0.05); }
.pill--live { background: rgba(216, 69, 58, 0.18); border-color: rgba(216, 69, 58, 0.5); color: #f0a49d; }
.pill--main { background: rgba(191, 155, 63, 0.18); border-color: var(--line); color: var(--gold-2); }
.pill--new { background: rgba(191, 155, 63, 0.9); border-color: transparent; color: #17130a; }

.empty { padding: 26px; text-align: center; color: var(--cream-dim); font-size: 0.9rem; }

/* --------------------------------------------------------------- uploader */
.drop {
  border: 1.5px dashed var(--line);
  border-radius: 14px;
  padding: 26px;
  text-align: center;
  background: rgba(0, 0, 0, 0.24);
  transition: background 0.18s, border-color 0.18s;
}
.drop.is-over { background: rgba(191, 155, 63, 0.12); border-color: var(--gold-2); }
.drop h4 { font-family: var(--serif); font-size: 1.1rem; margin: 10px 0 4px; font-weight: 600; }
.drop p { color: var(--cream-dim); font-size: 0.86rem; margin: 0 0 14px; }
.drop input[type="file"] { display: none; }

.upl { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.upl__row { background: rgba(0, 0, 0, 0.3); border: 1px solid var(--line-soft); border-radius: 12px; padding: 12px 14px; }
.upl__top { display: flex; justify-content: space-between; gap: 10px; font-size: 0.88rem; }
.upl__top b { font-weight: 600; word-break: break-all; }
.upl__pct { color: var(--gold-2); font-variant-numeric: tabular-nums; flex: none; }
.upl__bar { height: 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); overflow: hidden; margin-top: 9px; }
.upl__fill { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--gold), var(--gold-2)); transition: width 0.25s; }
.upl__msg { font-size: 0.8rem; color: var(--cream-dim); margin-top: 7px; }
.upl__msg.is-err { color: #f0a49d; }
.upl__msg.is-ok { color: #8fdcb4; }

/* ------------------------------------------------------------------ modal */
.modal { position: fixed; inset: 0; z-index: 60; display: none; padding: 20px; overflow-y: auto; background: rgba(3, 4, 7, 0.78); backdrop-filter: blur(6px); }
.modal.is-open { display: block; }
.modal__box {
  width: min(720px, 100%);
  margin: 40px auto;
  background: linear-gradient(180deg, rgba(26, 30, 40, 0.98), rgba(12, 14, 20, 0.99));
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); }
.modal__head h3 { font-size: 1.15rem; }
.modal__body { padding: 20px; }
.modal__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px 20px; }
.iconbtn { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-soft); background: transparent; color: var(--cream); cursor: pointer; }
.iconbtn:hover { background: rgba(255, 255, 255, 0.08); }

.mediagrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.mediacell { border: 1px solid var(--line-soft); border-radius: 10px; overflow: hidden; background: rgba(0,0,0,0.3); cursor: pointer; padding: 0; color: inherit; font: inherit; text-align: left; }
.mediacell:hover { border-color: var(--gold); }
.mediacell__img { height: 82px; background: #000 center/cover no-repeat; display: grid; place-items: center; color: var(--cream-dim); }
.mediacell__n { display: block; padding: 7px 9px; font-size: 0.76rem; color: var(--cream-dim); word-break: break-all; }

/* ------------------------------------------------------------------ toast */
.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); z-index: 90; padding: 12px 20px; border-radius: 999px; background: rgba(12, 14, 20, 0.96); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 0.9rem; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; max-width: calc(100% - 32px); }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast.is-err { border-color: rgba(216, 69, 58, 0.6); color: #f7c7c2; }
.toast.is-ok { border-color: rgba(76, 175, 125, 0.6); color: #b9e7cf; }

.msg { font-size: 0.87rem; margin: 10px 0 0; min-height: 1.2em; }
.msg.is-err { color: #f0a49d; }
.msg.is-ok { color: #8fdcb4; }

/* ------------------------------------------------------------------ mobile */
.side__toggle { display: none; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side {
    position: fixed;
    inset: 0 auto 0 0;
    width: 262px;
    transform: translateX(-100%);
    transition: transform 0.24s ease;
    z-index: 70;
    box-shadow: var(--shadow);
  }
  .shell.is-menu .side { transform: none; }
  .side__toggle { display: inline-flex; }
  .main { padding: 18px 16px 70px; }
  .head h2 { font-size: 1.3rem; }
}
