/* ============================================================
   SRSS Admin Panel — green/gold, serif headings, bilingual
   ============================================================ */
:root {
  --green-950: oklch(0.21 0.042 156);
  --green-900: oklch(0.26 0.052 155);
  --green-800: oklch(0.32 0.062 153);
  --green-700: oklch(0.39 0.072 152);
  --green-600: oklch(0.47 0.082 150);
  --green-100: oklch(0.93 0.028 150);
  --green-50:  oklch(0.97 0.014 150);
  --gold-600: oklch(0.66 0.12 74);
  --gold-500: oklch(0.74 0.122 78);
  --gold-400: oklch(0.81 0.108 82);
  --gold-100: oklch(0.93 0.05 85);
  --crimson:  oklch(0.53 0.19 22);
  --crimson-soft: oklch(0.96 0.03 22);
  --blue-soft: oklch(0.95 0.03 250);
  --blue: oklch(0.55 0.13 250);
  --cream:  oklch(0.987 0.006 95);
  --paper:  oklch(0.975 0.009 92);
  --paper-2: oklch(0.955 0.012 92);
  --line:   oklch(0.90 0.012 120);
  --ink:    oklch(0.26 0.022 152);
  --ink-soft: oklch(0.44 0.02 152);
  --ink-mute: oklch(0.58 0.018 152);
  --white:  oklch(0.995 0.003 95);
  --serif: "Tiro Devanagari Hindi", Georgia, serif;
  --sans:  "Mukta", system-ui, sans-serif;
  --shadow-sm: 0 1px 2px oklch(0.3 0.04 150 / 0.06), 0 2px 8px oklch(0.3 0.04 150 / 0.05);
  --shadow-md: 0 6px 20px oklch(0.3 0.05 150 / 0.10), 0 2px 6px oklch(0.3 0.05 150 / 0.06);
  --shadow-lg: 0 20px 50px oklch(0.25 0.05 150 / 0.18);
  --sidebar-w: 248px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: var(--sans); color: var(--ink); background: var(--paper); font-size: 15px; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
button { cursor: pointer; border: none; background: none; }

/* bilingual */
.t-en { display: none; }
html.lang-en .t-ne { display: none; }
html.lang-en .t-en { display: revert; }

.serif { font-family: var(--serif); }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(120% 90% at 85% 0%, oklch(0.31 0.06 153) 0%, transparent 55%), linear-gradient(160deg, var(--green-900), var(--green-950)); }
.login-card { background: var(--cream); border-radius: 20px; box-shadow: var(--shadow-lg); width: min(420px, 100%); padding: 38px 34px; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.login-brand img { width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--gold-500); background: #fff; }
.login-brand b { font-family: var(--serif); color: var(--green-900); font-size: 1.15rem; line-height: 1.1; }
.login-brand > div > span { display: block; font-size: 0.72rem; color: var(--ink-mute); }
.login-card h1 { font-family: var(--serif); font-weight: 600; color: var(--green-900); font-size: 1.5rem; margin-bottom: 4px; }
.login-card .sub { color: var(--ink-soft); font-size: 0.9rem; margin-bottom: 22px; }
.login-hint { margin-top: 18px; font-size: 0.8rem; color: var(--ink-mute); background: var(--green-50); border: 1px solid var(--green-100); border-radius: 10px; padding: 10px 12px; line-height: 1.7; }
.login-hint b { color: var(--green-800); }
.login-hint button { color: var(--green-700); font-weight: 600; text-decoration: underline; }

/* ---------- App shell ---------- */
.app { display: none; min-height: 100vh; }
.app.show { display: grid; grid-template-columns: var(--sidebar-w) 1fr; }
.sidebar { background: linear-gradient(180deg, var(--green-900), var(--green-950)); color: oklch(0.9 0.02 150); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.sidebar__brand { display: flex; align-items: center; gap: 11px; padding: 18px 20px; border-bottom: 1px solid oklch(1 0 0 / 0.08); }
.sidebar__brand img { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--gold-500); background: #fff; flex: none; }
.sidebar__brand b { font-family: var(--serif); color: #fff; font-size: 1rem; line-height: 1.2; }
.sidebar__brand > div > span { display: block; font-size: 0.68rem; color: oklch(0.8 0.02 150); }
.sidebar__nav { flex: 1; overflow-y: auto; padding: 12px 12px 24px; }
.nav-group__title { font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold-400); font-weight: 700; padding: 16px 10px 6px; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 9px; color: oklch(0.88 0.02 150); font-weight: 500; transition: background .15s, color .15s; position: relative; }
.nav-item:hover { background: oklch(1 0 0 / 0.07); color: #fff; }
.nav-item.active { background: oklch(1 0 0 / 0.12); color: #fff; }
.nav-item.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; background: var(--gold-500); border-radius: 0 3px 3px 0; }
.nav-item svg { width: 18px; height: 18px; flex: none; opacity: 0.9; }
.nav-item .badge { margin-left: auto; background: var(--crimson); color: #fff; font-size: 0.68rem; font-weight: 700; min-width: 20px; height: 20px; border-radius: 999px; display: grid; place-items: center; padding: 0 6px; }

/* ---------- Topbar ---------- */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { background: var(--cream); border-bottom: 1px solid var(--line); padding: 12px 26px; display: flex; align-items: center; gap: 16px; position: sticky; top: 0; z-index: 20; }
.topbar__burger { display: none; width: 40px; height: 40px; border-radius: 9px; color: var(--green-900); align-items: center; justify-content: center; }
.topbar__burger svg { width: 24px; height: 24px; }
.crumb { font-family: var(--serif); font-size: 1.25rem; color: var(--green-900); font-weight: 600; }
.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.lang-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.lang-toggle button { padding: 5px 13px; font-size: 0.8rem; font-weight: 600; color: var(--ink-soft); }
.lang-toggle button.active { background: var(--green-700); color: #fff; }
.viewsite { font-size: 0.85rem; color: var(--green-700); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.viewsite:hover { color: var(--gold-600); }
.viewsite svg { width: 15px; height: 15px; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 5px 6px 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); }
.user-chip__av { width: 30px; height: 30px; border-radius: 50%; background: var(--green-700); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 0.85rem; }
.user-chip__name { font-weight: 600; font-size: 0.85rem; line-height: 1.1; }
.user-chip__role { font-size: 0.7rem; color: var(--ink-mute); }
.user-menu { position: relative; }
.user-menu__pop { position: absolute; right: 0; top: calc(100% + 8px); background: var(--white); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-md); min-width: 180px; padding: 6px; display: none; z-index: 30; }
.user-menu.open .user-menu__pop { display: block; }
.user-menu__pop button, .user-menu__pop a { display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 11px; border-radius: 8px; font-size: 0.88rem; color: var(--ink-soft); font-weight: 500; }
.user-menu__pop button:hover, .user-menu__pop a:hover { background: var(--green-50); color: var(--green-800); }
.user-menu__pop svg { width: 16px; height: 16px; }
.user-menu__pop hr { border: none; border-top: 1px solid var(--line); margin: 5px 0; }

/* ---------- Content ---------- */
.view { padding: 26px; flex: 1; max-width: 1280px; width: 100%; }
.view__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.view__title { font-family: var(--serif); font-size: 1.7rem; color: var(--green-900); font-weight: 600; line-height: 1.25; }
.view__sub { color: var(--ink-soft); font-size: 0.92rem; margin-top: 2px; }

.btn { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; padding: 10px 18px; border-radius: 9px; transition: background .15s, transform .15s, box-shadow .15s; white-space: nowrap; }
.btn svg { width: 17px; height: 17px; }
.btn--primary { background: var(--green-700); color: #fff; }
.btn--primary:hover { background: var(--green-800); }
.btn--gold { background: var(--gold-500); color: var(--green-950); }
.btn--gold:hover { background: var(--gold-400); }
.btn--ghost { border: 1px solid var(--line); color: var(--ink-soft); background: var(--white); }
.btn--ghost:hover { border-color: var(--green-600); color: var(--green-800); }
.btn--danger { background: var(--crimson-soft); color: var(--crimson); }
.btn--danger:hover { background: var(--crimson); color: #fff; }
.btn--sm { padding: 7px 13px; font-size: 0.85rem; border-radius: 8px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---------- Cards / KPIs ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.kpi { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: 14px; }
.kpi__ic { width: 46px; height: 46px; border-radius: 12px; background: var(--green-50); color: var(--green-700); display: grid; place-items: center; flex: none; }
.kpi__ic svg { width: 24px; height: 24px; }
.kpi__num { font-family: var(--serif); font-size: 1.7rem; font-weight: 600; color: var(--green-900); line-height: 1; }
.kpi__lbl { font-size: 0.82rem; color: var(--ink-soft); margin-top: 3px; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm); }
.panel__head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.panel__head h3 { font-family: var(--serif); font-size: 1.1rem; color: var(--green-900); font-weight: 600; }
.panel__body { padding: 8px 20px 16px; }
.cols-2 { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; }

.activity { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.activity:last-child { border-bottom: none; }
.activity__dot { width: 32px; height: 32px; border-radius: 9px; flex: none; display: grid; place-items: center; background: var(--green-50); color: var(--green-700); }
.activity__dot svg { width: 16px; height: 16px; }
.activity__t { font-weight: 600; font-size: 0.9rem; color: var(--green-900); }
.activity__m { font-size: 0.78rem; color: var(--ink-mute); }

/* ---------- Toolbar (list) ---------- */
.toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.search { display: flex; align-items: center; gap: 8px; background: var(--white); border: 1px solid var(--line); border-radius: 9px; padding: 8px 12px; flex: 1; min-width: 200px; max-width: 360px; }
.search svg { width: 16px; height: 16px; color: var(--ink-mute); flex: none; }
.search input { border: none; outline: none; background: none; width: 100%; color: var(--ink); }
.filter-select { background: var(--white); border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; color: var(--ink-soft); }

/* ---------- Table ---------- */
.table-wrap { background: var(--white); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-sm); }
table.tbl { width: 100%; border-collapse: collapse; }
table.tbl th { text-align: left; padding: 13px 18px; background: var(--green-50); color: var(--green-900); font-weight: 600; font-size: 0.82rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.tbl td { padding: 13px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 0.9rem; }
table.tbl tr:last-child td { border-bottom: none; }
table.tbl tbody tr:hover { background: var(--paper); }
.tbl__title { font-weight: 600; color: var(--green-900); }
.tbl__sub { font-size: 0.78rem; color: var(--ink-mute); margin-top: 2px; }
.tbl__thumb { width: 46px; height: 34px; border-radius: 6px; background: var(--green-100); flex: none; background-size: cover; background-position: center; }
.tbl__actions { display: flex; gap: 6px; justify-content: flex-end; }
.icon-btn { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: var(--ink-soft); border: 1px solid var(--line); background: var(--white); transition: all .15s; }
.icon-btn:hover { border-color: var(--green-600); color: var(--green-700); }
.icon-btn.danger:hover { border-color: var(--crimson); color: var(--crimson); background: var(--crimson-soft); }
.icon-btn svg { width: 16px; height: 16px; }
.empty { text-align: center; padding: 50px 20px; color: var(--ink-mute); }
.empty svg { width: 42px; height: 42px; opacity: 0.4; margin-bottom: 10px; }

/* badges */
.badge-tag { display: inline-block; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; }
.b-green { background: var(--green-100); color: var(--green-700); }
.b-gold { background: var(--gold-100); color: var(--gold-600); }
.b-red { background: var(--crimson-soft); color: var(--crimson); }
.b-blue { background: var(--blue-soft); color: var(--blue); }
.b-gray { background: var(--paper-2); color: var(--ink-mute); }

/* pagination */
.pager { display: flex; gap: 6px; justify-content: flex-end; margin-top: 16px; }
.pager { display: flex; gap: 6px; justify-content: flex-end; margin-top: 16px; align-items: center; }
.pager__count { margin-right: auto; font-size: 0.85rem; color: var(--ink-mute); font-weight: 500; }
.pager button { min-width: 36px; height: 36px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--white); font-weight: 600; color: var(--ink-soft); }
.pager button.active { background: var(--green-700); color: #fff; border-color: var(--green-700); }
.pager button:disabled { opacity: 0.4; }

/* ---------- Form ---------- */
.form-card { background: var(--white); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm); padding: 24px; max-width: auto; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: 0.85rem; color: var(--green-900); }
.field label .req { color: var(--crimson); }
.field .hint { font-size: 0.75rem; color: var(--ink-mute); }
.field input, .field select, .field textarea { padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--white); color: var(--ink); transition: border-color .15s, box-shadow .15s; width: 100%; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--green-600); box-shadow: 0 0 0 3px var(--green-100); }
.field textarea { resize: vertical; min-height: 90px; }
.bi-input { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bi-input .bi { display: flex; flex-direction: column; gap: 4px; }
.bi-input .bi small { font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-mute); font-weight: 700; }
.form-actions { display: flex; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.form-actions .spacer { flex: 1; }
.img-drop { border: 1.5px dashed var(--line); border-radius: 10px; padding: 18px; text-align: center; color: var(--ink-mute); background: var(--paper); cursor: pointer; transition: border-color .15s; }
.img-drop:hover { border-color: var(--green-600); }
.img-drop.has { padding: 0; border-style: solid; overflow: hidden; }
.img-drop img { width: 100%; height: 160px; object-fit: cover; }
.tags-input { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-tag { background: var(--green-50); border: 1px solid var(--green-100); color: var(--green-800); padding: 4px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal.open { display: flex; }
.modal__scrim { position: absolute; inset: 0; background: oklch(0.18 0.03 150 / 0.55); backdrop-filter: blur(3px); }
.modal__card { position: relative; background: var(--cream); border-radius: 16px; box-shadow: var(--shadow-lg); width: min(560px, 100%); max-height: 90vh; overflow-y: auto; }
.modal__head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: var(--cream); }
.modal__head h3 { font-family: var(--serif); font-size: 1.2rem; color: var(--green-900); font-weight: 600; }
.modal__body { padding: 20px 22px; }
.modal__close { width: 34px; height: 34px; border-radius: 8px; color: var(--ink-soft); display: grid; place-items: center; }
.modal__close:hover { background: var(--paper-2); }
.modal__close svg { width: 20px; height: 20px; }
.detail-row { display: flex; gap: 14px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.detail-row:last-child { border-bottom: none; }
.detail-row .k { width: 130px; flex: none; color: var(--ink-mute); font-size: 0.85rem; font-weight: 600; }
.detail-row .v { color: var(--ink); font-size: 0.92rem; }

/* toast */
.toast-wrap { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.toast { background: var(--green-900); color: #fff; padding: 12px 20px; border-radius: 10px; box-shadow: var(--shadow-lg); font-weight: 500; font-size: 0.9rem; display: flex; align-items: center; gap: 10px; animation: toastin .25s ease; }
.toast.err { background: var(--crimson); }
.toast svg { width: 18px; height: 18px; }
@keyframes toastin { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* toggle switch */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { display: none; }
.switch__track { width: 44px; height: 24px; border-radius: 999px; background: var(--paper-2); border: 1px solid var(--line); position: relative; transition: background .2s; flex: none; }
.switch__track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .2s; }
.switch input:checked + .switch__track { background: var(--green-600); border-color: var(--green-600); }
.switch input:checked + .switch__track::after { transform: translateX(20px); }
.switch__lbl { font-size: 0.85rem; font-weight: 600; color: var(--ink-soft); }

/* menu builder */
.menu-build { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 14px; box-shadow: var(--shadow-sm); }
.menu-node { border-radius: 10px; margin: 4px 0; }
.menu-node.dragging { opacity: 0.45; }
.menu-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; transition: background .12s, box-shadow .12s; }
.menu-row:hover { background: var(--green-50); }
.menu-grip { color: var(--ink-mute); cursor: grab; display: flex; }
.menu-lbl { font-weight: 600; color: var(--green-900); }
.menu-url { font-size: 0.78rem; color: var(--ink-mute); font-family: ui-monospace, monospace; }
.menu-acts { margin-left: auto; display: flex; gap: 6px; }
.menu-kids { margin-left: 26px; padding-left: 12px; border-left: 2px dashed var(--green-100); margin-top: 2px; min-height: 6px; }
.menu-node.drop-before > .menu-row { box-shadow: 0 -3px 0 var(--gold-500); }
.menu-node.drop-into > .menu-row { background: var(--gold-100); box-shadow: inset 0 0 0 2px var(--gold-500); }

/* ---------- Charts ---------- */
.chart-row { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; margin-bottom: 20px; }
.chart-row.one { grid-template-columns: 1fr; }
.bars { display: flex; align-items: flex-end; gap: 12px; height: 200px; padding-top: 18px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; min-width: 0; }
.bars .bar i { width: 100%; max-width: 44px; border-radius: 7px 7px 0 0; background: linear-gradient(var(--green-600), var(--green-800)); position: relative; transition: height .9s cubic-bezier(.2,.7,.3,1); display: block; }
.bars .bar i::after { content: attr(data-v); position: absolute; top: -20px; left: 0; right: 0; text-align: center; font-weight: 600; font-size: 0.78rem; color: var(--green-800); }
.bars .bar small { font-size: 0.74rem; color: var(--ink-mute); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.hbars { display: flex; flex-direction: column; gap: 11px; }
.hbar { display: grid; grid-template-columns: 130px 1fr 38px; align-items: center; gap: 10px; font-size: 0.85rem; }
.hbar .hb-l { color: var(--ink-soft); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar .hb-track { background: var(--paper-2); border-radius: 999px; height: 12px; overflow: hidden; }
.hbar .hb-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--gold-500), var(--green-600)); transition: width .9s ease; }
.hbar .hb-v { text-align: right; font-weight: 600; color: var(--green-800); }
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; justify-content: center; }
.donut { width: 150px; height: 150px; border-radius: 50%; flex: none; display: grid; place-items: center; }
.donut::after { content: ""; width: 94px; height: 94px; background: var(--white); border-radius: 50%; grid-area: 1/1; }
.donut b { grid-area: 1/1; z-index: 1; font-family: var(--serif); font-size: 1.5rem; color: var(--green-800); }
.legend { display: flex; flex-direction: column; gap: 9px; }
.legend div { display: flex; align-items: center; gap: 9px; font-size: 0.85rem; color: var(--ink-soft); }
.legend i { width: 13px; height: 13px; border-radius: 4px; flex: none; }

/* ---------- Settings / generic tabs ---------- */
.tabset { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.tabset button { padding: 10px 15px; font-weight: 600; font-size: 0.9rem; color: var(--ink-mute); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabset button:hover { color: var(--green-800); }
.tabset button.active { color: var(--green-800); border-bottom-color: var(--gold-500); }
.tabpane { display: none; }
.tabpane.active { display: block; animation: fadein .25s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.social-row { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.social-row select, .social-row input { padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; }
.social-row select { width: 150px; flex: none; }
.social-row input { flex: 1; }
.social-row .icon-btn.danger { flex: none; }

/* ---------- SEO meter ---------- */
.seo-box { background: var(--green-50); border: 1px solid var(--green-100); border-radius: 12px; padding: 16px 18px; grid-column: 1/-1; }
.seo-box__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.seo-box__head h4 { font-family: var(--serif); color: var(--green-900); font-size: 1.05rem; }
.seo-score { display: flex; align-items: center; gap: 10px; }
.seo-score__ring { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.seo-score__ring::after { content: ""; width: 34px; height: 34px; background: var(--green-50); border-radius: 50%; grid-area: 1/1; }
.seo-score__ring b { grid-area: 1/1; z-index: 1; font-size: 0.9rem; font-weight: 700; }
.seo-score__lbl { font-size: 0.82rem; font-weight: 600; }
.seo-checks { list-style: none; display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.seo-checks li { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--ink-soft); }
.seo-checks li svg { width: 15px; height: 15px; flex: none; }
.seo-checks li.ok { color: var(--green-700); }
.seo-checks li.bad { color: var(--ink-mute); }
.serp { background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin-top: 12px; }
.serp .t { color: #1a0dab; font-size: 1.02rem; line-height: 1.2; }
.serp .u { color: #006621; font-size: 0.8rem; margin: 2px 0; }
.serp .d { color: var(--ink-soft); font-size: 0.82rem; }

@media (max-width: 980px) { .chart-row { grid-template-columns: 1fr; } }

/* ---------- Dark mode ---------- */
[data-theme="dark"] {
  --cream: oklch(0.20 0.012 240);
  --paper: oklch(0.17 0.012 240);
  --paper-2: oklch(0.24 0.012 240);
  --line: oklch(0.32 0.012 240);
  --ink: oklch(0.93 0.01 240);
  --ink-soft: oklch(0.78 0.012 240);
  --ink-mute: oklch(0.62 0.012 240);
  --white: oklch(0.23 0.014 240);
  --green-50: oklch(0.26 0.03 155);
  --green-100: oklch(0.30 0.04 155);
  --green-900: oklch(0.90 0.04 150);
  --blue-soft: oklch(0.28 0.04 250);
  --crimson-soft: oklch(0.28 0.06 22);
  --gold-100: oklch(0.32 0.06 80);
}
[data-theme="dark"] body { background: var(--paper); }
[data-theme="dark"] .table-wrap, [data-theme="dark"] .panel, [data-theme="dark"] .form-card, [data-theme="dark"] .kpi, [data-theme="dark"] .widget { background: var(--white); }
[data-theme="dark"] table.tbl th { background: oklch(0.26 0.02 240); }
[data-theme="dark"] table.tbl tbody tr:hover { background: oklch(0.25 0.014 240); }
[data-theme="dark"] .topbar { background: oklch(0.22 0.014 240); }
[data-theme="dark"] .field input, [data-theme="dark"] .field select, [data-theme="dark"] .field textarea, [data-theme="dark"] .rte, [data-theme="dark"] .search, [data-theme="dark"] .filter-select { background: oklch(0.26 0.014 240); color: var(--ink); }
[data-theme="dark"] .modal__card { background: var(--paper-2); }
[data-theme="dark"] .seo-box { background: oklch(0.24 0.02 155); }
[data-theme="dark"] .serp { background: oklch(0.26 0.014 240); }
[data-theme="dark"] .serp .t { color: #8ab4f8; }
[data-theme="dark"] .serp .u { color: #6ee7a8; }
[data-theme="dark"] .user-chip { background: oklch(0.27 0.014 240); }
[data-theme="dark"] .user-chip__name { color: var(--ink); }
[data-theme="dark"] .crumb { color: var(--ink); }
[data-theme="dark"] .viewsite { color: oklch(0.8 0.06 150); }
[data-theme="dark"] .lang-toggle button { color: var(--ink-soft); }
[data-theme="dark"] .user-menu__pop { background: var(--paper-2); }
[data-theme="dark"] .pager button { background: oklch(0.26 0.014 240); }

[data-theme="dark"] .sidebar { background: linear-gradient(180deg, oklch(0.42 0.14 147.17), var(--green-950)); }
.theme-btn { width: 38px; height: 38px; border-radius: 9px; border: 1px solid var(--line); background: var(--white); color: var(--ink-soft); display: grid; place-items: center; }
.theme-btn:hover { color: var(--gold-600); border-color: var(--green-600); }
.theme-btn svg { width: 18px; height: 18px; }

/* ---------- Permissions grid ---------- */
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.perm-chk { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); cursor: pointer; font-size: 0.88rem; font-weight: 500; }
.perm-chk input { width: 17px; height: 17px; accent-color: var(--green-700); }
.perm-chk:has(input:checked) { border-color: var(--green-600); background: var(--green-50); }

/* ---------- Rich text editor ---------- */
.rte-tb { display: flex; gap: 3px; flex-wrap: wrap; padding: 6px; border: 1px solid var(--line); border-bottom: none; border-radius: 9px 9px 0 0; background: var(--paper); }
.rte-tb button { padding: 5px 9px; border-radius: 6px; font-size: 0.82rem; color: var(--ink-soft); font-weight: 600; }
.rte-tb button:hover { background: var(--green-50); color: var(--green-800); }
.rte { min-height: 120px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 0 0 9px 9px; background: var(--white); font-size: 0.92rem; line-height: 1.6; overflow-y: auto; max-height: 280px; }
.rte:focus { outline: none; border-color: var(--green-600); box-shadow: 0 0 0 3px var(--green-100); }
.rte ul, .rte ol { padding-left: 22px; }
.rte:empty::before { content: attr(data-ph); color: var(--ink-mute); }

/* ---------- Error pages ---------- */
.err-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(120% 90% at 85% 0%, oklch(0.31 0.06 153) 0%, transparent 55%), linear-gradient(160deg, var(--green-900), var(--green-950)); color: #fff; text-align: center; }
.err-card { max-width: 520px; }
.err-code { font-family: var(--serif); font-size: clamp(5rem, 18vw, 9rem); font-weight: 600; line-height: 1; color: var(--gold-400); }
.err-title { font-family: var(--serif); font-size: 1.8rem; margin-top: 8px; }
.err-msg { color: oklch(0.9 0.02 150); margin-top: 14px; font-size: 1.05rem; }
.err-actions { margin-top: 28px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* role notice */
.ro-banner { background: var(--gold-100); border: 1px solid var(--gold-400); color: var(--gold-600); border-radius: 10px; padding: 10px 14px; font-size: 0.85rem; font-weight: 600; margin-bottom: 18px; display: flex; align-items: center; gap: 8px; }
.ro-banner svg { width: 16px; height: 16px; }

/* sidebar mobile */
.scrim { position: fixed; inset: 0; background: oklch(0.2 0.04 150 / 0); z-index: 40; visibility: hidden; transition: background .25s; }
.scrim.show { background: oklch(0.2 0.04 150 / 0.45); visibility: visible; }

@media (max-width: 980px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .cols-2 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .app.show { grid-template-columns: 1fr; }
  .sidebar { position: fixed; top: 0; left: 0; width: 260px; z-index: 50; transform: translateX(-100%); transition: transform .28s ease; }
  .sidebar.open { transform: translateX(0); }
  .topbar__burger { display: flex; }
  .form-grid, .bi-input { grid-template-columns: 1fr; }
  .view { padding: 18px; }
  .user-chip__name, .user-chip__role { display: none; }
  .hide-sm { display: none; }
  table.tbl thead { display: none; }
  table.tbl, table.tbl tbody, table.tbl tr, table.tbl td { display: block; width: 100%; }
  table.tbl tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  table.tbl td { border: none; padding: 6px 16px; }
  .tbl__actions { justify-content: flex-start; padding-top: 6px; }
}
