/* ============================================================
   YSR ADMIN — premium ink & gold, matching the site design system
   ============================================================ */

:root {
  --ink-0: #08090c;
  --ink-1: #0d0f13;
  --ink-2: #12151b;
  --ink-3: #1a1e26;
  --hairline: rgba(244, 239, 230, 0.10);
  --hairline-strong: rgba(244, 239, 230, 0.18);
  --parch-0: #f6f2e9;
  --gold: #c9a45c;
  --gold-bright: #e6c47c;
  --gold-deep: #9a7a3c;
  --gold-glow: rgba(201, 164, 92, 0.35);
  --text-hi: #f5f2ea;
  --text-mid: #c9c4b8;
  --text-lo: #918c80;
  --ok: #7fbf7f;
  --warn: #e0b458;
  --bad: #e07a6a;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", -apple-system, sans-serif;
  --radius: 14px;
  --radius-lg: 20px;
  --side-w: 248px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-hi);
  background: var(--ink-0);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--gold); color: var(--ink-0); }

h1, h2, h3 { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.01em; line-height: 1.15; }

/* ---------- Shell ---------- */
.shell { display: flex; min-height: 100vh; }

.side {
  width: var(--side-w);
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--ink-1), var(--ink-0));
  border-right: 1px solid var(--hairline);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.side__logo {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 1.4rem 1.5rem 1.2rem;
  border-bottom: 1px solid var(--hairline);
}
.side__logo img { height: 34px; }
.side__logo span {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--gold);
}
.side__nav { flex: 1; overflow-y: auto; padding: 1.2rem 0.9rem; }
.side__group {
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--text-lo);
  padding: 1.1rem 0.7rem 0.5rem;
}
.side__group:first-child { padding-top: 0; }
.side__link {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.6rem 0.7rem;
  border-radius: 10px;
  color: var(--text-mid);
  font-weight: 500;
  transition: background 0.25s, color 0.25s;
  position: relative;
}
.side__link:hover { background: rgba(244,239,230,0.05); color: var(--text-hi); }
.side__link.is-active {
  background: linear-gradient(90deg, rgba(201,164,92,0.16), rgba(201,164,92,0.05));
  color: var(--gold-bright);
}
.side__link.is-active::before {
  content: ""; position: absolute; left: -0.9rem; top: 20%; bottom: 20%;
  width: 3px; border-radius: 3px; background: var(--gold);
}
.side__icon { width: 1.2rem; text-align: center; color: var(--gold); opacity: 0.85; }
.side__foot { padding: 1rem 1.5rem; border-top: 1px solid var(--hairline); }
.side__site { font-size: 0.82rem; color: var(--text-lo); }
.side__site:hover { color: var(--gold); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.9rem 2rem;
  border-bottom: 1px solid var(--hairline);
  background: rgba(13,15,19,0.8);
  backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 40;
}
.topbar__burger { display: none; flex-direction: column; gap: 4px; padding: 6px; }
.topbar__burger span { width: 20px; height: 2px; background: var(--text-mid); border-radius: 2px; }
.topbar__title { font-family: var(--font-display); font-size: 1.25rem; flex: 1; }
.topbar__user { display: flex; align-items: center; gap: 0.8rem; cursor: pointer; position: relative; }
.topbar__meta { text-align: right; line-height: 1.25; }
.topbar__meta strong { display: block; font-size: 0.88rem; font-weight: 600; }
.topbar__meta span { font-size: 0.72rem; color: var(--gold); letter-spacing: 0.08em; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--hairline-strong);
  box-shadow: 0 0 0 2px rgba(201,164,92,0.25);
}
.avatar--init {
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--gold-deep), var(--gold));
  color: var(--ink-0); font-weight: 700; font-size: 0.85rem;
}
.avatar--lg { width: 96px; height: 96px; font-size: 1.6rem; }
.usermenu {
  position: absolute; right: 0; top: calc(100% + 10px);
  min-width: 170px;
  background: var(--ink-2);
  border: 1px solid var(--hairline-strong);
  border-radius: 12px;
  box-shadow: 0 24px 60px -12px rgba(0,0,0,0.7);
  padding: 0.4rem;
  display: none; z-index: 60;
}
.usermenu.open { display: block; }
.usermenu a { display: block; padding: 0.55rem 0.8rem; border-radius: 8px; font-size: 0.88rem; color: var(--text-mid); }
.usermenu a:hover { background: rgba(244,239,230,0.06); color: var(--text-hi); }

.content { padding: 2rem; max-width: 1240px; width: 100%; margin-inline: auto; flex: 1; }

/* ---------- Cards / panels ---------- */
.card {
  background: linear-gradient(180deg, var(--ink-2), var(--ink-1));
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.6rem;
}
.card + .card, .card + .tablewrap, .tablewrap + .card { margin-top: 1.4rem; }
.card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; }
.card__title { font-size: 1.15rem; }
.card__hint { font-size: 0.8rem; color: var(--text-lo); }

.grid { display: grid; gap: 1.4rem; }
.grid--stats { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid--2 { grid-template-columns: 2fr 1fr; align-items: start; }
@media (max-width: 1000px) { .grid--2 { grid-template-columns: 1fr; } }

.stat {
  background: linear-gradient(180deg, var(--ink-2), var(--ink-1));
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 1.3rem 1.5rem;
  position: relative; overflow: hidden;
}
.stat::after {
  content: ""; position: absolute; inset: auto -30% -60% auto; width: 70%; aspect-ratio: 1;
  background: radial-gradient(closest-side, rgba(201,164,92,0.12), transparent 70%);
}
.stat__label { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--text-lo); }
.stat__value { font-family: var(--font-display); font-size: 2.1rem; margin-top: 0.2rem; color: var(--text-hi); }
.stat__sub { font-size: 0.78rem; color: var(--gold); margin-top: 0.1rem; }

.eyebrow {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.26em; text-transform: uppercase;
  color: var(--gold);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.62rem 1.3rem;
  border-radius: 999px;
  font-weight: 600; font-size: 0.88rem;
  transition: transform 0.25s var(--ease), box-shadow 0.25s, background 0.25s, color 0.25s;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn--gold {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold-deep));
  color: var(--ink-0);
  box-shadow: 0 10px 26px -10px var(--gold-glow);
}
.btn--gold:hover { transform: translateY(-1px); box-shadow: 0 16px 34px -10px var(--gold-glow); }
.btn--ghost { border: 1px solid var(--hairline-strong); color: var(--text-mid); }
.btn--ghost:hover { border-color: var(--gold); color: var(--gold-bright); }
.btn--danger { border: 1px solid rgba(224,122,106,0.45); color: var(--bad); }
.btn--danger:hover { background: rgba(224,122,106,0.12); }
.btn--sm { padding: 0.4rem 0.95rem; font-size: 0.8rem; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; transform: none !important; }

/* ---------- Forms ---------- */
.field-label {
  display: block;
  font-size: 0.74rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-lo);
  margin: 1.1rem 0 0.45rem;
}
.field-label:first-child { margin-top: 0; }
.field, textarea.field, select.field {
  width: 100%;
  background: var(--ink-0);
  border: 1px solid var(--hairline-strong);
  border-radius: 10px;
  padding: 0.72rem 0.95rem;
  color: var(--text-hi);
  font: inherit;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.field:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,164,92,0.18); }
.field::placeholder { color: var(--text-lo); }
select.field option { background: var(--ink-2); }
textarea.field { resize: vertical; min-height: 90px; }
.field-row { display: flex; gap: 1rem; }
.field-row > * { flex: 1; }
.field-help { font-size: 0.76rem; color: var(--text-lo); margin-top: 0.35rem; }
.check { display: flex; gap: 0.6rem; align-items: center; font-size: 0.9rem; color: var(--text-mid); padding: 0.3rem 0; cursor: pointer; }
.check input { accent-color: var(--gold); width: 16px; height: 16px; }

/* ---------- Tables ---------- */
.tablewrap {
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  background: var(--ink-1);
}
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
thead th {
  text-align: left;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--text-lo);
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--hairline-strong);
  background: var(--ink-2);
  white-space: nowrap;
}
tbody td { padding: 0.85rem 1.1rem; border-bottom: 1px solid var(--hairline); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background 0.2s; }
tbody tr:hover { background: rgba(244,239,230,0.03); }
.rowtitle { font-weight: 600; color: var(--text-hi); }
.rowtitle a:hover { color: var(--gold-bright); }
.rowsub { font-size: 0.76rem; color: var(--text-lo); margin-top: 0.15rem; }
.thumb { width: 74px; height: 44px; object-fit: cover; border-radius: 8px; border: 1px solid var(--hairline); }

/* ---------- Pills ---------- */
.pill {
  display: inline-block;
  padding: 0.22rem 0.7rem;
  border-radius: 999px;
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  border: 1px solid;
}
.pill--draft     { color: var(--text-lo);  border-color: var(--hairline-strong); }
.pill--scheduled { color: var(--warn);     border-color: rgba(224,180,88,0.5); }
.pill--published { color: var(--ok);       border-color: rgba(127,191,127,0.45); }
.pill--archived  { color: var(--text-lo);  border-color: var(--hairline); opacity: 0.7; }
.pill--processing{ color: var(--warn);     border-color: rgba(224,180,88,0.5); }
.pill--ready     { color: var(--ok);       border-color: rgba(127,191,127,0.45); }
.pill--failed, .pill--error { color: var(--bad); border-color: rgba(224,122,106,0.5); }
.pill--queued    { color: var(--text-mid); border-color: var(--hairline-strong); }
.pill--sent      { color: var(--ok);       border-color: rgba(127,191,127,0.45); }
.pill--skipped   { color: var(--text-lo);  border-color: var(--hairline); }
.pill--connected { color: var(--ok);       border-color: rgba(127,191,127,0.45); }
.pill--disconnected { color: var(--text-lo); border-color: var(--hairline-strong); }
.pill--gold      { color: var(--gold-bright); border-color: rgba(201,164,92,0.5); }

/* ---------- Row actions / kebab menu ---------- */
.rowactions { display: flex; gap: 0.5rem; align-items: center; justify-content: flex-end; white-space: nowrap; }
.rowform { display: inline-flex; }
.kebab {
  width: 34px; height: 34px;
  border-radius: 10px;
  border: 1px solid var(--hairline-strong);
  display: grid; place-items: center;
  color: var(--text-mid);
  font-size: 1.05rem; line-height: 1;
  transition: border-color 0.25s, color 0.25s, background 0.25s;
}
.kebab:hover { border-color: var(--gold); color: var(--gold-bright); background: rgba(201,164,92,0.07); }
.kebabmenu {
  position: fixed;
  min-width: 168px;
  background: var(--ink-3);
  border: 1px solid var(--hairline-strong);
  border-radius: 12px;
  box-shadow: 0 24px 60px -12px rgba(0,0,0,0.75);
  padding: 0.35rem;
  z-index: 300;
  animation: toastin 0.25s var(--ease);
}
.kebabmenu button {
  display: block; width: 100%; text-align: left;
  padding: 0.55rem 0.85rem;
  border-radius: 8px;
  font-size: 0.86rem; font-weight: 500;
  color: var(--text-mid);
}
.kebabmenu button:hover { background: rgba(244,239,230,0.06); color: var(--text-hi); }
.kebabmenu button.is-danger { color: var(--bad); }
.kebabmenu button.is-danger:hover { background: rgba(224,122,106,0.1); }

/* ---------- Page head ---------- */
.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.6rem; flex-wrap: wrap; }
.pagehead h1 { font-size: 1.7rem; }
.pagehead__sub { color: var(--text-lo); font-size: 0.86rem; margin-top: 0.2rem; }
.pagehead__actions { display: flex; gap: 0.7rem; }

.filters { display: flex; gap: 0.6rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.filters a {
  padding: 0.4rem 1rem; border-radius: 999px;
  font-size: 0.8rem; font-weight: 600;
  border: 1px solid var(--hairline);
  color: var(--text-lo);
  transition: all 0.25s;
}
.filters a:hover { color: var(--text-hi); border-color: var(--hairline-strong); }
.filters a.on { color: var(--gold-bright); border-color: rgba(201,164,92,0.5); background: rgba(201,164,92,0.08); }

/* ---------- Toasts ---------- */
.toast {
  position: fixed; bottom: 1.6rem; right: 1.6rem; z-index: 200;
  padding: 0.85rem 1.3rem;
  border-radius: 12px;
  background: var(--ink-3);
  border: 1px solid var(--hairline-strong);
  box-shadow: 0 24px 60px -12px rgba(0,0,0,0.7);
  font-size: 0.9rem;
  animation: toastin 0.45s var(--ease);
  max-width: 380px;
}
.toast--ok  { border-color: rgba(127,191,127,0.5); }
.toast--err { border-color: rgba(224,122,106,0.55); }
@keyframes toastin { from { opacity: 0; transform: translateY(12px); } }

/* ---------- Editor (Quill theming) ---------- */
.editor-shell { border: 1px solid var(--hairline-strong); border-radius: 14px; overflow: hidden; background: var(--parch-0); }
.editor-shell .ql-toolbar.ql-snow {
  border: 0; border-bottom: 1px solid rgba(23,21,18,0.14);
  background: #efe9dc;
  padding: 0.6rem 0.8rem;
  position: sticky; top: 0; z-index: 5;
}
.editor-shell .ql-container.ql-snow { border: 0; font-size: 1.05rem; }
.editor-shell .ql-editor {
  min-height: 420px;
  font-family: var(--font-display);
  color: #171512;
  line-height: 1.8;
  padding: 2rem clamp(1.2rem, 5vw, 3rem);
}
.editor-shell .ql-editor h2, .editor-shell .ql-editor h3 { font-family: var(--font-display); margin: 1.4em 0 0.5em; }
.editor-shell .ql-editor blockquote {
  border-left: 3px solid var(--gold);
  background: #fffdf8;
  padding: 0.8rem 1.2rem;
  font-style: italic;
  margin: 1.2rem 0;
}
.editor-shell .ql-editor img { border-radius: 10px; margin: 1rem 0; }
.editor-shell .ql-snow .ql-picker, .editor-shell .ql-snow .ql-stroke { color: #57524a; stroke: #57524a; }
.editor-shell .ql-snow .ql-fill { fill: #57524a; }
.editor-shell .ql-snow.ql-toolbar button:hover .ql-stroke,
.editor-shell .ql-snow.ql-toolbar button.ql-active .ql-stroke { stroke: var(--gold-deep); }
.editor-shell .ql-snow.ql-toolbar button:hover .ql-fill,
.editor-shell .ql-snow.ql-toolbar button.ql-active .ql-fill { fill: var(--gold-deep); }

/* ---------- Dropzone / upload ---------- */
.drop {
  border: 1.5px dashed var(--hairline-strong);
  border-radius: 14px;
  padding: 2.4rem 1.5rem;
  text-align: center;
  color: var(--text-lo);
  transition: border-color 0.3s, background 0.3s;
  cursor: pointer;
}
.drop:hover, .drop.dragover { border-color: var(--gold); background: rgba(201,164,92,0.05); color: var(--text-mid); }
.drop strong { color: var(--gold-bright); font-weight: 600; }
.progress { height: 8px; border-radius: 99px; background: var(--ink-0); border: 1px solid var(--hairline); overflow: hidden; margin-top: 1rem; }
.progress i { display: block; height: 100%; width: 0%; border-radius: 99px; background: linear-gradient(90deg, var(--gold-deep), var(--gold-bright)); transition: width 0.3s; }

.imgpick { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--hairline-strong); aspect-ratio: 16/9; background: var(--ink-0); cursor: pointer; }
.imgpick img { width: 100%; height: 100%; object-fit: cover; }
.imgpick__empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-lo); font-size: 0.85rem; }
.imgpick::after {
  content: "Change"; position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(8,9,12,0.55); color: var(--text-hi); font-weight: 600; font-size: 0.85rem;
  opacity: 0; transition: opacity 0.25s;
}
.imgpick:hover::after { opacity: 1; }
.imgpick.is-empty::after { display: none; }

/* ---------- Schedule timeline ---------- */
.sched-day { margin-bottom: 1.6rem; }
.sched-day__date {
  font-family: var(--font-display); font-size: 1.05rem; color: var(--gold-bright);
  padding-bottom: 0.5rem; margin-bottom: 0.7rem;
  border-bottom: 1px solid var(--hairline);
}
.sched-item {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  margin-bottom: 0.6rem;
  background: var(--ink-1);
}
.sched-item__time { font-size: 0.8rem; color: var(--gold); min-width: 72px; font-weight: 600; }
.sched-item__what { flex: 1; min-width: 0; }
.sched-item__what strong { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sched-item__what span { font-size: 0.76rem; color: var(--text-lo); }

/* ---------- Login ---------- */
.login-body {
  min-height: 100vh; display: grid; place-items: center;
  background:
    radial-gradient(70% 55% at 50% 0%, rgba(201,164,92,0.14), transparent 60%),
    var(--ink-0);
  padding: 1.5rem;
}
.login-card {
  width: min(420px, 100%);
  background: linear-gradient(180deg, var(--ink-2), var(--ink-1));
  border: 1px solid var(--hairline-strong);
  border-radius: 24px;
  padding: 2.6rem 2.4rem;
  box-shadow: 0 40px 100px -30px rgba(0,0,0,0.8);
  text-align: center;
}
.login-card img { height: 46px; margin: 0 auto 1.2rem; }
.login-card h1 { font-size: 1.5rem; margin-bottom: 0.3rem; }
.login-card .sub { color: var(--text-lo); font-size: 0.86rem; margin-bottom: 1.8rem; }
.login-card form { text-align: left; }
.login-err {
  background: rgba(224,122,106,0.12);
  border: 1px solid rgba(224,122,106,0.4);
  color: #f0b3a8;
  border-radius: 10px;
  padding: 0.7rem 1rem;
  font-size: 0.85rem;
  margin-bottom: 1.2rem;
}

/* ---------- Misc ---------- */
.muted { color: var(--text-lo); }
.gold { color: var(--gold-bright); }
.mt-1 { margin-top: 0.6rem; } .mt-2 { margin-top: 1.2rem; } .mt-3 { margin-top: 2rem; }
.mb-2 { margin-bottom: 1.2rem; }
.flex { display: flex; gap: 0.8rem; align-items: center; }
.spread { justify-content: space-between; }
.empty {
  text-align: center; color: var(--text-lo);
  padding: 3.2rem 1rem;
}
.empty .big { font-family: var(--font-display); font-size: 1.3rem; color: var(--text-mid); margin-bottom: 0.4rem; }
hr.sep { border: 0; border-top: 1px solid var(--hairline); margin: 1.6rem 0; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .side {
    position: fixed; z-index: 100; left: 0; top: 0;
    transform: translateX(-100%);
    transition: transform 0.35s var(--ease);
    box-shadow: 0 0 80px rgba(0,0,0,0.6);
  }
  .side.open { transform: none; }
  .topbar__burger { display: flex; }
  .topbar { padding: 0.8rem 1.1rem; }
  .content { padding: 1.2rem; }
  .topbar__meta { display: none; }
  .field-row { flex-direction: column; gap: 0; }
}
