@charset "UTF-8";
@font-face {
    font-family: "Cairo";
    src: url("/assets/fonts/cairo-variable.ttf") format("truetype");
    font-style: normal;
    font-weight: 200 1000;
    font-display: swap;
}
:root {
    color-scheme: dark;
    --bg: #070A12;
    --surface: #101625;
    --raised: #172238;
    --line: #30405C;
    --ink: #F3F7FF;
    --muted: #A9BAD2;
    --blue: #377DFF;
    --cyan: #20D5FF;
    --violet: #9F6BFF;
    --green: #53E3A6;
    --red: #FF657A;
    --amber: #FFBE57;
    --shadow: 0 16px 48px #00000030;
    font-family: "Cairo", Tahoma, "Segoe UI", sans-serif;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.8;
    color: var(--ink);
    font-synthesis: none;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-color: var(--line) var(--bg); }
body { margin: 0; background: var(--bg); }
button, input, textarea, select { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; outline-offset: 4px; }
button, a { touch-action: manipulation; }
button { color: inherit; cursor: pointer; border: 0; }
button:disabled { cursor: not-allowed; opacity: .45; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--cyan); }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.55; font-weight: 800; }
b, strong { font-weight: 800; }
svg { flex-shrink: 0; vertical-align: middle; }
input, textarea, select {
    max-width: 100%; min-height: 48px; border: 1px solid var(--line);
    border-radius: 8px; padding: 10px 13px; background: var(--bg); color: var(--ink);
    transition: border-color .16s, box-shadow .16s;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .9; }
input:focus, select:focus, textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px #20D5FF26; outline: none; }
input[readonly] { background: var(--raised); color: var(--muted); }
input[type="number"], input[type="datetime-local"] { font-variant-numeric: tabular-nums; }
select { cursor: pointer; }
textarea { resize: vertical; min-height: 100px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -100px; right: 20px; background: var(--blue); padding: 12px 20px; z-index: 110; border-radius: 8px; }
.skip-link:focus { top: 10px; }
.icon { display: inline-block; width: 20px; height: 20px; }
.button {
    display: inline-flex; justify-content: center; align-items: center; gap: 9px;
    min-height: 48px; padding: 10px 18px; border: 1px solid transparent; border-radius: 8px;
    font-weight: 800; line-height: 1.7; white-space: nowrap;
    transition: background .16s, border-color .16s, box-shadow .16s;
}
.button-primary { color: #fff; background: var(--blue); border-color: #659BFF; box-shadow: 0 4px 18px #377DFF25; }
.button-primary:hover:not(:disabled) { background: #4B8BFF; box-shadow: 0 4px 24px #377DFF45; }
.button-secondary { background: var(--raised); border-color: var(--line); color: var(--ink); }
.button-secondary:hover:not(:disabled) { border-color: var(--cyan); background: #1D2D47; }
.button-danger { color: var(--bg); background: var(--red); border-color: #FF93A2; }
.button-danger:hover:not(:disabled) { background: #FF8596; }
.button-small { min-height: 44px; padding: 7px 12px; gap: 7px; }
.button-small .icon { width: 18px; height: 18px; }
.icon-button { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: var(--raised); color: var(--muted); flex-shrink: 0; }
.icon-button:hover { background: #20314E; border-color: var(--cyan); color: var(--cyan); }
.text-button { background: transparent; color: var(--cyan); font-weight: 800; text-decoration: underline; padding: 6px; }
.eyebrow { color: var(--cyan); font-weight: 800; margin-bottom: 6px; }
.heading-dot { color: var(--cyan); padding-right: 3px; }
.badge { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid currentColor; border-radius: 8px; font-weight: 800; padding: 4px 10px; line-height: 1.7; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.badge-active { background: #53E3A614; color: var(--green); border-color: #53E3A654; }
.badge-expiring { background: #FFBE5714; color: var(--amber); border-color: #FFBE5754; }
.badge-expired { background: #FF657A14; color: var(--red); border-color: #FF657A54; }
.badge-neutral { background: var(--raised); color: var(--muted); border-color: var(--line); }
.message { padding: 14px 16px; border-radius: 8px; display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 18px; overflow-wrap: anywhere; }
.message-error { color: #FFACB8; background: #FF657A14; border: 1px solid #FF657A66; }
.spinner { display: inline-block; width: 22px; height: 22px; border: 2px solid var(--line); border-top-color: var(--cyan); border-radius: 50%; animation: spin .7s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Administration shell */
.app-shell { min-height: 100vh; display: flex; }
.sidebar { width: 260px; position: fixed; right: 0; top: 0; bottom: 0; padding: 30px 18px 20px; background: var(--surface); border-left: 1px solid var(--line); color: var(--muted); display: flex; flex-direction: column; z-index: 10; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.brand-mark { width: 46px; height: 46px; border-radius: 10px; background: var(--blue); border: 1px solid #659BFF; color: #fff; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 0 22px #377DFF22; }
.brand-mark .icon { width: 27px; height: 27px; }
.brand b { font-size: 21px; font-weight: 900; letter-spacing: 1px; line-height: 1.4; }
.brand small { display: block; color: var(--muted); margin-top: 4px; font-size: 1rem; }
.sidebar .brand { margin: 0 4px 36px; }
.sidebar-label { color: var(--muted); padding: 0 12px; margin-bottom: 10px; }
.nav-item { display: flex; align-items: center; gap: 12px; background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 12px; font-weight: 800; text-align: right; width: 100%; min-height: 50px; margin-bottom: 8px; color: var(--muted); }
.nav-item:hover { background: var(--raised); color: var(--ink); border-color: var(--line); }
.nav-item.active { background: #377DFF20; border-color: #377DFF80; color: var(--ink); }
.nav-item.active .icon { color: var(--cyan); }
.nav-dot { width: 7px; height: 7px; background: var(--cyan); border-radius: 50%; margin-right: auto; box-shadow: 0 0 10px #20D5FF66; }
.sidebar-note { margin: auto 2px 24px; padding: 16px; background: var(--raised); border: 1px solid var(--line); border-top-color: var(--violet); border-radius: 10px; }
.small-icon { color: var(--violet); display: block; margin-bottom: 8px; }
.sidebar-note b { color: var(--ink); display: block; margin-bottom: 6px; }
.sidebar-note p { color: var(--muted); }
.sidebar-bottom { border-top: 1px solid var(--line); padding-top: 20px; display: flex; gap: 10px; align-items: center; }
.account-avatar, .header-avatar { display: flex; align-items: center; justify-content: center; width: 42px; height: 42px; border: 1px solid #9F6BFF70; border-radius: 8px; background: #9F6BFF20; color: #C7A6FF; font-weight: 800; flex-shrink: 0; }
.sidebar-bottom b, .sidebar-bottom small { display: block; }
.sidebar-bottom b { color: var(--ink); }
.sidebar-bottom small { color: var(--muted); font-size: 1rem; }
.sidebar-bottom .icon-button { margin-right: auto; }
.main-shell { margin-right: 260px; flex: 1; min-width: 0; }
.topbar { min-height: 80px; background: #101625E6; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 16px 32px; gap: 16px; }
.breadcrumb { color: var(--muted); display: flex; gap: 12px; align-items: center; }
.breadcrumb span { color: var(--line); }
.breadcrumb strong { color: var(--ink); }
.topbar-end { display: flex; align-items: center; gap: 16px; }
.timezone { color: var(--muted); }
.timezone b { margin-right: 7px; color: var(--cyan); }
.mobile-logout { display: none; }
.dashboard { max-width: 1700px; margin: 0 auto; padding: 32px 32px 24px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-heading h1 { font-size: clamp(28px, 2.5vw, 38px); }
.page-heading p { color: var(--muted); margin-top: 8px; }
.stats-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card { padding: 20px; text-align: right; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 6px 24px #00000014; transition: border-color .16s, background .16s; min-width: 0; }
.stat-card:hover { border-color: var(--cyan); background: var(--raised); }
.stat-card:nth-child(1) { border-top: 3px solid var(--blue); }
.stat-card:nth-child(2) { border-top: 3px solid var(--green); }
.stat-card:nth-child(3) { border-top: 3px solid var(--amber); }
.stat-card:nth-child(4) { border-top: 3px solid var(--red); }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); }
.stat-icon { display: flex; align-items: center; justify-content: center; border: 1px solid currentColor; border-radius: 8px; width: 38px; height: 38px; flex-shrink: 0; }
.stat-icon.neutral { background: #377DFF20; color: #85AEFF; }
.stat-icon.green { background: #53E3A618; color: var(--green); }
.stat-icon.amber { background: #FFBE5718; color: var(--amber); }
.stat-icon.red { background: #FF657A18; color: var(--red); }
.stat-card > strong { display: block; font-size: 42px; font-weight: 900; line-height: 1.5; margin-top: 12px; font-variant-numeric: tabular-nums; }
.stat-bottom { display: flex; align-items: center; gap: 7px; color: var(--muted); margin-top: 8px; }
.stat-bottom > span { margin-right: auto; color: var(--cyan); }
.dot { height: 6px; width: 6px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.green-dot { background: var(--green); }
.amber-dot { background: var(--amber); }
.red-dot { background: var(--red); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; padding: 24px; gap: 16px; }
.panel-heading h2 { font-size: 22px; display: flex; align-items: center; gap: 10px; }
.panel-heading p { color: var(--muted); margin-top: 5px; }
.count-badge { background: #377DFF20; border: 1px solid #377DFF70; color: #9DBEFF; padding: 1px 9px; border-radius: 6px; font-size: 1rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.toolbar { display: flex; gap: 12px; padding: 0 24px 20px; }
.search-field { display: flex; align-items: center; gap: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; flex: 1; min-width: 0; padding: 0 14px; min-height: 48px; }
.search-field > .icon { color: var(--cyan); }
.search-field input { padding: 9px 0; border: 0; box-shadow: none; background: transparent; width: 100%; min-width: 0; }
.search-field:focus-within { border-color: var(--cyan); box-shadow: 0 0 0 3px #20D5FF26; }
.search-shortcut { color: var(--muted); border: 1px solid var(--line); padding: 0 6px; border-radius: 4px; }
.type-filter select { min-width: 190px; }
.filter-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; padding: 0 24px 18px; border-bottom: 1px solid var(--line); gap: 16px; }
.status-filters { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.filter-button { background: var(--raised); border: 1px solid var(--line); border-radius: 8px; color: var(--muted); padding: 7px 12px; min-height: 44px; display: flex; gap: 7px; align-items: center; font-weight: 800; }
.filter-button:hover { border-color: var(--cyan); color: var(--ink); }
.filter-button.active { color: var(--cyan); background: #20D5FF14; border-color: var(--cyan); }
.filter-button span { background: #20D5FF18; border-radius: 4px; padding: 0 6px; }
.results-summary { color: var(--muted); }

/* Data stays a table on desktop, with roomy action targets. */
.table-scroll { overflow-x: auto; }
.subscribers-table { width: 100%; min-width: 1030px; border-collapse: collapse; text-align: right; }
.subscribers-table th { color: var(--muted); font-weight: 800; background: var(--raised); padding: 14px 18px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.subscribers-table td { padding: 20px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.subscribers-table tbody tr:last-child td { border-bottom: 0; }
.subscribers-table tbody tr { transition: background .16s; }
.subscribers-table tbody tr:hover { background: #17223888; }
.subscriber-cell { display: flex; align-items: center; gap: 12px; min-width: 180px; }
.subscriber-cell > div { min-width: 0; }
.subscriber-avatar { background: #377DFF20; color: #9DBEFF; border: 1px solid #377DFF70; border-radius: 8px; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; font-weight: 800; flex-shrink: 0; }
.subscriber-name { display: block; font-weight: 800; overflow-wrap: anywhere; max-width: 230px; }
.subscriber-meta { display: flex; flex-wrap: wrap; gap: 4px 9px; margin-top: 5px; direction: ltr; justify-content: flex-end; color: var(--muted); max-width: 230px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.subscriber-meta span + span::before { content: "·"; margin-right: 7px; color: var(--cyan); }
.service-name { display: flex; align-items: center; gap: 7px; color: var(--ink); font-weight: 800; }
.service-name .icon { width: 18px; height: 18px; color: var(--violet); }
.service-plan { display: block; color: var(--muted); margin-top: 5px; max-width: 230px; overflow-wrap: anywhere; }
.expiry-date { color: var(--ink); direction: ltr; display: block; text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.expiry-remaining { display: block; margin-top: 5px; color: var(--muted); }
.expiry-remaining.expired { color: var(--red); }
.expiry-remaining.expiring { color: var(--amber); }
.actions-heading { text-align: left; }
.row-actions { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.action-renew { background: #53E3A618; border: 1px solid #53E3A660; border-radius: 8px; font-weight: 800; color: var(--green); padding: 8px 12px; min-height: 44px; white-space: nowrap; }
.action-renew:hover { background: #53E3A630; border-color: var(--green); }
.row-actions .delete-action:hover { color: var(--red); background: #FF657A18; border-color: var(--red); }
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 24px; border-top: 1px solid var(--line); color: var(--muted); }
.page-size, .page-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.page-size select { min-height: 44px; padding: 5px 9px; font-variant-numeric: tabular-nums; }
.page-size > span { color: var(--muted); }
.page-controls > span { min-width: 40px; text-align: center; font-variant-numeric: tabular-nums; }
.notification-panel { display: flex; align-items: center; gap: 16px; border: 1px solid var(--line); border-right: 3px solid var(--violet); background: var(--surface); padding: 22px; border-radius: 10px; margin-top: 24px; }
.notification-symbol { height: 46px; width: 46px; background: #9F6BFF20; border: 1px solid #9F6BFF66; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: var(--violet); flex-shrink: 0; }
.notification-panel h2 { font-size: 20px; }
.notification-panel p { color: var(--muted); margin-top: 5px; }
.notification-panel .notification-hint { margin-top: 8px; }
.notification-panel > .badge { margin-right: auto; }
.dashboard-footer { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; color: var(--muted); padding-top: 26px; }
.empty-state { padding: 48px 24px; text-align: center; color: var(--muted); }
.empty-icon { width: 56px; height: 56px; margin: 0 auto 16px; background: #377DFF20; border: 1px solid #377DFF70; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: var(--cyan); }
.empty-state h3 { color: var(--ink); font-size: 21px; margin-bottom: 8px; }
.empty-state p { margin-bottom: 20px; }
.table-loading { display: flex; gap: 12px; justify-content: center; align-items: center; padding: 48px 24px; color: var(--muted); }

/* Forms and dialogs */
.body-modal-open { overflow: hidden; }
.modal { position: fixed; inset: 0; background: #02050DD9; backdrop-filter: blur(5px); display: flex; justify-content: center; align-items: center; padding: 24px; z-index: 50; overflow-y: auto; }
.modal-dialog { background: var(--surface); border: 1px solid var(--line); border-top: 2px solid var(--blue); border-radius: 12px; box-shadow: 0 30px 100px #00000080; width: 100%; max-width: 600px; max-height: calc(100dvh - 48px); overflow-y: auto; outline: none; position: relative; animation: modalEnter .16s ease; }
.modal-wide { max-width: 820px; }
.modal-compact { max-width: 560px; }
@keyframes modalEnter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 24px 28px; border-bottom: 1px solid var(--line); }
.modal-header h2 { font-size: 26px; }
.modal-header p { color: var(--muted); margin-top: 6px; overflow-wrap: anywhere; }
.modal-header .icon-button { margin-top: 4px; }
.modal-body { padding: 24px 28px; }
.modal-body > p { color: var(--muted); line-height: 1.9; margin-bottom: 20px; }
.modal-footer { display: flex; justify-content: flex-end; flex-wrap: wrap; align-items: center; gap: 12px; padding: 20px 28px; border-top: 1px solid var(--line); background: var(--raised); }
.form-section-title { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; }
.form-section-title:not(:first-of-type) { margin-top: 30px; }
.form-section-title > span:first-child { display: flex; width: 32px; height: 32px; align-items: center; justify-content: center; background: #377DFF20; color: var(--cyan); border: 1px solid #377DFF70; border-radius: 6px; font-weight: 800; }
.form-section-title h3 { font-size: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
.full-width { grid-column: 1/-1; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field label { font-weight: 800; color: var(--ink); }
.field input, .field textarea, .field select { width: 100%; line-height: 1.8; }
.field small { color: var(--muted); font-size: 1rem; }
.required { color: var(--red); }
.optional { color: var(--muted); font-weight: 600; margin-right: 5px; }
.admin-only { display: flex; align-items: center; gap: 5px; margin-right: auto; color: #C7A6FF; }
.admin-only .icon { height: 18px; width: 18px; }
.private-fields { padding: 20px; background: #9F6BFF08; border: 1px dashed #9F6BFF70; border-radius: 10px; }
.modal-body > .field { margin-top: 20px; }
.renew-summary { padding: 16px; border: 1px solid #377DFF70; background: #377DFF14; border-radius: 8px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 24px; }
.renew-summary span { color: var(--muted); }
.renew-summary strong { color: var(--cyan); direction: ltr; font-variant-numeric: tabular-nums; }
.quick-days { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; margin: 12px 0 16px; }
.quick-days button { min-height: 44px; font-weight: 800; background: var(--raised); border: 1px solid var(--line); border-radius: 8px; padding: 7px; color: var(--muted); }
.quick-days button:hover, .quick-days button.active { color: var(--cyan); background: #20D5FF14; border-color: var(--cyan); }
.modal-body > .renew-preview { color: var(--green); background: #53E3A610; border: 1px solid #53E3A650; padding: 12px 16px; border-radius: 8px; margin-bottom: 24px; }
.modal-body > .form-hint, .form-hint { color: var(--muted); line-height: 1.9; margin: 18px 0 0; display: flex; align-items: flex-start; gap: 8px; }
.form-hint .icon { color: var(--violet); margin-top: 4px; }
.danger-text { color: var(--red); }
.share-illustration { width: 60px; height: 60px; background: #377DFF20; border: 1px solid #377DFF70; color: var(--cyan); border-radius: 12px; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; }
.share-illustration .icon { width: 28px; height: 28px; }
#shareModal .modal-body > p { text-align: center; }
#shareModal .modal-body .form-hint { text-align: right; }
#shareUrl { overflow: hidden; text-overflow: ellipsis; }
.history-list { display: flex; flex-direction: column; }
.history-item { position: relative; padding: 0 28px 28px 0; border-right: 1px solid var(--line); margin-right: 8px; }
.history-item:last-child { padding-bottom: 0; border-right-color: transparent; }
.history-item::before { content: ""; position: absolute; right: -6px; top: 7px; width: 11px; height: 11px; background: var(--cyan); border: 2px solid var(--surface); border-radius: 50%; box-shadow: 0 0 0 2px #20D5FF40; }
.history-item h3 { font-size: 19px; margin-bottom: 5px; }
.history-item time { color: var(--muted); display: block; margin-bottom: 8px; direction: ltr; text-align: right; font-variant-numeric: tabular-nums; }
.history-item p { color: var(--muted); line-height: 1.9; overflow-wrap: anywhere; }
.history-item .history-amount { color: var(--green); font-weight: 800; }
.history-empty { text-align: center; color: var(--muted); padding: 32px 16px; }
.toast { position: fixed; bottom: 24px; left: 24px; display: flex; align-items: center; gap: 12px; padding: 16px; min-width: 300px; max-width: calc(100vw - 32px); border: 1px solid #53E3A670; background: var(--raised); border-radius: 10px; box-shadow: var(--shadow); z-index: 100; color: var(--ink); animation: modalEnter .2s ease; }
.toast-icon { display: flex; width: 36px; height: 36px; align-items: center; justify-content: center; background: #53E3A620; border-radius: 8px; color: var(--green); flex-shrink: 0; }
.toast > .icon-button { margin-right: auto; }
.toast.toast-error { border-color: var(--red); }
.toast.toast-error .toast-icon { background: #FF657A20; color: var(--red); }

/* Sign in */
.login-page { min-height: 100dvh; display: grid; grid-template-columns: 48% 52%; background: var(--bg); }
.login-story { background: linear-gradient(145deg,#172238,#101625 65%); color: var(--ink); padding: 44px 56px 32px; display: flex; flex-direction: column; border-left: 1px solid var(--line); position: relative; overflow: hidden; }
.login-story::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(#30405C25 1px,transparent 1px),linear-gradient(90deg,#30405C25 1px,transparent 1px); background-size: 48px 48px; mask-image: linear-gradient(transparent,#000); pointer-events: none; }
.login-story::after { content: ""; position: absolute; width: 420px; height: 420px; left: -260px; bottom: 80px; border: 1px solid #377DFF70; border-radius: 12px; transform: rotate(30deg); box-shadow: 0 0 0 42px #377DFF08,0 0 0 84px #377DFF06; pointer-events: none; }
.login-story .brand { position: relative; z-index: 1; }
.login-story-content { margin: auto 0; position: relative; z-index: 1; padding: 64px 0; }
.login-story-tag { color: var(--cyan); display: inline-block; background: #20D5FF14; border: 1px solid #20D5FF60; border-radius: 8px; padding: 5px 12px; margin-bottom: 24px; font-weight: 800; }
.login-story h1 { font-size: clamp(36px,3.6vw,56px); line-height: 1.65; font-weight: 900; }
.login-story h1 span { color: var(--cyan); }
.login-story p { max-width: 440px; color: var(--muted); line-height: 2; margin-top: 24px; }
.story-line { display: flex; align-items: center; gap: 12px; margin-top: 36px; }
.story-line span { width: 40px; height: 3px; background: var(--violet); }
.story-line small { color: #C7A6FF; letter-spacing: 1px; font-size: 1rem; }
.story-footer { color: var(--muted); position: relative; z-index: 1; }
.login-form-area { display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; padding: 64px 40px 88px; }
.login-card { width: 100%; max-width: 440px; }
.login-icon { display: flex; width: 56px; height: 56px; border: 1px solid #377DFF70; border-radius: 10px; align-items: center; justify-content: center; background: #377DFF20; color: var(--cyan); margin-bottom: 24px; }
.login-icon .icon { width: 28px; height: 28px; }
.login-card h2 { font-size: 34px; }
.login-card > p { color: var(--muted); margin-top: 8px; margin-bottom: 30px; }
.login-card form .field { margin-bottom: 22px; }
.login-card form .field input { min-height: 54px; background: var(--surface); }
.login-card form .field input::placeholder { text-align: right; }
.password-field { position: relative; }
.password-field input { padding-left: 82px; }
.password-field button { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); background: var(--raised); border: 1px solid var(--line); border-radius: 6px; color: var(--cyan); font-weight: 800; padding: 4px 10px; min-height: 38px; }
.login-submit { width: 100%; min-height: 54px; margin-top: 8px; justify-content: space-between; }
.login-security { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); padding-top: 24px; }
.login-security .icon { color: var(--green); }
.login-footer { position: absolute; bottom: 28px; color: var(--muted); }
.login-mobile-brand { display: none; }

/* Customer subscription */
.customer-page { min-height: 100dvh; background: radial-gradient(ellipse at 50% 0,#377DFF12,transparent 55%),var(--bg); padding: 0 24px 32px; }
.public-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 1120px; margin: 0 auto; padding: 28px 0; }
.public-header-label { color: var(--cyan); background: #20D5FF0D; border: 1px solid #20D5FF55; border-radius: 8px; padding: 5px 12px; font-weight: 800; }
.customer-card { max-width: 800px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); margin: 24px auto 0; overflow: hidden; }
.customer-hero { padding: 30px 34px; background: linear-gradient(115deg,#172238,#10213D); border-bottom: 1px solid var(--line); border-top: 3px solid var(--blue); }
.customer-kicker { color: var(--cyan); display: flex; align-items: center; gap: 8px; margin-bottom: 24px; }
.customer-title-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.customer-title-row > div { min-width: 0; }
.customer-title-row p { color: var(--muted); margin-bottom: 4px; }
.customer-title-row h1 { font-size: 36px; overflow-wrap: anywhere; }
.customer-title-row .badge { align-self: center; }
.customer-subtitle { color: var(--muted); margin-top: 12px; }
.customer-content { padding: 28px 34px 32px; }
.customer-plan { display: flex; align-items: center; gap: 14px; background: var(--raised); border: 1px solid var(--line); border-radius: 10px; padding: 18px; margin-bottom: 30px; }
.customer-plan > div:nth-child(2) { min-width: 0; }
.customer-plan-icon { background: #9F6BFF20; border: 1px solid #9F6BFF60; color: #C7A6FF; width: 48px; height: 48px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.customer-plan-icon .icon { width: 24px; height: 24px; }
.detail-label { display: block; color: var(--muted); margin-bottom: 5px; }
.customer-plan h2 { font-size: 21px; overflow-wrap: anywhere; }
.plan-type { margin-right: auto; align-self: center; background: #9F6BFF14; color: #C7A6FF; padding: 4px 10px; border: 1px solid #9F6BFF60; border-radius: 8px; white-space: nowrap; }
.section-label { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 18px; }
.section-label h2 { font-size: 20px; display: flex; align-items: center; gap: 8px; }
.section-label h2 .icon { color: var(--cyan); }
.section-label > span { color: var(--muted); }
.countdown { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; direction: rtl; }
.countdown > div { text-align: center; border: 1px solid #377DFF80; border-top: 3px solid var(--cyan); background: linear-gradient(#172B4B,var(--raised)); padding: 18px 8px 14px; border-radius: 10px; }
.countdown strong { font-size: 44px; font-weight: 900; color: var(--cyan); display: block; line-height: 1.4; font-variant-numeric: tabular-nums; }
.countdown span { color: var(--muted); display: block; margin-top: 6px; }
.countdown.is-expired > div { background: #FF657A0A; border-color: #FF657A60; }
.countdown.is-expired strong { color: var(--red); }
.expiry-note { text-align: center; color: var(--muted); margin-top: 18px; line-height: 2; }
.expiry-note time { color: var(--ink); direction: ltr; unicode-bidi: embed; font-weight: 800; font-variant-numeric: tabular-nums; }
.expiry-note > span { display: block; }
.customer-services { margin-top: 30px; padding-top: 26px; border-top: 1px solid var(--line); }
.service-group + .service-group { margin-top: 22px; }
.service-group > .detail-label { margin-bottom: 10px; }
.bot-list { display: flex; gap: 10px; flex-wrap: wrap; }
.bot-pill { display: inline-flex; align-items: center; gap: 10px; background: #377DFF12; border: 1px solid #377DFF60; border-radius: 8px; padding: 10px 14px; color: #C0D5FF; min-width: 0; max-width: 100%; }
.bot-pill b { font-weight: 800; overflow-wrap: anywhere; min-width: 0; }
.bot-pill .icon { color: var(--cyan); }
.api-pill { background: #9F6BFF12; border-color: #9F6BFF60; color: #D3BBFF; }
.api-pill .icon { color: var(--violet); }
.renew-callout { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px; background: #377DFF12; border: 1px solid #377DFF70; border-radius: 10px; margin-top: 32px; }
.renew-callout h2 { font-size: 20px; }
.renew-callout p { color: var(--muted); margin-top: 6px; }
.renew-callout .button { flex-shrink: 0; }
.customer-card-footer { border-top: 1px solid var(--line); padding: 18px; text-align: center; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--raised); }
.customer-card-footer .icon { color: var(--green); }
.public-footer { max-width: 800px; margin: 24px auto 0; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; color: var(--muted); }
.customer-unavailable { text-align: center; padding: 48px 36px; }
.customer-icon { width: 68px; height: 68px; border: 1px solid #9F6BFF70; border-radius: 12px; background: #9F6BFF20; color: var(--violet); display: flex; align-items: center; justify-content: center; margin: 0 auto 24px; }
.customer-icon .icon { width: 32px; height: 32px; }
.customer-unavailable h1 { font-size: 32px; }
.customer-unavailable p { line-height: 2; color: var(--muted); max-width: 500px; margin: 16px auto 26px; }

/* Adapt spacing and layout, never shrink the reading size. */
@media (max-width: 1380px) {
    .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .stat-card { padding: 18px 20px; }
    .stat-card > strong { margin-top: 6px; }
    .login-story { padding-right: 40px; padding-left: 40px; }
}
@media (max-width: 1100px) {
    .sidebar { width: 86px; padding: 24px 14px; align-items: center; }
    .sidebar .brand { margin: 0 0 30px; }
    .sidebar .brand > span:not(.brand-mark), .sidebar .brand > b, .sidebar-label, .nav-item > span, .sidebar-note, .sidebar-bottom > div, .sidebar-bottom > .account-avatar { display: none; }
    .nav-item { width: 50px; justify-content: center; padding: 12px; }
    .sidebar-bottom { margin-top: auto; width: 100%; justify-content: center; }
    .sidebar-bottom .icon-button { margin: 0; }
    .main-shell { margin-right: 86px; }
    .dashboard { padding: 28px 24px; }
    .topbar { padding-right: 24px; padding-left: 24px; }
    .notification-panel { flex-wrap: wrap; align-items: flex-start; }
    .notification-panel > div:nth-child(2) { flex: 1; min-width: 220px; }
    .login-story h1 { font-size: 36px; }
    .login-story { padding-right: 30px; padding-left: 30px; }
    .login-form-area { padding-right: 30px; padding-left: 30px; }
}
@media (max-width: 760px) {
    :root { font-size: 15px; }
    .sidebar { display: none; }
    .main-shell { margin-right: 0; }
    .topbar { min-height: 72px; padding: 12px 16px; gap: 10px; }
    .breadcrumb { gap: 8px; flex-wrap: wrap; }
    .topbar-end { gap: 10px; }
    .timezone, .header-avatar { display: none; }
    .mobile-logout { display: inline-flex; }
    .dashboard { padding: 24px 16px; }
    .page-heading { flex-wrap: wrap; align-items: flex-start; gap: 18px; margin-bottom: 24px; }
    .page-heading h1 { font-size: 28px; }
    .page-heading .button { min-height: 46px; }
    .stats-grid { gap: 12px; margin-bottom: 24px; }
    .stat-card { padding: 16px; }
    .stat-top { align-items: flex-start; gap: 7px; }
    .stat-icon { width: 32px; height: 32px; }
    .stat-icon .icon { width: 18px; height: 18px; }
    .stat-card > strong { font-size: 36px; }
    .stat-bottom { align-items: flex-start; }
    .stat-bottom .dot { margin-top: 10px; }
    .panel-heading { padding: 20px 16px; align-items: flex-start; }
    .panel-heading h2 { font-size: 21px; flex-wrap: wrap; }
    .panel-heading .button { padding: 8px 10px; }
    .panel-heading .button span { display: none; }
    .toolbar { padding: 0 16px 16px; flex-wrap: wrap; }
    .search-field { flex-basis: 100%; }
    .search-shortcut { display: none; }
    .type-filter, .type-filter select { width: 100%; }
    .filter-row { padding: 0 16px 16px; gap: 12px; }
    .status-filters { width: 100%; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
    .filter-button { justify-content: center; }
    .results-summary { width: 100%; }
    .table-scroll { overflow: visible; padding: 16px; background: var(--bg); }
    .subscribers-table { min-width: 0; display: block; }
    .subscribers-table thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
    .subscribers-table tbody { display: grid; gap: 16px; }
    .subscribers-table tr { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 0 16px; }
    .subscribers-table td { display: grid; grid-template-columns: 100px minmax(0,1fr); gap: 4px 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
    .subscribers-table td::before { color: var(--muted); font-weight: 800; grid-row: 1 / span 2; }
    .subscribers-table td:nth-child(2)::before { content: "الخدمة والباقـة"; }
    .subscribers-table td:nth-child(3)::before { content: "الحالة"; }
    .subscribers-table td:nth-child(4)::before { content: "الانتهاء"; }
    .subscribers-table td:nth-child(5)::before { content: "إجراءات"; }
    .subscribers-table td:first-child, .subscribers-table td:last-child, .subscribers-table td[colspan] { display: block; }
    .subscribers-table td:first-child::before, .subscribers-table td:last-child::before, .subscribers-table td[colspan]::before { content: none; }
    .subscribers-table td:last-child { border-bottom: 0; }
    .subscribers-table tbody tr:last-child td { border-bottom: 1px solid var(--line); }
    .subscribers-table tbody tr:last-child td:last-child { border-bottom: 0; }
    .subscribers-table td > .badge { justify-self: start; grid-column: 2; }
    .subscriber-name, .subscriber-meta, .service-plan { max-width: none; }
    .subscriber-cell { min-width: 0; }
    .subscriber-meta { justify-content: flex-end; }
    .expiry-date { white-space: normal; }
    .row-actions { justify-content: flex-start; flex-wrap: wrap; gap: 8px; }
    .action-renew { flex: 1; }
    .pagination { padding: 18px 16px; gap: 18px; }
    .page-size { width: 100%; }
    .page-controls { justify-content: space-between; width: 100%; }
    .page-controls .button { flex: 1; }
    .notification-panel { padding: 20px 16px; gap: 12px; }
    .notification-panel > div:nth-child(2) { min-width: 190px; }
    .notification-panel > .badge { margin-right: 58px; }
    .dashboard-footer { flex-direction: column; }
    .modal { padding: 12px; }
    .modal-dialog { max-height: calc(100dvh - 24px); }
    .modal-header, .modal-body { padding: 20px; }
    .modal-header h2 { font-size: 24px; }
    .modal-footer { padding: 16px 20px; }
    .form-grid { grid-template-columns: 1fr; gap: 18px; }
    .full-width { grid-column: auto; }
    .private-fields { padding: 16px; }
    .form-section-title h3 { font-size: 18px; }
    .admin-only { margin-right: 0; width: 100%; }
    .toast { bottom: 16px; left: 16px; min-width: 0; width: calc(100vw - 32px); padding: 14px; }
    .login-page { display: block; }
    .login-story { display: none; }
    .login-mobile-brand { display: flex; align-items: center; gap: 12px; align-self: flex-start; margin-bottom: 40px; }
    .login-mobile-brand b { font-size: 21px; font-weight: 900; letter-spacing: 1px; }
    .login-form-area { min-height: 100dvh; padding: 28px 24px 88px; justify-content: flex-start; }
    .login-card { max-width: 440px; margin: auto 0; padding: 12px 0 24px; }
    .login-card h2 { font-size: 30px; }
    .login-footer { bottom: 24px; }
    .customer-page { padding: 0 16px 28px; }
    .public-header { padding: 22px 0; gap: 12px; }
    .public-header .brand { gap: 9px; }
    .public-header .brand b { font-size: 18px; }
    .public-header .brand-mark { width: 40px; height: 40px; }
    .public-header-label { padding: 5px 8px; }
    .customer-card { margin-top: 12px; }
    .customer-hero { padding: 24px 20px; }
    .customer-kicker { margin-bottom: 20px; }
    .customer-title-row { flex-wrap: wrap; gap: 12px; }
    .customer-title-row h1 { font-size: 30px; }
    .customer-content { padding: 24px 20px; }
    .customer-plan { padding: 16px; gap: 12px; flex-wrap: wrap; }
    .customer-plan h2 { font-size: 20px; }
    .plan-type { margin-right: 60px; white-space: normal; }
    .section-label h2 { font-size: 20px; }
    .countdown { gap: 8px; }
    .countdown > div { padding: 16px 5px 12px; }
    .countdown strong { font-size: 32px; }
    .bot-pill { padding: 10px 12px; }
    .renew-callout { padding: 20px; flex-wrap: wrap; gap: 18px; }
    .renew-callout .button { width: 100%; justify-content: space-between; }
    .customer-card-footer { padding: 16px; }
    .public-footer { flex-direction: column; }
    .customer-unavailable { padding: 36px 24px; }
    .customer-unavailable h1 { font-size: 28px; }
}
@media (max-width: 400px) {
    .stat-top { flex-wrap: wrap-reverse; }
    .stat-top > span:first-child { width: 100%; }
    .stat-card { padding: 14px; }
    .stat-bottom { gap: 5px; }
    .countdown { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
    .countdown strong { font-size: 38px; }
    .customer-content, .customer-hero { padding-right: 18px; padding-left: 18px; }
    .quick-days { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .modal-footer > .button { flex: 1; }
    .row-actions { gap: 6px; }
    .row-actions .icon-button { width: 42px; }
    .action-renew { padding-right: 9px; padding-left: 9px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
@media print {
    :root { color-scheme: light; --bg: #fff; --surface: #fff; --raised: #F0F3F8; --ink: #101625; --muted: #30405C; --line: #A9BAD2; }
    .sidebar, .topbar, .page-heading > .button, .toolbar, .filter-row, .row-actions, .pagination, .notification-panel, .modal, .toast, .renew-callout { display: none !important; }
    .main-shell { margin: 0; }
    .dashboard { padding: 16px; }
    .subscribers-table { min-width: 0; }
    .customer-page { background: #fff; }
    .customer-card { box-shadow: none; }
}
