/* ════════════════════════════════════════════════════════════════
   مركز الإشعارات — Notification center (bell badge + bottom sheet)
   ════════════════════════════════════════════════════════════════ */

@keyframes notifBadgePop {
    0%   { transform: scale(0); }
    70%  { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ── Notification centre (features/notifications/center.js) — same look as the
   other sheets (33-sheets.css): handle, sticky header, .btn-close-style ×, tokens. ── */
.notif-backdrop {
    position: fixed;
    inset: 0;
    background: var(--c-overlay);
    z-index: 10299;
    display: none;
    animation: notifBackdropFade var(--mo-base) var(--ease-out);
}
.notif-backdrop.active { display: block; }
@keyframes notifBackdropFade { from { opacity: 0; } to { opacity: 1; } }

.notif-sheet {
    position: fixed;
    inset-inline-end: 0; inset-inline-start: 0; bottom: 0;
    z-index: 10300;
    background: var(--c-surface);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px));
    box-shadow: var(--el-3);
    transform: translateY(100%);
    transition: transform var(--mo-slow) var(--ease-out);
    display: flex;
    flex-direction: column;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
.notif-sheet.active { transform: translateY(0); }
@media (min-width: 769px) {
    .notif-sheet { max-width: 560px; margin-inline: auto; }
}
.notif-sheet__handle {
    width: 40px;
    height: 4px;
    background: var(--c-border-strong);
    border-radius: var(--radius-pill);
    margin: 7px auto 0;
    flex-shrink: 0;
}
.notif-sheet__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--sp-2);
    padding: 8px 16px 10px;
    border-bottom: 1px solid var(--c-border);
    flex-shrink: 0;
}
.notif-sheet__title-wrap {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    min-width: 0;
}
.notif-sheet__title-wrap i { color: var(--c-text-muted); font-size: 1rem; }
.notif-sheet__title {
    font-size: var(--fs-lg);
    font-weight: 800;
    color: var(--c-text);
}
.notif-sheet__count {
    background: var(--c-surface-2);
    color: var(--c-text);
    font-size: var(--fs-xs);
    font-weight: 800;
    min-width: 22px;
    padding: 1px 8px;
    border-radius: var(--radius-pill);
    text-align: center;
}
.notif-sheet__actions {
    display: flex;
    align-items: center;
    gap: var(--sp-1);
    flex-shrink: 0;
}
.notif-sheet__clear {
    background: transparent;
    border: none;
    color: var(--c-primary);
    font-family: inherit;
    font-weight: 700;
    font-size: var(--fs-sm);
    cursor: pointer;
    min-height: var(--tap);
    padding: 0 var(--sp-2);
    border-radius: var(--radius-sm);
    -webkit-tap-highlight-color: transparent;
}
.notif-sheet__close {
    width: var(--tap);
    height: var(--tap);
    border-radius: var(--radius-pill);
    border: none;
    background: var(--c-surface-2);
    color: var(--c-text-muted);
    font-size: 1.05rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    transition: transform var(--mo-fast) var(--ease-out);
}
.notif-sheet__close:active, .notif-sheet__clear:active { transform: scale(0.97); }
.notif-sheet button:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; }

.notif-sheet__body {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: var(--sp-3) 16px 18px;
    background: var(--c-bg);
}

/* «إشعارات حتى لو التطبيق مغلق» switch row */
.notif-bg-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    margin: 0 0 var(--sp-2);
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
}
.notif-bg-toggle__text { flex: 1; min-width: 0; }
.notif-bg-toggle__title { font-weight: 700; font-size: var(--fs-md); color: var(--c-text); }
.notif-bg-toggle__sub { font-size: var(--fs-xs); color: var(--c-text-muted); line-height: 1.4; margin-top: 2px; }
.notif-bg-toggle .btn { white-space: nowrap; min-width: 72px; flex-shrink: 0; }

.notif-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--c-text-muted);
}
.notif-empty i {
    font-size: 2rem;
    color: var(--c-text-muted);
    display: block;
    margin-bottom: 12px;
}
.notif-empty p {
    font-size: var(--fs-md);
    font-weight: 800;
    color: var(--c-text);
    margin: 0 0 6px;
}
.notif-empty small {
    font-size: var(--fs-xs);
    color: var(--c-text-muted);
    line-height: 1.5;
}

/* Group heading with a small tone dot (عاجل / قريب / معلومات) */
.notif-group-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--fs-xs);
    color: var(--c-text-muted);
    font-weight: 700;
    margin: var(--sp-3) var(--sp-1) 6px;
}
.notif-group-title:first-child { margin-top: var(--sp-1); }
.notif-group-title--high::before,
.notif-group-title--medium::before,
.notif-group-title--low::before {
    content: '';
    width: 8px; height: 8px;
    border-radius: var(--radius-pill);
    flex-shrink: 0;
}
.notif-group-title--high::before   { background: var(--c-danger); }
.notif-group-title--medium::before { background: var(--c-warning); }
.notif-group-title--low::before    { background: var(--c-border-strong); }
.notif-group-title--history {
    justify-content: space-between;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px dashed var(--c-border);
}
.notif-history-clear {
    background: transparent;
    color: var(--c-text-muted);
    border: none;
    font-size: var(--fs-xs);
    font-weight: 700;
    cursor: pointer;
    min-height: var(--tap);
    padding: 0 8px;
    font-family: inherit;
}

/* One row: icon · title + body · action + ×. Urgency comes from the section heading. */
.notif-list { display: flex; flex-direction: column; gap: var(--sp-2); }
.notif-row {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    padding-block: 10px;
    padding-inline: 12px 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.notif-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--c-surface-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.notif-row__main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.notif-row__title {
    font-size: var(--fs-md);
    font-weight: 800;
    color: var(--c-text);
    line-height: var(--lh-tight);
    overflow-wrap: anywhere;
    unicode-bidi: plaintext;   
}
.notif-row__body {
    font-size: var(--fs-xs);
    color: var(--c-text-muted);
    font-weight: 600;
    line-height: 1.4;
}
.notif-row__actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}
.notif-row__cta {
    background: var(--c-primary-soft);
    color: var(--c-primary);
    border: none;
    font-family: inherit;
    font-weight: 700;
    font-size: var(--fs-xs);
    min-height: 36px;
    padding: 0 12px;
    border-radius: var(--radius-pill);
    white-space: nowrap;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform var(--mo-fast) var(--ease-out);
}
.notif-row__dismiss {
    background: transparent;
    border: none;
    color: var(--c-text-muted);
    width: var(--tap);
    height: var(--tap);
    border-radius: var(--radius-pill);
    cursor: pointer;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    transition: transform var(--mo-fast) var(--ease-out);
}
.notif-row__cta:active, .notif-row__dismiss:active { transform: scale(0.97); }
.notif-list--history .notif-row--history { background: var(--c-surface-2); }
.notif-list--history .notif-row__title { color: var(--c-text-muted); }
.notif-row__cta--ghost { background: var(--c-surface); border: 1px solid var(--c-border-strong); color: var(--c-text); }
.notif-history-empty {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 14px;
    background: var(--c-surface);
    border: 1px dashed var(--c-border-strong);
    border-radius: var(--radius-md);
    color: var(--c-text-muted);
    font-size: var(--fs-xs);
    line-height: 1.55;
}
.notif-history-empty i { color: var(--c-text-muted); font-size: 1rem; margin-top: 2px; flex-shrink: 0; }

/* When sheet is open, lock body scroll behind it */
body.notif-open { overflow: hidden; }

/* ════════════════════════════════════════════════════════════════
   BILLS PAGE — compact redesign (replaces tall hero + fat rows)
   ════════════════════════════════════════════════════════════════ */
.bills-page { padding: 0 0 8px; }
.bills-stats {
    display: flex;
    gap: 8px;
    margin: 4px 0 10px;
}
.bills-stat {
    flex: 1;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.bills-stat__label {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 600;
    line-height: 1.2;
}
.bills-stat__value {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.15;
    display: flex;
    align-items: baseline;
    gap: 4px;
}
.bills-stat__value small {
    font-size: 0.62rem;
    color: var(--text-faint);
    font-weight: 600;
}
.bills-add-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}
.bills-add-btn {
    flex: 1;
    background: var(--c-surface-2);
    border: 1px solid var(--c-border);
    color: var(--text-strong);
    min-height: var(--tap);
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 700;
    font-family: var(--font-ui);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
@media (hover: hover) and (pointer: fine) {
    .bills-add-btn:hover { background: var(--c-border); }
}
.bills-add-btn i { font-size: 0.75rem; }

.bills-list-wrap { padding: 0; }

/* Compact summary line — replaces the tall "all paid" hero */
.bills-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    background: var(--c-warning-soft);
    border: 1px solid var(--c-warning-line);
    border-radius: 12px;
    margin: 0 0 10px;
}
.bills-summary--done {
    background: var(--c-success-soft);
    border-color: var(--c-success-line);
}
.bills-summary__left {
    display: flex; align-items: center; gap: 10px;
    min-width: 0; flex: 1;
}
.bills-summary__icon {
    font-size: 1.1rem;
    width: 32px; height: 32px;
    background: var(--c-surface);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--c-warning-line);
    flex-shrink: 0;
}
.bills-summary--done .bills-summary__icon {
    background: var(--c-success); color: var(--c-on-primary);
    border-color: var(--c-success);
    font-weight: 900;
}
.bills-summary__title {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.25;
}
.bills-summary__sub {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 1px;
}
.bills-summary__progress {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.bills-summary__bar {
    width: 60px; height: 5px;
    background: var(--c-warning-soft);
    border-radius: 3px;
    overflow: hidden;
}
.bills-summary--done .bills-summary__bar { background: var(--c-success-soft); }
.bills-summary__bar span {
    display: block; height: 100%;
    background: var(--c-warning);
}
.bills-summary--done .bills-summary__bar span { background: var(--c-success); }
.bills-summary__pct {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--c-warning);
    min-width: 30px;
    text-align: end;
}
.bills-summary--done .bills-summary__pct { color: var(--success-text); }

.bills-empty {
    padding: 16px 14px;
    background: var(--c-bg);
    border: 1px dashed var(--c-border-strong);
    border-radius: 12px;
    color: var(--text-muted);
    font-size: 0.78rem;
    display: flex; align-items: center; gap: 10px;
}
.bills-empty i { color: var(--text-faint); font-size: 1rem; }

/* Dense rows — single line look on mobile */
.bills-rows {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.bills-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: 10px;
    padding: 8px 10px;
    transition: opacity var(--mo-fast) var(--ease-out);
}
.bills-row.is-paid { opacity: 0.55; background: var(--c-bg); }
.bills-row__icon {
    font-size: 1.05rem;
    width: 32px; height: 32px;
    background: var(--c-bg);
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.bills-row.is-paid .bills-row__icon {
    background: var(--c-success-soft);
}
.bills-row__main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.bills-row__name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    unicode-bidi: plaintext;   
}
.bills-row.is-paid .bills-row__name {
    text-decoration: line-through;
    text-decoration-thickness: 1.5px;
    color: var(--text-muted);
}
.bills-row__meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
}
.bills-row__amt {
    font-weight: 700;
    color: var(--text-main);
}
.bills-row.is-paid .bills-row__amt { color: var(--text-faint); }
.bills-tag {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1.4;
}
.bills-tag--neutral { background:var(--c-surface-2); color:var(--text-strong); }
.bills-tag--orange  { background:var(--c-warning-soft); color:var(--c-warning); }
.bills-tag--red     { background:var(--c-danger-soft); color:var(--c-danger); }
.bills-tag--purple  { background:var(--c-primary-soft); color:var(--st-new); }
.bills-tag--green   { background:var(--c-success-soft); color:var(--c-success); }
.bills-tag--amber   { background:var(--c-warning-soft); color:var(--c-warning); }
.bills-row__amt-orig { color:var(--text-faint); font-weight:600; font-size:0.62rem; margin-inline-start:3px; }
.bills-row__amt-tilde { color:var(--c-warning); font-weight:800; margin-inline-end:1px; }

/* ─── Section grouping (obligations on top, subscriptions below) ─── */
.bills-section { margin-bottom: 14px; }
.bills-section__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 4px 8px;
    margin-top: 4px;
}
.bills-section__title {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--text-main);
}
.bills-section__count {
    background: var(--c-surface-2);
    color: var(--text-strong);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    min-width: 22px;
    text-align: center;
}

/* Subscriptions section — distinct orange/cream tint */
.bills-section--sub .bills-section__head {
    border-top: 1px dashed var(--c-warning-line);
    margin-top: 14px;
    padding-top: 12px;
}
.bills-section--sub .bills-section__title .ico { color: var(--c-warning); }
/* Subscription rows use the same neutral card surface as the other rows. */

