/* "سجل الفواتير" — the Stitch billing screen: masthead plate with the mark,
   a two-up stat row, then one tile per payment. */
:root{--bg:#090914;--panel:#11111b;--panel2:#171724;--line:rgba(255,255,255,.09);--text:#f7f6ff;--muted:#aaa6bc;--violet:#19B47A;--violet-dark:#0E8A5C;--violet-light:#5FE0AE;--green:#4ed899}
*{box-sizing:border-box}
body{margin:0;min-height:100vh;background:var(--bg);color:var(--text);font-family:Alexandria,system-ui,sans-serif}
.topbar{width:min(760px,calc(100% - 40px));height:78px;margin:auto;display:flex;align-items:center;border-bottom:1px solid var(--line)}
.back{width:38px;height:38px;display:grid;place-items:center;margin-left:16px;border:1px solid var(--line);border-radius:50%;color:#aaa7b8;text-decoration:none}
.brand{display:flex;align-items:center;gap:9px;color:inherit;text-decoration:none;font-weight:800}
.brand span{width:33px;height:33px;display:grid;place-items:center;border-radius:10px;background:linear-gradient(135deg,var(--violet-light),var(--violet-dark))}
main{width:min(760px,calc(100% - 40px));margin:26px auto 80px;display:grid;gap:16px}

.page-hero{position:relative;overflow:hidden;display:flex;align-items:center;justify-content:space-between;gap:20px;border:1px solid var(--line);border-radius:18px;background:#181828;padding:28px 28px 30px}
.page-hero::before{content:"";position:absolute;top:-70px;inset-inline-start:-70px;width:180px;height:180px;border-radius:50%;background:rgba(25,180,122,.2);filter:blur(46px);pointer-events:none}
.page-hero>*{position:relative;z-index:1}
.kicker{display:block;color:var(--violet-light);font-size:10px;letter-spacing:.18em;text-transform:uppercase;margin-bottom:11px}
.page-hero h1{margin:0 0 8px;font-size:clamp(24px,4vw,32px);letter-spacing:-.03em}
.page-hero p{margin:0;color:var(--muted);font-size:12.5px}
.hero-mark{flex:none;width:56px;height:56px;color:var(--violet);opacity:.35;transform:rotate(12deg);transition:transform .5s}
.page-hero:hover .hero-mark{transform:rotate(0)}

.stats{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.stats article{border:1px solid var(--line);border-radius:16px;background:var(--panel);padding:20px;display:flex;flex-direction:column;gap:11px}
.stat-icon{width:40px;height:40px;display:grid;place-items:center;border-radius:11px;background:rgba(25,180,122,.14);color:var(--violet-light);font-size:16px}
.stat-icon.mint{background:rgba(78,216,153,.12);color:var(--green)}
.stats small{color:var(--muted);font-size:9.5px;letter-spacing:.1em;text-transform:uppercase}
.stats b{font-size:21px;letter-spacing:-.02em}

.state{min-height:150px;border:1px solid var(--line);border-radius:16px;background:var(--panel);display:grid;place-content:center;justify-items:center;gap:11px;text-align:center;color:var(--muted);font-size:12px;padding:26px}
.state[hidden]{display:none}
.state.danger{color:#ff9aad}
.state b{color:var(--text);font-size:14px}
.state small{font-size:11px}
.state i{width:28px;height:28px;border:3px solid #28263a;border-top-color:var(--violet);border-radius:50%;animation:spin .8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}

.invoices{display:grid;gap:10px}
.invoice{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:15px;border:1px solid var(--line);border-radius:14px;background:var(--panel);padding:16px 18px;transition:transform .25s,border-color .25s}
.invoice:hover{transform:translateY(-2px);border-color:rgba(25,180,122,.4)}
.glyph{width:42px;height:42px;display:grid;place-items:center;border-radius:11px;background:rgba(25,180,122,.12);color:var(--violet-light);font-size:16px}
.invoice-info{min-width:0}
.invoice-info b{display:block;font-size:13.5px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.invoice-info small{display:block;color:var(--muted);font-size:11px;margin-top:5px}
.invoice-amount{display:grid;justify-items:end;gap:6px;text-align:end}
.invoice-amount b{font-size:15px;letter-spacing:-.02em;white-space:nowrap}
.badge{padding:4px 10px;border-radius:999px;background:rgba(78,216,153,.12);color:var(--green);font-size:10px;font-weight:700;white-space:nowrap}
.badge.granted{background:rgba(157,143,255,.14);color:var(--violet-light)}
.badge.recurring{background:rgba(25,180,122,.16);color:var(--violet-light)}
.partial-note{margin:4px 0 0;color:#ffd47c;font-size:11px;text-align:center;line-height:1.8}

@media(max-width:560px){
  .topbar,main{width:calc(100% - 28px)}
  .page-hero{padding:22px 20px 24px}
  .hero-mark{display:none}
  .stats{grid-template-columns:1fr}
  .invoice{grid-template-columns:auto minmax(0,1fr);gap:12px}
  .invoice-amount{grid-column:2/3;justify-items:start;text-align:start;grid-auto-flow:column;align-items:center;gap:10px}
}
