/* ─── FashionDesk Design Tokens ─────────────────────────────────
   Change the theme here only. All components reference these vars.
   ──────────────────────────────────────────────────────────────── */
:root {
    --fd-primary:        #C9A0A8;
    --fd-primary-soft:   #F2E4E6;
    --fd-primary-dark:   #A87880;
    --fd-accent:         #A8B5C9;
    --fd-accent-soft:    #E4EAF2;
    --fd-surface:        #FFFFFF;
    --fd-background:     #FAF8F7;
    --fd-text:           #1C1C1E;
    --fd-text-muted:     #8A8A8E;
    --fd-border:         #EFEFEF;
    --fd-shadow:         0 0 0 1px var(--fd-border);
    --fd-shadow-md:      0 2px 12px rgba(0, 0, 0, 0.08);
    --fd-radius:         16px;
    --fd-radius-sm:      10px;
    --fd-radius-xs:      6px;
    --fd-nav-height:     68px;
    --fd-sidebar-width:  220px;
    --fd-amber:          #C4822A;
    --fd-amber-soft:     #FDF3E3;
    --fd-green:          #3A7D5A;
    --fd-green-soft:     #E8F5EE;
    --fd-filled-border:  #93C4AD;
}

/* ─── Base ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    color: var(--fd-text);
    background: var(--fd-background);
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }

/* ─── Shared Utility Classes ────────────────────────────────────── */
.fd-card {
    background: var(--fd-surface);
    border-radius: var(--fd-radius);
    box-shadow: var(--fd-shadow);
    padding: 16px;
}

.fd-btn-primary {
    display: block;
    width: 100%;
    padding: 16px;
    background: var(--fd-primary);
    color: white;
    border: none;
    border-radius: var(--fd-radius);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    letter-spacing: 0.2px;
    font-family: inherit;
}

.fd-btn-primary:active { background: var(--fd-primary-dark); }

.fd-search {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--fd-surface);
    border: 1.5px solid var(--fd-border);
    border-radius: var(--fd-radius);
    padding: 13px 16px;
    font-size: 15px;
    color: var(--fd-text-muted);
    box-shadow: var(--fd-shadow);
}

/* ─── Stage Bar (shared) ────────────────────────────────────────── */
.order-stage-bar {
    display: flex;
    gap: 3px;
}

.order-stage-dot {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: var(--fd-border);
}

.order-stage-dot.filled  { background: var(--fd-primary); }
.order-stage-dot.current { background: var(--fd-primary-dark); }

/* ─── Form Fields (shared) ─────────────────────────────────────── */
.fd-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.fd-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--fd-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.fd-input {
    width: 100%;
    border: 1.5px solid var(--fd-border);
    border-radius: var(--fd-radius-sm);
    padding: 12px 14px;
    font-size: 15px;
    color: var(--fd-text);
    background: var(--fd-surface);
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
}

.fd-input:focus { border-color: var(--fd-primary); }
.fd-input::placeholder { color: var(--fd-text-muted); }

.fd-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--fd-border);
}

.fd-toggle-row:last-child { border-bottom: none; }

.fd-toggle-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--fd-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.fd-toggle-sub {
    font-size: 12px;
    color: var(--fd-text-muted);
    margin-top: 2px;
}

.fd-toggle {
    position: relative;
    width: 44px;
    height: 26px;
    flex-shrink: 0;
}

.fd-toggle input { opacity: 0; width: 0; height: 0; }

.fd-toggle-track {
    position: absolute;
    inset: 0;
    background: var(--fd-border);
    border-radius: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.fd-toggle input:checked + .fd-toggle-track { background: var(--fd-primary); }

.fd-toggle-track::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: transform 0.2s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.fd-toggle input:checked + .fd-toggle-track::after { transform: translateX(18px); }

/* ─── Minimal theme utilities ───────────────────────────────────── */
.fd-page-title {
    font-family: Georgia, 'Palatino Linotype', Palatino, serif;
    font-weight: 400;
}

.fd-micro-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--fd-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.fd-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.fd-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--fd-text-muted);
}

.fd-section-action {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--fd-primary-dark);
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    padding: 4px;
}

.fd-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: var(--fd-radius-xs);
    font-size: 11px;
    font-weight: 600;
}

.fd-badge-kids {
    background: var(--fd-accent-soft);
    color: var(--fd-accent);
}

.fd-meas-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ─── Blazor Error UI ───────────────────────────────────────────── */
#blazor-error-ui {
    color-scheme: light only;
    background: #FFF3CD;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    font-size: 14px;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
    border-radius: var(--fd-radius-sm);
}

.blazor-error-boundary::after { content: "An error has occurred."; }

/* ─── Loading Screen ────────────────────────────────────────────── */
.loading-progress {
    position: relative;
    display: block;
    width: 6rem;
    height: 6rem;
    margin: 30vh auto 1rem;
}

.loading-progress circle {
    fill: none;
    stroke: var(--fd-border);
    stroke-width: 0.5rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: var(--fd-primary);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: 600;
    inset: calc(30vh + 2.5rem) 0 auto 0;
    color: var(--fd-text-muted);
    font-size: 13px;
}

.loading-progress-text::after {
    content: var(--blazor-load-percentage-text, "Loading");
}
