/* Nozol: shared styles for the public pages, the guest app, the staff panel and the platform admin.
   Built on /static/theme.css (the site's colours and fonts); Arabic pages switch to Cairo and right-to-left. */
:root { --nz: var(--accent); --nz-soft: var(--accent-light); --shadow: 0 1px 2px rgba(93,50,114,.06), 0 6px 20px rgba(93,50,114,.06);
        --warn: #b8860b; --warn-soft: rgba(255,192,0,.16); --blue: #2f6db5; --blue-soft: rgba(47,109,181,.10); }
html { -webkit-text-size-adjust: 100%; }
body.nz { background: var(--bg); color: var(--text); margin: 0; min-height: 100vh; }
[dir="rtl"] body.nz, body.nz[dir="rtl"] { font-family: 'Cairo', 'Nunito', sans-serif; }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3 { font-family: 'Cairo', 'Baloo 2', sans-serif; }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: middle; }
.ic.s14 { width: 14px; height: 14px; } .ic.s16 { width: 16px; height: 16px; } .ic.s22 { width: 22px; height: 22px; } .ic.s26 { width: 26px; height: 26px; } .ic.s32 { width: 32px; height: 32px; }
[dir="rtl"] .flip { transform: scaleX(-1); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 12px;
       padding: 10px 16px; font: inherit; font-weight: 800; font-size: .92rem; cursor: pointer; text-decoration: none; line-height: 1.2;
       background: var(--accent); color: #fff; transition: background .15s, border-color .15s, opacity .15s; white-space: nowrap; }
.btn:hover { background: var(--accent-hover); }
.btn:disabled, .btn.busy { opacity: .55; cursor: default; }
.btn.gold { background: var(--gold); color: #3a2148; } .btn.gold:hover { background: var(--gold-hover); }
.btn.ghost { background: var(--surface); color: var(--accent); border-color: var(--border); } .btn.ghost:hover { border-color: var(--accent); }
.btn.soft { background: var(--accent-light); color: var(--accent); } .btn.soft:hover { background: rgba(93,50,114,.12); }
.btn.green { background: var(--green); } .btn.green:hover { background: #22683f; }
.btn.danger { background: var(--surface); color: var(--danger); border-color: var(--border); } .btn.danger:hover { border-color: var(--danger); background: var(--danger-soft); }
.btn.sm { padding: 7px 11px; font-size: .82rem; border-radius: 10px; } .btn.lg { padding: 14px 22px; font-size: 1rem; border-radius: 14px; }
.btn.block { width: 100%; } .btn.icon { padding: 8px; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); font-weight: 800; cursor: pointer; text-decoration: underline; }

/* surfaces */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 18px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; } .card.pad0 { padding: 0; overflow: hidden; }
.muted { color: var(--dim); font-weight: 600; } .small { font-size: .84rem; } .tiny { font-size: .74rem; }
.row { display: flex; align-items: center; gap: 10px; } .row.wrap { flex-wrap: wrap; max-width: none; margin: 0; padding: 0; }   /* theme.css also has a .wrap page container */ .row.between { justify-content: space-between; } .row.top { align-items: flex-start; }
.grow { flex: 1; min-width: 0; } .stack > * + * { margin-top: 12px; } .hide { display: none !important; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 720px) { .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); } }

/* chips and badges */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: .76rem; font-weight: 800;
        background: var(--accent-light); color: var(--accent); white-space: nowrap; }
.chip.green { background: var(--green-soft); color: var(--green); } .chip.gold { background: var(--warn-soft); color: #8a5a00; }
.chip.red { background: var(--danger-soft); color: var(--danger); } .chip.blue { background: var(--blue-soft); color: var(--blue); }
.chip.grey { background: rgba(0,0,0,.05); color: var(--dim); }
.dotn { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .72rem; font-weight: 800;
        display: inline-flex; align-items: center; justify-content: center; }

/* forms */
.f { display: block; } .f > span { display: block; font-size: .8rem; font-weight: 800; margin-bottom: 5px; color: var(--text); }
.f small { display: block; margin-top: 4px; color: var(--dim); font-weight: 600; font-size: .76rem; }
.in, select.in, textarea.in { width: 100%; box-sizing: border-box; border: 1px solid var(--border); background: var(--surface); color: var(--text);
     border-radius: 12px; padding: 10px 12px; font: inherit; font-weight: 600; font-size: .95rem; outline: none; min-height: 0; }
.in:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
textarea.in { resize: vertical; min-height: 78px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; cursor: pointer; }
.check input { appearance: auto; -webkit-appearance: auto; width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.switch { position: relative; width: 42px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: #d9cde3; transition: background .15s; cursor: pointer; }
.switch i::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + i { background: var(--green); } .switch input:checked + i::after { transform: translateX(18px); }
[dir="rtl"] .switch input:checked + i::after { transform: translateX(-18px); }

/* segmented control */
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; background: var(--surface); border: 1px solid var(--border); padding: 4px; border-radius: 999px; }
.seg button { border: 0; background: none; padding: 7px 13px; border-radius: 999px; font: inherit; font-weight: 800; font-size: .8rem; color: var(--dim); cursor: pointer; }
.seg button.on { background: var(--accent); color: #fff; }

/* toast and modal */
#toasts { position: fixed; inset-inline: 0; bottom: 18px; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 200; pointer-events: none; padding: 0 16px; }
.toast { background: #2b1638; color: #fff; padding: 11px 16px; border-radius: 12px; font-weight: 700; font-size: .9rem; box-shadow: 0 8px 30px rgba(0,0,0,.18);
         display: flex; align-items: center; gap: 8px; max-width: 520px; animation: tin .2s ease-out; pointer-events: auto; }
.toast.err { background: var(--danger); } .toast.ok { background: var(--green); }
@keyframes tin { from { transform: translateY(10px); opacity: 0; } }
.modal-bg { position: fixed; inset: 0; background: rgba(43,22,56,.42); z-index: 150; display: flex; align-items: center; justify-content: center; padding: 16px; animation: fin .15s; }
@keyframes fin { from { opacity: 0; } }
.modal { background: var(--surface); border-radius: 20px; width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.wide { max-width: 760px; }
.modal-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-h h3 { margin: 0; font-size: 1.15rem; } .modal-b { padding: 18px; } .modal-f { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 18px; border-top: 1px solid var(--border); flex-wrap: wrap; }
@media (max-width: 560px) { .modal-bg { align-items: flex-end; padding: 0; } .modal { border-radius: 20px 20px 0 0; max-height: 92vh; } }

/* empty states and skeletons */
.empty { text-align: center; padding: 34px 16px; color: var(--dim); font-weight: 700; }
.empty .ic { width: 34px; height: 34px; color: var(--border); display: block; margin: 0 auto 10px; stroke-width: 1.6; }
.skel { background: linear-gradient(90deg, rgba(93,50,114,.05), rgba(93,50,114,.1), rgba(93,50,114,.05)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 10px; }
@keyframes sk { to { background-position: -200% 0; } }

/* tables */
.tw { overflow-x: auto; } table.t { width: 100%; border-collapse: collapse; font-size: .88rem; }
.t th, .t td { padding: 10px 12px; text-align: start; border-bottom: 1px solid var(--border); white-space: nowrap; }
.t th { font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); background: var(--bg); }
.t tr:last-child td { border-bottom: 0; } .t td.wrap { white-space: normal; }

/* public pages */
.nz-nav { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 22px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.nz-nav .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 1.15rem; }
.nz-nav .brand img { height: 26px; width: auto; } .nz-nav .brand .sep { width: 1px; height: 22px; background: var(--border); }
.nz-nav .links { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.nz-nav .links a { color: var(--text); text-decoration: none; font-weight: 700; font-size: .9rem; } .nz-nav .links a:hover { color: var(--accent); }
.nz-nav .links a.btn { color: #fff; } .nz-nav .links a.btn.ghost { color: var(--accent); }
@media (max-width: 760px) { .nz-nav { padding: 12px 16px; } .nz-nav .links .hm { display: none; } .nz-nav .links { gap: 10px; } }
.wrap:not(.row) { max-width: 1140px; margin: 0 auto; padding: 0 18px; }
.foot { text-align: center; padding: 28px 18px 36px; font-size: .84rem; color: var(--dim); font-weight: 600; border-top: 1px solid var(--border); margin-top: 40px; }
.foot a { color: var(--accent); font-weight: 800; text-decoration: none; margin: 0 6px; }
