/* ════════════════════════════════════════════════════════════
   لوحات الإدارة: صاحب المحل + المدير العام + صفحات الدخول
   ════════════════════════════════════════════════════════════ */
.app-top{position:sticky;top:0;z-index:10;background:rgba(237,241,240,.9);backdrop-filter:blur(8px);border-bottom:1px solid var(--line)}
.app-top__in{max-width:1080px;margin:0 auto;padding:12px 16px;display:flex;align-items:center;gap:12px}
.app-top__title{font-weight:600;color:var(--ink-2);padding-inline-start:12px;border-inline-start:1px solid var(--line);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.app-top__end{margin-inline-start:auto;display:flex;gap:8px;align-items:center}
.app-main{max-width:1080px;margin:0 auto;padding:24px 16px 64px;display:grid;gap:28px}

.sect{display:grid;gap:14px}
.sect__head{display:flex;align-items:end;justify-content:space-between;gap:12px;flex-wrap:wrap}
.sect__title{font-family:var(--display);font-weight:400;font-size:26px;line-height:1.2}
.sect__sub{color:var(--muted);font-size:14px}
.panel{background:var(--surface);border-radius:var(--r-lg);padding:20px}
.panel--flat{background:transparent;padding:0}
.grid-2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
@media (max-width:760px){.grid-2{grid-template-columns:1fr}}

/* ── أرقام اليوم */
.figures{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1px;background:var(--line);border-radius:var(--r-lg);overflow:hidden}
.figure{background:var(--surface);padding:18px 20px}
.figure__v{text-align:right;font-family:var(--display);font-weight:400;font-size:44px;line-height:1;padding-top:8px}
.figure__v small{font-family:var(--font);font-size:15px;font-weight:600;color:var(--muted);margin-inline-start:6px}
.figure__l{color:var(--muted);font-size:14px;margin-top:4px}
@media (max-width:640px){.figures{grid-template-columns:1fr}.figure{display:flex;justify-content:space-between;align-items:center}.figure__l{margin:0}}

/* ── أعمدة بسيطة */
.bars{display:grid;align-items:end;gap:4px;height:140px;padding-top:8px}
.bars--24{grid-template-columns:repeat(24,1fr)}
.bars--7{grid-template-columns:repeat(7,1fr);gap:10px}
.bars__col{display:grid;grid-template-rows:1fr auto;gap:6px;height:100%;min-width:0}
.bars__bar{align-self:end;border-radius:4px 4px 2px 2px;background:var(--ink);min-height:2px}
.bars__bar.is-zero{background:transparent}
.bars__col{border-bottom:0}
.bars{border-bottom:0}
.bars__bar.is-now{background:var(--signal)}
.bars__x{font-size:11px;color:var(--muted);text-align:center;white-space:nowrap;direction:ltr}
.bars__val{font-size:12px;font-weight:600;text-align:center}
.chart-cap{display:flex;justify-content:space-between;font-size:14px;color:var(--muted);margin-bottom:6px}

/* ── قوائم */
.rows{display:grid}
.row{display:flex;align-items:center;gap:14px;padding:14px 0;border-bottom:1px solid var(--line)}
.row:last-child{border-bottom:0}
.row__main{min-width:0;flex:1}
.row__title{font-weight:600}
.row__sub{font-size:13px;color:var(--muted)}
.empty{padding:18px;border:1.5px dashed var(--line);border-radius:var(--r-md);color:var(--muted);text-align:center;font-size:14px}

.status{display:inline-flex;align-items:center;gap:6px;padding:3px 10px;border-radius:999px;font-size:13px;font-weight:600;white-space:nowrap}
.status::before{content:"";width:7px;height:7px;border-radius:50%;background:currentColor}
.status--active{background:var(--ready-soft);color:var(--ready-deep)}
.status--pending{background:#E3E9E8;color:var(--ink-2)}
.status--soon{background:var(--signal-soft);color:#8A6100}
.status--grace{background:#FFE4CC;color:#9A4600}
.status--expired{background:var(--danger-soft);color:var(--danger)}
.status--disabled{background:#E3E9E8;color:var(--muted)}

.linkbox{display:flex;gap:8px;align-items:center;padding:10px 12px;border-radius:var(--r-md);background:var(--paper);font-size:14px;direction:ltr}
.linkbox code{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:inherit}

/* ── نافذة كود الربط */
.qrbox{display:grid;place-items:center;gap:10px;margin:16px 0;text-align:center}
.qrbox__img{width:220px;height:220px;padding:12px;background:#fff;border-radius:var(--r-md);box-shadow:inset 0 0 0 1px var(--line)}
.qrbox__img svg{width:100%;height:100%}
.qrbox__code{font-family:var(--display);font-size:36px;letter-spacing:.08em;padding-top:6px}
.qrbox__timer{font-size:13px;color:var(--muted)}
.creds{display:grid;gap:8px;margin:14px 0;padding:14px;border-radius:var(--r-md);background:var(--paper)}
.creds div{display:flex;justify-content:space-between;gap:12px}
.creds b{direction:ltr}

/* ── صفحات الدخول */
.auth{min-height:100vh;min-height:100dvh;display:grid;place-items:center;padding:24px 16px}
.auth__box{width:100%;max-width:400px}
.auth__brand{display:flex;justify-content:center;margin-bottom:22px}
.auth__card{background:var(--surface);border-radius:var(--r-lg);padding:28px 24px}
.auth__title{font-family:var(--display);font-weight:400;font-size:32px;line-height:1.2;margin-bottom:4px}
.auth__sub{color:var(--muted);margin-bottom:20px}
.auth__foot{text-align:center;margin-top:18px;font-size:14px;color:var(--muted)}

/* ── جدول المحلات (المدير) */
.table{width:100%;border-collapse:collapse;font-size:15px}
.table th{font-size:13px;font-weight:600;color:var(--muted);text-align:right;padding:0 10px 10px;border-bottom:1px solid var(--line)}
.table td{padding:14px 10px;border-bottom:1px solid var(--line);vertical-align:middle}
.table tr:last-child td{border-bottom:0}
.table .num{direction:ltr;text-align:right}
.acts{display:flex;flex-wrap:wrap;gap:6px}
.menu{position:relative}
.menu__list{position:absolute;inset-inline-end:0;top:calc(100% + 6px);z-index:20;min-width:200px;padding:6px;background:var(--surface);border-radius:var(--r-md);box-shadow:0 12px 32px rgba(15,58,64,.18)}
.menu__list button{display:block;width:100%;text-align:right;padding:10px 12px;border:0;border-radius:8px;background:none;font-weight:500}
.menu__list button:hover{background:var(--paper)}
.menu__list .is-danger{color:var(--danger)}
@media (max-width:860px){
  .table thead{display:none}
  .table,.table tbody,.table tr,.table td{display:block;width:100%}
  .table tr{padding:14px 0;border-bottom:1px solid var(--line)}
  .table td{padding:4px 0;border:0}
  .table td[data-l]::before{content:attr(data-l);display:inline-block;min-width:110px;color:var(--muted);font-size:13px}
  .table td.num{direction:rtl}
}
.bars__bar.is-zero.is-now{background:transparent}

/* ── الاشتراكات والدفعات (المدير) */
.figures--4{grid-template-columns:repeat(4,minmax(0,1fr))}
@media (max-width:900px){.figures--4{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:640px){.figures--4{grid-template-columns:1fr}}
.figure--btn{border:0;text-align:right;font:inherit;color:inherit;cursor:pointer}
.figure--btn:hover{background:#F7FAF9}
.figure--btn.has-items .figure__v{color:#9A4600}
.sect__tools{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.sect__tools .input{max-width:240px;min-height:42px}
.sect__tools .chip{min-height:38px;font-size:14px}
.row-acts{display:flex;gap:6px;justify-content:flex-end;align-items:center}
.cell-sub{font-size:13px;color:var(--muted)}
.cell-sub.is-warn{color:#9A4600;font-weight:600}
.cell-sub.is-bad{color:var(--danger);font-weight:600}
.opt-group{display:grid;gap:8px;margin-bottom:16px}
.opt-group .chip{min-height:46px}
.chip small{font-weight:500;opacity:.75;margin:0 6px}
.preview{display:flex;justify-content:space-between;gap:10px;align-items:baseline;padding:12px 14px;margin:4px 0 14px;border-radius:var(--r-md);background:var(--paper);font-size:14px}
.preview b{font-size:16px}
.pay-row{display:grid;grid-template-columns:1fr auto;gap:2px 12px;padding:12px 0;border-bottom:1px solid var(--line)}
.pay-row:last-child{border-bottom:0}
.pay-row__amt{font-weight:700;text-align:left;white-space:nowrap}
.pay-row .cell-sub{grid-column:1/-1}
.pay-sum{display:flex;justify-content:space-between;padding:12px 14px;border-radius:var(--r-md);background:var(--paper);font-size:14px;margin:10px 0 6px}
.linkbtn{border:0;background:none;padding:0;color:var(--danger);font-size:13px;font-weight:600;text-decoration:underline;text-underline-offset:3px}
.notice{padding:14px 16px;border-radius:var(--r-md);font-weight:500;display:flex;gap:12px;align-items:center;justify-content:space-between;flex-wrap:wrap}
.notice--warn{background:#FFE4CC;color:#6B3200}
.notice--bad{background:var(--danger-soft);color:var(--danger)}
.notice .btn{min-height:38px}

/* ── ربط نظام الكاشير */
.pos__intro{color:var(--muted);font-size:14px;margin-bottom:10px}
.pos__steps{margin:0 0 14px;padding-inline-start:20px;display:grid;gap:4px;color:var(--ink-2);font-size:14px;line-height:1.7}
.pos__form{display:grid;gap:12px;max-width:520px;margin-top:6px}
.pos__form .btn{justify-self:start}
.pos__err{color:#9A4600}
.figures--5{grid-template-columns:repeat(5,minmax(0,1fr))}
@media (max-width:1100px){.figures--5{grid-template-columns:repeat(2,minmax(0,1fr))}.figures--5>:last-child{grid-column:1/-1}}
@media (max-width:640px){.figures--5{grid-template-columns:1fr}}
.figure--btn.has-items#tProblemsBox .figure__v{color:var(--danger)}

/* ── سجل المشاكل (المدير) */
.log{list-style:none;margin:0;padding:0;display:grid;max-height:520px;overflow:auto}
.log--modal{max-height:60vh;margin-bottom:14px}
.log__item{padding:11px 12px 11px 0;border-bottom:1px solid var(--line);border-inline-start:3px solid transparent;padding-inline-start:12px}
.log__item:last-child{border-bottom:0}
.log__item--error{border-inline-start-color:var(--danger)}
.log__item--warn{border-inline-start-color:#E59A1C}
.log__item--info{border-inline-start-color:var(--line)}
.log__meta{display:flex;gap:10px;align-items:center;flex-wrap:wrap;font-size:12.5px;color:var(--muted)}
.log__meta b{color:var(--ink);font-weight:600}
.log__meta time{margin-inline-start:auto;direction:rtl}
.log__kind{padding:1px 8px;border-radius:99px;background:var(--paper);font-weight:600}
.log__msg{margin-top:4px;font-size:14.5px;overflow-wrap:anywhere;unicode-bidi:plaintext;text-align:start}
.link-alt{margin:6px 0 0;text-align:center}
