:root {
  --ink: #16181d; --amber: #f2a516; --amber-d: #a66200; --mist: #f3f6fa; --line: #e2e8ef; --muted: #5d6d7e;
  --green: #17744b; --green-bg: #ddf3e8; --red: #b3261e; --red-bg: #fde8e6; --blue: #1769aa; --blue-bg: #e6eefb; --warn-bg: #fff4d6;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Geeza Pro", "Segoe UI", Tahoma, Arial, sans-serif; background: var(--mist); color: var(--ink);
  font-size: 15px; line-height: 1.6;
}
button, input, select, textarea { font: inherit; color: inherit; }
.ltr { direction: ltr; unicode-bidi: embed; display: inline-block; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(160deg, #1d2230, var(--ink)); }
.login { width: min(420px, 100%); background: #fff; border-radius: 22px; padding: 32px; box-shadow: 0 20px 60px #0006; }
.brand { font-size: 30px; font-weight: 800; letter-spacing: -.5px; direction: ltr; text-align: center; margin-bottom: 4px; }
.brand i { font-style: normal; color: var(--amber); }
.login h1 { font-size: 18px; text-align: center; margin: 0 0 24px; color: var(--muted); font-weight: 600; }

/* layout */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100%; }
.side { background: var(--ink); color: #fff; padding: 20px 14px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; }
.side .brand { color: #fff; text-align: right; padding: 0 10px 18px; font-size: 26px; }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 11px 14px; border-radius: 12px; background: none; border: 0; color: #c9cdd6; cursor: pointer; text-align: right; width: 100%; }
.nav:hover { background: #ffffff14; }
.nav.on { background: var(--amber); color: var(--ink); font-weight: 800; }
.badge { min-width: 24px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--amber); color: var(--ink); font-size: 12px; font-weight: 800; display: inline-grid; place-items: center; }
.nav.on .badge { background: var(--ink); color: #fff; }
.side .spacer { flex: 1; }
.me { padding: 12px 10px; font-size: 13px; color: #8a909c; border-top: 1px solid #ffffff22; word-break: break-all; }
.main { padding: 24px 28px 60px; min-width: 0; }
.top { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.top h2 { margin: 0; font-size: 24px; flex: 1; }

/* components */
.btn { border: 0; border-radius: 12px; padding: 9px 16px; background: var(--amber); color: var(--ink); font-weight: 800; cursor: pointer; }
.btn:hover { filter: brightness(.96); }
.btn.sec { background: #fff; border: 1px solid var(--line); font-weight: 700; }
.btn.ok { background: var(--green); color: #fff; }
.btn.danger { background: var(--red); color: #fff; }
.btn.small { padding: 5px 12px; font-size: 13px; border-radius: 10px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tab { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 16px; cursor: pointer; font-weight: 700; }
.tab.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; cursor: pointer; text-align: right; }
.stat:hover { border-color: var(--amber); }
.stat b { display: block; font-size: 34px; line-height: 1.1; }
.stat.alert b { color: var(--amber-d); }
.chip { display: inline-block; padding: 2px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 800; background: var(--blue-bg); color: var(--blue); }
.chip.pending, .chip.new { background: var(--warn-bg); color: #7a5200; }
.chip.approved, .chip.done { background: var(--green-bg); color: var(--green); }
.chip.rejected, .chip.suspended, .chip.cancelled { background: var(--red-bg); color: var(--red); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.ad { display: flex; flex-direction: column; gap: 10px; padding: 0; overflow: hidden; }
.ad .media { background: #0e0f12; aspect-ratio: 9 / 12; display: grid; place-items: center; }
.ad .media img, .ad .media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.ad .body { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.ad .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 14px; text-align: right; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #fafbfc; font-size: 13px; color: var(--muted); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.empty { padding: 40px; text-align: center; color: var(--muted); background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); }
.in, select.in, textarea.in { width: 100%; border: 1px solid #d5dee8; border-radius: 12px; padding: 9px 12px; background: #fff; }
.in:focus { outline: 2px solid var(--amber); outline-offset: 0; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field > label { font-weight: 700; font-size: 14px; }
.err { color: var(--red); font-size: 13.5px; min-height: 20px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
dialog { border: 0; border-radius: 20px; padding: 24px; width: min(520px, 94vw); box-shadow: 0 20px 70px #0007; }
dialog::backdrop { background: #0009; }
dialog h3 { margin: 0 0 16px; }
.dlg-actions { display: flex; gap: 10px; justify-content: flex-start; margin-top: 8px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 22px; border-radius: 999px; z-index: 50; box-shadow: 0 8px 30px #0005; }
.toast.err { background: var(--red); }
.note { background: var(--warn-bg); border-radius: 12px; padding: 10px 14px; font-size: 13.5px; margin-bottom: 16px; }
td select.in { min-width: 130px; padding: 5px 8px; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .side .brand { width: 100%; }
  .side .spacer, .me { display: none; }
  .main { padding: 16px; }
  .row2 { grid-template-columns: 1fr; }
}

.w180 { width: 180px; }

td select.in { min-width: 110px; }
.table-wrap td:nth-child(6), .table-wrap td:nth-child(7) { white-space: nowrap; }
