:root {
    --bg-main: #f7f8ff;
    --bg-soft: #eff4ff;
    --surface: rgba(255, 255, 255, 0.86);
    --surface-solid: #ffffff;
    --line: rgba(120, 140, 184, 0.16);
    --text: #14213d;
    --muted: #8b98b4;
    --primary: #2c6af2;
    --secondary: #8f4cff;
    --success: #1d9d77;
    --danger: #ef5f71;
    --warning: #f1a941;
    --shadow-lg: 0 28px 60px rgba(83, 102, 150, 0.13);
    --shadow-md: 0 16px 36px rgba(85, 101, 145, 0.11);
    --shadow-sm: 0 10px 24px rgba(87, 104, 151, 0.08);
    --radius-xl: 34px;
    --radius-lg: 26px;
    --radius-md: 20px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Tajawal', sans-serif;
    background:
        radial-gradient(circle at top left, rgba(155, 111, 255, 0.18), transparent 28%),
        radial-gradient(circle at top right, rgba(52, 128, 255, 0.18), transparent 25%),
        linear-gradient(180deg, #fbfbff 0%, #f4f7ff 52%, #fbfcff 100%);
    color: var(--text);
}

body.modal-open {
    overflow: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

.screen-glow {
    position: fixed;
    inset: auto;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.36;
    pointer-events: none;
    z-index: 0;
}

.screen-glow--one {
    top: -40px;
    right: -40px;
    background: rgba(142, 103, 255, 0.34);
}

.screen-glow--two {
    bottom: 140px;
    left: -80px;
    background: rgba(73, 157, 255, 0.22);
}

.mobile-shell {
    position: relative;
    z-index: 1;
    max-width: 430px;
    min-height: 100vh;
    margin: 0 auto;
    padding-bottom: 112px;
}

.app-header {
    position: relative;
    padding: 22px 24px 18px;
}

.app-header--surface {
    min-height: 126px;
}

.app-header--gradient {
    min-height: 180px;
    border-bottom-right-radius: 44px;
    border-bottom-left-radius: 44px;
    background: linear-gradient(135deg, #2f63f0 0%, #7747ff 100%);
    color: #ffffff;
    box-shadow: var(--shadow-lg);
}

.app-header--auth {
    padding-top: 44px;
    min-height: 172px;
    text-align: center;
}

.app-header--auth .header-copy {
    margin-top: 54px;
}

.app-header--surface .header-copy {
    margin-top: 54px;
    text-align: center;
}

.app-header--gradient .header-copy {
    margin-top: 54px;
    text-align: center;
}

.header-copy h1 {
    margin: 0;
    font-size: clamp(2rem, 5vw, 2.65rem);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.header-copy p {
    margin: 10px 0 0;
    color: inherit;
    opacity: 0.8;
    font-size: 1.05rem;
}

.ornaments {
    position: absolute;
    inset: 18px 24px auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.ornament {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 14px 24px rgba(82, 99, 142, 0.12);
    color: #ffffff;
    font-size: 1.55rem;
    backdrop-filter: blur(14px);
}

.app-header--gradient .ornament {
    background: rgba(255, 255, 255, 0.12);
}

.ornament::before {
    content: '';
    position: absolute;
    top: -22px;
    left: 50%;
    width: 1px;
    height: 24px;
    background: rgba(232, 207, 130, 0.78);
    transform: translateX(-50%);
}

.ornament--blue {
    color: #3e8eff;
}

.ornament--rose {
    color: #ff5a65;
}

.ornament--gold {
    color: #ffcc19;
}

.ornament--star {
    color: #ffcf1a;
}

.page-body {
    padding: 0 18px 32px;
}

.page-body--floating {
    margin-top: -46px;
}

.auth-stack {
    display: grid;
    gap: 20px;
}

.card,
.panel,
.auth-card,
.empty-state,
.stat-card,
.admin-card {
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-xl);
    background: var(--surface);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(18px);
}

.card,
.panel,
.admin-card {
    padding: 22px;
}

.auth-card {
    padding: 26px 22px;
}

.hero-balance {
    display: grid;
    gap: 24px;
    padding: 28px 24px;
    border-radius: 42px;
    color: #ffffff;
    background: linear-gradient(135deg, #2762ef 0%, #3554dd 46%, #4768ff 100%);
    box-shadow: 0 26px 50px rgba(53, 101, 233, 0.28);
}

.hero-balance__top,
.hero-balance__bottom {
    display: flex;
    justify-content: space-between;
    gap: 18px;
}

.hero-balance__label {
    display: block;
    color: rgba(255, 255, 255, 0.78);
    font-size: 1.02rem;
}

.hero-balance__value {
    margin-top: 8px;
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
}

.hero-balance__meta strong {
    display: block;
    margin-top: 8px;
    font-size: 1.7rem;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: 20px;
}

.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 128px;
    padding: 16px 10px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: var(--shadow-sm);
    text-align: center;
    color: var(--text);
}

.quick-action i {
    font-size: 1.75rem;
}

.quick-action--green {
    background: linear-gradient(180deg, #eefdf5 0%, #f8fffb 100%);
    color: #0a9c6b;
}

.quick-action--violet {
    background: linear-gradient(180deg, #f8edff 0%, #fcf7ff 100%);
    color: #7d35ff;
}

.quick-action--amber {
    background: linear-gradient(180deg, #fff4ea 0%, #fffaf3 100%);
    color: #ef6a08;
}

.quick-action--slate {
    background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
    color: #49627a;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 28px 0 16px;
}

.section-head h2,
.section-head h3 {
    margin: 0;
    font-size: 1.9rem;
    font-weight: 700;
}

.section-head .pill-link {
    padding: 10px 18px;
    border-radius: 999px;
    color: var(--primary);
    background: #eef5ff;
    font-weight: 700;
}

.empty-state {
    padding: 42px 22px;
    text-align: center;
    color: #b1bdd3;
    border: 1px dashed #dde6f5;
}

.empty-state i,
.empty-state img {
    display: block;
    margin: 0 auto 14px;
    font-size: 3.2rem;
    width: 88px;
    opacity: 0.9;
}

.note-banner {
    margin-bottom: 18px;
    padding: 13px 18px;
    border-radius: 20px;
    color: #7a879f;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.cards-grid {
    display: grid;
    gap: 18px;
}

.store-card {
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 18px;
    padding: 26px 22px 22px;
    border-radius: 42px;
    color: #ffffff;
    box-shadow: 0 26px 44px rgba(65, 89, 148, 0.2);
}

.store-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at bottom left, rgba(255, 255, 255, 0.08), transparent 32%),
        linear-gradient(120deg, rgba(255, 255, 255, 0.04), transparent 45%);
    pointer-events: none;
}

.store-card__top,
.store-card__bottom {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
}

.store-card__icon {
    width: 70px;
    height: 70px;
    flex: 0 0 70px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.11);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.9rem;
}

.store-card__summary {
    min-width: 0;
    flex: 1;
    display: grid;
    gap: 10px;
    text-align: right;
}

.store-card__duration {
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    gap: 8px;
}

.store-card__hours-number {
    font-size: 2.65rem;
    line-height: 0.95;
    font-weight: 800;
}

.store-card__hours-label {
    margin-bottom: 4px;
    font-size: 1.18rem;
    font-weight: 700;
}

.store-card__description {
    margin: 0;
    max-width: 230px;
    line-height: 1.7;
    font-size: 0.96rem;
    color: rgba(255, 255, 255, 0.75);
}

.store-card__stock-chip {
    width: fit-content;
    margin-top: 2px;
}

.store-card__spec {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.store-card__spec-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
}

.store-card__spec-value {
    font-size: 1.65rem;
    line-height: 1;
    font-weight: 800;
}

.store-card__bottom {
    align-items: flex-end;
}

.store-card__purchase {
    display: grid;
    gap: 12px;
    margin: 0;
}

.store-card__purchase .btn {
    min-width: 126px;
    min-height: 54px;
    border-radius: 20px;
    font-size: 1.08rem;
}

.store-card__price {
    display: grid;
    gap: 4px;
    justify-items: end;
    text-align: left;
}

.store-card__price-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.98rem;
}

.store-card__price-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    direction: ltr;
}

.store-card__currency {
    margin-bottom: 5px;
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.94);
}

.store-card__amount {
    font-size: 3rem;
    line-height: 0.92;
    font-weight: 800;
}

.stock-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 13px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.11);
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.92rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 56px;
    padding: 0 24px;
    border: 0;
    border-radius: 22px;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
    font-weight: 800;
}

.btn:hover {
    transform: translateY(-1px);
}

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

.btn--primary {
    color: #ffffff;
    background: linear-gradient(135deg, #6f2bff 0%, #9e72ff 100%);
    box-shadow: 0 20px 32px rgba(124, 70, 255, 0.25);
}

.btn--light {
    color: #274884;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(255, 255, 255, 0.2);
}

.btn--ghost {
    color: var(--primary);
    background: #eef4ff;
}

.btn--danger {
    color: #ffffff;
    background: linear-gradient(135deg, #ed5c72 0%, #ff8a8a 100%);
}

.btn--dark {
    color: #ffffff;
    background: linear-gradient(135deg, #1c2438 0%, #2c3b59 100%);
}

.btn--block {
    width: 100%;
}

.form-grid {
    display: grid;
    gap: 16px;
}

.field {
    display: grid;
    gap: 8px;
}

.field label {
    color: #9aa7bd;
    font-size: 1rem;
}

.field-control {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 64px;
    padding: 0 18px;
    border: 1px solid rgba(118, 138, 184, 0.12);
    border-radius: 24px;
    background: #f8faff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.field-control i {
    color: #d5deef;
    font-size: 1.35rem;
}

.field-control input,
.field-control select,
.field-control textarea {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    resize: vertical;
}

.field-control textarea {
    min-height: 120px;
    padding: 18px 0;
}

.field-help {
    color: var(--muted);
    font-size: 0.95rem;
}

.field-control--logo {
    gap: 16px;
}

.payment-services,
.payment-options {
    display: grid;
    gap: 14px;
}

.payment-service-card,
.payment-option__content {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 24px;
    background: linear-gradient(180deg, #fbfcff 0%, #f3f7ff 100%);
    border: 1px solid rgba(113, 140, 197, 0.12);
    box-shadow: var(--shadow-sm);
}

.payment-service-card__copy,
.payment-option__copy {
    display: grid;
    gap: 4px;
    flex: 1;
}

.payment-service-card__copy strong,
.payment-option__copy strong {
    font-size: 1.06rem;
}

.payment-service-card__copy span,
.payment-option__copy small {
    color: var(--muted);
}

.payment-service-card__copy bdi,
.payment-option__copy bdi {
    font-size: 1.08rem;
    font-weight: 800;
    color: var(--primary);
}

.payment-service-logo {
    width: 62px;
    height: 62px;
    flex: 0 0 62px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 12px 24px rgba(92, 112, 158, 0.16);
}

.payment-service-logo img {
    width: 100%;
    height: 100%;
    display: block;
}

.payment-service-logo--compact {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border-radius: 15px;
}

.payment-service-logo--small {
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
    border-radius: 18px;
}

.payment-service-logo--placeholder {
    background: linear-gradient(135deg, #edf4ff 0%, #f7f0ff 100%);
}

.payment-service-logo--bank {
    background: linear-gradient(135deg, #0c68ff 0%, #45c2ff 100%);
}

.payment-service-logo--palpay {
    background: linear-gradient(135deg, #5c2dff 0%, #bb8cff 100%);
}

.payment-service-logo--jawwal {
    background: linear-gradient(135deg, #00a76f 0%, #42e3b0 100%);
}

.payment-option {
    display: block;
    position: relative;
    cursor: pointer;
}

.payment-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.payment-option__check {
    color: #d2dced;
    font-size: 1.5rem;
}

.payment-option__content {
    width: 100%;
}

.payment-option input:checked + .payment-option__content {
    border-color: rgba(92, 88, 255, 0.42);
    background: linear-gradient(180deg, #f9f5ff 0%, #eef3ff 100%);
    box-shadow: 0 18px 34px rgba(121, 93, 255, 0.14);
}

.payment-option input:checked + .payment-option__content .payment-option__check {
    color: var(--secondary);
}

.payment-method-list {
    display: grid;
    gap: 16px;
}

.payment-method-editor {
    padding: 20px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: var(--shadow-sm);
}

.payment-method-editor__head,
.payment-method-editor__logo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.payment-method-editor__head {
    margin-bottom: 16px;
}

.payment-method-editor__remove {
    min-height: 44px;
    padding-inline: 16px;
    border-radius: 16px;
}

.payment-method-editor__logo .field-control {
    flex: 1;
}

.login-banner-editor {
    display: grid;
    gap: 14px;
}

.login-banner-editor__preview {
    overflow: hidden;
    border-radius: 26px;
    border: 1px solid rgba(113, 140, 197, 0.12);
    background: linear-gradient(180deg, #fbfcff 0%, #f3f7ff 100%);
}

.login-banner-editor__preview img {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    display: block;
}

.auth-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.auth-card__icon {
    width: 74px;
    height: 74px;
    border-radius: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(114, 51, 255, 0.95) 0%, rgba(186, 145, 255, 0.9) 100%);
    color: #ffffff;
    font-size: 2rem;
    box-shadow: 0 20px 40px rgba(141, 93, 255, 0.3);
}

.auth-card h2 {
    margin: 0;
    font-size: 3.1rem;
    line-height: 1.05;
}

.auth-card p {
    margin: 6px 0 0;
    color: #c1bfd0;
    font-size: 1.15rem;
}

.auth-inline-link {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
    font-size: 1rem;
    color: #9ea7bb;
}

.auth-inline-link a {
    color: #6f2bff;
    font-weight: 700;
}

.login-alert-banner {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 18px;
    padding: 16px 18px;
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    background-color: #dc3f4f;
    background: linear-gradient(135deg, #ff5d68 0%, #dc3f4f 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #ffffff;
    box-shadow: 0 20px 38px rgba(220, 63, 79, 0.24);
}

.login-alert-banner__icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.16);
    font-size: 2rem;
    line-height: 1;
}

.login-alert-banner__content {
    display: grid;
    gap: 6px;
    flex: 1;
}

.login-alert-banner__content strong {
    font-size: 1.06rem;
    font-weight: 800;
}

.login-alert-banner__content p {
    margin: 0;
    color: rgba(255, 255, 255, 0.92);
    line-height: 1.8;
    font-size: 0.95rem;
}

.login-alert-banner__link {
    width: fit-content;
    margin-top: 4px;
    padding: 9px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    font-size: 0.92rem;
    font-weight: 700;
}

.login-alert-banner__link:hover,
.login-alert-banner__link:focus {
    background: rgba(255, 255, 255, 0.24);
    color: #ffffff;
}

.auth-banner {
    display: grid;
    gap: 18px;
    padding: 24px 22px;
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, rgba(39, 98, 239, 0.96) 0%, rgba(126, 73, 255, 0.94) 100%);
    color: #ffffff;
    box-shadow: var(--shadow-lg);
}

.auth-banner__copy {
    display: grid;
    gap: 10px;
}

.auth-banner__copy h3 {
    margin: 0;
    font-size: 2rem;
}

.auth-banner__copy p {
    margin: 0;
    color: rgba(255, 255, 255, 0.86);
    line-height: 1.8;
}

.auth-banner__button {
    width: fit-content;
    min-width: 160px;
}

.auth-banner__media {
    overflow: hidden;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.14);
}

.auth-banner__media img {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    display: block;
}

.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.switch {
    position: relative;
    width: 68px;
    height: 38px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch span {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: #ecdffb;
    transition: 0.2s ease;
}

.switch span::before {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #f6edff;
    box-shadow: 0 8px 14px rgba(100, 76, 138, 0.16);
    transition: 0.2s ease;
}

.switch input:checked + span {
    background: linear-gradient(135deg, #7d3cff 0%, #b18aff 100%);
}

.switch input:checked + span::before {
    transform: translateX(-30px);
    background: #ffffff;
}

.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 14px;
    border-radius: 18px;
    box-shadow: var(--shadow-sm);
}

.alert--success {
    color: #106e55;
    background: #ebfaf5;
}

.alert--danger {
    color: #9d3646;
    background: #ffeff2;
}

.alert--info {
    color: #2057a8;
    background: #edf4ff;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 88px;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.93rem;
    font-weight: 700;
}

.badge--success {
    color: #0d7e5a;
    background: #e7fbf1;
}

.badge--danger {
    color: #a93f50;
    background: #ffeef1;
}

.badge--warning {
    color: #90631a;
    background: #fff6df;
}

.badge--muted {
    color: #71829f;
    background: #eef2fa;
}

.badge--info {
    color: #2057a8;
    background: #edf4ff;
}

.purchase-card,
.account-card,
.recharge-card {
    display: grid;
    gap: 16px;
}

.purchase-card__head,
.data-row,
.inline-actions,
.archive-note {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.purchase-card__code {
    padding: 16px 18px;
    border-radius: 22px;
    background: #f7f9ff;
    color: #334669;
    word-break: break-word;
    white-space: pre-line;
}

.code-preline {
    white-space: pre-line;
    word-break: break-word;
}

.log-context-cell {
    min-width: 280px;
}

.log-context {
    margin: 0;
    padding: 12px 14px;
    border-radius: 16px;
    background: #f7f9ff;
    color: #334669;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.88rem;
    line-height: 1.7;
    direction: ltr;
    text-align: left;
}

.inline-actions {
    flex-wrap: wrap;
}

.admin-balance-form {
    display: grid;
    gap: 8px;
    min-width: 300px;
}

.admin-balance-form select,
.admin-balance-form input {
    width: 100%;
    border: 1px solid #dde4f3;
    border-radius: 12px;
    padding: 10px;
    background: #ffffff;
    color: var(--text);
}

.money-positive {
    color: #12966f;
    font-weight: 800;
}

.money-negative {
    color: #d94b61;
    font-weight: 800;
}

.transaction-card {
    padding: 18px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: var(--shadow-sm);
}

.pending-recharge-card {
    border: 1px solid rgba(255, 193, 7, 0.22);
    background: linear-gradient(180deg, #fffdf7 0%, #ffffff 100%);
}

.pending-recharge-message {
    margin: 0;
    padding: 14px 16px;
    border-radius: 18px;
    background: #fff6df;
    color: #8b6316;
    font-weight: 800;
    line-height: 1.8;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
}

.pagination a {
    min-width: 42px;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: #eef4ff;
    color: var(--primary);
    font-weight: 800;
}

.pagination a.is-active {
    color: #ffffff;
    background: linear-gradient(135deg, #2f63f0 0%, #7747ff 100%);
}

.inline-actions .btn {
    min-height: 48px;
    padding-inline: 18px;
    border-radius: 18px;
}

.card-status-note {
    padding: 14px 16px;
    border-radius: 18px;
    font-weight: 700;
    line-height: 1.7;
}

.card-status-note--warning {
    color: #8b6316;
    background: #fff6df;
}

.card-status-note--danger {
    color: #a93f50;
    background: #ffeef1;
}

.card-status-note--info {
    color: #2057a8;
    background: #edf4ff;
}

.countdown-chip {
    color: var(--primary);
    font-weight: 800;
}

.quantity-box {
    display: grid;
    gap: 8px;
}

.quantity-box__label {
    color: rgba(255, 255, 255, 0.76);
    font-size: 0.9rem;
    font-weight: 700;
}

.quantity-box__controls {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.quantity-box__button {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 800;
    color: #274884;
    background: #ffffff;
}

.quantity-box__button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.quantity-box__controls input {
    width: 58px;
    border: 0;
    outline: 0;
    background: transparent;
    text-align: center;
    color: #ffffff;
    font-weight: 800;
    -moz-appearance: textfield;
}

.quantity-box__controls input::-webkit-outer-spin-button,
.quantity-box__controls input::-webkit-inner-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

.quantity-box--modal {
    margin-bottom: 18px;
}

.quantity-box--modal .quantity-box__label {
    color: var(--muted);
}

.quantity-box--modal .quantity-box__controls {
    justify-content: center;
    background: #eef3ff;
    box-shadow: none;
}

.quantity-box--modal .quantity-box__controls input {
    color: var(--text);
}

.purchase-modal {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 18px;
}

.purchase-modal[hidden] {
    display: none !important;
}

.purchase-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(16, 24, 40, 0.45);
    backdrop-filter: blur(6px);
}

.purchase-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(100%, 430px);
    padding: 24px 22px;
    border-radius: 34px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 30px 60px rgba(52, 66, 110, 0.24);
}

.purchase-modal__close {
    position: absolute;
    top: 14px;
    left: 14px;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 14px;
    cursor: pointer;
    color: var(--text);
    background: #eef3ff;
}

.purchase-modal__head {
    margin-bottom: 18px;
}

.purchase-modal__head h3 {
    margin: 0;
    font-size: 1.8rem;
}

.purchase-modal__head p {
    margin: 8px 0 0;
    color: var(--muted);
}

.purchase-invoice {
    display: grid;
    gap: 12px;
    padding: 18px;
    margin-bottom: 18px;
    border-radius: 26px;
    background: linear-gradient(180deg, #fbfcff 0%, #f4f7ff 100%);
    border: 1px solid rgba(113, 140, 197, 0.12);
}

.purchase-invoice__total {
    font-size: 1.15rem;
}

.purchase-total-box {
    display: grid;
    gap: 8px;
    justify-items: center;
    padding: 18px;
    margin-bottom: 18px;
    border-radius: 24px;
    background: linear-gradient(135deg, #edf4ff 0%, #f6efff 100%);
    color: var(--text);
    text-align: center;
}

.purchase-total-box span {
    color: var(--muted);
    font-weight: 700;
}

.purchase-total-box strong {
    font-size: 2rem;
    color: var(--primary);
}

.support-fab {
    position: fixed;
    left: max(18px, calc(50% - 195px));
    bottom: 126px;
    width: 74px;
    height: 74px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: linear-gradient(135deg, #2365f4 0%, #2b83ff 100%);
    box-shadow: 0 24px 38px rgba(44, 106, 242, 0.34);
    font-size: 1.8rem;
    z-index: 9;
}

.bottom-nav {
    position: fixed;
    right: 50%;
    bottom: 18px;
    transform: translateX(50%);
    width: min(394px, calc(100vw - 24px));
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    padding: 14px 18px;
    border-radius: 36px;
    background: rgba(255, 255, 255, 0.84);
    box-shadow: 0 26px 52px rgba(102, 119, 164, 0.18);
    backdrop-filter: blur(20px);
    z-index: 10;
}

.bottom-nav a {
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 10px 4px;
    color: #a2afc4;
    font-size: 0.98rem;
    font-weight: 700;
}

.bottom-nav a i {
    font-size: 1.8rem;
}

.bottom-nav a.is-active {
    color: var(--primary);
}

.admin-body {
    background:
        radial-gradient(circle at top left, rgba(184, 150, 255, 0.2), transparent 25%),
        linear-gradient(180deg, #f7f3ff 0%, #f5f7fd 48%, #fbfcff 100%);
}

.admin-shell {
    max-width: 1180px;
    margin: 0 auto;
    padding: 28px 18px 44px;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 28px;
    border-radius: 36px;
    background: linear-gradient(135deg, #ffffff 0%, #f7f3ff 100%);
    box-shadow: var(--shadow-md);
}

.admin-header h1 {
    margin: 10px 0 0;
    font-size: 2.5rem;
}

.admin-kicker {
    color: var(--secondary);
    font-weight: 700;
}

.admin-user-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-radius: 999px;
    background: #eef3ff;
    color: var(--primary);
    font-weight: 700;
}

.admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 22px 0;
}

.admin-nav a {
    padding: 12px 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: var(--shadow-sm);
    color: #5f6f8e;
    font-weight: 700;
}

.admin-nav a.is-active {
    color: #ffffff;
    background: linear-gradient(135deg, #275de9 0%, #7c49ff 100%);
}

.admin-main {
    display: grid;
    gap: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.stat-card {
    padding: 20px;
}

.stat-card span {
    color: var(--muted);
}

.stat-card strong {
    display: block;
    margin-top: 12px;
    font-size: 2rem;
}

.admin-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 20px;
}

.table-wrap {
    overflow: auto;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.8);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 16px;
    text-align: right;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

th {
    color: var(--muted);
    font-weight: 700;
}

.data-stack {
    display: grid;
    gap: 18px;
}

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

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

.divider {
    height: 1px;
    margin: 10px 0;
    background: var(--line);
}

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

.span-2 {
    grid-column: span 2;
}

.login-page .page-body {
    margin-top: -30px;
}

.tiny-note {
    text-align: center;
    color: #b3b7c8;
    line-height: 1.8;
}

.tiny-note strong {
    color: #6a37ff;
}

.debt-issued-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    background: linear-gradient(135deg, rgba(237, 246, 255, 0.96), rgba(248, 241, 255, 0.96));
}

.debt-issued-result h3 {
    margin: 6px 0;
    font-size: 1.8rem;
}

.debt-issued-code {
    display: grid;
    gap: 10px;
    min-width: min(100%, 320px);
}

.debt-issued-code pre {
    margin: 0;
    padding: 14px 16px;
    border-radius: 18px;
    background: #ffffff;
    color: #24324c;
    box-shadow: var(--shadow-sm);
    white-space: pre-wrap;
    word-break: break-word;
}

.debt-customer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}

.debt-customer-card {
    display: grid;
    gap: 18px;
    padding: 22px;
    border-radius: 34px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: var(--shadow-md);
}

.debt-customer-card.is-archived {
    opacity: 0.72;
}

.debt-customer-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.debt-customer-card__head h3 {
    margin: 10px 0 4px;
    font-size: 1.65rem;
}

.debt-avatar {
    width: 62px;
    height: 62px;
    flex: 0 0 62px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 22px;
    color: #ffffff;
    background: linear-gradient(135deg, #275de9 0%, #7c49ff 100%);
    box-shadow: 0 18px 30px rgba(92, 88, 255, 0.2);
    font-size: 1.6rem;
}

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

.debt-metrics > div,
.debt-summary-grid > div,
.debt-issue-summary > div {
    padding: 14px;
    border-radius: 20px;
    background: linear-gradient(180deg, #fbfcff 0%, #f3f7ff 100%);
    border: 1px solid rgba(113, 140, 197, 0.12);
}

.debt-metrics span,
.debt-summary-grid span,
.debt-issue-summary span {
    display: block;
    color: var(--muted);
    font-size: 0.92rem;
}

.debt-metrics strong,
.debt-summary-grid strong,
.debt-issue-summary strong {
    display: block;
    margin-top: 6px;
    color: var(--text);
    font-size: 1.18rem;
}

.debt-metrics__remaining strong {
    color: var(--danger);
}

.debt-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.debt-card-actions .btn {
    min-height: 44px;
    padding-inline: 16px;
    border-radius: 16px;
}

.debt-card-actions form {
    margin: 0;
}

.debt-status--debt {
    color: #9a4b11;
    background: #fff1df;
}

.debt-status--paid {
    color: #0d7e5a;
    background: #e7fbf1;
}

.debt-status--empty {
    color: #2057a8;
    background: #edf4ff;
}

.debt-modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.debt-modal[hidden] {
    display: none !important;
}

.debt-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(16, 24, 40, 0.48);
    backdrop-filter: blur(8px);
}

.debt-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(100%, 520px);
    max-height: min(88vh, 900px);
    overflow: auto;
    padding: 24px;
    border-radius: 34px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 32px 72px rgba(48, 63, 108, 0.26);
}

.debt-modal--wide .debt-modal__dialog {
    width: min(100%, 980px);
}

.debt-modal__close {
    position: sticky;
    top: 0;
    float: left;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 16px;
    cursor: pointer;
    color: var(--text);
    background: #eef3ff;
    z-index: 2;
}

.debt-modal__head {
    margin-bottom: 18px;
}

.debt-modal__head h3 {
    margin: 0;
    font-size: 1.95rem;
}

.debt-modal__head p {
    margin: 8px 0 0;
    color: var(--muted);
}

.debt-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    padding: 8px;
    border-radius: 20px;
    background: #eef4ff;
}

.debt-tabs button {
    min-height: 42px;
    padding: 0 16px;
    border: 0;
    border-radius: 15px;
    cursor: pointer;
    color: #61718e;
    background: transparent;
    font-weight: 800;
}

.debt-tabs button.is-active {
    color: #ffffff;
    background: linear-gradient(135deg, #275de9 0%, #7c49ff 100%);
}

.debt-tab-panel {
    display: none;
}

.debt-tab-panel.is-active {
    display: block;
}

.stock-file-import {
    overflow: hidden;
    background:
        radial-gradient(circle at top left, rgba(119, 75, 255, 0.12), transparent 34%),
        rgba(255, 255, 255, 0.9);
}

.stock-file-import .section-head p {
    margin: 8px 0 0;
    line-height: 1.7;
}

.stock-file-import__icon {
    width: 68px;
    height: 68px;
    flex: 0 0 68px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 24px;
    color: #ffffff;
    background: linear-gradient(135deg, #275de9 0%, #7c49ff 100%);
    box-shadow: 0 18px 34px rgba(91, 73, 238, 0.24);
    font-size: 1.75rem;
}

.stock-import-format-note {
    display: grid;
    gap: 7px;
    padding: 16px 18px;
    border-radius: 22px;
    color: #526584;
    background: linear-gradient(135deg, #eef5ff 0%, #f7f1ff 100%);
    line-height: 1.7;
}

.stock-import-confirmation {
    display: grid;
    gap: 18px;
}

.stock-import-confirmation__summary {
    padding: 20px;
    border-radius: 26px;
    background: linear-gradient(135deg, #eefaf6 0%, #f7fbff 100%);
    border: 1px solid rgba(29, 157, 119, 0.12);
}

.stock-import-confirmation__summary h3 {
    margin: 14px 0 18px;
    font-size: 1.7rem;
}

.stock-import-sample {
    display: grid;
    gap: 10px;
    padding: 18px;
    border-radius: 26px;
    background: #f8faff;
    border: 1px solid rgba(113, 140, 197, 0.12);
}

.stock-import-sample__item {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 12px;
    border-radius: 18px;
    background: #ffffff;
}

.stock-import-sample__item > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    border-radius: 12px;
    color: var(--primary);
    background: #eef4ff;
    font-weight: 800;
}

.stock-import-sample__item code {
    padding-top: 5px;
    color: #334669;
    white-space: pre-line;
    word-break: break-word;
    font-family: 'Tajawal', sans-serif;
}

.stock-import-preview-list {
    display: grid;
    gap: 14px;
    padding: 18px;
    border-radius: 26px;
    background: #f8faff;
    border: 1px solid rgba(113, 140, 197, 0.12);
}

.stock-import-preview-list__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.stock-import-preview-list__head > div {
    display: grid;
    gap: 5px;
}

.stock-import-preview-list td.code-preline {
    min-width: 260px;
    white-space: pre-line;
}

.stock-import-delete {
    min-height: 40px;
    padding-inline: 13px;
    border-radius: 14px;
}

.stock-import-pagination a {
    padding-inline: 13px;
    gap: 7px;
}

@media (max-width: 767px) {
    .admin-header,
    .admin-grid,
    .stats-grid,
    .admin-form-grid {
        grid-template-columns: 1fr;
    }

    .admin-header {
        padding: 24px 18px;
    }

    .admin-header h1 {
        font-size: 2rem;
    }

    .stock-import-preview-list__head {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .debt-issued-result,
    .hero-balance__top,
    .hero-balance__bottom,
    .purchase-card__head,
    .data-row,
    .toggle-row,
    .section-head {
        flex-direction: column;
        align-items: stretch;
    }

    .debt-metrics,
    .debt-summary-grid,
    .debt-issue-summary {
        grid-template-columns: 1fr;
    }

    .debt-modal {
        align-items: flex-end;
        padding: 10px;
    }

    .debt-modal__dialog {
        max-height: 92vh;
        border-radius: 30px 30px 24px 24px;
        padding: 22px 18px;
    }

    .store-card__top,
    .store-card__bottom,
    .store-card__spec {
        flex-direction: row;
        align-items: flex-start;
    }

    .store-card__price {
        justify-items: end;
    }

    .quick-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .auth-card h2 {
        font-size: 2.4rem;
    }

    .store-card {
        padding: 24px 20px 20px;
    }

    .store-card__hours-number {
        font-size: 2.35rem;
    }

    .store-card__description {
        max-width: none;
        font-size: 0.92rem;
    }

    .store-card__amount {
        font-size: 2.55rem;
    }
}
