/* ═══════════════════════════════════════════════════════════
   ZikFash — Design System
   Tokens: cream bg · dark espresso · gold accent · forest green
═══════════════════════════════════════════════════════════ */

:root {
    --cream: #faf6f0;
    --cream-2: #f5f0e8;
    --cream-3: #fffdf8;
    --border: #e8ddc8;
    --border-2: #d8c8a8;
    --espresso: #1a1208;
    --espresso-2: #2e2010;
    --espresso-3: #3a2810;
    --gold: #b8955a;
    --gold-2: #d4a84b;
    --text: #1a1208;
    --text-2: #7a6040;
    --text-3: #9a7a50;
    --green: #2d6a4f;
    --green-2: #245c43;
    --green-3: #52b788;
    --green-bg: #d1fae5;
    --red: #dc2626;
    --red-bg: #fee2e2;
    --amber: #d97706;
    --amber-bg: #fff3cd;
    --blue: #0369a1;
    --blue-bg: #e0f2fe;
    --wa: #25D366;
    --wa-2: #1ebe5b;
    --radius: 8px;
    --radius-lg: 14px;
    --shadow: 0 2px 12px rgba(26, 18, 8, .08);
    --shadow-lg: 0 12px 40px rgba(26, 18, 8, .18);
}

/* ─── Reset ───────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Lato', sans-serif;
    background: var(--cream);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ─── Loading Splash ──────────────────────────────────────── */
.app-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    gap: 8px;
}

.loading-logo {
    font-size: 3rem;
    animation: spin-scissors 2s ease-in-out infinite;
}

@keyframes spin-scissors {

    0%,
    100% {
        transform: rotate(-15deg);
    }

    50% {
        transform: rotate(15deg);
    }
}

.loading-text {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--espresso);
}

.loading-sub {
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gold);
}

.loading-dots {
    display: flex;
    gap: 6px;
    margin-top: 12px;
}

.loading-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--gold);
    animation: dot-pulse 1.2s ease-in-out infinite;
}

.loading-dots span:nth-child(2) {
    animation-delay: .2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: .4s;
}

@keyframes dot-pulse {

    0%,
    100% {
        opacity: .3;
        transform: scale(.9);
    }

    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

/* ─── App Shell ───────────────────────────────────────────── */
.zf-app {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
}

/* ─── Header ──────────────────────────────────────────────── */
.zf-header {
    background: var(--espresso);
    color: #f5e6c8;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 2px 16px rgba(0, 0, 0, .3);
}

.zf-header__brand h1 {
    font-family: 'Playfair Display', serif;
    font-size: 1.35rem;
    letter-spacing: .04em;
    line-height: 1;
}

.zf-header__brand span {
    font-size: .68rem;
    letter-spacing: .18em;
    color: var(--gold);
    text-transform: uppercase;
    display: block;
    margin-top: 2px;
}

/* ─── Header nav links ────────────────────────────────────── */
.zf-nav-link {
    color: rgba(245, 230, 200, 0.65);
    text-decoration: none;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 5px 12px;
    border-radius: 20px;
    transition: all .18s;
    border: 1px solid transparent;
}

.zf-nav-link:hover {
    color: #f5e6c8;
    border-color: rgba(245, 230, 200, .25);
}

.zf-nav-link.active {
    color: var(--espresso);
    background: var(--gold);
    border-color: var(--gold);
}

/* ─── Buttons ─────────────────────────────────────────────── */

.btn {
    cursor: pointer;
    border: none;
    border-radius: 6px;
    font-family: 'Lato', sans-serif;
    font-weight: 600;
    letter-spacing: .04em;
    transition: all .18s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.btn-dark {
    background: var(--espresso);
    color: #f5e6c8;
    padding: 10px 20px;
    font-size: .875rem;
}

.btn-dark:hover:not(:disabled) {
    background: var(--espresso-2);
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border: 1.5px solid var(--border-2);
    padding: 8px 16px;
    font-size: .875rem;
}

.btn-outline:hover:not(:disabled) {
    background: var(--espresso);
    color: #f5e6c8;
    border-color: var(--espresso);
}

.btn-green {
    background: var(--green);
    color: #fff;
    padding: 9px 18px;
    font-size: .875rem;
}

.btn-green:hover:not(:disabled) {
    background: var(--green-2);
}

.btn-wa {
    background: var(--wa);
    color: #fff;
    padding: 9px 18px;
    font-size: .875rem;
}

.btn-wa:hover:not(:disabled) {
    background: var(--wa-2);
}

.btn-amber {
    background: var(--amber);
    color: #fff;
    padding: 7px 14px;
    font-size: .8rem;
}

.btn-amber:hover:not(:disabled) {
    background: #b45309;
}

.btn-ghost {
    background: none;
    border: none;
    color: var(--gold);
    font-size: .82rem;
    font-family: 'Lato', sans-serif;
    font-weight: 600;
    letter-spacing: .08em;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color .15s;
}

.btn-ghost:hover {
    color: #f5e6c8;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    color: var(--text-2);
    transition: color .15s;
    font-size: 1rem;
    line-height: 1;
}

.btn-icon:hover {
    color: var(--text);
}

.btn-sm {
    padding: 5px 10px !important;
    font-size: .76rem !important;
}

.btn-xs {
    padding: 4px 8px !important;
    font-size: .7rem !important;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

/* ─── Cards ───────────────────────────────────────────────── */
.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* ─── Form Controls ───────────────────────────────────────── */
.field {
    margin-bottom: 14px;
}

.field:last-child {
    margin-bottom: 0;
}

.label {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-2);
    margin-bottom: 5px;
    display: block;
}

.input,
.select,
.textarea {
    width: 100%;
    border: 1.5px solid var(--border-2);
    border-radius: 6px;
    padding: 9px 12px;
    font-family: 'Lato', sans-serif;
    font-size: .9rem;
    background: var(--cream-3);
    outline: none;
    color: var(--text);
    transition: border-color .18s, box-shadow .18s;
    appearance: none;
    -webkit-appearance: none;
}

.input:focus,
.select:focus,
.textarea:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(184, 149, 90, .12);
}

.input[type="date"] {
    cursor: pointer;
}

.naira-wrap {
    position: relative;
}

.naira-wrap::before {
    content: '₦';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-2);
    font-weight: 700;
    pointer-events: none;
    font-size: .9rem;
}

.naira-wrap .input {
    padding-left: 26px;
}

/* ─── Gender Toggle ───────────────────────────────────────── */
.gender-toggle {
    display: flex;
    border: 1.5px solid var(--border-2);
    border-radius: 6px;
    overflow: hidden;
}

.gender-btn {
    flex: 1;
    padding: 8px;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .05em;
    cursor: pointer;
    border: none;
    background: transparent;
    transition: all .15s;
    color: var(--text-2);
    font-family: 'Lato', sans-serif;
}

.gender-btn.active {
    background: var(--espresso);
    color: #f5e6c8;
}

/* ─── Tags / Badges ───────────────────────────────────────── */
.tag {
    padding: 2px 9px;
    border-radius: 20px;
    font-size: .66rem;
    font-weight: 700;
    white-space: nowrap;
    display: inline-block;
    letter-spacing: .02em;
}

.tag-pending {
    background: var(--amber-bg);
    color: #856404;
    border: 1px solid #ffd966;
}

.tag-done {
    background: var(--green-bg);
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.tag-overdue {
    background: var(--red-bg);
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.tag-collected {
    background: var(--blue-bg);
    color: var(--blue);
    border: 1px solid #7dd3fc;
}

/* ─── Customer List ───────────────────────────────────────── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 20px 16px 0;
}

.page-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    font-weight: 700;
}

.page-subtitle {
    font-size: .72rem;
    color: var(--text-2);
    margin-top: 2px;
}

.customer-list {
    padding: 0 16px 24px;
}

.empty-state {
    padding: 48px 20px;
    text-align: center;
}

.empty-state__icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.empty-state__title {
    font-family: 'Playfair Display', serif;
    font-size: 1.05rem;
    margin-bottom: 6px;
}

.empty-state__sub {
    font-size: .82rem;
    color: var(--text-2);
}

.customer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #f0e8d4;
    cursor: pointer;
    transition: background .15s;
    text-decoration: none;
    color: inherit;
}

.customer-row:last-child {
    border-bottom: none;
}

.customer-row:hover {
    background: #f7f2ea;
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #e8d9bc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    color: #7a5c30;
    font-weight: 700;
    flex-shrink: 0;
}

.customer-row__info {
    flex: 1;
    min-width: 0;
    padding: 0 10px;
}

.customer-row__name {
    font-weight: 600;
    font-size: .92rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.customer-row__meta {
    font-size: .7rem;
    color: var(--text-2);
    margin-top: 1px;
}

.progress-bar {
    height: 4px;
    background: var(--cream-2);
    border-radius: 99px;
    overflow: hidden;
    margin-top: 5px;
    width: 80px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--green), var(--green-3));
    border-radius: 99px;
    transition: width .4s;
}

.overdue-dot {
    width: 8px;
    height: 8px;
    background: var(--red);
    border-radius: 50%;
    display: inline-block;
    animation: pulse-dot 1.5s infinite;
    flex-shrink: 0;
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: .35;
    }
}

.customer-row__right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.owed-label {
    font-size: .68rem;
    color: var(--amber);
    font-weight: 700;
}

/* ─── Detail Page ─────────────────────────────────────────── */
.detail-section {
    padding: 16px;
}

.customer-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.customer-bar__avatar {
    width: 46px;
    height: 46px;
    font-size: 1.25rem;
}

.customer-bar__info {
    flex: 1;
}

.customer-bar__name {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.2;
}

.customer-bar__meta {
    font-size: .73rem;
    color: var(--text-2);
    margin-top: 2px;
}

.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 16px 0;
}

/* ─── Measurements grid ───────────────────────────────────── */
.body-measure-layout {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: 14px;
    margin-bottom: 16px;
}

.svg-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
}

.svg-card__hint {
    font-size: .65rem;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: .1em;
    margin-bottom: 6px;
    text-align: center;
}

.svg-card__count {
    font-size: .65rem;
    color: var(--text-3);
    margin-top: 5px;
}

.measure-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.measure-chip {
    background: var(--cream-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 9px;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}

.measure-chip:hover {
    border-color: var(--gold);
}

.measure-chip.filled {
    background: #e8f5ee;
    border-color: #a7d9bc;
}

.measure-chip__label {
    font-size: .6rem;
    color: var(--text-2);
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.measure-chip__val {
    font-size: .85rem;
    font-weight: 700;
    margin-top: 2px;
}

.measure-chip__val.has-val {
    color: var(--green);
}

.measure-chip__val.no-val {
    color: #c0a878;
}

/* ─── Order Card ──────────────────────────────────────────── */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    font-weight: 700;
}

.order-card {
    padding: 13px 14px;
    margin-bottom: 10px;
}

.order-card__top {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.order-card__thumb {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 6px;
    border: 1.5px solid var(--border);
    cursor: pointer;
    flex-shrink: 0;
    transition: transform .15s;
}

.order-card__thumb:hover {
    transform: scale(1.04);
}

.order-card__body {
    flex: 1;
    min-width: 0;
}

.order-card__desc {
    font-weight: 700;
    font-size: .9rem;
    margin-bottom: 2px;
}

.order-card__note {
    font-size: .72rem;
    color: var(--text-2);
    margin-bottom: 4px;
}

.order-card__due {
    font-size: .7rem;
}

.order-card__due.overdue {
    color: #991b1b;
    font-weight: 700;
}

.order-card__due.normal {
    color: var(--text-3);
}

.order-card__tags {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

/* Payment bar */
.pay-section {
    margin-top: 10px;
    padding: 8px 10px;
    background: var(--cream);
    border-radius: 6px;
    border: 1px solid #f0e8d4;
}

.pay-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .7rem;
    margin-bottom: 4px;
}

.pay-row__left {
    color: var(--text-2);
}

.pay-row__right {
    font-weight: 700;
}

.pay-row__right.owed {
    color: var(--amber);
}

.pay-row__right.paid {
    color: var(--green);
}

.pay-pill {
    height: 5px;
    background: var(--cream-2);
    border-radius: 99px;
    overflow: hidden;
}

.pay-pill__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--green), var(--green-3));
    border-radius: 99px;
    transition: width .4s;
}

/* Order actions */
.order-card__actions {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.order-card__actions .btn-receipt {
    margin-left: auto;
}

/* ─── Modals ──────────────────────────────────────────────── */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(26, 18, 8, .6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 16px;
    animation: fade-overlay .2s;
}

@keyframes fade-overlay {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal {
    background: var(--cream-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    width: 100%;
    max-width: 390px;
    box-shadow: var(--shadow-lg);
    max-height: 90vh;
    overflow-y: auto;
    animation: slide-modal .2s;
}

@keyframes slide-modal {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal__title {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.modal__sub {
    font-size: .73rem;
    color: var(--text-2);
    margin-bottom: 16px;
}

/* Photo upload */
.photo-upload-area {
    border: 2px dashed var(--border-2);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s;
}

.photo-upload-area:hover {
    border-color: var(--gold);
    background: #fffdf4;
}

.photo-upload-area__icon {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.photo-upload-area__text {
    font-size: .76rem;
    color: var(--text-2);
}

.photo-preview {
    position: relative;
    display: inline-block;
    width: 100%;
}

.photo-preview img {
    width: 100%;
    max-height: 140px;
    object-fit: cover;
    border-radius: 8px;
    border: 1.5px solid var(--border);
}

.photo-preview__remove {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--red);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: .76rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
}

/* Receipt preview */
.receipt-box {
    background: var(--cream-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    font-size: .73rem;
    white-space: pre-wrap;
    line-height: 1.65;
    color: var(--espresso-3);
    font-family: 'Courier New', monospace;
    max-height: 260px;
    overflow-y: auto;
}

/* Lightbox */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 250;
    cursor: zoom-out;
    padding: 20px;
    animation: fade-overlay .15s;
}

.lightbox-overlay img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
    cursor: default;
}

.lightbox-close {
    position: fixed;
    top: 18px;
    right: 18px;
    background: rgba(255, 255, 255, .15);
    backdrop-filter: blur(6px);
    border: 1.5px solid rgba(255, 255, 255, .3);
    color: #fff;
    font-size: 1.2rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, transform .15s;
    z-index: 251;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, .3);
    transform: scale(1.08);
}

/* ─── Toast ───────────────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    color: #f5e6c8;
    padding: 10px 24px;
    border-radius: 99px;
    font-size: .8rem;
    letter-spacing: .05em;
    z-index: 300;
    white-space: nowrap;
    pointer-events: none;
    animation: toast-in .2s;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .3);
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ─── Form row ────────────────────────────────────────────── */
.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* ─── Blazor error UI ─────────────────────────────────────── */
#blazor-error-ui {
    background: #ff7043;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, .2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    color: white;
    font-size: .85rem;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* ═══════════════════════════════════════════════════════════
   Hijabify Studio — Page Styles
   Ported design from hijabify/src/App.tsx, adapted to
   ZikFash design tokens (cream, espresso, gold, green)
═══════════════════════════════════════════════════════════ */

.hijabify-page {
    padding: 24px 20px 60px;
    max-width: 1100px;
    margin: 0 auto;
}

/* ── Header ────────────────────────────────────────────────── */
.hijabify-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
}

.hijabify-header-icon {
    width: 48px;
    height: 48px;
    background: var(--espresso);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(26,18,8,.25);
}

.hijabify-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--espresso);
    line-height: 1.1;
}

.hijabify-subtitle {
    font-size: .73rem;
    color: var(--text-2);
    letter-spacing: .06em;
    margin-top: 3px;
}

/* ── Two-column grid ───────────────────────────────────────── */
.hijabify-grid {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 24px;
    align-items: start;
}

@media (max-width: 720px) {
    .hijabify-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Control cards ─────────────────────────────────────────── */
.hijabify-controls {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.hijabify-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hijabify-section-label {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--text-2);
}

.hijabify-optional {
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text-3);
}

/* ── API key input ─────────────────────────────────────────── */
.hijabify-input {
    width: 100%;
    border: 1.5px solid var(--border-2);
    border-radius: 8px;
    padding: 9px 12px;
    font-family: 'Lato', sans-serif;
    font-size: .88rem;
    background: var(--cream-3);
    outline: none;
    color: var(--text);
    transition: border-color .18s, box-shadow .18s;
}

.hijabify-input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(184,149,90,.14);
}

.hijabify-hint {
    font-size: .68rem;
    color: var(--text-3);
}

.hijabify-hint a {
    color: var(--gold);
    text-decoration: none;
}

.hijabify-hint a:hover {
    text-decoration: underline;
}

/* ── Upload zones ──────────────────────────────────────────── */
.hijabify-upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--border-2);
    border-radius: 12px;
    padding: 20px 12px;
    cursor: pointer;
    transition: border-color .18s, background .18s;
    background: var(--cream-3);
    min-height: 90px;
    text-align: center;
    position: relative;
    overflow: hidden;
    gap: 6px;
}

.hijabify-upload-zone:hover {
    border-color: var(--gold);
    background: #fdf8f0;
}

.hijabify-upload-zone.has-image {
    border-color: var(--green);
    background: #f0faf5;
    padding: 6px;
}

.hijabify-preview-thumb {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
}

.hijabify-upload-badge {
    position: absolute;
    top: 6px;
    right: 8px;
    background: var(--green);
    color: #fff;
    font-size: .6rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    letter-spacing: .06em;
}

.hijabify-upload-icon {
    font-size: 1.4rem;
}

.hijabify-upload-text {
    font-size: .72rem;
    color: var(--text-2);
    font-weight: 600;
}

.hijabify-file-input {
    display: none;
}

/* ── Style grid ────────────────────────────────────────────── */
.hijabify-style-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
}

.hijabify-style-btn {
    padding: 9px 8px;
    border-radius: 10px;
    border: 1.5px solid var(--border-2);
    background: var(--cream-3);
    font-family: 'Lato', sans-serif;
    font-size: .75rem;
    font-weight: 600;
    color: var(--text-2);
    cursor: pointer;
    transition: all .15s;
    text-align: center;
}

.hijabify-style-btn:hover {
    border-color: var(--gold);
    color: var(--text);
}

.hijabify-style-btn.active {
    background: var(--espresso);
    border-color: var(--espresso);
    color: #f5e6c8;
    box-shadow: 0 3px 10px rgba(26,18,8,.2);
}

/* ── Generate button ───────────────────────────────────────── */
.hijabify-generate-btn {
    width: 100%;
    padding: 14px;
    background: var(--gold);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    font-size: .95rem;
    letter-spacing: .04em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background .18s, transform .1s, box-shadow .18s;
    box-shadow: 0 4px 16px rgba(184,149,90,.35);
}

.hijabify-generate-btn:hover:not(:disabled) {
    background: #a07038;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(184,149,90,.4);
}

.hijabify-generate-btn:active:not(:disabled) {
    transform: translateY(0);
}

.hijabify-generate-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
    box-shadow: none;
}

.hijabify-reset-btn {
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 1.5px solid var(--border-2);
    border-radius: 10px;
    font-family: 'Lato', sans-serif;
    font-size: .82rem;
    color: var(--text-2);
    cursor: pointer;
    transition: all .15s;
}

.hijabify-reset-btn:hover {
    border-color: var(--red);
    color: var(--red);
    background: var(--red-bg);
}

/* ── Canvas (right panel) ──────────────────────────────────── */
.hijabify-canvas-wrap {
    position: relative;
}

.hijabify-canvas {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    min-height: 520px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Loading overlay */
.hijabify-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255,253,248,.85);
    backdrop-filter: blur(6px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    z-index: 10;
}

.hijabify-loading-text {
    font-family: 'Playfair Display', serif;
    font-size: 1.05rem;
    color: var(--espresso);
    font-style: italic;
}

.hijabify-loading-sub {
    font-size: .72rem;
    color: var(--text-2);
    letter-spacing: .05em;
}

/* Spinners */
.hijabify-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    flex-shrink: 0;
}

.hijabify-spinner-lg {
    width: 52px;
    height: 52px;
    border: 4px solid var(--border);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty state */
.hijabify-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 48px 32px;
    gap: 10px;
}

.hijabify-empty-icon {
    font-size: 3rem;
    opacity: .4;
}

.hijabify-empty-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    color: var(--espresso);
}

.hijabify-empty-text {
    font-size: .8rem;
    color: var(--text-2);
    line-height: 1.6;
}

/* Result image */
.hijabify-result-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 24px;
    display: block;
}

/* Result action buttons */
.hijabify-result-actions {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 5;
}

.hijabify-action-btn {
    padding: 11px 20px;
    border-radius: 50px;
    font-family: 'Lato', sans-serif;
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all .15s;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,.25);
}

.hijabify-action-btn.primary {
    background: var(--espresso);
    color: #f5e6c8;
}

.hijabify-action-btn.primary:hover {
    background: var(--espresso-2);
    transform: translateY(-1px);
}

.hijabify-action-btn.secondary {
    background: #fff;
    color: var(--espresso);
}

.hijabify-action-btn.secondary:hover {
    background: var(--cream-2);
    transform: translateY(-1px);
}

.hijabify-result-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(26,18,8,.65);
    color: #f5e6c8;
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .08em;
    padding: 4px 10px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}

/* Error */
.hijabify-error {
    margin-top: 12px;
    padding: 12px 14px;
    background: var(--red-bg);
    border: 1px solid #fca5a5;
    border-radius: 10px;
    font-size: .8rem;
    color: var(--red);
    line-height: 1.5;
}

/* Toast */
.hijabify-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--espresso);
    color: #f5e6c8;
    font-size: .82rem;
    font-weight: 700;
    padding: 11px 22px;
    border-radius: 50px;
    box-shadow: 0 8px 30px rgba(0,0,0,.3);
    z-index: 200;
    animation: toast-in .25s ease;
    white-space: nowrap;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(-50%) translateY(12px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Provider Row (multi-key panel) ──────────────────────────────── */
.hijabify-provider-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.hijabify-provider-badge {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
    font-weight: 800;
    flex-shrink: 0;
    margin-top: 2px;
    letter-spacing: 0;
}

.hijabify-provider-badge.p1 { background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: var(--espresso); }
.hijabify-provider-badge.p2 { background: linear-gradient(135deg, #7c3aed, #a855f7); color: #fff; }
.hijabify-provider-badge.p3 { background: linear-gradient(135deg, var(--green), var(--green-3)); color: #fff; }

.hijabify-provider-label {
    font-size: .72rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: .02em;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.hijabify-provider-free {
    font-size: .58rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    background: rgba(184,149,90,.12);
    color: var(--gold);
    padding: 2px 7px;
    border-radius: 20px;
}

/* ── #1 Dashboard Stats Row ──────────────────────────────────────────── */
.zf-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 14px 16px 4px;
}

.zf-stat {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 10px 8px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform .15s;
}

.zf-stat:hover { transform: translateY(-1px); }

.zf-stat__val {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--espresso);
    line-height: 1;
}

.zf-stat__label {
    font-size: .58rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-3);
    margin-top: 4px;
}

.zf-stat--warn   { border-color: #ffd966; background: var(--amber-bg); }
.zf-stat--warn   .zf-stat__val { color: var(--amber); }

.zf-stat--danger { border-color: #fca5a5; background: var(--red-bg); }
.zf-stat--danger .zf-stat__val { color: var(--red); }

.zf-stat--success { border-color: #6ee7b7; background: var(--green-bg); }
.zf-stat--success .zf-stat__val { color: var(--green); }

/* ── #2 Search Bar ───────────────────────────────────────────────────── */
.zf-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.zf-search-icon {
    position: absolute;
    left: 10px;
    font-size: .85rem;
    pointer-events: none;
    line-height: 1;
}

.zf-search-input {
    width: 100%;
    border: 1.5px solid var(--border-2);
    border-radius: 8px;
    padding: 8px 36px 8px 34px;
    font-family: 'Lato', sans-serif;
    font-size: .875rem;
    background: var(--cream-3);
    outline: none;
    color: var(--text);
    transition: border-color .18s, box-shadow .18s;
}

.zf-search-input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(184,149,90,.12);
}

.zf-search-input::-webkit-search-cancel-button { display: none; }

.zf-search-clear {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: var(--text-3);
    font-size: .75rem;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    line-height: 1;
    transition: color .15s;
}

.zf-search-clear:hover { color: var(--text); }