/* Calm, low-noise theme: one accent colour, large targets, generous spacing. */
/* Themes are picked by the viewer (see the "المظهر" menu) and set as data-theme / data-font on <html>. */
:root {
  /* "paper": warm white with a blue accent, modelled on Notion's light palette. */
  --bg: #f7f6f3; --card: #ffffff; --ink: #37352f; --muted: #787774; --line: #e9e9e7; --field: #ffffff;
  --brand: #2383e2; --brand-soft: #e7f1fc; --brand-ink: #ffffff; --danger: #c4554d;
  --warn-bg: #fdebec; --warn-line: #f3c6c2; --note-bg: #fbf3db; --note-line: #ecdba6;
  --ok: #dbeddb; --ok-ink: #1c3829; --wait: #fdecc8; --wait-ink: #402c1b; --bad: #ffe2dd; --bad-ink: #5d1715;
  --radius: 10px;
  --font: "IBM Plex Sans Arabic";
  color-scheme: light;
}
/* "violet": Hostinger hPanel's purple on a pale lavender page. */
[data-theme=violet] {
  --bg: #f4f5ff; --card: #ffffff; --ink: #2f1c6a; --muted: #727586; --line: #dadce0; --field: #ffffff;
  --brand: #673de6; --brand-soft: #ebe4ff; --brand-ink: #ffffff;
}
/* "sage": soft green on warm off-white. */
[data-theme=sage] {
  --bg: #f5f3ee; --card: #fffdf9; --ink: #26312d; --muted: #6f7a75; --line: #e3dfd6; --field: #ffffff;
  --brand: #2f6f5e; --brand-soft: #e3efea; --brand-ink: #ffffff;
}
/* Night mode: every colour set has a dark version. The base is a soft neutral dark, modelled on Linear. */
[data-mode=dark] {
  --bg: #111318; --card: #191c22; --ink: #e3e5e8; --muted: #8a8f98; --line: #2a2e37; --field: #111318;
  --brand: #6aa9ee; --brand-soft: #1c2a3d; --brand-ink: #0f1115; --danger: #eb8a84;
  --warn-bg: #3a2224; --warn-line: #6b3a3c; --note-bg: #35301c; --note-line: #5c5227;
  --ok: #1f3a2c; --ok-ink: #a8dcbf; --wait: #40361a; --wait-ink: #f0d58c; --bad: #45262a; --bad-ink: #f3b1ab;
  color-scheme: dark;
}
[data-mode=dark][data-theme=violet] {
  --bg: #14121f; --card: #1c1930; --ink: #e7e4f5; --muted: #9a96b5; --line: #2e2a47; --field: #14121f;
  --brand: #a48bf5; --brand-soft: #2a2350; --brand-ink: #14121f;
}
[data-mode=dark][data-theme=sage] {
  --bg: #1b211f; --card: #232b28; --ink: #e4e9e6; --muted: #98a39e; --line: #353f3b; --field: #1b211f;
  --brand: #6fb8a2; --brand-soft: #2a3a35; --brand-ink: #10201b;
}
.mode-toggle { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: 6px 16px; cursor: pointer; font: inherit; font-size: 14px; }
.mode-toggle:hover { border-color: var(--brand); }
.mode-toggle .to-light, [data-mode=dark] .mode-toggle .to-dark { display: none; }
[data-mode=dark] .mode-toggle .to-light { display: inline; }
[data-font=tajawal] { --font: "Tajawal"; }
[data-font=cairo] { --font: "Cairo"; }
[data-font=system] { --font: "Segoe UI"; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.75 var(--font), "Segoe UI", Tahoma, Arial, sans-serif; }

.look { position: fixed; bottom: 14px; left: 14px; z-index: 5; font-size: 14px; }
.look summary { list-style: none; cursor: pointer; padding: 7px 16px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--muted); }
.look summary::-webkit-details-marker { display: none; }
.look .panel { position: absolute; bottom: 46px; left: 0; width: 250px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .14); }
.look p { margin: 0 0 8px; font-weight: 600; color: var(--muted); font-size: 13px; }
.look .row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 14px; }
.look .row:last-child { margin-bottom: 0; }
.look button { border: 1px solid var(--line); background: var(--field); color: var(--ink); border-radius: 8px; padding: 7px 8px; cursor: pointer; font-size: 14px; display: flex; align-items: center; gap: 8px; font-family: inherit; }
.look button.on { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); font-weight: 600; }
.look i { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(128, 128, 128, .4); flex: none; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; margin: 0; font-weight: 700; }
main { max-width: 1100px; margin: 0 auto; padding: 28px 18px 80px; }
.focus { max-width: 720px; margin: 0 auto; }
[hidden] { display: none !important; }

.top { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; background: var(--card); border-bottom: 1px solid var(--line); padding: 10px 18px; }
.top .brand { color: var(--ink); font-weight: 700; font-size: 18px; }
.top nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.top nav a { color: var(--muted); padding: 7px 14px; border-radius: 999px; }
.top nav a.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.top nav a:hover { color: var(--ink); text-decoration: none; }
.who { display: flex; gap: 12px; align-items: center; color: var(--muted); font-size: 14px; }
button.link { background: none; border: 0; color: var(--brand); cursor: pointer; font: inherit; text-decoration: underline; padding: 0; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin: 18px 0; }
.narrow { max-width: 460px; margin: 48px auto; }
.muted, small { color: var(--muted); }
small { display: block; font-size: 13px; font-weight: 400; margin-top: 4px; }
.bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

.flash { padding: 12px 16px; border-radius: var(--radius); margin: 16px 0; background: var(--ok); color: var(--ok-ink); }
.flash.err { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--bad-ink); }
.flash.note { background: var(--note-bg); border: 1px solid var(--note-line); color: var(--wait-ink); }

label, .field { display: block; font-weight: 600; font-size: 14px; margin-bottom: 18px; }
.lbl { display: block; }
input, select, textarea { width: 100%; min-height: 46px; padding: 10px 12px; margin-top: 6px; border: 1px solid var(--line); border-radius: 10px; font: inherit; font-weight: 400; background: var(--field); color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--brand-soft); border-color: var(--brand); }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; margin: 0; }
label.check { font-weight: 400; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 20px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--brand); text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.big { min-height: 50px; padding: 10px 26px; font-size: 17px; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.danger { color: var(--danger); border-color: var(--warn-line); background: transparent; }
.btn.ok { background: var(--ok); border-color: transparent; color: var(--ok-ink); }
.btn.small { min-height: 34px; padding: 3px 12px; font-size: 14px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 20px 0 0; }
.chip { padding: 7px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); }
.chip b { color: var(--muted); font-weight: 600; margin-inline-start: 4px; }
.chip.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.chip.on b { color: inherit; }
.chip:hover { text-decoration: none; border-color: var(--brand); }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px; }
.filters input, .filters select { width: auto; margin: 0; min-width: 150px; }
.filters .grow { flex: 1; min-width: 220px; }
.filters details { flex-basis: 100%; }
.filters summary { cursor: pointer; color: var(--muted); font-size: 14px; width: fit-content; }
.filters .more { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }

.summary { display: flex; gap: 22px; flex-wrap: wrap; color: var(--muted); margin: 6px 4px; font-size: 15px; }
.summary b { color: var(--ink); }

.table-wrap { padding: 0; overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: 13px 10px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
th { font-size: 13px; color: var(--muted); font-weight: 600; }
tbody tr:hover { background: var(--brand-soft); }
td[dir=ltr] { text-align: right; }
td .under { display: block; font-size: 12.5px; color: var(--muted); }
td.empty { text-align: center; color: var(--muted); padding: 44px; }
td.row-actions { text-align: left; }
.row-actions form.inline { display: inline-flex; vertical-align: middle; margin-inline-end: 4px; }

.tag { display: inline-block; padding: 2px 12px; border-radius: 999px; font-size: 13px; background: var(--line); }
.s-delivered, .s-purchased { background: var(--ok); color: var(--ok-ink); }
.s-pending { background: var(--wait); color: var(--wait-ink); }
.s-not_delivered, .s-canceled, .s-refunded { background: var(--bad); color: var(--bad-ink); }

.stepper { list-style: none; display: flex; gap: 6px; padding: 0; margin: 20px 0 0; counter-reset: step; }
.stepper li { flex: 1; counter-increment: step; }
.stepper button { width: 100%; border: 0; border-top: 4px solid var(--line); background: none; padding: 8px 2px; font: inherit; font-size: 13px; color: var(--muted); cursor: pointer; text-align: right; }
.stepper button::before { content: counter(step) ". "; }
.stepper .done button { border-color: var(--brand); color: var(--ink); }
.stepper .on button { border-color: var(--brand); color: var(--brand); font-weight: 700; }

.form fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.form legend { font-weight: 700; font-size: 18px; padding: 0; margin-bottom: 16px; }
.form.all fieldset + fieldset, .form:not([data-wizard]) fieldset + fieldset { border-top: 1px solid var(--line); padding-top: 22px; margin-top: 6px; }
.form .sub { background: var(--brand-soft); border-radius: var(--radius); padding: 16px 16px 2px; margin-bottom: 18px; }
.choices { display: flex; gap: 8px; margin-top: 6px; }
.choices label { flex: 1; margin: 0; cursor: pointer; }
.choices input { position: absolute; opacity: 0; }
.choices span { display: block; text-align: center; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--field); font-weight: 600; }
.choices input:checked + span { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.choices input:focus-visible + span { outline: 3px solid var(--brand-soft); }
.secret { display: flex; gap: 8px; margin-top: 6px; }
.secret input { margin: 0; font-family: Consolas, "Courier New", monospace; }
.copy { border: 1px solid var(--line); background: var(--card); color: var(--muted); border-radius: 10px; padding: 0 14px; cursor: pointer; font: inherit; font-size: 13px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; padding-top: 18px; border-top: 1px solid var(--line); }
.danger-zone { margin-top: 8px; text-align: left; }
form.inline { display: flex; gap: 6px; align-items: center; }
form.inline input { margin: 0; min-width: 150px; min-height: 36px; padding: 5px 10px; }
.pager { display: flex; gap: 4px; flex-wrap: wrap; }
.steps { padding-right: 20px; }

@media (prefers-reduced-motion: no-preference) {
  .btn, .chip, input, select { transition: border-color .15s, background-color .15s; }
}
@media (max-width: 640px) {
  main { padding: 18px 12px 60px; }
  .card { padding: 16px; }
  .stepper button { font-size: 0; }
  .stepper button::before { font-size: 13px; content: counter(step); }
}
