/* 4Sofit Web — RTL professional theme */
:root {
    --brand: #0d9488;
    --primary: #0d9488;
    --brand-dark: #0f766e;
    --brand-light: #ccfbf1;
    --brand-muted: #99f6e4;
    --bg: #f1f5f9;
    --surface: #ffffff;
    --sidebar: #0f172a;
    --sidebar-hover: #1e293b;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --danger: #dc2626;
    --success: #16a34a;
    --warning: #d97706;
    --num-neutral: #0f172a;
    --num-positive: #16a34a;
    --num-negative: #dc2626;
    --num-caution: #d97706;
    --num-brand: #0f766e;
    --num-muted: #94a3b8;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 4px 16px rgba(15, 23, 42, 0.04);
    --font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    direction: rtl;
    height: 100%;
    overflow: hidden;
}

a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Shell */
.app-shell {
    display: flex;
    height: 100vh;
    min-height: 0;
    overflow: hidden;
}

/* —— Sidebar (desktop parity) —— */
.sidebar-shell {
    position: relative;
    flex-shrink: 0;
    z-index: 400;
}

.sidebar {
    width: 196px;
    height: 100vh;
    position: sticky;
    top: 0;
    background: #0a1628;
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width 0.2s ease;
}

.sidebar-shell.is-collapsed .sidebar {
    width: 60px;
}

.sidebar-header {
    background: #081420;
    padding: 18px 10px 14px;
    flex-shrink: 0;
}

.sidebar-header-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sidebar-logo-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.sidebar-product-name {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    text-align: center;
}

.sidebar-toggle-btn {
    position: absolute;
    left: -4px;
    right: auto;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid rgba(13, 148, 136, 0.35);
    background: linear-gradient(165deg, #ffffff 0%, #f0fdfa 100%);
    color: var(--brand-dark);
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(13, 148, 136, 0.18), 0 1px 2px rgba(15, 23, 42, 0.08);
    z-index: 2;
    transition: background 0.15s, transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.sidebar-toggle-btn:hover {
    background: linear-gradient(165deg, #ccfbf1 0%, #99f6e4 100%);
    border-color: var(--brand);
    box-shadow: 0 4px 14px rgba(13, 148, 136, 0.28);
    transform: translateY(-50%) scale(1.06);
}

.sidebar-quick-actions {
    background: #081420;
    padding: 0 8px 12px;
    flex-shrink: 0;
}

.sidebar-divider {
    height: 1px;
    background: #1e3a4f;
    margin: 0 4px 8px;
    opacity: 0.75;
}

.sidebar-quick-label {
    font-size: 10px;
    font-weight: 600;
    color: #64748b;
    text-align: center;
    margin-bottom: 6px;
}

.sidebar-quick-grid {
    display: grid;
    grid-template-columns: repeat(var(--qa-cols, 3), 1fr);
    gap: 4px;
}

.sidebar-quick-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 44px;
    padding: 6px 4px;
    margin: 2px 0;
    border: 1px solid #1e3a4f;
    border-radius: 10px;
    background: #132a3d;
    color: #f1f5f9;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    font-family: inherit;
    width: 100%;
    text-decoration: none;
    box-sizing: border-box;
}

.sidebar-quick-btn:hover {
    background: var(--brand);
    border-color: var(--brand-muted);
}

.sidebar-quick-btn-label {
    line-height: 1.2;
    text-align: center;
}

.sidebar-groups {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 0 8px;
    scrollbar-width: thin;
    scrollbar-color: #1e3a4f transparent;
}

.sidebar-group-btn {
    display: flex;
    align-items: center;
    width: calc(100% - 6px);
    margin: 1px 3px 0;
    padding: 4px 5px;
    min-height: 40px;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: #fff;
    cursor: pointer;
    text-align: right;
    transition: background 0.15s;
    position: relative;
}

.sidebar-shell.is-collapsed .sidebar-group-btn {
    justify-content: center;
    padding: 4px;
}

@media (hover: hover) and (pointer: fine) {
    .sidebar-group-btn:hover {
        background: #132a3d;
    }
}

.sidebar-group-btn.is-open {
    background: #132a3d;
}

.sidebar-group-btn.is-active {
    background: rgba(13, 148, 136, 0.18);
}

.sidebar-group-label {
    flex: 1;
    font-size: 13px;
    margin: 0 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-group-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.sidebar-chevron {
    font-size: 10px;
    opacity: 0.75;
    display: inline-block;
    transition: transform 0.15s ease;
}

.sidebar-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 8px;
    background: var(--danger);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
}

.sidebar-shell.is-collapsed .sidebar-badge-dot {
    position: absolute;
    top: 4px;
    left: 4px;
    min-width: 16px;
    height: 16px;
    font-size: 8px;
}

.icon-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 9px;
    background: #132a3d;
    color: #e2e8f0;
}

.icon-badge-sm {
    width: 24px;
    height: 24px;
    border-radius: 7px;
}

.icon-badge-md {
    width: 34px;
    height: 34px;
}

.icon-badge-teal {
    background: #0f766e;
    color: #ccfbf1;
}

.icon-badge-flyout {
    background: #1e293b;
    color: #cbd5e1;
}

.sidebar-footer {
    background: #081420;
    padding: 8px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.sidebar-footer-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: calc(100% - 8px);
    min-height: 36px;
    padding: 6px 10px;
    border: 1px solid #1e3a4f;
    border-radius: 10px;
    background: #132a3d;
    color: #f1f5f9;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.sidebar-footer-btn:hover:not(:disabled) {
    background: var(--brand);
}

.sidebar-footer-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

.sidebar-footer-btn--signout:hover:not(:disabled) {
    background: rgba(185, 28, 28, 0.88);
    border-color: rgba(248, 113, 113, 0.45);
}

.sidebar-footer-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
}

.sidebar-user {
    font-size: 12px;
    color: #94a3b8;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-version-chip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: calc(100% - 8px);
    min-height: 34px;
    padding: 5px 10px;
    border-radius: 10px;
    border: 1px dashed rgba(212, 168, 83, 0.35);
    background: rgba(212, 168, 83, 0.07);
}

.sidebar-version-chip__label {
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 0.04em;
}

.sidebar-version-chip__value {
    font-size: 13px;
    font-weight: 800;
    color: #fbbf24;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.08em;
}

/* Flyout submenu */
.sidebar-flyout-backdrop {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(2, 6, 23, 0.22);
}

.sidebar-flyout {
    display: none;
    flex-direction: column;
    position: fixed;
    z-index: 310;
    min-width: 260px;
    max-width: 320px;
    max-height: min(520px, calc(100vh - 24px));
    overflow: hidden;
    background: #0a1628;
    border: 1px solid #1e293b;
    border-radius: 14px;
    padding: 10px 4px 6px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

.sidebar-flyout.is-open {
    display: flex;
}

.sidebar-flyout.is-opening {
    pointer-events: none;
    user-select: none;
}

.sidebar-flyout-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    padding: 4px 12px 10px;
    margin-bottom: 4px;
    border-bottom: 1px solid #1e293b;
}

.sidebar-flyout-close {
    margin-inline-start: auto;
    display: none;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    color: #94a3b8;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.sidebar-flyout-close__icon {
    font-size: 14px;
    line-height: 1;
}

.sidebar-flyout-close__label {
    font-size: 12px;
}

.sidebar-flyout-close:hover {
    background: rgba(13, 148, 136, 0.18);
    color: #99f6e4;
    border-color: rgba(94, 234, 212, 0.28);
}

.sidebar-flyout-title {
    font-size: 14px;
    font-weight: 700;
    color: #e2e8f0;
}

.sidebar-flyout-items {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2px 4px 8px;
    scrollbar-width: thin;
    scrollbar-color: #475569 transparent;
    position: relative;
}

.sidebar-flyout-items::-webkit-scrollbar {
    width: 5px;
}

.sidebar-flyout-items::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 4px;
}

.sidebar-flyout-items.has-scroll::after {
    content: "";
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    height: 20px;
    margin-top: -20px;
    pointer-events: none;
    background: linear-gradient(to top, #0a1628 0%, transparent 100%);
    opacity: 1;
    transition: opacity 0.15s;
}

.sidebar-flyout-items.at-bottom::after {
    opacity: 0;
}

.sidebar-flyout-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 6px 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #cbd5e1;
    cursor: pointer;
    text-align: right;
    transition: background 0.12s, color 0.12s;
    font-family: inherit;
    font-size: inherit;
    text-decoration: none;
    box-sizing: border-box;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) and (pointer: fine) {
    .sidebar-flyout-item:hover {
        background: #132a3d;
        color: #fff;
    }
}

.sidebar-flyout-item.is-active {
    background: rgba(13, 148, 136, 0.22);
    color: #5eead4;
}

.sidebar-flyout-item-label {
    flex: 1;
    font-size: 12px;
    margin: 0 10px;
}

.brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    isolation: isolate;
    transition: opacity 0.25s ease, filter 0.25s ease, transform 0.25s ease;
}

.brand-logo::before {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 14px;
    border: 2px solid rgba(94, 234, 212, 0.45);
    opacity: 0;
    transform: scale(0.92);
    pointer-events: none;
    z-index: -1;
}

.brand-logo::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.28), transparent 55%);
    pointer-events: none;
}

body[data-circuit-status="connected"] .brand-logo,
body:not([data-circuit-status]) .brand-logo {
    animation: brandLogoLive 2.8s ease-in-out infinite;
}

body[data-circuit-status="connected"] .brand-logo::before,
body:not([data-circuit-status]) .brand-logo::before {
    animation: brandLogoRing 2.8s ease-in-out infinite;
}

body[data-circuit-status="reconnecting"] .brand-logo {
    animation: brandLogoReconnect 1.05s ease-in-out infinite;
}

body[data-circuit-status="reconnecting"] .brand-logo::before {
    animation: brandLogoRingFast 1.05s ease-in-out infinite;
    border-color: rgba(251, 191, 36, 0.55);
}

body[data-circuit-status="disconnected"] .brand-logo {
    animation: none;
    opacity: 0.5;
    filter: grayscale(0.55);
}

@keyframes brandLogoLive {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(45, 212, 191, 0.28), 0 2px 10px rgba(13, 148, 136, 0.22);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 5px rgba(45, 212, 191, 0), 0 4px 16px rgba(13, 148, 136, 0.38);
        transform: scale(1.04);
    }
}

@keyframes brandLogoRing {
    0%, 100% { opacity: 0; transform: scale(0.92); }
    50% { opacity: 0.85; transform: scale(1.08); }
}

@keyframes brandLogoReconnect {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.35); }
    50% { transform: scale(1.05); box-shadow: 0 0 0 6px rgba(251, 191, 36, 0); }
}

@keyframes brandLogoRingFast {
    0%, 100% { opacity: 0.2; transform: scale(0.95); }
    50% { opacity: 0.9; transform: scale(1.12); }
}

.brand-logo.lg { width: 64px; height: 64px; font-size: 22px; border-radius: 16px; }

.main-area {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.topbar-overdue-link {
    text-decoration: none;
}

.topbar-start {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex-shrink: 0;
}

.topbar-leading {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 1 auto;
    min-width: 0;
    max-width: max-content;
}

.topbar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    width: 100%;
}

.topbar-row--actions {
    padding-top: 8px;
    margin-top: 2px;
    border-top: 1px solid rgba(226, 232, 240, 0.9);
}

.topbar-quick-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    padding: 0;
}

.topbar-quick-actions__label {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 800;
    color: #64748b;
    letter-spacing: 0.02em;
    padding: 5px 10px;
    border-radius: 8px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    white-space: nowrap;
}

.topbar-quick-actions__items {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 2px 0;
}

.topbar-quick-actions__items::-webkit-scrollbar {
    display: none;
}

.topbar-quick-actions.is-empty {
    padding: 2px 0;
}

.quick-actions-empty {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 600;
}

.topbar-quick-actions::-webkit-scrollbar {
    display: none;
}

.topbar-quick-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.1) 0%, rgba(13, 148, 136, 0.04) 100%);
    border: 1px solid rgba(13, 148, 136, 0.24);
    color: #0f766e;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    font-family: inherit;
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.12s, box-shadow 0.15s;
}

.topbar-quick-btn:hover {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-muted) 100%);
    border-color: var(--brand);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(13, 148, 136, 0.28);
}

.topbar-quick-btn__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 7px;
    background: rgba(13, 148, 136, 0.14);
    color: inherit;
}

.topbar-quick-btn:hover .topbar-quick-btn__icon {
    background: rgba(255, 255, 255, 0.2);
}

.dashboard-quick-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0;
}

.dashboard-quick-actions__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    gap: 10px;
}

.dashboard-quick-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #0f172a;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.12s, box-shadow 0.15s;
    min-height: 48px;
}

.dashboard-quick-btn:hover {
    border-color: #99f6e4;
    color: #0f766e;
    background: linear-gradient(180deg, #f0fdfa 0%, #fff 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(15, 118, 110, 0.12);
}

.dashboard-quick-btn__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(13, 148, 136, 0.12);
    color: #0f766e;
}

.quick-fab-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 1040;
    animation: fade-in 0.18s ease;
}

.quick-fab-sheet {
    position: fixed;
    inset-inline: 12px;
    bottom: calc(var(--mobile-bottom-nav-h, 62px) + 72px + var(--safe-bottom, 0px));
    z-index: 1041;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
    padding: 14px;
    animation: fab-sheet-in 0.22s ease;
}

.quick-fab-sheet__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.quick-fab-sheet__close {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
}

.quick-fab-sheet__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.quick-fab-sheet__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface-alt, #f8fafc);
    text-decoration: none;
    color: var(--text);
    font-size: 11px;
    font-weight: 700;
}

.quick-fab-sheet__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: rgba(13, 148, 136, 0.12);
    color: var(--brand);
}

.quick-fab-trigger {
    display: none;
    position: fixed;
    inset-inline-end: 16px;
    bottom: calc(var(--mobile-bottom-nav-h, 62px) + 12px + var(--safe-bottom, 0px));
    z-index: 1035;
    width: 52px;
    height: 52px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-muted) 100%);
    color: #fff;
    box-shadow: 0 8px 24px rgba(13, 148, 136, 0.42);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.quick-fab-trigger.is-open {
    transform: rotate(45deg);
}

.quick-fab-trigger__icon {
    font-size: 28px;
    line-height: 1;
    font-weight: 300;
}

@keyframes fab-sheet-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.topbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 10px 16px 10px 20px;
    min-height: 48px;
    background: #ffffff;
    border-bottom: 1px solid rgba(226, 232, 240, 0.85);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    overflow: visible;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04), 0 4px 20px rgba(15, 23, 42, 0.03);
}

.topbar-title { font-size: 15px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.topbar-clock { white-space: nowrap; }
.topbar-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
    margin: 0;
    padding: 0;
    border: none;
}

.main-area:has(.page-toolbar) .topbar-title,
.main-area:has(.list-page-shell) .topbar-title {
    visibility: hidden;
    width: 0;
    overflow: hidden;
    padding: 0;
    margin: 0;
}

.shell-status-chips {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.shell-status-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.35;
    border: 1px solid transparent;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.shell-status-chip__dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    flex-shrink: 0;
    background: currentColor;
    opacity: 0.55;
}

.shell-status-chip.is-ok .shell-status-chip__dot {
    background: #10b981;
    opacity: 1;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
}

.shell-status-chip.is-warn .shell-status-chip__dot {
    background: #f59e0b;
    opacity: 1;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25);
}

.shell-status-chip.is-bad .shell-status-chip__dot {
    background: #ef4444;
    opacity: 1;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25);
}

.shell-status-chip.is-muted .shell-status-chip__dot {
    background: #94a3b8;
    opacity: 1;
}

.shell-status-chip__label {
    color: inherit;
    opacity: 0.8;
    font-weight: 500;
}

.shell-status-chip__sep {
    opacity: 0.45;
    font-weight: 700;
}

.shell-status-chip__value {
    font-weight: 700;
}

.shell-status-chip.is-ok {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #047857;
}

.shell-status-chip.is-warn {
    background: #fffbeb;
    border-color: #fde68a;
    color: #b45309;
}

.shell-status-chip.is-bad {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.shell-status-chip.is-muted {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #64748b;
}

.version-badge {
    background: var(--brand-light);
    color: var(--brand-dark);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.page-content {
    padding: 24px 28px 16px;
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.page-content.page-enter {
    animation: pageEnter var(--duration-slow, 0.42s) cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Scroll surfaces — professional scrollbar for cards & pages ── */
.scroll-surface,
.page-scroll-area,
.add-card-body,
.list-page-shell > .page-scroll-area {
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 #f1f5f9;
    scroll-behavior: smooth;
    overscroll-behavior: contain;
}

.scroll-surface::-webkit-scrollbar,
.page-scroll-area::-webkit-scrollbar,
.add-card-body::-webkit-scrollbar,
.list-page-shell > .page-scroll-area::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.scroll-surface::-webkit-scrollbar-track,
.page-scroll-area::-webkit-scrollbar-track,
.add-card-body::-webkit-scrollbar-track,
.list-page-shell > .page-scroll-area::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 8px;
    margin: 4px 0;
}

.scroll-surface::-webkit-scrollbar-thumb,
.page-scroll-area::-webkit-scrollbar-thumb,
.add-card-body::-webkit-scrollbar-thumb,
.list-page-shell > .page-scroll-area::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #cbd5e1, #94a3b8);
    border-radius: 8px;
    border: 2px solid #f1f5f9;
}

.scroll-surface::-webkit-scrollbar-thumb:hover,
.page-scroll-area::-webkit-scrollbar-thumb:hover,
.add-card-body::-webkit-scrollbar-thumb:hover,
.list-page-shell > .page-scroll-area::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #94a3b8, #64748b);
}

/* ── Enhanced page scrollbar (subscription & long forms) ── */
.scroll-surface-pro {
    scrollbar-gutter: stable both-edges;
    scrollbar-width: auto;
    scrollbar-color: #64748b #e8eef4;
    padding-inline-end: 6px;
}

.scroll-surface-pro::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.scroll-surface-pro::-webkit-scrollbar-track {
    background: linear-gradient(180deg, #f1f5f9 0%, #e8eef4 100%);
    border-radius: 10px;
    margin: 6px 0;
    border: 1px solid #e2e8f0;
}

.scroll-surface-pro::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #94a3b8 0%, #64748b 55%, #475569 100%);
    border-radius: 10px;
    border: 2px solid #e8eef4;
    min-height: 48px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.scroll-surface-pro::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #0d9488 0%, #0f766e 55%, #115e59 100%);
    border-color: #ccfbf1;
}

.scroll-surface-pro::-webkit-scrollbar-thumb:active {
    background: linear-gradient(180deg, #115e59 0%, #134e4a 100%);
}

/* صفحات متعددة الأقسام — تمرير كامل للمحتوى (الشريط العلوي ثابت، المحتوى يمرّر) */
.page-scroll-area {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: scroll;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 12px;
}

.page-content:has(> .page-scroll-area) > .page-toolbar,
.page-content:has(> .page-scroll-area) > .page-header {
    flex-shrink: 0;
}

.page-content:has(> .page-form-stage) {
    padding: 0;
    background: linear-gradient(165deg, #eef2f7 0%, #e2e8f0 100%);
}

.page-content:has(> .page-form-stage) > .page-toolbar {
    flex-shrink: 0;
    margin: 16px 20px 0;
    border-radius: 12px;
}

.page-form-stage {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
    padding: 16px 24px 20px;
    position: relative;
    background:
        radial-gradient(ellipse 75% 55% at 50% 0%, rgba(34, 197, 94, 0.11), transparent 62%),
        radial-gradient(ellipse 50% 40% at 100% 100%, rgba(13, 148, 136, 0.07), transparent 55%);
}

.page-form-stage::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 520px 320px at 50% 45%, rgba(34, 197, 94, 0.08), transparent 70%);
    pointer-events: none;
}

.page-form-stage > * {
    position: relative;
    z-index: 1;
}

.page-form-stage > .page-float-card,
.page-form-stage > .add-card-panel.page-float-card {
    flex: 1 1 0;
    width: min(100%, 820px);
    max-width: 820px;
    min-height: 0;
    max-height: calc(100vh - 108px);
    height: calc(100vh - 108px);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 1 !important;
    transform: none !important;
    animation: cardIn 0.34s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.9) inset,
        0 4px 8px rgba(15, 23, 42, 0.05),
        0 16px 40px rgba(15, 23, 42, 0.12),
        0 32px 80px rgba(15, 23, 42, 0.18);
}

.add-card-panel.page-float-card {
    max-height: calc(100vh - 108px);
}

.page-float-card .add-card-header {
    flex-shrink: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

.add-card-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
}

.add-card-header-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-inline-start: auto;
    padding-inline-start: 12px;
}

.page-float-card-meta,
.page-float-card .form-card-header-meta {
    width: 100%;
    padding-inline-start: 66px;
}

.page-float-card .form-card-header-actions {
    margin-inline-start: 0;
}

.page-float-card .add-card-body {
    flex: 1 1 0;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 18px 24px 22px;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #22c55e #ecfdf5;
    scroll-behavior: smooth;
    overscroll-behavior: contain;
    border-top: 1px solid rgba(226, 232, 240, 0.6);
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    background: linear-gradient(180deg, #fafbfc 0%, #ffffff 8%);
}

.page-float-card .add-card-body::-webkit-scrollbar {
    width: 9px;
}

.page-float-card .add-card-body::-webkit-scrollbar-track {
    background: linear-gradient(180deg, #ecfdf5 0%, #f1f5f9 100%);
    border-radius: 10px;
    margin: 6px 2px;
    border: 1px solid rgba(34, 197, 94, 0.08);
}

.page-float-card .add-card-body::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #4ade80 0%, #22c55e 50%, #16a34a 100%);
    border-radius: 10px;
    border: 2px solid #ecfdf5;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.page-float-card .add-card-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
}

.page-float-card .add-card-body::-webkit-scrollbar-thumb:active {
    background: #15803d;
}

.page-float-card .add-card-body .form-section {
    margin-bottom: 14px;
}

.page-float-card .add-card-body .form-section:last-child {
    margin-bottom: 4px;
}

.page-float-card.form-card-pay .form-summary-strip {
    margin-top: 12px;
}

.page-float-card .add-card-footer {
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: auto;
    padding: 18px 24px;
    border-top: 1px solid #e2e8f0;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.page-float-card .add-card-footer .alert {
    flex: 1 1 100%;
    margin: 0;
}

.page-float-card .add-card-footer .form-card-footer-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-inline-start: auto;
    width: 100%;
}

.page-float-card .add-card-footer .form-card-footer-alert {
    flex: 1 1 100%;
    margin: 0 0 4px;
}

.page-float-card .add-card-footer .form-card-footer-actions .btn-form-cancel {
    min-width: 108px;
    font-weight: 600;
    color: #64748b;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    transition: border-color 0.15s, color 0.15s, background 0.15s, transform 0.12s;
}

.page-float-card .add-card-footer .btn-form-cancel:hover {
    color: #0f172a;
    border-color: #cbd5e1;
    background: #f8fafc;
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .page-form-stage {
        padding: 10px 10px 12px;
    }

    .page-form-stage > .page-float-card,
    .page-form-stage > .add-card-panel.page-float-card {
        width: 100%;
        max-width: 100%;
        flex: 1 1 0;
        min-height: 0;
        height: auto;
        max-height: none;
    }

    .add-card-panel.page-float-card {
        max-height: none;
    }
}

.page-content:has(> .page-scroll-area) > .page-scroll-area {
    flex: 1 1 0;
    min-height: 0;
}

/* صفحات القائمة — الشريط العلوي والملخص ثابت، الجدول فقط يمرّر */
.page-content:not(:has(> .page-scroll-area)) > .page-header,
.page-content:not(:has(> .page-scroll-area)) > .page-toolbar,
.page-content:not(:has(> .page-scroll-area)) > .list-page-shell,
.page-content:not(:has(> .page-scroll-area)) > .reports-center-shell,
.page-content:not(:has(> .page-scroll-area)) > .report-page-shell,
.page-content:not(:has(> .page-scroll-area)) > .loading-state,
.page-content:not(:has(> .page-scroll-area)) > .summary-row,
.page-content:not(:has(> .page-scroll-area)) > .quick-actions,
.page-content:not(:has(> .page-scroll-area)) > .alert,
.page-content:not(:has(> .page-scroll-area)) > .panel,
.page-content:not(:has(> .page-scroll-area)) > .form-panel,
.page-content:not(:has(> .page-scroll-area)) > .filter-panel {
    flex-shrink: 0;
}

.page-content:not(:has(> .page-scroll-area)) > .data-table-wrap.data-table-fill {
    flex: 1 1 0;
    min-height: 0;
    max-height: none !important;
    height: auto;
}

.page-content:not(:has(> .page-scroll-area)) > .panel:has(.data-table-fill) {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.page-content:not(:has(> .page-scroll-area)) > .panel:has(.data-table-fill) .data-table-wrap.data-table-fill {
    flex: 1 1 0;
    min-height: 0;
}

/* Login */
.login-shell {
    min-height: 100vh;
    min-height: 100dvh;
    height: 100vh;
    height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    scroll-padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #0f172a 0%, #134e4a 50%, #0d9488 100%);
    padding: 24px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
}

.login-shell::-webkit-scrollbar {
    width: 8px;
}

.login-shell::-webkit-scrollbar-track {
    background: transparent;
}

.login-shell::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.login-shell::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.42);
    background-clip: padding-box;
}

.login-card {
    width: 100%;
    max-width: 420px;
    flex-shrink: 0;
    background: var(--surface);
    border-radius: 20px;
    padding: 36px 32px;
    box-shadow: 0 24px 48px rgba(0,0,0,0.25);
}

.login-card--long-form {
    margin-top: 0;
    margin-bottom: 8px;
}

.login-brand { text-align: center; margin-bottom: 28px; }
.login-brand h1 { margin: 12px 0 4px; font-size: 28px; color: var(--text); }
.login-brand p { margin: 0; color: var(--text-muted); font-size: 14px; }
.login-hint { margin-top: 20px; text-align: center; font-size: 12px; color: var(--text-muted); }
.register-code-note { margin-bottom: 16px; font-size: 13px; line-height: 1.5; }
.register-code-note code { font-family: Consolas, monospace; font-size: 12px; }
.register-assigned-code { margin: 10px 0 0; font-size: 14px; }
.register-assigned-code__value {
    display: inline-block;
    margin-top: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(13, 148, 136, 0.12);
    font-family: Consolas, monospace;
    font-size: 18px;
    letter-spacing: 0.04em;
}
.register-assigned-code__hint { margin: 8px 0 0; font-size: 12px; color: var(--text-muted); }
.register-readonly-code {
    background: #f1f5f9;
    color: var(--text);
    font-weight: 700;
    font-family: Consolas, monospace;
    cursor: default;
}
.register-device-note { margin-bottom: 16px; }
.login-card--provisioning { max-width: 520px; }
.company-provisioning { margin: 0 0 20px; }
.company-provisioning__device {
    padding: 14px 16px;
    border-radius: 12px;
    background: var(--surface-elevated, #f8fafc);
    border: 1px solid var(--border, #e2e8f0);
    margin-bottom: 16px;
}
.company-provisioning__badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    background: #e2e8f0;
    color: var(--text-muted);
}
.company-provisioning__badge.is-ok { background: rgba(13, 148, 136, 0.15); color: #0d9488; }
.company-provisioning__badge.is-warn { background: rgba(245, 158, 11, 0.15); color: #d97706; }
.company-provisioning__badge.is-error { background: rgba(239, 68, 68, 0.12); color: #dc2626; }
.company-provisioning__hint { margin: 10px 0 0; font-size: 12px; line-height: 1.5; color: var(--text-muted); }
.company-provisioning__hint.is-ok { color: #0d9488; }
.company-provisioning__hint.is-warn { color: #d97706; }
.company-provisioning__hint.is-error { color: #dc2626; }
.company-provisioning__steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.company-provisioning__step {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border, #e2e8f0);
    background: #fff;
    font-size: 13px;
}
.company-provisioning__step.is-done {
    border-color: rgba(13, 148, 136, 0.35);
    background: rgba(13, 148, 136, 0.06);
}
.company-provisioning__step.is-ready {
    border-color: rgba(59, 130, 246, 0.35);
    background: rgba(59, 130, 246, 0.06);
}
.company-provisioning__step-num {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    background: #e2e8f0;
    color: var(--text-muted);
}
.company-provisioning__step.is-done .company-provisioning__step-num {
    background: #0d9488;
    color: #fff;
}
.company-provisioning__step.is-ready .company-provisioning__step-num {
    background: #3b82f6;
    color: #fff;
}
.company-provisioning__step strong { display: block; margin-bottom: 2px; }
.company-provisioning__step span { color: var(--text-muted); font-size: 12px; line-height: 1.45; }
.company-provisioning__step code { font-family: Consolas, monospace; font-size: 11px; }
.company-provisioning__activate { margin-top: 8px; }
.company-provisioning__activate-title {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 700;
}
.company-provisioning__wait p { margin: 8px 0 12px; font-size: 13px; line-height: 1.5; }
.login-links { margin-top: 16px; text-align: center; font-size: 13px; color: var(--text-muted); }
.login-links a { color: var(--primary); text-decoration: none; font-weight: 600; }
.login-links a:hover { text-decoration: underline; }
.login-links span { margin: 0 8px; opacity: 0.5; }

/* ── شريط "الاشتراك ساري" في صفحة الدخول ───────────────────────── */
.login-subscription-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.login-subscription-banner__title { font-weight: 800; font-size: 15px; }
.login-subscription-banner__meta { font-size: 13px; opacity: 0.92; }
.login-subscription-banner__days { font-weight: 700; }

/* الشركة المثبّتة عند تسجيل الدخول من جهاز مفعّل */
.login-locked-company {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 10px;
    background: #f8fafc;
}
.login-locked-company__name { font-weight: 700; }
.login-locked-company__code { font-family: Consolas, monospace; font-size: 12px; color: var(--text-muted); }

/* ── اختيار الخطة في تسجيل الشركة ───────────────────────────────── */
.register-plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}
.register-plan-option {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 12px 12px 36px;
    border: 1.5px solid var(--border, #e2e8f0);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color .15s, background .15s, box-shadow .15s;
}
.register-plan-option:hover { border-color: var(--primary); }
.register-plan-option input[type="radio"] {
    position: absolute;
    inset-inline-start: 12px;
    top: 14px;
}
.register-plan-option:has(input:checked) {
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary) 7%, #fff);
    box-shadow: 0 0 0 1px var(--primary) inset;
}
.register-plan-option__head { display: flex; align-items: center; gap: 8px; }
.register-plan-option__name { font-weight: 700; }
.register-plan-option__price { font-weight: 800; font-size: 15px; color: var(--primary); }
.register-plan-option__duration { font-size: 12px; color: var(--text-muted); }
.register-plan-option__badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
}

.register-exists-splash {
    max-width: min(440px, calc(100vw - 32px));
}

.register-exists-details {
    margin: 16px 0 0;
    padding: 14px 16px;
    border-radius: 14px;
    background: #fffbeb;
    border: 1px solid rgba(245, 158, 11, 0.25);
    display: grid;
    gap: 12px;
}

.register-exists-row {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 8px 12px;
    align-items: start;
}

.register-exists-row dt {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.register-exists-row dd {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    word-break: break-word;
}

.register-exists-code {
    font-family: Consolas, monospace;
    letter-spacing: 0.04em;
}

.register-exists-status {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.register-exists-status--pending {
    background: rgba(245, 158, 11, 0.15);
    color: #b45309;
}

.register-exists-status--active {
    background: rgba(22, 163, 74, 0.12);
    color: #15803d;
}

.register-exists-status--suspended {
    background: rgba(220, 38, 38, 0.1);
    color: #b91c1c;
}

.register-exists-status--expired {
    background: rgba(100, 116, 139, 0.15);
    color: #475569;
}

.register-exists-actions {
    flex-wrap: wrap;
}

.register-exists-actions .confirm-splash-btn-yes,
.register-exists-actions .confirm-splash-btn-no {
    text-decoration: none;
    text-align: center;
}

.login-card--unified {
    max-width: 480px;
}

.login-setup {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.login-setup-row {
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: #f8fafc;
}

.login-setup-row.is-ok {
    border-color: rgba(34, 197, 94, 0.28);
    background: linear-gradient(180deg, #f0fdf4 0%, #fff 100%);
}

.login-setup-row.is-warn {
    border-color: rgba(245, 158, 11, 0.32);
    background: linear-gradient(180deg, #fffbeb 0%, #fff 100%);
}

.login-setup-row.is-muted {
    border-color: var(--border);
}

.login-setup-row__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.login-setup-row__title {
    font-size: 13px;
    font-weight: 800;
    color: #0f172a;
}

.login-setup-row__badge {
    font-size: 11px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #475569;
}

.login-setup-row.is-ok .login-setup-row__badge {
    background: #dcfce7;
    color: #15803d;
}

.login-setup-row.is-warn .login-setup-row__badge {
    background: #fef3c7;
    color: #b45309;
}

.login-machine-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.login-machine-row__code {
    flex: 1;
    font-family: Consolas, monospace;
    font-size: 12px;
    font-weight: 700;
    background: #fff;
}

.login-setup-row__hint {
    margin: 10px 0 0;
    font-size: 12px;
    line-height: 1.55;
    color: var(--text-muted);
}

.login-setup-row__hint.is-ok {
    color: #15803d;
    font-weight: 600;
}

.login-company-code {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.login-company-code code {
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(13, 148, 136, 0.12);
    font-size: 16px;
    font-weight: 800;
    color: #0f766e;
}

.login-company-code__name {
    font-size: 13px;
    font-weight: 700;
    color: #334155;
}

.login-setup-details {
    margin-top: 12px;
}

.login-setup-details summary {
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 10px;
}

.login-setup-form {
    padding-top: 4px;
}

.login-signin-form {
    padding-top: 4px;
    border-top: 1px solid var(--border);
}

.login-signin-form__title {
    margin: 16px 0 14px;
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
}

.login-remember {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 4px 0 14px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-muted);
    cursor: pointer;
}

.login-remember input {
    margin-top: 3px;
    accent-color: var(--primary);
}

.login-prefs-note {
    margin: -6px 0 14px;
    font-size: 11px;
    line-height: 1.5;
    color: var(--text-muted);
}

.login-activation {
    margin-bottom: 24px;
    padding: 18px;
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 14px;
    background: rgba(245, 158, 11, 0.08);
}
.login-activation h2 {
    margin: 0 0 8px;
    font-size: 18px;
    color: var(--text);
}
.login-activation p {
    margin: 0 0 16px;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
}

.page-content:has(> .page-toolbar),
.page-content:has(> .list-page-shell),
.page-content:has(> .early-settlement-shell),
.page-content:has(> .reports-center-shell),
.page-content:has(> .report-page-shell) {
    padding-top: 12px;
}

.page-content:not(:has(> .page-scroll-area)) > .list-page-shell,
.page-content:not(:has(> .page-scroll-area)) > .early-settlement-shell,
.page-content:not(:has(> .page-scroll-area)) > .reports-center-shell,
.page-content:not(:has(> .page-scroll-area)) > .report-page-shell {
    flex: 1 1 0;
    min-height: 0;
}

.page-content:not(:has(> .page-scroll-area)) > .list-page-shell > .data-table-wrap.data-table-fill {
    flex: 1 1 0;
    min-height: 0;
    max-height: none !important;
}

/* —— WPF-style page toolbar —— */
.page-toolbar,
.page-header {
    flex-shrink: 0;
    margin-bottom: 0;
}

.page-toolbar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 12px 20px 10px;
}

.page-toolbar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 42px;
}

.page-toolbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 1 auto;
    min-width: 0;
    padding-inline-start: 2px;
}

.page-toolbar-badge {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.page-toolbar-badge-teal { background: #ecfeff; color: #0d9488; }
.page-toolbar-badge-green { background: #f0fdf4; color: #16a34a; }
.page-toolbar-badge-cyan { background: #ecfeff; color: #0891b2; }
.page-toolbar-badge-amber { background: #fffbeb; color: #d97706; }
.page-toolbar-badge-slate { background: #f1f5f9; color: #475569; }

.page-toolbar-titles {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

.page-toolbar-title,
.page-header h1 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text);
}

.page-toolbar-subtitle-inline {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.page-toolbar-tools,
.page-header-actions {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 0;
    padding-inline-end: 4px;
}

.toolbar-actions-cluster {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    max-width: 100%;
    padding: 4px;
    border-radius: 12px;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    border: 1px solid #eef2f6;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.page-toolbar-meta {
    margin-top: 6px;
    padding: 6px 10px;
    background: #f8fafc;
    border-radius: 8px;
    font-size: 12px;
    color: #64748b;
    line-height: 1.4;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    box-shadow: var(--shadow);
}

.page-header p { margin: 0; color: var(--text-muted); font-size: 13px; }

/* List page shell — card like WPF */
.list-page-shell {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.list-page-shell > .page-toolbar {
    border: none;
    border-radius: 0;
    box-shadow: none;
    border-bottom: 1px solid var(--border);
}

.list-page-shell > .data-table-wrap {
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.list-page-shell > .loading-state {
    padding: 24px;
}

.list-page-shell > .table-pager {
    flex-shrink: 0;
}

.list-page-shell > .list-page-body {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: scroll;
}

/* عرض مجمّع — سطح المكتب */
.page-content:has(.contracts-grouped-view) {
    overflow-y: auto;
    overflow-x: hidden;
}
.list-page-shell:has(.contracts-grouped-view):not(:has(> .list-page-body)) {
    overflow: visible;
    flex: 0 1 auto;
    min-height: auto;
}

.list-page-shell > .page-scroll-area {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: scroll;
    overflow-x: hidden;
    padding: 8px 12px 12px;
}

.list-page-shell > .panel.filter-panel {
    flex-shrink: 0;
    margin: 0;
    border: none;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    box-shadow: none;
    padding: 8px 14px;
}

/* Toolbar search — WPF LiveSearchBox parity */
.toolbar-search {
    --toolbar-search-width: min(320px, 100%);
    display: flex;
    align-items: center;
    gap: 0;
    width: var(--toolbar-search-width);
    min-width: 180px;
    max-width: 100%;
    flex: 1 1 240px;
    height: 42px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0 10px 0 12px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.toolbar-search.is-focused {
    border-color: var(--brand);
    border-width: 2px;
    padding: 0 9px 0 11px;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12);
}

.toolbar-search-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    flex-shrink: 0;
    margin-left: 6px;
}

.toolbar-search-input {
    flex: 1 1 auto;
    min-width: 0;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    padding: 0;
    height: 100%;
    outline: none;
}

.toolbar-search-input::placeholder {
    color: #94a3b8;
}

.toolbar-search-input::-webkit-search-cancel-button {
    display: none;
}

.toolbar-search-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
}

.toolbar-search-clear:hover {
    background: #f1f5f9;
    color: #64748b;
}

/* Toolbar buttons — WPF ToolbarBtn / ToolbarAddBtn */
.btn-toolbar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 42px;
    min-width: 108px;
    padding: 8px 14px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    white-space: nowrap;
}

.btn-toolbar:hover:not(:disabled) {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.btn-toolbar.is-active,
.btn-toolbar.btn-primary {
    background: var(--brand-light);
    border-color: var(--brand-muted);
    color: var(--brand-dark);
}

.btn-toolbar-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 42px;
    min-width: 128px;
    padding: 8px 16px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    background: linear-gradient(180deg, #0d9488 0%, #0f766e 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.28);
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
    white-space: nowrap;
}

.btn-toolbar-add:hover:not(:disabled) {
    background: linear-gradient(180deg, #0f766e 0%, #115e59 100%);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.32);
}

.btn-toolbar-add::before {
    content: "+";
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
}

.toolbar-date {
    width: auto;
    height: 42px;
    padding: 8px 12px;
    flex-shrink: 0;
}

.toolbar-select {
    width: auto;
    min-width: 148px;
    max-width: 200px;
    height: 42px;
    padding: 8px 12px;
    flex-shrink: 0;
}

.list-page-shell > .quick-actions {
    padding: 8px 14px;
    border-top: 1px solid var(--border);
    background: #fafbfc;
}

.btn-toolbar.text-danger {
    color: var(--danger);
    border-color: #fecaca;
}

.btn-toolbar.text-danger:hover:not(:disabled) {
    background: #fef2f2;
}

.btn-toolbar:disabled,
.btn-toolbar-add:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
    opacity: 0.55;
    cursor: not-allowed;
}

.search-input { min-width: 180px; }

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: clamp(12px, 2vw, 16px);
    margin-bottom: 24px;
}

.stat-card {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 14px;
    padding: 18px 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    border-right: 4px solid var(--brand);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.stat-card-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.stat-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--brand-light);
    color: var(--brand-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-primary { border-right-color: var(--brand); }
.stat-primary .stat-icon { background: var(--brand-light); color: var(--brand-dark); }
.stat-success { border-right-color: var(--success); }
.stat-success .stat-icon { background: #dcfce7; color: #166534; }
.stat-danger { border-right-color: var(--danger); }
.stat-danger .stat-icon { background: #fee2e2; color: #b91c1c; }
.stat-warning { border-right-color: var(--warning); }
.stat-warning .stat-icon { background: #fef3c7; color: #b45309; }

.stat-title { font-size: 13px; color: var(--text-muted); }
.stat-value { font-size: 22px; font-weight: 700; line-height: 1.2; color: var(--num-neutral); }
.stat-primary .stat-value { color: var(--num-brand); }
.stat-success .stat-value { color: var(--num-positive); }
.stat-danger .stat-value { color: var(--num-negative); }
.stat-warning .stat-value { color: var(--num-caution); }
.stat-sub { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

.num-neutral { color: var(--num-neutral); }
.num-positive { color: var(--num-positive); }
.num-negative { color: var(--num-negative); }
.num-caution  { color: var(--num-caution); }
.num-brand    { color: var(--num-brand); }
.num-muted    { color: var(--num-muted); }

.amount-cell.num-positive,
td.num-positive { color: var(--num-positive); }
.amount-cell.num-negative,
td.num-negative { color: var(--num-negative); }
.amount-cell.num-caution,
td.num-caution { color: var(--num-caution); }

.tabular-nums {
    font-variant-numeric: lining-nums tabular-nums;
    font-feature-settings: "lnum", "tnum";
}

.money-input,
input[type="number"] {
    font-variant-numeric: lining-nums tabular-nums;
    font-feature-settings: "lnum", "tnum";
}

.amount-cell {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    font-weight: 600;
    white-space: nowrap;
}

/* Panel */
.panel {
    background: var(--surface);
    border-radius: 14px;
    padding: 22px 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 20px;
    transition: box-shadow 0.18s ease;
}

.panel:hover {
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
}

.panel-title { margin: 0 0 16px; font-size: 17px; font-weight: 600; }

/* Data table */
.data-table-wrap {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: auto;
}

.data-table-wrap.data-table-scroll {
    overflow: auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 #f1f5f9;
}

.data-table-wrap.data-table-scroll::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.data-table-wrap.data-table-scroll::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 8px;
    margin: 4px 0;
}

.data-table-wrap.data-table-scroll::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #cbd5e1, #94a3b8);
    border-radius: 8px;
    border: 2px solid #f1f5f9;
}

.data-table-wrap.data-table-scroll::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #94a3b8, #64748b);
}

.panel .data-table-wrap {
    box-shadow: none;
    border: 1px solid var(--border);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table thead {
    background: #f8fafc;
}

.data-table-wrap.data-table-scroll .data-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f8fafc;
    box-shadow: 0 1px 0 var(--border);
}

.data-table th {
    text-align: right;
    padding: 12px 16px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.data-table tbody tr:hover { background: #f8fafc; }
.data-table tbody tr:last-child td { border-bottom: none; }

.empty-cell {
    text-align: center;
    color: var(--text-muted);
    padding: 40px !important;
}

.muted { color: var(--text-muted); }

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success { background: #dcfce7; color: #166534; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-primary { background: var(--brand-light); color: var(--brand-dark); }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-muted { background: #f1f5f9; color: #64748b; }

/* Buttons & inputs */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.15s, transform 0.1s;
}

.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover:not(:disabled) { background: #f8fafc; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }

.input {
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    background: #fff;
    color: var(--text);
    min-width: 0;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    width: 100%;
}

.input:hover:not(:disabled):not(:focus) {
    border-color: #94a3b8;
    background: #fafbfc;
}

.input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.18);
    background: #fff;
}

.input:disabled {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
}

.input-group {
    display: flex;
    align-items: stretch;
    width: 100%;
}

.money-input-group {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #cbd5e1;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.money-input-group:focus-within {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.18);
}

.money-input-group .money-input {
    border: none;
    border-radius: 0;
    box-shadow: none;
    flex: 1;
    font-variant-numeric: tabular-nums;
}

.money-input-group .money-input:focus {
    box-shadow: none;
}

.input-group-suffix {
    display: flex;
    align-items: center;
    padding: 0 12px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
    border-right: 1px solid #e2e8f0;
    white-space: nowrap;
}

.money-cell-input {
    min-width: 120px;
    max-width: 180px;
}

.money-cell-input .money-input {
    padding: 8px 10px;
    font-size: 13px;
}

.purchase-lines-wrap {
    margin-bottom: 8px;
}

.purchase-lines-table .input {
    min-width: 0;
}

.purchase-lines-table select.input {
    min-width: 140px;
}

.money-display {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    white-space: nowrap;
    font-weight: 600;
}

.money-display.num-positive { color: var(--num-positive); }
.money-display.num-negative { color: var(--num-negative); }
.money-display.num-caution  { color: var(--num-caution); }
.money-display.num-brand    { color: var(--num-brand); }
.money-display.num-muted    { color: var(--num-muted); font-weight: 500; }

.field-label {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}


.form-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-field label,
.form-field .field-label { font-size: 13px; font-weight: 600; color: #475569; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0 16px;
}

.form-grid .span-2 { grid-column: span 2; }
.form-panel { max-width: 720px; }

/* ── Professional form card (WPF-style) ── */
.page-scroll-area.form-card-host {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 2px 8px 0;
}

.page-scroll-area.form-card-host > .form-card {
    flex: 1 1 0;
    min-height: 0;
    width: 100%;
    max-width: 920px;
}

/* ── Floating form stage (contract-card parity) ── */
.page-scroll-area.form-float-stage {
    position: relative;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 32px 28px 40px;
    background:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(34, 197, 94, 0.09), transparent),
        radial-gradient(ellipse 55% 45% at 100% 100%, rgba(13, 148, 136, 0.06), transparent),
        linear-gradient(165deg, #eef2f7 0%, #e2e8f0 100%);
}

.page-scroll-area.form-float-stage::before {
    content: '';
    position: absolute;
    width: min(680px, 88%);
    height: min(440px, 62%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -52%);
    background: radial-gradient(ellipse, rgba(34, 197, 94, 0.14) 0%, transparent 68%);
    pointer-events: none;
    z-index: 0;
}

.page-scroll-area.form-float-stage > * {
    position: relative;
    z-index: 1;
}

.page-scroll-area.form-float-stage.form-card-host > .form-card,
.page-scroll-area.form-float-stage.form-card-host > .loading-state {
    flex: 0 1 auto;
    margin: auto;
}

.page-scroll-area.form-float-stage.form-card-host > .form-card {
    width: min(100%, 720px);
    max-width: 720px;
    min-height: 0;
    max-height: min(calc(100vh - 168px), 820px);
    animation: cardIn 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.form-card-float {
    border: 1px solid rgba(148, 163, 184, 0.32);
    border-radius: 18px;
    animation: none;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.85) inset,
        0 2px 4px rgba(15, 23, 42, 0.04),
        0 12px 32px rgba(15, 23, 42, 0.10),
        0 28px 72px rgba(15, 23, 42, 0.16);
}

.form-card-float.form-card-teal,
.form-card-float.form-card-green,
.form-card-float.form-card-amber {
    border-top: none;
}

.form-card-float.form-card-green {
    border-color: rgba(34, 197, 94, 0.24);
}

.form-card-float .form-card-header {
    padding: 20px 24px 18px;
    border-radius: 18px 18px 0 0;
}

.form-card-float.form-card-green .form-card-header {
    background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 42%, #ffffff 100%);
    border-bottom: 1px solid rgba(34, 197, 94, 0.14);
}

.form-card-float.form-card-teal .form-card-header {
    background: linear-gradient(135deg, #ecfeff 0%, #f0fdfa 42%, #ffffff 100%);
    border-bottom: 1px solid rgba(13, 148, 136, 0.12);
}

.form-card-float .form-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08), inset 0 0 0 1px rgba(255, 255, 255, 0.65);
}

.form-card-float .form-card-title {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.form-card-float .form-card-body {
    padding: 10px 20px 14px;
    background: #ffffff;
}

.form-card-float .form-card-footer {
    padding: 16px 24px 18px;
    border-radius: 0 0 18px 18px;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -2px 12px rgba(15, 23, 42, 0.04);
}

.form-card-float .form-section {
    background: #f8fafc;
    border: 1px solid #e8edf2;
    border-radius: 12px;
    padding: 16px 16px 14px;
    margin-bottom: 12px;
    box-shadow: none;
}

.form-card-float .form-section:last-child {
    margin-bottom: 2px;
}

.form-card-float .form-section-finance {
    background: linear-gradient(145deg, #f0fdf4 0%, #fafdfa 100%);
    border-color: #bbf7d0;
}

.form-card-float .form-card-context-chip {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(34, 197, 94, 0.2);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
}

.form-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.07), 0 1px 3px rgba(15, 23, 42, 0.04);
    overflow: hidden;
    animation: formCardIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes formCardIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.form-card-teal { border-top: 3px solid var(--brand); }
.form-card-green { border-top: 3px solid var(--success); }
.form-card-amber { border-top: 3px solid var(--warning); }

.form-card-header {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    padding: 16px 22px;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-bottom: 1px solid var(--border);
}

.form-card-teal .form-card-header {
    background: linear-gradient(135deg, #f0fdfa 0%, #ffffff 100%);
}

.form-card-header-main {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1 1 auto;
    min-width: 0;
}

.form-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--brand-light);
    color: var(--brand-dark);
    box-shadow: inset 0 0 0 1px rgba(13, 148, 136, 0.12);
}

.form-card-green .form-card-icon {
    background: #dcfce7;
    color: #166534;
}

.form-card-title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.25;
}

.form-card-subtitle {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.45;
}

.form-card-header-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.form-card-header-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    margin-inline-start: auto;
    padding-inline-start: 12px;
}

.form-card-body {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 18px 22px 8px;
}

.form-card-footer {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 22px;
    border-top: 1px solid var(--border);
    background: linear-gradient(180deg, #fafbfc 0%, #ffffff 100%);
    box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.04);
}

.form-card-footer .alert {
    flex: 1 1 100%;
    margin: 0;
}

.form-card-footer-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-inline-start: auto;
    padding-inline-start: 16px;
}

.form-card-footer-hint {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.form-card .form-section {
    background: #ffffff;
    border: 1px solid #e8edf2;
    border-radius: 14px;
    padding: 16px 18px 14px;
    margin-bottom: 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.form-card .form-section:last-child {
    margin-bottom: 4px;
}

.form-card .form-section-finance {
    background: linear-gradient(145deg, #f0fdf4 0%, #ffffff 100%);
    border-color: #bbf7d0;
}

.form-section-heading {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px dashed #e2e8f0;
}

.form-section-step {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(13, 148, 136, 0.28);
}

.form-section-finance .form-section-step {
    background: var(--success);
    box-shadow: 0 2px 6px rgba(22, 163, 74, 0.25);
}

.form-section-heading-text {
    flex: 1;
    min-width: 0;
}

.form-section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    line-height: 1.3;
}

.form-section-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 3px;
    line-height: 1.4;
}

.form-card .form-section-finance .form-section-title { color: #059669; }

.form-card .form-field {
    margin-bottom: 0;
}

.form-card .form-field label,
.form-card .form-field .field-label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    letter-spacing: 0.01em;
}

.form-card .input,
.form-card select.input,
.form-card .money-input-group {
    min-height: 42px;
    border-radius: 10px;
    border-color: #cbd5e1;
    font-size: 14px;
}

.form-card .input:focus,
.form-card select.input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.14);
}

.form-card .radio-row {
    gap: 10px;
}

.form-card .radio-chip {
    flex: 1 1 auto;
    justify-content: center;
    min-height: 42px;
    border-radius: 10px;
    font-weight: 600;
    transition: border-color 0.15s, background 0.15s, transform 0.12s;
}

.form-card .radio-chip:has(input:checked) {
    background: #f0fdfa;
    border-color: var(--brand);
    color: var(--brand-dark);
    box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.1);
}

.form-summary-strip {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 14px;
}

.form-summary-item {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-summary-item.highlight {
    background: linear-gradient(145deg, #f0fdfa, #fff);
    border-color: #99f6e4;
}

.form-summary-item .label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-summary-item .value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.form-summary-item.highlight .value {
    color: var(--brand-dark);
}

.form-card-context-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--border);
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
}

.form-card-context-chip strong {
    color: var(--brand-dark);
}

/* Sticky form actions — legacy panels */
.form-actions-sticky {
    position: sticky;
    bottom: 0;
    z-index: 4;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 14px 0 6px;
    margin-top: 8px;
    background: linear-gradient(to top, #ffffff 70%, rgba(255, 255, 255, 0.94) 88%, transparent);
}

.form-actions-sticky .alert {
    flex: 1 1 100%;
    margin-bottom: 0;
}

.form-panel-pay .form-actions-sticky {
    padding-bottom: 4px;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 14px;
}

.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }

.loading-state {
    text-align: center;
    padding: 48px;
    color: var(--text-muted);
    font-size: 15px;
}

.access-denied {
    text-align: center;
    padding: 60px 24px;
}

.access-denied h2 { margin-bottom: 8px; }

.branch-switcher {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    min-width: 0;
    padding: 4px 8px 4px 6px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.branch-switcher.is-compact {
    padding: 3px 8px 3px 6px;
}

.branch-switcher-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #0f766e;
    flex-shrink: 0;
}

.branch-switcher-field {
    flex: 0 0 auto;
    min-width: 0;
}

.branch-switcher-label {
    font-size: 11px;
    color: #64748b;
    flex-shrink: 0;
    white-space: nowrap;
    font-weight: 600;
}

.branch-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 999px;
    background: #f0fdfa;
    border: 1px solid #99f6e4;
    color: #0f766e;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.branch-badge.is-compact {
    padding: 4px 10px;
}

.branch-badge__icon {
    display: inline-flex;
    color: inherit;
}

.branch-badge__label {
    color: #64748b;
    font-weight: 600;
}

.branch-badge__value {
    color: #0f172a;
    font-weight: 800;
}

.header-sub-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid transparent;
    white-space: nowrap;
    transition: transform 0.12s, box-shadow 0.15s;
}

.header-sub-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.header-sub-chip.is-compact {
    padding: 4px 10px;
}

.header-sub-chip__dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    flex-shrink: 0;
}

.header-sub-chip.is-ok {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #047857;
}

.header-sub-chip.is-ok .header-sub-chip__dot {
    background: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
}

.header-sub-chip.is-warn {
    background: #fffbeb;
    border-color: #fde68a;
    color: #b45309;
}

.header-sub-chip.is-warn .header-sub-chip__dot {
    background: #f59e0b;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25);
}

.header-sub-chip.is-muted {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #64748b;
}

.header-sub-chip__label {
    font-weight: 600;
    opacity: 0.85;
}

.header-sub-chip__value {
    font-weight: 800;
}

.header-sub-chip__plan {
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(15, 118, 110, 0.18);
    font-size: 10px;
    font-weight: 800;
    color: inherit;
}

.header-sub-chip.is-ok .header-sub-chip__plan {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.22);
}

.dash-command-strip {
    margin-bottom: 20px;
    padding: 18px 18px 16px;
    border-radius: 16px;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.dash-command-strip__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px dashed #e2e8f0;
}

.dash-command-strip__context {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.dash-command-strip__link {
    font-size: 12px;
    font-weight: 700;
    color: #0f766e;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 999px;
    background: #f0fdfa;
    border: 1px solid #99f6e4;
}

.dash-command-strip__link:hover {
    background: #ccfbf1;
}

.dash-command-strip__actions-title {
    margin: 0;
    font-size: 12px;
    font-weight: 800;
    color: #64748b;
    letter-spacing: 0.02em;
}

.dash-command-strip__actions-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.dash-command-strip__actions .dashboard-quick-actions.is-empty {
    padding: 8px 0 0;
}

@media (max-width: 960px) {
    .topbar-row--primary {
        flex-wrap: wrap;
    }
    .topbar-meta {
        width: 100%;
        justify-content: flex-start;
    }
    .dash-command-strip__toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .dash-command-strip__link {
        text-align: center;
    }
}

@media (max-width: 640px) {
    .topbar-row--actions {
        display: none;
    }
    .dashboard-quick-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.branch-switcher .search-select,
.search-select--branch {
    width: 100%;
    max-width: none;
    min-width: 0;
}

.search-select--branch .search-select__control {
    min-height: 36px;
    border-radius: 8px;
}

.search-select--branch .search-select__icon {
    width: 28px;
    flex-shrink: 0;
}

.search-select--branch .search-select__icon svg {
    width: 14px;
    height: 14px;
}

.search-select--branch .search-select__input {
    font-size: 12px;
    font-weight: 700;
    padding: 5px 0;
    white-space: nowrap;
}

.search-select--branch .search-select__toggle {
    width: 24px;
    padding-inline-end: 5px;
    flex-shrink: 0;
}

.search-select--branch .search-select__clear {
    width: 20px;
    height: 20px;
    font-size: 10px;
    flex-shrink: 0;
}

.input-sm {
    padding: 4px 10px;
    font-size: 13px;
    min-width: 140px;
}

.radio-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.radio-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

.radio-chip:has(input:checked) {
    border-color: var(--primary);
    background: rgba(13, 148, 136, 0.08);
}

.field-hint {
    display: block;
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 13px;
}

/* ── Searchable select (combobox) ── */
.search-select {
    position: relative;
    width: 100%;
}

.search-select__control {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 44px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.search-select.is-open .search-select__control,
.search-select__control:focus-within {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.14);
}

.search-select.is-disabled .search-select__control {
    background: #f8fafc;
    opacity: 0.75;
}

.search-select__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    flex-shrink: 0;
    color: var(--text-muted);
}

.search-select__input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    padding: 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    font-family: inherit;
    outline: none;
}

.search-select__input::placeholder {
    color: #94a3b8;
    font-weight: 500;
}

.search-select__clear,
.search-select__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    flex-shrink: 0;
}

.search-select__clear {
    width: 28px;
    height: 28px;
    margin-inline-end: 2px;
    border-radius: 8px;
    font-size: 12px;
}

.search-select__clear:hover {
    background: #f1f5f9;
    color: var(--danger);
}

.search-select__toggle {
    width: 36px;
    height: 100%;
    padding-inline-end: 10px;
}

.search-select__chevron {
    display: inline-block;
    width: 0;
    height: 0;
    border-inline: 5px solid transparent;
    border-top: 6px solid currentColor;
    transition: transform 0.15s;
}

.search-select.is-open .search-select__chevron {
    transform: rotate(180deg);
}

.search-select__panel {
    position: absolute;
    inset-inline: 0;
    top: calc(100% + 6px);
    z-index: 120;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
    overflow: hidden;
    animation: search-select-in 0.16s ease;
}

@keyframes search-select-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.search-select__list {
    list-style: none;
    margin: 0;
    padding: 6px;
    max-height: min(320px, 50vh);
    overflow-y: auto;
}

.search-select__option {
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.12s;
}

.search-select__option:hover,
.search-select__option.is-highlighted {
    background: #f1f5f9;
}

.search-select__option.is-selected {
    background: rgba(13, 148, 136, 0.08);
}

.search-select__option.is-selected.is-highlighted {
    background: rgba(13, 148, 136, 0.14);
}

.search-select__option-main {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.search-select__option-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-muted);
}

.search-select__option-row {
    width: 100%;
}

.search-select__chip {
    display: inline-flex;
    padding: 2px 8px;
    border-radius: 999px;
    background: #f1f5f9;
    font-size: 11px;
    font-weight: 700;
    color: #475569;
}

.search-select__price {
    margin-inline-start: auto;
    font-weight: 700;
    color: var(--brand);
}

.search-select__empty {
    padding: 16px 14px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

.badge-xs {
    font-size: 10px;
    padding: 2px 6px;
}

.search-select--toolbar {
    min-width: 200px;
}

.search-select--toolbar .search-select__control {
    min-height: 38px;
    border-radius: 10px;
}

.search-select--toolbar .search-select__input {
    font-size: 13px;
    padding: 8px 0;
}

.search-select--compact .search-select__control {
    min-height: 38px;
    border-radius: 10px;
}

.search-select--compact .search-select__input {
    font-size: 13px;
    padding: 8px 0;
}

.search-select__option-null .search-select__option-main {
    font-weight: 600;
    color: var(--text-muted);
}

.search-select__panel {
    z-index: 1300;
}

.actions-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    white-space: nowrap;
}

.filter-panel {
    margin-bottom: 16px;
    padding: 16px;
}

.panel-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 12px;
}

/* Modal / Add Card */
.add-card-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1200;
    padding: 24px;
    opacity: 0;
    isolation: isolate;
}

.add-card-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    pointer-events: none;
}

.add-card-overlay > .add-card-panel {
    position: relative;
    z-index: 1;
    isolation: isolate;
}

.add-card-overlay.is-open {
    animation: overlayIn 0.22s ease forwards;
}

.add-card-overlay.is-open > .add-card-panel {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.add-card-overlay.is-closing {
    animation: overlayOut 0.18s ease forwards;
}

/* ── Confirm splash (حذف / تنبيه) ── */
.confirm-splash-overlay {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.52);
    backdrop-filter: blur(6px);
    opacity: 0;
}

.confirm-splash-overlay.is-open {
    animation: overlayIn 0.22s ease forwards;
}

.confirm-splash-overlay.is-closing {
    animation: overlayOut 0.18s ease forwards;
}

.confirm-splash-panel {
    width: min(100%, 420px);
    background: #ffffff;
    border-radius: 20px;
    padding: 28px 28px 24px;
    text-align: center;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.9) inset,
        0 8px 24px rgba(15, 23, 42, 0.12),
        0 32px 80px rgba(15, 23, 42, 0.22);
    opacity: 0;
    transform: translateY(16px) scale(0.96);
}

.confirm-splash-panel.is-open {
    animation: confirmSplashIn 0.32s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.confirm-splash-panel.is-closing {
    animation: confirmSplashOut 0.18s ease forwards;
}

@keyframes confirmSplashIn {
    from { opacity: 0; transform: translateY(20px) scale(0.94); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes confirmSplashOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(10px) scale(0.97); }
}

.confirm-splash-icon-wrap {
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.confirm-splash-danger .confirm-splash-icon-wrap {
    background: linear-gradient(145deg, #fee2e2 0%, #fecaca 100%);
    box-shadow: 0 8px 24px rgba(220, 38, 38, 0.18), inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.confirm-splash-warning .confirm-splash-icon-wrap {
    background: linear-gradient(145deg, #fef3c7 0%, #fde68a 100%);
    box-shadow: 0 8px 24px rgba(217, 119, 6, 0.16), inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.confirm-splash-primary .confirm-splash-icon-wrap {
    background: linear-gradient(145deg, #ccfbf1 0%, #99f6e4 100%);
    box-shadow: 0 8px 24px rgba(13, 148, 136, 0.16), inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.confirm-splash-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.confirm-splash-danger .confirm-splash-icon { color: #b91c1c; }
.confirm-splash-warning .confirm-splash-icon { color: #b45309; }
.confirm-splash-primary .confirm-splash-icon { color: #0f766e; }

.confirm-splash-title {
    margin: 0 0 10px;
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
}

.confirm-splash-body {
    margin-bottom: 22px;
}

.confirm-splash-message {
    margin: 0 0 8px;
    font-size: 15px;
    line-height: 1.55;
    color: #334155;
}

.confirm-splash-detail {
    margin: 0;
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
}

.confirm-splash-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.confirm-splash-btn-no,
.confirm-splash-btn-yes {
    min-width: 128px;
    min-height: 44px;
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.12s, box-shadow 0.15s, background 0.15s, border-color 0.15s;
}

.confirm-splash-btn-no {
    background: #ffffff;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.confirm-splash-btn-no:hover:not(:disabled) {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.confirm-splash-btn-yes {
    border: none;
    color: #ffffff;
}

.confirm-splash-danger .confirm-splash-btn-yes {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.35);
}

.confirm-splash-danger .confirm-splash-btn-yes:hover:not(:disabled) {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(220, 38, 38, 0.4);
}

.confirm-splash-warning .confirm-splash-btn-yes {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 4px 14px rgba(217, 119, 6, 0.32);
}

.confirm-splash-warning .confirm-splash-btn-yes:hover:not(:disabled) {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    transform: translateY(-1px);
}

.confirm-splash-primary .confirm-splash-btn-yes {
    background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
    box-shadow: 0 4px 14px rgba(13, 148, 136, 0.32);
}

.confirm-splash-primary .confirm-splash-btn-yes:hover:not(:disabled) {
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
    transform: translateY(-1px);
}

.confirm-splash-btn-yes:disabled,
.confirm-splash-btn-no:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

/* ── Modal form cards — unified professional input cards ── */
.add-card-panel.modal-form-card {
    max-height: min(92vh, 860px);
    min-height: min(420px, 88vh);
    height: auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.92) inset,
        0 4px 8px rgba(15, 23, 42, 0.05),
        0 16px 40px rgba(15, 23, 42, 0.12),
        0 32px 80px rgba(15, 23, 42, 0.18);
}

.add-card-panel.modal-form-card .add-card-header {
    flex-shrink: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
}

.add-card-panel.modal-form-card .add-card-body {
    flex: 1 1 auto;
    min-height: 200px;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 18px 24px 22px;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 #f1f5f9;
    scroll-behavior: smooth;
    overscroll-behavior: contain;
    border-top: 1px solid rgba(226, 232, 240, 0.65);
    border-bottom: 1px solid rgba(226, 232, 240, 0.65);
    background: linear-gradient(180deg, #fafbfc 0%, #ffffff 10%);
}

.add-card-panel.modal-form-card .add-card-footer {
    flex-shrink: 0;
    padding: 18px 24px;
    border-top: 1px solid #e2e8f0;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.add-card-panel.modal-form-card .add-card-footer .form-card-footer-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-inline-start: auto;
}

.add-card-header-amber .add-card-icon {
    background: #fffbeb;
    color: #d97706;
    box-shadow: inset 0 0 0 1px rgba(217, 119, 6, 0.14);
}

.add-card-header-green .add-card-icon {
    background: #f0fdf4;
    color: #16a34a;
    box-shadow: inset 0 0 0 1px rgba(22, 163, 74, 0.14);
}

.add-card-header-teal .add-card-icon {
    background: #ecfeff;
    color: #0891b2;
    box-shadow: inset 0 0 0 1px rgba(8, 145, 178, 0.12);
}

/* Form sections inside any add-card / float body */
.add-card-body .form-section,
.page-float-card .add-card-body .form-section {
    background: #ffffff;
    border: 1px solid #e8edf2;
    border-radius: 14px;
    padding: 16px 18px 14px;
    margin-bottom: 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.add-card-body .form-section:last-child,
.page-float-card .add-card-body .form-section:last-child {
    margin-bottom: 4px;
}

.add-card-body .form-section-finance,
.page-float-card .add-card-body .form-section-finance {
    background: linear-gradient(145deg, #f0fdf4 0%, #ffffff 100%);
    border-color: #bbf7d0;
}

.add-card-body .form-section-guarantor,
.add-card-body .form-section-warning,
.page-float-card .add-card-body .form-section-guarantor,
.page-float-card .add-card-body .form-section-warning {
    background: linear-gradient(145deg, #fffbeb 0%, #ffffff 100%);
    border-color: #fde68a;
}

.add-card-body .form-section .form-field,
.page-float-card .add-card-body .form-section .form-field {
    margin-bottom: 12px;
}

.add-card-body .form-section .form-field:last-child,
.page-float-card .add-card-body .form-section .form-field:last-child {
    margin-bottom: 0;
}

/* Contract float card — teal scroll (parity with payment green) */
.page-float-card.form-card-contract .add-card-body {
    scrollbar-color: #0d9488 #ecfeff;
}

.page-float-card.form-card-contract .add-card-body::-webkit-scrollbar-track {
    background: linear-gradient(180deg, #ecfeff 0%, #f0fdfa 100%);
    border-color: rgba(13, 148, 136, 0.1);
}

.page-float-card.form-card-contract .add-card-body::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #2dd4bf 0%, #0d9488 50%, #0f766e 100%);
    border-color: #ecfeff;
}

.page-float-card.form-card-contract .add-card-header {
    background: linear-gradient(135deg, #ecfeff 0%, #f0fdfa 42%, #ffffff 100%);
}

.page-float-card.form-card-contract .add-card-icon {
    background: #ecfeff;
    color: #0891b2;
}

/* Expense modal — amber accent scroll */
.add-card-panel.modal-form-card:has(.add-card-header-amber) .add-card-body {
    scrollbar-color: #d97706 #fffbeb;
}

.add-card-panel.modal-form-card:has(.add-card-header-amber) .add-card-body::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #fbbf24 0%, #d97706 100%);
    border-color: #fffbeb;
}

.add-card-panel {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 520px;
    max-height: min(90vh, 820px);
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.22);
    opacity: 0;
    transform: translateY(16px) scale(0.98);
}

.add-card-panel.is-open {
    animation: cardIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.add-card-panel.is-closing {
    animation: cardOut 0.18s ease forwards;
}

.add-card-lg { max-width: 720px; }
.add-card-xl { max-width: 820px; }

.add-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 24px;
    border-radius: 16px 16px 0 0;
    border-bottom: 1px solid #e2e8f0;
}

.add-card-header-teal {
    background: linear-gradient(135deg, #ecfeff 0%, #ffffff 100%);
}

.add-card-header-green {
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
}

.add-card-header-amber {
    background: linear-gradient(135deg, #fffbeb 0%, #ffffff 100%);
}

.add-card-header-slate {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
}

.add-card-header-main {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.add-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: #ecfeff;
    color: #0891b2;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(8, 145, 178, 0.12);
}

.add-card-header-text h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
}

.add-card-header-text p {
    margin: 4px 0 0;
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
}

.add-card-close {
    width: 36px;
    height: 36px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    color: #64748b;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s, transform 0.15s;
}

.add-card-close:hover {
    background: #f1f5f9;
    color: #0f172a;
    transform: scale(1.05);
}

.add-card-body {
    padding: 16px 24px 20px;
    overflow-y: auto;
    flex: 1 1 0;
    min-height: 0;
}

.add-card-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    background: #fafbfc;
    border-radius: 0 0 16px 16px;
}

/* Legacy form-section base — cards use .add-card-body / .form-card rules above */

.field-hint {
    font-size: 11px;
    color: var(--brand-dark);
    margin-top: 4px;
}

.input-readonly {
    background: #fff;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 10px 12px;
    font-weight: 600;
    color: #334155;
}

.textarea {
    min-height: 72px;
    resize: vertical;
    font-family: inherit;
}

.stock-alert {
    margin-top: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.5;
}

.stock-alert.is-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #78350f;
}

.stock-alert.is-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.kpi-preview-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 14px;
}

@media (max-width: 720px) {
    .kpi-preview-grid { grid-template-columns: repeat(2, 1fr); }
}

.kpi-preview-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.kpi-preview-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.kpi-preview-card.highlight .kpi-value { color: var(--brand-dark); }
.kpi-preview-card.success .kpi-value { color: var(--success); }

.kpi-label {
    font-size: 10px;
    color: #64748b;
}

.kpi-value {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}

.btn-form-save {
    min-width: 140px;
    box-shadow: 0 4px 14px rgba(13, 148, 136, 0.25);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-form-save:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(13, 148, 136, 0.32);
}

.btn-form-cancel {
    min-width: 100px;
}

/* Legacy modal class aliases */
.modal-overlay { /* unused — kept for compat */ }
.modal-panel { /* unused */ }

/* Page & UI animations */
@keyframes pageEnter {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes overlayIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes overlayOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(20px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes cardOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(12px) scale(0.98); }
}

.stats-grid .stat-card,
.summary-chip,
.panel {
    animation: fadeUp 0.4s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.stats-grid .stat-card:nth-child(1) { animation-delay: 0.03s; }
.stats-grid .stat-card:nth-child(2) { animation-delay: 0.06s; }
.stats-grid .stat-card:nth-child(3) { animation-delay: 0.09s; }
.stats-grid .stat-card:nth-child(4) { animation-delay: 0.12s; }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* loading pulse moved to ux-motion.css */

/* POS */
.pos-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 16px;
    align-items: start;
}

@media (max-width: 960px) {
    .pos-layout { grid-template-columns: 1fr; }
}

.pos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-top: 12px;
    max-height: 480px;
    overflow-y: auto;
}

.pos-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    cursor: pointer;
    text-align: right;
    transition: border-color 0.15s;
}

.pos-card:hover { border-color: var(--primary); }

.qty-input { width: 72px; }

.crm-notes {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 240px;
    overflow-y: auto;
}

.crm-notes li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.text-danger { color: var(--danger); }

/* Trend chart */
.trend-bars {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    padding: 16px 0 8px;
    min-height: 160px;
}

.trend-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.trend-bar {
    width: 100%;
    max-width: 48px;
    min-height: 4px;
    background: linear-gradient(to top, var(--brand-dark), var(--brand));
    border-radius: 6px 6px 0 0;
    transition: height 0.3s;
}

.trend-label { font-size: 12px; color: var(--text-muted); }
.trend-value { font-size: 11px; font-weight: 600; color: var(--brand-dark); }

/* Calendar */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.calendar-head {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 8px 4px;
}

.calendar-cell {
    aspect-ratio: 1;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px;
    cursor: pointer;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 13px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.calendar-cell:hover { border-color: var(--brand); }
.calendar-cell.other-month { opacity: 0.4; }
.calendar-cell.today { border-color: var(--brand); background: var(--brand-light); }
.calendar-cell.selected { box-shadow: 0 0 0 2px var(--brand); }
.calendar-cell.has-due { background: #fff7ed; }
.calendar-cell.has-overdue { background: #fef2f2; }
.calendar-cell .day-num { font-weight: 700; }
.calendar-cell .day-meta { font-size: 10px; color: var(--text-muted); }

.calendar-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.calendar-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.calendar-stat-chip {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 13px;
}

/* Filter bar */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
    margin-bottom: 16px;
}

.filter-bar .form-field { margin-bottom: 0; }

/* Summary cards inline */
.summary-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.summary-chip {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    text-align: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    border-right: 3px solid #cbd5e1;
}

.summary-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.summary-chip .label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.summary-chip .value { font-size: 18px; font-weight: 700; margin-top: 4px; color: var(--num-neutral); }
.summary-chip.chip-success .value { color: var(--num-positive); }
.summary-chip.chip-danger .value { color: var(--num-negative); }
.summary-chip.chip-warning .value { color: var(--num-caution); }
.summary-chip.chip-primary .value { color: var(--num-brand); }
.summary-chip .chip-sub { font-size: 11px; color: #94a3b8; margin-top: 4px; }

.chip-primary { border-right-color: var(--brand); }
.chip-success { border-right-color: var(--success); }
.chip-danger { border-right-color: var(--danger); }
.chip-warning { border-right-color: var(--warning); }

/* Global search palette (Ctrl+K) */
.search-palette-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 3000;
    backdrop-filter: blur(2px);
}

.search-palette {
    position: fixed;
    top: 12vh;
    left: 50%;
    transform: translateX(-50%);
    width: min(640px, calc(100vw - 24px));
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.22);
    z-index: 3001;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.search-palette-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
}

.search-palette-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    font-family: inherit;
}

.search-palette-hint {
    font-size: 0.72rem;
    color: #94a3b8;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 2px 6px;
}

.search-palette-list {
    list-style: none;
    margin: 0;
    padding: 6px;
    max-height: 360px;
    overflow-y: auto;
}

.search-palette-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
}

.search-palette-item.selected,
.search-palette-item:hover {
    background: #f0fdfa;
}

.search-cat {
    font-size: 0.72rem;
    color: #0f766e;
    font-weight: 700;
}

.search-sub {
    font-size: 0.82rem;
    color: #64748b;
}

.search-palette-empty {
    padding: 24px;
    text-align: center;
    color: #64748b;
}

.search-palette-footer {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 14px;
    font-size: 0.75rem;
    color: #94a3b8;
    border-top: 1px solid #f1f5f9;
    background: #fafbfc;
}

.search-palette-footer kbd {
    font-size: 0.7rem;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 1px 4px;
    background: #fff;
}

.search-shortcut-btn {
    min-width: 36px;
    padding: 6px 10px;
    font-size: 1rem;
}

/* ── Blazor Server connection status ── */
.blazor-connection-banner {
    position: fixed;
    top: 0;
    inset-inline: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.12);
    animation: connectionBannerIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.js-circuit-banner.is-visible {
    display: flex;
}

@keyframes connectionBannerIn {
    from { opacity: 0; transform: translateY(-100%); }
    to { opacity: 1; transform: translateY(0); }
}

.blazor-connection-banner.is-reconnecting {
    background: linear-gradient(90deg, #fef3c7, #fde68a);
    color: #92400e;
    border-bottom: 1px solid #fcd34d;
}

.blazor-connection-banner.is-disconnected {
    background: linear-gradient(90deg, #fee2e2, #fecaca);
    color: #991b1b;
    border-bottom: 1px solid #fca5a5;
}

.blazor-connection-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    background: currentColor;
}

.is-reconnecting .blazor-connection-dot {
    animation: connectionPulse 1.2s ease-in-out infinite;
}

@keyframes connectionPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.45; transform: scale(0.85); }
}

.blazor-connection-reload {
    border: 1px solid currentColor;
    background: rgba(255, 255, 255, 0.65);
    color: inherit;
    border-radius: 8px;
    padding: 4px 12px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.blazor-connection-reload:hover {
    background: #fff;
}

.page-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 12px;
    color: #64748b;
}

.page-breadcrumbs-link {
    color: #0f766e;
    text-decoration: none;
    font-weight: 600;
}

.page-breadcrumbs-link:hover {
    text-decoration: underline;
}

.page-breadcrumbs-sep {
    color: #cbd5e1;
    user-select: none;
}

.page-breadcrumbs-current {
    color: #334155;
    font-weight: 700;
}

/* Phase C — dashboard prefs + gateway monitor */
.dash-prefs-panel {
    margin: 0 0 12px;
    padding: 12px 16px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f0fdfa, #ecfeff);
    border: 1px solid #99f6e4;
}

.dash-prefs-title {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 700;
    color: #0f766e;
}

.dash-prefs-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.dash-prefs-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #cbd5e1;
    font-size: 12px;
    cursor: pointer;
}

.dash-live-dot {
    color: #16a34a;
    font-size: 10px;
}

.gateway-monitor-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.gateway-kpi {
    padding: 12px 14px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.gateway-kpi-label {
    display: block;
    font-size: 11px;
    color: #64748b;
    margin-bottom: 4px;
}

.gateway-kpi-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
}

.gateway-kpi-value.is-ok { color: #15803d; }
.gateway-kpi-value.is-warn { color: #b45309; }
.gateway-kpi-value.is-bad { color: #b91c1c; }

.gateway-monitor-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.gateway-chip {
    border: 1px solid #cbd5e1;
    background: #fff;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    color: #334155;
}

.gateway-chip.is-active {
    background: #0f766e;
    border-color: #0f766e;
    color: #fff;
}

.gateway-payload-snippet {
    max-height: 160px;
    overflow: auto;
    padding: 10px;
    border-radius: 8px;
    background: #0f172a;
    color: #e2e8f0;
    font-size: 11px;
    direction: ltr;
    text-align: left;
}

.gateway-detail-row td {
    background: #f8fafc;
}

/* Platform License Center */
.platform-page { max-width: 1440px; margin-inline: auto; }
.platform-kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.platform-kpi { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-radius: 14px; background: #fff; border: 1px solid #e2e8f0; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04); min-height: 88px; transition: box-shadow 0.2s ease, transform 0.2s ease; }
.platform-kpi:hover { box-shadow: 0 6px 20px rgba(15, 23, 42, 0.07); transform: translateY(-1px); }
.platform-kpi__content { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.platform-kpi__label { font-size: 12px; font-weight: 600; color: #64748b; }
.platform-kpi__value { font-size: 1.75rem; font-weight: 800; line-height: 1.1; color: #0f172a; }
.platform-kpi__sub { font-size: 10px; color: #94a3b8; margin-top: 2px; }
.platform-kpi__icon { width: 42px; height: 42px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.platform-kpi--success .platform-kpi__icon { background: #dcfce7; color: #15803d; }
.platform-kpi--success .platform-kpi__value { color: #15803d; }
.platform-kpi--amber .platform-kpi__icon { background: #fef3c7; color: #b45309; }
.platform-kpi--amber .platform-kpi__value { color: #b45309; }
.platform-kpi--rose .platform-kpi__icon { background: #ffe4e6; color: #e11d48; }
.platform-kpi--rose .platform-kpi__value { color: #e11d48; }
.platform-kpi--slate .platform-kpi__icon { background: #f1f5f9; color: #475569; }
.platform-workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); gap: 18px; align-items: start; }
.platform-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.platform-panel { background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 20px 22px; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04); }
.platform-panel__head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.platform-panel__head--toolbar { flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.platform-panel__icon { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, #ccfbf1, #99f6e4); color: #0f766e; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.platform-panel__title { margin: 0; font-size: 1rem; font-weight: 700; color: #0f172a; }
.platform-panel__sub { margin: 4px 0 0; font-size: 12px; color: #64748b; line-height: 1.45; }
.platform-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.platform-panel__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.platform-code-box { margin-top: 16px; padding: 14px 16px; border-radius: 12px; background: linear-gradient(145deg, #0f172a, #1e293b); color: #e2e8f0; }
.platform-code-label { display: block; font-size: 11px; color: #94a3b8; margin-bottom: 6px; }
.platform-code-value { display: block; font-size: 0.95rem; font-weight: 700; word-break: break-all; letter-spacing: 0.02em; }
.platform-code-hint { margin: 8px 0 0; font-size: 11px; color: #94a3b8; }
.platform-code-tag { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: #f1f5f9; color: #334155; }
.platform-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.platform-search { min-width: 160px; flex: 1; max-width: 240px; }
.platform-filter { min-width: 130px; }
.platform-flash { margin: 0; }
.platform-table-desktop { display: block; }
.platform-tenant-cards { display: none; }
.platform-aside { position: sticky; top: 12px; min-width: 0; }
.platform-aside-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 280px; padding: 24px; text-align: center; background: #f8fafc; border: 2px dashed #e2e8f0; border-radius: 16px; color: #94a3b8; }
.platform-aside-empty p { margin: 0; font-size: 13px; line-height: 1.6; }
.platform-panel--detail .platform-detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 10px; }
.platform-aside-close { border: none; background: #f1f5f9; color: #64748b; width: 28px; height: 28px; border-radius: 8px; cursor: pointer; font-size: 14px; flex-shrink: 0; }
.platform-aside-close:hover { background: #e2e8f0; }
.platform-detail-dl { display: grid; gap: 8px; margin: 14px 0; padding: 0; }
.platform-detail-dl > div { display: grid; grid-template-columns: 72px 1fr; gap: 8px; font-size: 13px; }
.platform-detail-dl dt { color: #94a3b8; font-weight: 500; }
.platform-detail-dl dd { margin: 0; color: #334155; font-weight: 600; word-break: break-word; }
.platform-detail-quotas { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.platform-tenant-card { display: block; width: 100%; text-align: inherit; padding: 14px 16px; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s; }
.platform-tenant-card:hover { border-color: #99f6e4; box-shadow: 0 4px 12px rgba(15, 118, 110, 0.08); }
.platform-tenant-card.is-selected { border-color: #0f766e; box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.15); }
.platform-tenant-card__top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.platform-tenant-card__top code { font-size: 11px; padding: 2px 6px; background: #f1f5f9; border-radius: 4px; }
.platform-tenant-card__meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.platform-tenant-card__stats { display: flex; gap: 16px; font-size: 12px; color: #64748b; }
.btn-table.is-active { background: #0f766e; color: #fff; border-color: #0f766e; }
@media (max-width: 1200px) { .platform-kpi-row { grid-template-columns: repeat(2, 1fr); } .platform-workspace { grid-template-columns: 1fr; } .platform-aside { position: static; } .platform-aside:not(.is-open) .platform-aside-empty { min-height: 120px; } }
@media (max-width: 768px) { .platform-kpi-row { grid-template-columns: repeat(2, 1fr); gap: 10px; } .platform-kpi { padding: 12px 14px; min-height: 76px; } .platform-kpi__value { font-size: 1.4rem; } .platform-kpi__icon { width: 36px; height: 36px; } .platform-kpi__sub { display: none; } .platform-panel { padding: 16px; border-radius: 14px; } .platform-panel__head--toolbar { flex-direction: column; align-items: stretch; } .platform-toolbar { width: 100%; } .platform-search { max-width: none; flex: 1 1 100%; } .platform-filter { flex: 1; } .platform-form-grid { grid-template-columns: 1fr; } .platform-form-grid .span-2 { grid-column: span 1; } .platform-table-desktop { display: none; } .platform-tenant-cards { display: flex; flex-direction: column; gap: 10px; } .platform-aside-empty { display: none; } .platform-aside:not(.is-open) { display: none; } }
@media (max-width: 480px) { .platform-kpi-row { grid-template-columns: 1fr 1fr; gap: 8px; } .platform-kpi { flex-direction: column-reverse; align-items: flex-start; min-height: auto; padding: 12px; } .platform-kpi__value { font-size: 1.25rem; } }

.quota-bar-wrap { display: flex; flex-direction: column; gap: 6px; }
.quota-bar-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.quota-bar-label { font-weight: 600; color: #334155; }
.quota-bar-count { font-weight: 700; color: #0f172a; }
.quota-bar-track { height: 8px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.quota-bar-fill { height: 100%; border-radius: 999px; transition: width 0.35s ease; }
.quota-bar-fill.is-ok { background: linear-gradient(90deg, #0d9488, #14b8a6); }
.quota-bar-fill.is-warn { background: linear-gradient(90deg, #d97706, #f59e0b); }
.quota-bar-fill.is-full { background: linear-gradient(90deg, #dc2626, #ef4444); }
.quota-bar-hint { font-size: 11px; color: #64748b; }
.list-quota-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 16px; padding: 12px 16px; border-radius: 12px; background: #f8fafc; border: 1px solid #e2e8f0; }
.quota-inline { flex: 1; min-width: 200px; }

/* Responsive data list + mobile cards */
.responsive-data-list__mobile { display: none; }
.list-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 14px 16px; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05); }
.list-card--danger { border-right: 4px solid #dc2626; }
.list-card--warning { border-right: 4px solid #f59e0b; }
.list-card--success { border-right: 4px solid #16a34a; }
.list-card--brand { border-right: 4px solid #0f766e; }
.list-card--selected { box-shadow: 0 0 0 2px #99f6e4; background: #f0fdfa; }
.list-card__badge-row { display: flex; align-items: center; gap: 8px; }
.list-card__select { display: inline-flex; align-items: center; cursor: pointer; }
.list-card__select input { width: 18px; height: 18px; accent-color: #0f766e; cursor: pointer; }
.list-card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.list-card__titles { min-width: 0; flex: 1; }
.list-card__title { margin: 0; font-size: 15px; font-weight: 700; color: #0f172a; line-height: 1.35; }
.list-card__subtitle { margin: 4px 0 0; font-size: 12px; color: #64748b; }
.list-card__badge { flex-shrink: 0; }
.list-card__meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin: 0 0 12px; padding: 0; }
.list-card-meta-item { display: contents; }
.list-card-meta-item dt { font-size: 10px; font-weight: 600; color: #94a3b8; }
.list-card-meta-item dd { margin: 0; font-size: 13px; font-weight: 600; color: #334155; }
.list-card__highlight { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 12px 14px; margin-bottom: 12px; border-radius: 10px; background: linear-gradient(135deg, #fef2f2 0%, #fff7ed 100%); border: 1px solid #fecaca; }
.list-card__highlight-label { font-size: 12px; font-weight: 600; color: #64748b; }
.list-card__highlight-value { font-size: 1.25rem !important; font-weight: 800 !important; }
.list-card__footer { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.list-card__actions { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; min-width: 0; }
.list-card__btn-primary { flex: 1; min-width: 120px; min-height: 42px; justify-content: center; }
.row-actions-menu { position: relative; flex-shrink: 0; }
.row-actions-menu__trigger { list-style: none; display: inline-flex; align-items: center; justify-content: center; min-width: 42px; min-height: 42px; padding: 0 12px; border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; color: #475569; font-size: 18px; font-weight: 700; cursor: pointer; user-select: none; }
.row-actions-menu__trigger::-webkit-details-marker { display: none; }
.row-actions-menu[open] .row-actions-menu__trigger { background: #f0fdfa; border-color: #99f6e4; color: #0f766e; }
.row-actions-menu__panel { position: absolute; inset-inline-end: 0; bottom: calc(100% + 6px); min-width: 180px; padding: 6px; border-radius: 12px; background: #fff; border: 1px solid #e2e8f0; box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14); z-index: 50; }
.row-actions-menu__item { display: block; width: 100%; text-align: inherit; padding: 10px 12px; border: none; border-radius: 8px; background: transparent; color: #334155; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none; font-family: inherit; }
.row-actions-menu__item:hover { background: #f0fdfa; color: #0f766e; }
.row-actions-menu__item--danger { color: #b91c1c; }
.row-actions-menu__item--danger:hover { background: #fef2f2; color: #991b1b; }

/* ── Subscription page ── */
.subscription-page-scroll {
    max-width: 1180px;
    width: 100%;
    margin-inline: auto;
    padding-bottom: 48px;
}

.subscription-page-scroll .form-card {
    flex: none;
    min-height: auto;
    height: auto;
    max-width: none;
    overflow: visible;
}

.subscription-page-scroll .form-card-body {
    flex: none;
    min-height: auto;
    overflow: visible;
    padding: 20px 24px 24px;
}

.subscription-page-scroll .form-card-header {
    padding: 18px 24px;
}

.subscription-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-bottom: 8px;
}
.subscription-hero {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid #99f6e4;
    background: linear-gradient(135deg, #0f766e 0%, #115e59 48%, #134e4a 100%);
    color: #ecfdf5;
    box-shadow: 0 16px 40px rgba(15, 118, 110, 0.22);
}
.subscription-hero.is-warning { border-color: #fcd34d; background: linear-gradient(135deg, #b45309 0%, #92400e 52%, #78350f 100%); box-shadow: 0 16px 40px rgba(180, 83, 9, 0.22); }
.subscription-hero.is-critical { border-color: #fca5a5; background: linear-gradient(135deg, #b91c1c 0%, #991b1b 52%, #7f1d1d 100%); box-shadow: 0 16px 40px rgba(185, 28, 28, 0.22); }
.subscription-hero.is-expired { border-color: #cbd5e1; background: linear-gradient(135deg, #475569 0%, #334155 52%, #1e293b 100%); box-shadow: 0 16px 40px rgba(51, 65, 85, 0.22); }
.subscription-hero.is-neutral { border-color: #cbd5e1; background: linear-gradient(135deg, #64748b 0%, #475569 100%); }
.subscription-hero__glow {
    position: absolute;
    inset-inline-start: -80px;
    top: -60px;
    width: 280px;
    height: 280px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.14) 0%, transparent 68%);
    pointer-events: none;
}
.subscription-hero__inner { position: relative; padding: 22px 24px 20px; display: flex; flex-direction: column; gap: 18px; }
.subscription-hero__main { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 14px; }
.subscription-hero__company { min-width: 0; }
.subscription-hero__eyebrow { display: block; font-size: 13px; font-weight: 600; opacity: 0.88; margin-bottom: 6px; }
.subscription-hero__code-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 4px; }
.subscription-hero__code {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.18);
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #fff;
}
.subscription-hero__copy { color: #ecfdf5 !important; border-color: rgba(255, 255, 255, 0.28) !important; background: rgba(255, 255, 255, 0.08) !important; }
.subscription-hero__copy:hover { background: rgba(255, 255, 255, 0.16) !important; }
.subscription-hero__copy.is-copied { background: rgba(16, 185, 129, 0.35) !important; border-color: rgba(167, 243, 208, 0.5) !important; }
.subscription-hero__badges { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.subscription-hero__badge { font-size: 12px; padding: 5px 12px; }
.subscription-plan-pill {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #fff;
}
.subscription-hero__metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}
.subscription-hero-metric {
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.subscription-hero-metric__label { display: block; font-size: 11px; opacity: 0.78; margin-bottom: 4px; }
.subscription-hero-metric__value { display: block; font-size: 1.15rem; font-weight: 800; color: #fff; }
.subscription-hero-metric__value small { font-size: 0.72em; font-weight: 600; margin-inline-start: 3px; opacity: 0.85; }
.subscription-hero-metric.num-caution .subscription-hero-metric__value { color: #fde68a; }
.subscription-hero-metric.num-negative .subscription-hero-metric__value { color: #fecaca; }
.subscription-hero__timeline { display: flex; flex-direction: column; gap: 6px; }
.subscription-hero__timeline-head { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; opacity: 0.9; }
.subscription-hero__timeline-track { height: 8px; border-radius: 999px; background: rgba(15, 23, 42, 0.35); overflow: hidden; }
.subscription-hero__timeline-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #5eead4, #a7f3d0); transition: width 0.4s ease; }
.subscription-hero.is-warning .subscription-hero__timeline-fill { background: linear-gradient(90deg, #fcd34d, #fde68a); }
.subscription-hero.is-critical .subscription-hero__timeline-fill,
.subscription-hero.is-expired .subscription-hero__timeline-fill { background: linear-gradient(90deg, #fca5a5, #fecaca); }
.subscription-hero__timeline-dates { display: flex; justify-content: space-between; font-size: 11px; opacity: 0.78; }
.subscription-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid #fde68a;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}
.subscription-banner--warn { border-color: #fcd34d; }
.subscription-banner__icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: #f59e0b;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    flex-shrink: 0;
}
.subscription-banner strong { display: block; font-size: 14px; color: #92400e; margin-bottom: 2px; }
.subscription-banner p { margin: 0; font-size: 13px; color: #a16207; line-height: 1.6; }
.subscription-banner code { font-size: 12px; padding: 1px 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.65); }
.subscription-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
    gap: 20px;
    align-items: start;
}
.subscription-layout__main,
.subscription-layout__aside { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.subscription-layout__aside { position: static; top: auto; }
.subscription-status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 12px; }
.subscription-quotas { display: flex; flex-direction: column; gap: 16px; margin-top: 20px; padding-top: 20px; border-top: 1px solid #e2e8f0; }

/* ── Subscription pricing plans ── */
.subscription-pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
}
.subscription-pricing-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 20px 16px 16px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    background: linear-gradient(165deg, #ffffff 0%, #f8fafc 100%);
    text-align: center;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.subscription-pricing-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}
.subscription-pricing-card.is-recommended {
    border-color: #0d9488;
    box-shadow: 0 8px 22px rgba(13, 148, 136, 0.16);
    background: linear-gradient(165deg, #f0fdfa 0%, #effaf8 100%);
}
.subscription-pricing-card__ribbon {
    position: absolute;
    top: -10px;
    inset-inline-start: 50%;
    transform: translateX(50%);
    background: linear-gradient(135deg, #0d9488, #0a7b6e);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 999px;
    white-space: nowrap;
}
.subscription-pricing-card__name {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}
.subscription-pricing-card__price {
    font-size: 22px;
    font-weight: 800;
    color: #0d9488;
    letter-spacing: -0.5px;
}
.subscription-pricing-card__duration {
    font-size: 13px;
    color: #64748b;
}
.subscription-pricing-card__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    font-size: 12px;
    color: #94a3b8;
}
.subscription-pricing-note {
    margin: 14px 0 0;
    font-size: 12px;
    color: #64748b;
    line-height: 1.7;
}
.subscription-aside-card {
    padding: 20px 20px 18px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}
.subscription-aside-card--accent {
    border-color: #99f6e4;
    background: linear-gradient(180deg, #f0fdfa 0%, #fff 42%);
    box-shadow: 0 8px 24px rgba(15, 118, 110, 0.1);
}
.subscription-aside-card__head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.subscription-aside-card__head h3 { margin: 0; font-size: 15px; font-weight: 800; color: #0f172a; }
.subscription-aside-card__head p { margin: 4px 0 0; font-size: 12px; color: #64748b; line-height: 1.5; }
.subscription-aside-card__icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #ccfbf1, #99f6e4);
    color: #0f766e;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.subscription-activation-field label { display: block; font-size: 12px; font-weight: 600; color: #475569; margin-bottom: 6px; }
.subscription-activation-input {
    font-family: ui-monospace, Consolas, monospace;
    font-size: 14px;
    letter-spacing: 0.02em;
    padding: 11px 14px;
}
.subscription-activation-alert { margin-top: 12px; font-size: 13px; }
.subscription-activation-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.subscription-activation-actions .btn-primary { flex: 1; min-width: 140px; justify-content: center; }
.subscription-help {
    padding: 18px;
    border-radius: 16px;
    background: linear-gradient(145deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px dashed #cbd5e1;
}
.subscription-help__icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #0f766e;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}
.subscription-help .panel-title { margin: 0 0 8px; font-size: 15px; font-weight: 800; color: #0f172a; }
.subscription-help p { margin: 0 0 12px; color: #64748b; line-height: 1.7; font-size: 13px; }
.subscription-help__copy.is-copied { color: #047857; border-color: #a7f3d0; background: #ecfdf5; }
.subscription-policy-list { margin: 0; padding-inline-start: 18px; color: #64748b; line-height: 1.85; font-size: 13px; }
.subscription-policy-list strong { color: #0f172a; }
.subscription-history-table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid #e2e8f0; }
.subscription-history-table { min-width: 560px; font-size: 13px; margin: 0; }
.subscription-history-table thead th { background: #f8fafc; font-size: 12px; }
.subscription-feature-matrix__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.subscription-feature-matrix__title { margin: 0; font-size: 14px; font-weight: 700; color: #0f172a; }
.subscription-feature-matrix__count {
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    background: #f0fdfa;
    color: #0f766e;
    border: 1px solid #99f6e4;
}
.subscription-feature-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}
.subscription-feature-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 13px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.subscription-feature-item:hover { box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05); }
.subscription-feature-item.is-enabled { border-color: #bbf7d0; background: linear-gradient(180deg, #f0fdf4 0%, #fff 100%); }
.subscription-feature-item.is-disabled { background: #f8fafc; opacity: 0.92; }
.subscription-feature-item__icon {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    flex-shrink: 0;
    margin-top: 1px;
}
.subscription-feature-item.is-enabled .subscription-feature-item__icon { background: #16a34a; color: #fff; }
.subscription-feature-item.is-disabled .subscription-feature-item__icon { background: #e2e8f0; color: #64748b; }
.subscription-feature-item__body { min-width: 0; }
.subscription-feature-item strong { display: block; font-size: 13px; color: #0f172a; }
.subscription-feature-item span { display: block; font-size: 12px; color: #64748b; margin-top: 2px; line-height: 1.45; }
.subscription-feature-item em { display: block; font-size: 11px; color: #b45309; margin-top: 5px; font-style: normal; font-weight: 600; }
@media (max-width: 960px) {
    .subscription-layout { grid-template-columns: 1fr; }
    .subscription-layout__aside { position: static; }
    .subscription-hero__metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .subscription-feature-list { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
    .subscription-hero__inner { padding: 16px; }
    .subscription-hero__metrics { grid-template-columns: 1fr 1fr; gap: 8px; }
    .subscription-hero-metric { padding: 10px; }
    .subscription-hero-metric__value { font-size: 1rem; }
}

/* Blazor validation */
.valid.modified:not([type=checkbox]) { outline: 1px solid var(--success); }
.invalid { outline: 1px solid var(--danger); }
.validation-message { color: var(--danger); font-size: 13px; }

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
    border-radius: 8px;
}

.blazor-error-boundary::after { content: "حدث خطأ في التطبيق."; }

.error-boundary-panel {
    max-width: 520px;
    margin: 48px auto;
    padding: 32px 28px;
    text-align: center;
    border-radius: 18px;
    background: #fff;
    border: 1px solid #fecaca;
    box-shadow: 0 20px 48px rgba(185, 28, 28, 0.1);
}
.error-boundary-panel__icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 16px;
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    color: #b91c1c;
    font-size: 28px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #fecaca;
}
.error-boundary-panel h2 {
    margin: 0 0 10px;
    font-size: 1.25rem;
    color: #0f172a;
}
.error-boundary-message {
    margin: 0 0 20px;
    color: #64748b;
    line-height: 1.7;
    font-size: 14px;
}
.error-boundary-details {
    margin: 0 0 18px;
    text-align: start;
    font-size: 12px;
    color: #475569;
}
.error-boundary-details summary {
    cursor: pointer;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 8px;
}
.error-boundary-details pre {
    margin: 0;
    padding: 12px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 11px;
    line-height: 1.5;
}
.error-boundary-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

#blazor-error-ui {
    background: #fef3c7;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0,0,0,0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

/* Responsive — see mobile-responsive.css for phone/tablet drawer layout */
@media (max-width: 900px) {
    .form-grid { grid-template-columns: 1fr; }
    .form-grid .span-2 { grid-column: span 1; }
}

@media (max-width: 768px) {
    /* Topbar/toolbar mobile rules moved to mobile-responsive.css (992px) */
    .form-panel-pay { max-width: 100%; }
    .page-scroll-area.form-card-host {
        overflow-y: auto;
    }
    .page-scroll-area.form-float-stage {
        padding: 16px 12px 24px;
        align-items: flex-start;
    }
    .page-scroll-area.form-float-stage.form-card-host > .form-card {
        width: 100%;
        max-width: 100%;
        max-height: min(calc(100vh - 148px), 820px);
    }
    .form-card:not(.form-card-float) {
        min-height: min(520px, calc(100vh - 200px));
    }
    .add-card-panel {
        max-width: calc(100vw - 24px);
        margin: 12px;
    }
    .notification-panel {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        min-width: 0;
        border-radius: 16px 16px 0 0;
        max-height: 70vh;
        overflow-y: auto;
    }
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .calendar-grid { gap: 4px; }
    .calendar-cell { font-size: 11px; padding: 4px; }
    .data-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .summary-row { grid-template-columns: 1fr; }
    .kpi-preview-grid { grid-template-columns: 1fr; }
    .topbar-title { font-size: 16px; }
    .page-content { padding: 12px; }
    .pos-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
    .toast-host {
        right: 12px;
        left: 12px;
        max-width: none;
    }
}

/* ── About page ── */
.about-page-scroll {
    max-width: 960px;
    margin-inline: auto;
    padding-bottom: 48px;
}

.about-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.about-hero {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    border: 1px solid rgba(94, 234, 212, 0.22);
    background: linear-gradient(145deg, #0f172a 0%, #134e4a 52%, #0f766e 100%);
    color: #ecfdf5;
    box-shadow: 0 16px 40px rgba(15, 118, 110, 0.22);
}

.about-hero__glow {
    position: absolute;
    inset: -40% -20% auto auto;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(94, 234, 212, 0.28) 0%, transparent 68%);
    pointer-events: none;
}

.about-hero__inner {
    position: relative;
    padding: 28px 28px 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.about-hero__top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.about-version-plate {
    position: relative;
    flex-shrink: 0;
    min-width: 148px;
    padding: 16px 20px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(8px);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.about-version-plate__ring {
    position: absolute;
    inset: -1px;
    border-radius: 16px;
    border: 1px solid rgba(94, 234, 212, 0.2);
    pointer-events: none;
}

.about-version-plate__label {
    font-size: 11px;
    font-weight: 600;
    color: #99f6e4;
    letter-spacing: 0.04em;
}

.about-version-plate__code {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: #fff;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.about-version-plate__status {
    font-size: 10px;
    color: rgba(236, 253, 245, 0.72);
}

.about-pill--plan {
    background: rgba(59, 130, 246, 0.22);
    border-color: rgba(147, 197, 253, 0.35);
    color: #bfdbfe;
}

.about-hero__brand {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.about-hero__logo {
    width: 72px;
    height: 72px;
    font-size: 26px;
    border-radius: 18px;
    flex-shrink: 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    animation: brandLogoLive 2.8s ease-in-out infinite;
}

.about-hero__title {
    margin: 0 0 4px;
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.about-hero__tagline {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 600;
    color: #99f6e4;
}

.about-hero__desc {
    margin: 0;
    font-size: 13px;
    line-height: 1.75;
    color: rgba(236, 253, 245, 0.88);
    max-width: 52ch;
}

.about-hero__desc strong {
    color: #fff;
    font-weight: 700;
}

.about-hero__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.about-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #ecfdf5;
}

.about-pill--version {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.22);
}

.about-pill--ok {
    background: rgba(22, 163, 74, 0.22);
    border-color: rgba(74, 222, 128, 0.35);
    color: #bbf7d0;
}

.about-pill--warn {
    background: rgba(217, 119, 6, 0.22);
    border-color: rgba(251, 191, 36, 0.35);
    color: #fde68a;
}

.about-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.about-metric-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 18px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.about-metric-card__icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.about-metric-card__icon.primary { background: #dbeafe; color: #1d4ed8; }
.about-metric-card__icon.teal { background: #ccfbf1; color: #0f766e; }
.about-metric-card__icon.slate { background: #f1f5f9; color: #475569; }
.about-metric-card__icon.success { background: #dcfce7; color: #15803d; }
.about-metric-card__icon.warn { background: #fef3c7; color: #b45309; }

.about-metric-card__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.about-metric-card__label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}

.about-metric-card__value {
    font-size: 15px;
    font-weight: 800;
    color: var(--text);
}

.about-metric-card__hint {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
}

.about-session-card {
    padding: 20px 22px;
    border-radius: 16px;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.about-session-card__head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    color: #0f766e;
    font-size: 14px;
}

.about-session-dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 20px;
    margin: 0;
}

.about-session-dl > div {
    display: grid;
    grid-template-columns: 88px 1fr;
    gap: 8px;
    font-size: 13px;
}

.about-session-dl dt {
    margin: 0;
    color: var(--text-muted);
    font-weight: 500;
}

.about-session-dl dd {
    margin: 0;
    font-weight: 700;
    color: var(--text);
}

.about-session-dl code {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 6px;
    background: #f0fdfa;
    color: #0f766e;
}

.about-section-title {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
}

.about-modules-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.about-module-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 18px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: border-color 0.18s, box-shadow 0.18s, transform 0.12s;
}

.about-module-card:hover {
    border-color: rgba(13, 148, 136, 0.28);
    box-shadow: 0 8px 24px rgba(15, 118, 110, 0.1);
    transform: translateY(-1px);
}

.about-module-card__icon {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.about-module-card__icon.primary { background: linear-gradient(135deg, #dbeafe, #bfdbfe); color: #1d4ed8; }
.about-module-card__icon.success { background: linear-gradient(135deg, #dcfce7, #bbf7d0); color: #15803d; }
.about-module-card__icon.teal { background: linear-gradient(135deg, #ccfbf1, #99f6e4); color: #0f766e; }
.about-module-card__icon.slate { background: linear-gradient(135deg, #f1f5f9, #e2e8f0); color: #475569; }

.about-module-card__title {
    display: block;
    font-size: 14px;
    font-weight: 800;
    margin-bottom: 4px;
    color: #0f172a;
}

.about-module-card__desc {
    margin: 0;
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-muted);
}

.about-capability-list {
    list-style: none;
    margin: 0;
    padding: 16px 18px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: grid;
    gap: 10px;
}

.about-capability-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    line-height: 1.55;
    color: #334155;
}

.about-capability-check {
    width: 22px;
    height: 22px;
    border-radius: 8px;
    background: #ecfdf5;
    color: #0f766e;
    font-size: 12px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.about-footer {
    padding: 18px 4px 4px;
    text-align: center;
}

.about-footer__version {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: linear-gradient(145deg, #f8fafc 0%, #fff 100%);
    margin-bottom: 12px;
}

.about-footer__version-label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
}

.about-footer__version-code {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: #0f766e;
    font-variant-numeric: tabular-nums;
}

.about-footer__links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 12px;
}

.about-footer-link {
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid rgba(13, 148, 136, 0.22);
    background: #f0fdfa;
    color: #0f766e;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}

.about-footer-link:hover {
    background: #ccfbf1;
    border-color: rgba(13, 148, 136, 0.35);
    text-decoration: none;
}

.about-footer__copy {
    margin: 0 0 4px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
}

@media (max-width: 768px) {
    .about-hero__top {
        flex-direction: column;
        align-items: stretch;
    }

    .about-version-plate {
        width: 100%;
    }

    .about-hero__brand {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .about-hero__desc {
        max-width: none;
    }

    .about-hero__badges {
        justify-content: center;
    }

    .about-metrics,
    .about-modules-grid,
    .about-session-dl {
        grid-template-columns: 1fr;
    }

    .about-session-dl > div {
        grid-template-columns: 76px 1fr;
    }
}
.alert-chip { border: 1px solid var(--danger); text-decoration: none; color: inherit; }
.alert-chip:hover { background: rgba(220, 38, 38, 0.06); }

.toast-host {
    position: fixed;
    bottom: 20px;
    right: 20px;
    left: auto;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: min(420px, calc(100vw - 40px));
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #fff;
    padding: 14px 16px;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.28);
    font-size: 14px;
    animation: toast-in 0.24s ease;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.toast-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
}

.toast-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.toast-title {
    font-size: 12px;
    font-weight: 700;
    opacity: 0.85;
    letter-spacing: 0.02em;
}

.toast-text {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
}

.toast-success { border-right: 4px solid var(--success); }
.toast-error { border-right: 4px solid var(--danger); }
.toast-info { border-right: 4px solid var(--brand); }
.toast-warning { border-right: 4px solid #f59e0b; }
.toast-added { border-right: 4px solid #10b981; }
.toast-updated { border-right: 4px solid #14b8a6; }
.toast-deleted { border-right: 4px solid #64748b; }

.toast-success .toast-icon { background: rgba(22, 163, 74, 0.22); color: #86efac; }
.toast-error .toast-icon { background: rgba(220, 38, 38, 0.22); color: #fca5a5; }
.toast-info .toast-icon { background: rgba(13, 148, 136, 0.22); color: #5eead4; }
.toast-warning .toast-icon { background: rgba(245, 158, 11, 0.22); color: #fcd34d; }
.toast-added .toast-icon { background: rgba(16, 185, 129, 0.22); color: #6ee7b7; }
.toast-updated .toast-icon { background: rgba(20, 184, 166, 0.22); color: #5eead4; }
.toast-deleted .toast-icon { background: rgba(100, 116, 139, 0.28); color: #cbd5e1; }

.toast.is-exiting {
    animation: toast-out 0.22s ease forwards;
}

@keyframes toast-out {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(8px); }
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Risk badges ── */
.risk-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}
.risk-low { background: #dcfce7; color: #166534; }
.risk-medium { background: #fef3c7; color: #92400e; }
.risk-high { background: #fee2e2; color: #991b1b; }
.risk-unknown { background: #f1f5f9; color: #64748b; }

/* ── Contract progress ── */
.contract-progress { margin: 12px 0; }
.contract-progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
}
.progress-track {
    height: 8px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--brand), var(--brand-dark));
    border-radius: 999px;
    transition: width 0.3s ease;
}
.contract-progress-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

/* ── Notification center (v2 — bell + panel) ── */
.app-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: inherit;
}

.app-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.notification-center {
    position: relative;
}

.notification-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    color: #64748b;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease, color 0.18s ease;
}

.notification-btn .notification-bell-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.notification-btn:hover {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #0f766e;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.notification-btn.is-open {
    background: linear-gradient(135deg, #ecfeff 0%, #f0fdfa 100%);
    border-color: rgba(13, 148, 136, 0.35);
    color: #0f766e;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12);
}

.notification-btn.has-alerts {
    color: #0f766e;
    border-color: rgba(13, 148, 136, 0.28);
    background: linear-gradient(180deg, #f0fdfa 0%, #ecfeff 100%);
    box-shadow: 0 2px 10px rgba(13, 148, 136, 0.12);
}

.notification-btn.has-alerts .notification-bell-icon {
    color: #0d9488;
}

.notification-btn.is-clear {
    color: #64748b;
}

.notification-bell-shell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.notification-ring {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid rgba(13, 148, 136, 0.35);
    opacity: 0;
    pointer-events: none;
}

.notification-badge {
    position: absolute;
    top: -5px;
    left: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.45), 0 0 0 2px #ffffff;
    line-height: 1;
}

.notification-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1090;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.notification-backdrop.is-guarded {
    pointer-events: none;
}

.notification-panel {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    z-index: 1100;
    width: min(92vw, 360px);
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 16px;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.8) inset,
        0 8px 24px rgba(15, 23, 42, 0.1),
        0 24px 56px rgba(15, 23, 42, 0.14);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: min(70vh, 520px);
    outline: none;
}

.notification-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #f0fdfa 0%, #ffffff 100%);
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    flex-shrink: 0;
}

.notification-panel-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.notification-panel-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #ccfbf1 0%, #99f6e4 100%);
    color: var(--brand-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 1px rgba(13, 148, 136, 0.15);
}

.notification-panel-title {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.notification-panel-subtitle {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.notification-close-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    background: #fff;
    color: #64748b;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s, transform 0.12s;
}

.notification-close-btn:hover {
    background: #f8fafc;
    color: #0f172a;
    transform: scale(1.05);
}

.notification-panel-body {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.notification-list {
    padding: 6px 0;
}

.notification-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s ease, transform 0.12s ease;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item:hover {
    background: linear-gradient(90deg, rgba(248, 250, 252, 0.95) 0%, #ffffff 100%);
    transform: translateX(-2px);
}

.notification-item-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-item-icon.danger {
    background: #fee2e2;
    color: #b91c1c;
}

.notification-item-icon.warning {
    background: #fef3c7;
    color: #b45309;
}

.notification-item-icon.primary {
    background: #ccfbf1;
    color: #0f766e;
}

.notification-item-content {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.notification-item-title {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
}

.notification-item-desc {
    font-size: 11px;
    color: var(--text-muted);
}

.notification-item-value {
    font-size: 13px;
    font-weight: 800;
    color: #0f172a;
    flex-shrink: 0;
    padding: 4px 8px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.notification-item.danger .notification-item-value {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.notification-item.warning .notification-item-value {
    background: #fffbeb;
    border-color: #fde68a;
    color: #b45309;
}

.notification-item.primary .notification-item-value {
    background: #f0fdfa;
    border-color: #99f6e4;
    color: #0f766e;
}

.notification-panel-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border-top: 1px solid var(--border);
    background: #fafbfc;
    flex-shrink: 0;
}

.notification-footer-link {
    flex: 1;
    text-align: center;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--brand-dark);
    text-decoration: none;
    border: 1px solid transparent;
    transition: background 0.15s, border-color 0.15s;
}

.notification-footer-link:hover {
    background: #ffffff;
    border-color: #e2e8f0;
    text-decoration: none;
}

.notification-empty {
    padding: 32px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.notification-empty-bell {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(145deg, #ecfdf5 0%, #d1fae5 100%);
    color: var(--brand-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
    box-shadow: 0 8px 20px rgba(13, 148, 136, 0.12);
}

.notification-empty-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}

.notification-empty-hint {
    margin: 0;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ── Notification center pro (installment table) ── */
.notification-panel-pro {
    width: min(94vw, 520px);
    max-height: min(78vh, 640px);
}

.notification-panel-pro .notification-panel-body {
    min-height: 140px;
}

.notification-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    background: #fafbfc;
    flex-shrink: 0;
}

.notification-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.notification-filter-chip:hover:not(:disabled) {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.notification-filter-chip:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.notification-filter-chip.is-active {
    background: linear-gradient(135deg, #ecfeff 0%, #f0fdfa 100%);
    border-color: rgba(13, 148, 136, 0.35);
    color: #0f766e;
    box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.1);
}

.notification-filter-chip.is-active.danger {
    background: linear-gradient(135deg, #fef2f2 0%, #fff1f2 100%);
    border-color: rgba(220, 38, 38, 0.35);
    color: #b91c1c;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.08);
}

.notification-filter-chip.is-active.warning {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-color: rgba(217, 119, 6, 0.35);
    color: #b45309;
    box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.08);
}

.notification-filter-count {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    font-size: 10px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.notification-filter-chip.is-active .notification-filter-count {
    background: rgba(255, 255, 255, 0.75);
}

.notification-section {
    padding: 8px 0 4px;
}

.notification-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 14px 8px;
}

.notification-section-title {
    font-size: 12px;
    font-weight: 800;
    color: #334155;
    letter-spacing: 0.01em;
}

.notification-section-link {
    font-size: 11px;
    font-weight: 700;
    color: var(--brand-dark);
    text-decoration: none;
}

.notification-section-link:hover {
    text-decoration: underline;
}

.notification-section-empty {
    margin: 0;
    padding: 16px 14px;
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}

.notification-divider {
    height: 1px;
    margin: 4px 14px;
    background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
}

.notification-table-wrap {
    padding: 0 8px 6px;
}

.notification-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 12px;
}

.notification-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 8px 10px;
    text-align: right;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #64748b;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.notification-table tbody tr {
    transition: background 0.12s ease;
}

.notification-table tbody tr:hover {
    background: #f8fafc;
}

.notification-table tbody td {
    padding: 10px;
    vertical-align: top;
    border-bottom: 1px solid #f1f5f9;
}

.notification-table-row.danger td {
    border-right: 3px solid #ef4444;
}

.notification-table-row.warning td {
    border-right: 3px solid #f59e0b;
}

.notification-row-link {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}

.notification-row-link:hover .notification-row-customer {
    color: var(--brand-dark);
}

.notification-row-customer {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.25;
    transition: color 0.12s;
}

.notification-row-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: #64748b;
}

.notification-row-dot {
    opacity: 0.5;
}

.notification-date {
    display: block;
    font-size: 11px;
    color: #475569;
    margin-bottom: 4px;
}

.notification-days-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.2;
}

.notification-days-badge.danger {
    background: #fee2e2;
    color: #b91c1c;
}

.notification-days-badge.warning {
    background: #fef3c7;
    color: #b45309;
}

.notification-amount {
    font-size: 12px;
    font-weight: 800;
    color: #0f172a;
    white-space: nowrap;
    text-align: left;
    font-variant-numeric: tabular-nums;
}

.notification-table-row.danger .notification-amount {
    color: #b91c1c;
}

.notification-panel-pro .notification-panel-footer {
    gap: 6px;
}

.notification-panel-pro .notification-footer-link {
    font-size: 11px;
    padding: 7px 8px;
}

/* ── Payment form (legacy alias) ── */
.form-panel-pay { max-width: none; border: none; box-shadow: none; padding: 0; }
.form-card-pay .kpi-preview-grid { margin-top: 0; }
.form-card-pay .form-summary-strip { margin-top: 14px; }

.form-card-settings .form-section + .form-section {
    margin-top: 8px;
    padding-top: 20px;
    border-top: 1px dashed var(--border);
}

.form-card-pos {
    max-width: none;
    width: 100%;
}

.form-card-pos .form-card-body {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.form-card-pos .pos-layout {
    flex: 1 1 0;
    min-height: 0;
    align-items: stretch;
    height: 100%;
}

.form-card-pos .pos-products,
.form-card-pos .pos-cart {
    display: flex;
    flex-direction: column;
    min-height: 0;
    gap: 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    background: var(--surface);
}

.form-card-pos .pos-grid {
    flex: 1 1 0;
    min-height: 120px;
    max-height: none;
    margin-top: 0;
}

.form-card-pos .pos-cart-table-wrap {
    flex: 0 1 auto;
    min-height: 80px;
    max-height: min(32vh, 320px);
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.form-card-pos .pos-cart-table-wrap .data-table {
    margin: 0;
}

.form-card-footer .form-summary-strip-inline {
    flex: 1 1 auto;
    margin: 0;
    min-width: min(100%, 280px);
}

@media (max-width: 960px) {
    .form-card-pos .pos-layout {
        grid-template-columns: 1fr;
    }

    .form-card-pos .pos-grid {
        max-height: min(40vh, 360px);
    }
}

/* ── Dashboard sections ── */
.dash-section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--brand-dark);
    margin: 0 0 10px;
}

.dash-alert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: clamp(10px, 2vw, 12px);
    margin-bottom: 24px;
}

.dash-alert-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    border-right: 3px solid #cbd5e1;
}

.dash-alert-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.dash-alert-card.has-alert { border-right-color: var(--warning); background: #fffbeb; }
.dash-alert-card.has-alert.danger { border-right-color: var(--danger); background: #fef2f2; }
.dash-alert-card.is-ok { border-right-color: var(--success); }

.dash-alert-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.dash-alert-value { font-size: 16px; font-weight: 700; color: var(--num-neutral); }
.dash-alert-card.has-alert .dash-alert-value { color: var(--num-caution); }
.dash-alert-card.has-alert.danger .dash-alert-value { color: var(--num-negative); }
.dash-alert-card.is-ok .dash-alert-value { color: var(--num-positive); }
.dash-alert-meta { font-size: 11px; color: #94a3b8; }

.dash-par-header strong.num-positive { color: var(--num-positive); }
.dash-par-header strong.num-caution { color: var(--num-caution); }
.dash-par-header strong.num-negative { color: var(--num-negative); }

.dash-progress-track {
    height: 8px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 4px;
}

.dash-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--brand), var(--brand-dark));
    border-radius: 999px;
    transition: width 0.3s ease;
}

.dash-progress-fill.warning { background: linear-gradient(90deg, #f59e0b, #d97706); }
.dash-progress-fill.danger { background: linear-gradient(90deg, #ef4444, #dc2626); }

.dash-par-panel { margin-bottom: 24px; }

.dash-par-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.dash-par-item { display: flex; flex-direction: column; gap: 8px; }
.dash-par-header {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
}

.stat-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.stat-card-link:hover .stat-card {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

/* ── Customer account tabs ── */
.account-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    padding: 4px;
    background: #f1f5f9;
    border-radius: 12px;
}

.account-tab {
    flex: 1;
    min-width: 120px;
    padding: 10px 16px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.account-tab:hover { color: var(--brand-dark); }

.account-tab.active {
    background: #fff;
    color: var(--brand-dark);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

/* ── Reports hub ── */
.reports-hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}

.report-hub-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 18px 16px;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid var(--border);
    border-radius: 14px;
    color: inherit;
    border-right: 3px solid var(--brand);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    min-height: 120px;
}

.report-hub-card-link {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-decoration: none;
    color: inherit;
    flex: 1;
}

.report-hub-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.report-hub-pdf {
    align-self: flex-start;
    margin-top: auto;
}

.branch-dash-table-wrap {
    overflow: auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 #f1f5f9;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.branch-dash-table-wrap.data-table-scroll::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.branch-dash-table-wrap.data-table-scroll::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 8px;
}

.branch-dash-table-wrap.data-table-scroll::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #cbd5e1, #94a3b8);
    border-radius: 8px;
    border: 2px solid #f1f5f9;
}

.branch-dash-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.branch-dash-table th,
.branch-dash-table td {
    padding: 10px 12px;
    text-align: right;
    border-bottom: 1px solid var(--border);
}
.branch-dash-table th {
    font-weight: 600;
    color: var(--text-muted);
    background: #f8fafc;
    position: sticky;
    top: 0;
    z-index: 2;
    box-shadow: 0 1px 0 var(--border);
}
.branch-dash-table tbody tr:hover { background: #f8fafc; }

.report-hub-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #ecfeff;
    color: #0891b2;
    flex-shrink: 0;
}
.report-hub-title { font-size: 15px; font-weight: 700; color: #0f172a; }
.report-hub-desc { font-size: 12px; color: var(--text-muted); line-height: 1.4; }

/* ── Customer account ── */
.customer-account-header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ── Grouped contracts ── */
.contracts-grouped-view {
    flex: 1 1 auto;
    min-height: 0;
    padding: 8px 12px 12px;
    overflow: visible;
}
.list-page-shell > .contracts-grouped-view {
    overflow: visible;
}
.contract-group {
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
}
.contract-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f8fafc;
    cursor: pointer;
    user-select: none;
}
.contract-group-header:hover { background: #f1f5f9; }
.contract-group-body { padding: 0 8px 8px; }

/* ── Skeleton loading ── */
.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.2s ease-in-out infinite;
    border-radius: 8px;
    height: 16px;
}
@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.chip-primary { border-right-color: var(--brand); }
.chip-success { border-right-color: var(--success); }
.chip-danger { border-right-color: var(--danger); }
.chip-warning { border-right-color: var(--warning); }

/* Global search palette (Ctrl+K) */
.search-palette-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 3000;
    backdrop-filter: blur(2px);
}

.search-palette {
    position: fixed;
    top: 12vh;
    left: 50%;
    transform: translateX(-50%);
    width: min(640px, calc(100vw - 24px));
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.22);
    z-index: 3001;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.search-palette-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
}

.search-palette-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    font-family: inherit;
}

.search-palette-hint {
    font-size: 0.72rem;
    color: #94a3b8;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 2px 6px;
}

.search-palette-list {
    list-style: none;
    margin: 0;
    padding: 6px;
    max-height: 360px;
    overflow-y: auto;
}

.search-palette-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
}

.search-palette-item.selected,
.search-palette-item:hover {
    background: #f0fdfa;
}

.search-cat {
    font-size: 0.72rem;
    color: #0f766e;
    font-weight: 700;
}

.search-sub {
    font-size: 0.82rem;
    color: #64748b;
}

.search-palette-empty {
    padding: 24px;
    text-align: center;
    color: #64748b;
}

.search-palette-footer {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 14px;
    font-size: 0.75rem;
    color: #94a3b8;
    border-top: 1px solid #f1f5f9;
    background: #fafbfc;
}

.search-palette-footer kbd {
    font-size: 0.7rem;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 1px 4px;
    background: #fff;
}

.search-shortcut-btn {
    min-width: 36px;
    padding: 6px 10px;
    font-size: 1rem;
}

/* ── Blazor Server connection status ── */
.blazor-connection-banner {
    position: fixed;
    top: 0;
    inset-inline: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.12);
    animation: connectionBannerIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.js-circuit-banner.is-visible {
    display: flex;
}

@keyframes connectionBannerIn {
    from { opacity: 0; transform: translateY(-100%); }
    to { opacity: 1; transform: translateY(0); }
}

.blazor-connection-banner.is-reconnecting {
    background: linear-gradient(90deg, #fef3c7, #fde68a);
    color: #92400e;
    border-bottom: 1px solid #fcd34d;
}

.blazor-connection-banner.is-disconnected {
    background: linear-gradient(90deg, #fee2e2, #fecaca);
    color: #991b1b;
    border-bottom: 1px solid #fca5a5;
}

.blazor-connection-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    background: currentColor;
}

.is-reconnecting .blazor-connection-dot {
    animation: connectionPulse 1.2s ease-in-out infinite;
}

@keyframes connectionPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.45; transform: scale(0.85); }
}

.blazor-connection-reload {
    border: 1px solid currentColor;
    background: rgba(255, 255, 255, 0.65);
    color: inherit;
    border-radius: 8px;
    padding: 4px 12px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.blazor-connection-reload:hover {
    background: #fff;
}

.page-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 12px;
    color: #64748b;
}

.page-breadcrumbs-link {
    color: #0f766e;
    text-decoration: none;
    font-weight: 600;
}

.page-breadcrumbs-link:hover {
    text-decoration: underline;
}

.page-breadcrumbs-sep {
    color: #cbd5e1;
    user-select: none;
}

.page-breadcrumbs-current {
    color: #334155;
    font-weight: 700;
}

/* Phase C — dashboard prefs + gateway monitor */
.dash-prefs-panel {
    margin: 0 0 12px;
    padding: 12px 16px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f0fdfa, #ecfeff);
    border: 1px solid #99f6e4;
}

.dash-prefs-title {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 700;
    color: #0f766e;
}

.dash-prefs-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.dash-prefs-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #cbd5e1;
    font-size: 12px;
    cursor: pointer;
}

.dash-live-dot {
    color: #16a34a;
    font-size: 10px;
}

.gateway-monitor-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.gateway-kpi {
    padding: 12px 14px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.gateway-kpi-label {
    display: block;
    font-size: 11px;
    color: #64748b;
    margin-bottom: 4px;
}

.gateway-kpi-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
}

.gateway-kpi-value.is-ok { color: #15803d; }
.gateway-kpi-value.is-warn { color: #b45309; }
.gateway-kpi-value.is-bad { color: #b91c1c; }

.gateway-monitor-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.gateway-chip {
    border: 1px solid #cbd5e1;
    background: #fff;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    color: #334155;
}

.gateway-chip.is-active {
    background: #0f766e;
    border-color: #0f766e;
    color: #fff;
}

.gateway-payload-snippet {
    max-height: 160px;
    overflow: auto;
    padding: 10px;
    border-radius: 8px;
    background: #0f172a;
    color: #e2e8f0;
    font-size: 11px;
    direction: ltr;
    text-align: left;
}

.gateway-detail-row td {
    background: #f8fafc;
}

/* Platform License Center */
.platform-page { max-width: 1440px; margin-inline: auto; }
.platform-kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.platform-kpi { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-radius: 14px; background: #fff; border: 1px solid #e2e8f0; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04); min-height: 88px; transition: box-shadow 0.2s ease, transform 0.2s ease; }
.platform-kpi:hover { box-shadow: 0 6px 20px rgba(15, 23, 42, 0.07); transform: translateY(-1px); }
.platform-kpi__content { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.platform-kpi__label { font-size: 12px; font-weight: 600; color: #64748b; }
.platform-kpi__value { font-size: 1.75rem; font-weight: 800; line-height: 1.1; color: #0f172a; }
.platform-kpi__sub { font-size: 10px; color: #94a3b8; margin-top: 2px; }
.platform-kpi__icon { width: 42px; height: 42px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.platform-kpi--success .platform-kpi__icon { background: #dcfce7; color: #15803d; }
.platform-kpi--success .platform-kpi__value { color: #15803d; }
.platform-kpi--amber .platform-kpi__icon { background: #fef3c7; color: #b45309; }
.platform-kpi--amber .platform-kpi__value { color: #b45309; }
.platform-kpi--rose .platform-kpi__icon { background: #ffe4e6; color: #e11d48; }
.platform-kpi--rose .platform-kpi__value { color: #e11d48; }
.platform-kpi--slate .platform-kpi__icon { background: #f1f5f9; color: #475569; }
.platform-workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); gap: 18px; align-items: start; }
.platform-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.platform-panel { background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 20px 22px; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04); }
.platform-panel__head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.platform-panel__head--toolbar { flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.platform-panel__icon { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, #ccfbf1, #99f6e4); color: #0f766e; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.platform-panel__title { margin: 0; font-size: 1rem; font-weight: 700; color: #0f172a; }
.platform-panel__sub { margin: 4px 0 0; font-size: 12px; color: #64748b; line-height: 1.45; }
.platform-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.platform-panel__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.platform-code-box { margin-top: 16px; padding: 14px 16px; border-radius: 12px; background: linear-gradient(145deg, #0f172a, #1e293b); color: #e2e8f0; }
.platform-code-label { display: block; font-size: 11px; color: #94a3b8; margin-bottom: 6px; }
.platform-code-value { display: block; font-size: 0.95rem; font-weight: 700; word-break: break-all; letter-spacing: 0.02em; }
.platform-code-hint { margin: 8px 0 0; font-size: 11px; color: #94a3b8; }
.platform-code-tag { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: #f1f5f9; color: #334155; }
.platform-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.platform-search { min-width: 160px; flex: 1; max-width: 240px; }
.platform-filter { min-width: 130px; }
.platform-flash { margin: 0; }
.platform-table-desktop { display: block; }
.platform-tenant-cards { display: none; }
.platform-aside { position: sticky; top: 12px; min-width: 0; }
.platform-aside-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 280px; padding: 24px; text-align: center; background: #f8fafc; border: 2px dashed #e2e8f0; border-radius: 16px; color: #94a3b8; }
.platform-aside-empty p { margin: 0; font-size: 13px; line-height: 1.6; }
.platform-panel--detail .platform-detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 10px; }
.platform-aside-close { border: none; background: #f1f5f9; color: #64748b; width: 28px; height: 28px; border-radius: 8px; cursor: pointer; font-size: 14px; flex-shrink: 0; }
.platform-aside-close:hover { background: #e2e8f0; }
.platform-detail-dl { display: grid; gap: 8px; margin: 14px 0; padding: 0; }
.platform-detail-dl > div { display: grid; grid-template-columns: 72px 1fr; gap: 8px; font-size: 13px; }
.platform-detail-dl dt { color: #94a3b8; font-weight: 500; }
.platform-detail-dl dd { margin: 0; color: #334155; font-weight: 600; word-break: break-word; }
.platform-detail-quotas { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.platform-tenant-card { display: block; width: 100%; text-align: inherit; padding: 14px 16px; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s; }
.platform-tenant-card:hover { border-color: #99f6e4; box-shadow: 0 4px 12px rgba(15, 118, 110, 0.08); }
.platform-tenant-card.is-selected { border-color: #0f766e; box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.15); }
.platform-tenant-card__top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.platform-tenant-card__top code { font-size: 11px; padding: 2px 6px; background: #f1f5f9; border-radius: 4px; }
.platform-tenant-card__meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.platform-tenant-card__stats { display: flex; gap: 16px; font-size: 12px; color: #64748b; }
.btn-table.is-active { background: #0f766e; color: #fff; border-color: #0f766e; }
@media (max-width: 1200px) { .platform-kpi-row { grid-template-columns: repeat(2, 1fr); } .platform-workspace { grid-template-columns: 1fr; } .platform-aside { position: static; } .platform-aside:not(.is-open) .platform-aside-empty { min-height: 120px; } }
@media (max-width: 768px) { .platform-kpi-row { grid-template-columns: repeat(2, 1fr); gap: 10px; } .platform-kpi { padding: 12px 14px; min-height: 76px; } .platform-kpi__value { font-size: 1.4rem; } .platform-kpi__icon { width: 36px; height: 36px; } .platform-kpi__sub { display: none; } .platform-panel { padding: 16px; border-radius: 14px; } .platform-panel__head--toolbar { flex-direction: column; align-items: stretch; } .platform-toolbar { width: 100%; } .platform-search { max-width: none; flex: 1 1 100%; } .platform-filter { flex: 1; } .platform-form-grid { grid-template-columns: 1fr; } .platform-form-grid .span-2 { grid-column: span 1; } .platform-table-desktop { display: none; } .platform-tenant-cards { display: flex; flex-direction: column; gap: 10px; } .platform-aside-empty { display: none; } .platform-aside:not(.is-open) { display: none; } }
@media (max-width: 480px) { .platform-kpi-row { grid-template-columns: 1fr 1fr; gap: 8px; } .platform-kpi { flex-direction: column-reverse; align-items: flex-start; min-height: auto; padding: 12px; } .platform-kpi__value { font-size: 1.25rem; } }

.quota-bar-wrap { display: flex; flex-direction: column; gap: 6px; }
.quota-bar-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.quota-bar-label { font-weight: 600; color: #334155; }
.quota-bar-count { font-weight: 700; color: #0f172a; }
.quota-bar-track { height: 8px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.quota-bar-fill { height: 100%; border-radius: 999px; transition: width 0.35s ease; }
.quota-bar-fill.is-ok { background: linear-gradient(90deg, #0d9488, #14b8a6); }
.quota-bar-fill.is-warn { background: linear-gradient(90deg, #d97706, #f59e0b); }
.quota-bar-fill.is-full { background: linear-gradient(90deg, #dc2626, #ef4444); }
.quota-bar-hint { font-size: 11px; color: #64748b; }
.list-quota-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 16px; padding: 12px 16px; border-radius: 12px; background: #f8fafc; border: 1px solid #e2e8f0; }
.quota-inline { flex: 1; min-width: 200px; }

/* Responsive data list + mobile cards */
.responsive-data-list__mobile { display: none; }
.list-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 14px 16px; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05); }
.list-card--danger { border-right: 4px solid #dc2626; }
.list-card--warning { border-right: 4px solid #f59e0b; }
.list-card--success { border-right: 4px solid #16a34a; }
.list-card--brand { border-right: 4px solid #0f766e; }
.list-card--selected { box-shadow: 0 0 0 2px #99f6e4; background: #f0fdfa; }
.list-card__badge-row { display: flex; align-items: center; gap: 8px; }
.list-card__select { display: inline-flex; align-items: center; cursor: pointer; }
.list-card__select input { width: 18px; height: 18px; accent-color: #0f766e; cursor: pointer; }
.list-card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.list-card__titles { min-width: 0; flex: 1; }
.list-card__title { margin: 0; font-size: 15px; font-weight: 700; color: #0f172a; line-height: 1.35; }
.list-card__subtitle { margin: 4px 0 0; font-size: 12px; color: #64748b; }
.list-card__badge { flex-shrink: 0; }
.list-card__meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin: 0 0 12px; padding: 0; }
.list-card-meta-item { display: contents; }
.list-card-meta-item dt { font-size: 10px; font-weight: 600; color: #94a3b8; }
.list-card-meta-item dd { margin: 0; font-size: 13px; font-weight: 600; color: #334155; }
.list-card__highlight { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 12px 14px; margin-bottom: 12px; border-radius: 10px; background: linear-gradient(135deg, #fef2f2 0%, #fff7ed 100%); border: 1px solid #fecaca; }
.list-card__highlight-label { font-size: 12px; font-weight: 600; color: #64748b; }
.list-card__highlight-value { font-size: 1.25rem !important; font-weight: 800 !important; }
.list-card__footer { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.list-card__actions { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; min-width: 0; }
.list-card__btn-primary { flex: 1; min-width: 120px; min-height: 42px; justify-content: center; }
.row-actions-menu { position: relative; flex-shrink: 0; }
.row-actions-menu__trigger { list-style: none; display: inline-flex; align-items: center; justify-content: center; min-width: 42px; min-height: 42px; padding: 0 12px; border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; color: #475569; font-size: 18px; font-weight: 700; cursor: pointer; user-select: none; }
.row-actions-menu__trigger::-webkit-details-marker { display: none; }
.row-actions-menu[open] .row-actions-menu__trigger { background: #f0fdfa; border-color: #99f6e4; color: #0f766e; }
.row-actions-menu__panel { position: absolute; inset-inline-end: 0; bottom: calc(100% + 6px); min-width: 180px; padding: 6px; border-radius: 12px; background: #fff; border: 1px solid #e2e8f0; box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14); z-index: 50; }
.row-actions-menu__item { display: block; width: 100%; text-align: inherit; padding: 10px 12px; border: none; border-radius: 8px; background: transparent; color: #334155; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none; font-family: inherit; }
.row-actions-menu__item:hover { background: #f0fdfa; color: #0f766e; }
.row-actions-menu__item--danger { color: #b91c1c; }
.row-actions-menu__item--danger:hover { background: #fef2f2; color: #991b1b; }
