/* ═══════════════════════════════════════════════════════════════
   COMPONENTS — Buttons · Cards · Forms · Badges · Modals
   Clean Minimalist Theme
═══════════════════════════════════════════════════════════════ */

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-ui);
    font-weight: 500;
    font-size: 0.875rem;
    letter-spacing: 0.01em;
    text-decoration: none;
    border: none;
    border-radius: var(--r-md);
    padding: 10px 20px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition:
            background var(--dur-sm) ease,
            color var(--dur-sm) ease,
            border-color var(--dur-sm) ease;
    white-space: nowrap;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* No shimmer sweep */
.btn::before { display: none; }
.btn:active { transform: scale(0.98); }

/* Primary (replaces btn-gold) */
.btn-gold {
    /* Brighter, more yellow than the dull --gold (#d4a017) — see request. */
    background: var(--gold-bright);
    /* Dark ink on gold ≈ 8.5:1 contrast — white on gold was 2.4:1 (WCAG fail). */
    color: #0a0a14;
    font-weight: 700;
}
.btn-gold:hover {
    background: #ffd640;   /* lift a touch brighter on hover */
    color: #0a0a14;
}

/* Ghost */
.btn-ghost {
    background: transparent;
    color: var(--gold);
    border: 1px solid var(--border-mid);
}
.btn-ghost:hover {
    background: var(--gold-pale);
    border-color: var(--gold);
    color: var(--gold-deep);
}

/* Glass (subtle) */
.btn-glass {
    background: var(--bg-raised);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
}
.btn-glass:hover {
    background: var(--border-subtle);
    border-color: var(--border-mid);
}

/* Danger (replaces btn-crimson) */
.btn-crimson {
    background: var(--crimson);
    color: #ffffff;
}
.btn-crimson:hover {
    background: #c82333;
    color: #ffffff;
}

/* Sizes */
.btn-sm { padding: 7px 14px; font-size: 0.8rem; border-radius: var(--r-sm); }
.btn-lg { padding: 14px 32px; font-size: 0.95rem; border-radius: var(--r-lg); }
.btn-icon { padding: 10px; border-radius: var(--r-md); aspect-ratio: 1; }

/* ── Cards ────────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-xl);
    position: relative;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
    transition:
            border-color var(--dur-sm) ease,
            box-shadow var(--dur-sm) ease;
}
.card::before { display: none; }
.card-hover:hover {
    border-color: var(--border-mid);
    box-shadow: var(--shadow-md);
}

.card-gold {
    border-color: var(--border-mid);
}

/* Moto card */
.moto-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-xl);
    overflow: hidden;
    transition: box-shadow var(--dur-sm) ease, border-color var(--dur-sm) ease;
}
.moto-card:hover {
    border-color: var(--border-mid);
    box-shadow: var(--shadow-md);
}
.moto-card__img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background: var(--bg-raised);
    position: relative;
}
.moto-card__img-placeholder {
    width: 100%;
    height: 220px;
    background: var(--bg-raised);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    opacity: 0.4;
}
.moto-card__badge {
    position: absolute;
    top: 14px;
    right: 14px;
}
.moto-card__body { padding: 20px; }
.moto-card__brand { font-size: 0.75rem; font-family: var(--font-ui); font-weight: 500; letter-spacing: 0.02em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 4px; }
.moto-card__name  { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; }
.moto-card__specs { display: flex; gap: 12px; margin-bottom: 16px; }
.moto-card__spec  { font-size: 0.8rem; font-family: var(--font-ui); color: var(--text-muted); }
.moto-card__price { display: flex; align-items: baseline; gap: 6px; margin-bottom: 16px; }
.moto-card__price-num  { font-family: var(--font-mono); font-size: 1.5rem; font-weight: 600; color: var(--text-primary); }
.moto-card__price-unit { font-family: var(--font-ui); font-size: 0.75rem; color: var(--text-muted); }
.moto-card__footer { display: flex; gap: 8px; }

/* ── Badges ───────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--r-full);
    font-family: var(--font-ui);
    font-size: 0.72rem;
    font-weight: 500;
}
.badge-gold    { background: var(--gold-pale);    color: var(--text-gold-strong, var(--text-gold));    border: 1px solid rgba(212, 160, 23, 0.25); }
.badge-green   { background: var(--teal-pale);    color: var(--teal);         border: 1px solid rgba(34, 160, 107, 0.2); }
.badge-red     { background: var(--crimson-pale); color: var(--text-crimson); border: 1px solid rgba(220, 53, 69, 0.2); }
.badge-muted   { background: var(--bg-raised);    color: var(--text-muted);   border: 1px solid var(--border-subtle); }
.badge-dot::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ── Forms ────────────────────────────────────────────────────── */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.form-label {
    font-family: var(--font-ui);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}
.form-input,
.form-select,
.form-textarea {
    background: #ffffff;
    border: 1px solid var(--border-mid);
    border-radius: var(--r-md);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    padding: 10px 14px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    transition: border-color var(--dur-sm) ease, box-shadow var(--dur-sm) ease;
    -webkit-appearance: none;
}
.form-group {
    min-width: 0;
}
.form-input::placeholder { color: var(--text-faint); }
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-pale);
}
.form-input.error  { border-color: var(--crimson); box-shadow: 0 0 0 3px var(--crimson-pale); }
.form-error-msg    { font-size: 0.75rem; color: var(--text-crimson); font-family: var(--font-ui); }
.form-textarea     { resize: vertical; min-height: 100px; }

/* Date/time input accent */
.form-input[type="date"],
.form-input[type="time"],
.form-input[type="datetime-local"] {
    color-scheme: light;
}

/* ── Custom Cursor (disabled — use normal cursor) ────────────── */
#cursor-ring,
#cursor-dot {
    display: none;
}

/* ── Toast Notifications ──────────────────────────────────────── */
#toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
}
.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    animation: toastSlide var(--dur-lg) ease both;
    min-width: 280px;
}
.toast.out { animation: toastOut var(--dur-md) ease both; }
.toast-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.toast-body { flex: 1; }
.toast-title { font-family: var(--font-ui); font-weight: 600; font-size: 0.85rem; margin-bottom: 2px; }
.toast-msg   { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.4; }
.toast-close { background: none; border: none; color: var(--text-muted); font-size: 1rem; cursor: pointer; padding: 0; transition: color var(--dur-sm); flex-shrink: 0; }
.toast-close:hover { color: var(--text-primary); }
.toast.success { border-left: 3px solid var(--teal); }
.toast.success .toast-title { color: var(--teal); }
.toast.error   { border-left: 3px solid var(--crimson); }
.toast.error   .toast-title { color: var(--text-crimson); }
.toast.warning { border-left: 3px solid #f0ad4e; }
.toast.warning .toast-title { color: #e09600; }

/* ── Modal ────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-overlay);
    z-index: var(--z-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: overlayIn var(--dur-md) ease;
}
.modal {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-xl);
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn var(--dur-lg) var(--ease-back);
    position: relative;
}
.modal__header {
    padding: 24px 24px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal__title { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; color: var(--text-primary); }
.modal__close { background: var(--bg-raised); border: 1px solid var(--border-subtle); color: var(--text-muted); width: 32px; height: 32px; border-radius: var(--r-md); display: flex; align-items: center; justify-content: center; font-size: 1rem; cursor: pointer; transition: all var(--dur-sm); }
.modal__close:hover { background: var(--crimson-pale); border-color: var(--crimson); color: var(--text-crimson); }
.modal__body    { padding: 20px 24px; }
.modal__footer  { padding: 0 24px 24px; display: flex; gap: 12px; justify-content: flex-end; }

/* ── Loader ───────────────────────────────────────────────────── */
#page-loader {
    position: fixed;
    inset: 0;
    background: #ffffff;
    z-index: calc(var(--z-cursor) + 1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 20px;
    transition: opacity var(--dur-lg) ease, visibility var(--dur-lg);
}
#page-loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-logo { font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; color: var(--text-primary); letter-spacing: -0.01em; }
.loader-bar-track { width: 200px; height: 3px; background: var(--bg-raised); border-radius: var(--r-full); overflow: hidden; }
.loader-bar { height: 100%; background: var(--gold); border-radius: var(--r-full); animation: progressFill 1.5s ease forwards; }
.loader-text { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); }

/* ── Stat Card ────────────────────────────────────────────────── */
.stat-card {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-xl);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: border-color var(--dur-sm) ease;
}
.stat-card:hover { border-color: var(--border-mid); }
.stat-card__label { font-family: var(--font-ui); font-size: 0.75rem; font-weight: 500; text-transform: uppercase; color: var(--text-muted); }
.stat-card__value { font-family: var(--font-mono); font-size: 2.2rem; font-weight: 600; color: var(--text-primary); line-height: 1; }
.stat-card__sub   { font-family: var(--font-ui); font-size: 0.8rem; color: var(--text-muted); }
.stat-card__icon  { font-size: 1.6rem; margin-bottom: 4px; }

/* ── Progress Bar ─────────────────────────────────────────────── */
.progress-track {
    width: 100%;
    height: 4px;
    background: var(--bg-raised);
    border-radius: var(--r-full);
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    border-radius: var(--r-full);
    background: var(--gold);
    transition: width var(--dur-lg) ease;
}

/* ── Step Wizard ──────────────────────────────────────────────── */
.steps {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 40px;
}
.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
    position: relative;
}
.step-item:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 16px;
    left: calc(50% + 16px);
    right: calc(-50% + 16px);
    height: 1px;
    background: var(--border-subtle);
    transition: background var(--dur-md);
}
.step-item.completed:not(:last-child)::after { background: var(--gold); }
.step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--border-subtle);
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: all var(--dur-sm) ease;
}
.step-item.active  .step-num { border-color: var(--gold); color: var(--gold); background: var(--gold-pale); }
.step-item.completed .step-num { border-color: var(--gold); background: var(--gold); color: #ffffff; }
.step-label { font-family: var(--font-ui); font-size: 0.72rem; font-weight: 500; color: var(--text-muted); text-align: center; }
.step-item.active .step-label { color: var(--text-gold-strong, var(--text-gold)); }

/* ── Table ────────────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
    font-family: var(--font-ui);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-subtle);
    text-align: left;
}
.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-faint);
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: background var(--dur-sm);
}
.data-table tr:hover td { background: var(--bg-raised); }
.data-table tr:last-child td { border-bottom: none; }

/* ── Tabs ─────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; background: var(--bg-raised); padding: 4px; border-radius: var(--r-lg); }
.tab-btn {
    flex: 1;
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-radius: var(--r-md);
    font-family: var(--font-ui);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--dur-sm) ease;
}
.tab-btn.active { background: #ffffff; color: var(--text-primary); box-shadow: var(--shadow-sm); }
.tab-btn:hover:not(.active) { color: var(--text-secondary); }

/* ── Section Header ───────────────────────────────────────────── */
.section-label {
    font-family: var(--font-ui);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.section-label::before,
.section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
}

/* ── Scrollable Panel ─────────────────────────────────────────── */
.scroll-panel {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-subtle) transparent;
}
.scroll-panel::-webkit-scrollbar       { width: 4px; }
.scroll-panel::-webkit-scrollbar-track { background: transparent; }
.scroll-panel::-webkit-scrollbar-thumb { background: var(--border-subtle); border-radius: var(--r-full); }

/* ── Custom date / date-time picker (components/datepicker.js) ─────────────── */
.dt-field { position: relative; }
.dt-trigger { width: 100%; text-align: left; padding: 11px 14px; border-radius: 10px;
    border: 1px solid var(--border-subtle); background: var(--bg-raised); color: var(--text-primary);
    cursor: pointer; font-size: .92rem; display: flex; align-items: center; gap: 10px; transition: border-color .15s; font-family: inherit; }
.dt-trigger:hover { border-color: var(--border-mid); }
.dt-trigger.placeholder .dt-trigger__txt { color: var(--text-muted); }
.dt-trigger [data-icon] { color: var(--gold-bright); }
.dt-pop { position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; width: 304px; max-width: 92vw;
    background: var(--bg-raised); border: 1px solid var(--border-subtle); border-radius: 14px; padding: 14px;
    box-shadow: 0 18px 54px rgba(0,0,0,.5); }
.dt-pop[hidden] { display: none; }
.dt-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 8px; }
.dt-head__title { font-family: var(--font-display); font-weight: 600; font-size: .95rem; }
.dt-nav { background: none; border: 1px solid var(--border-subtle); border-radius: 8px; width: 30px; height: 30px;
    cursor: pointer; color: var(--text-secondary); display: flex; align-items: center; justify-content: center; }
.dt-nav:hover { border-color: var(--gold); color: var(--gold-bright); }
.dt-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.dt-wd { text-align: center; font-size: .6rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; padding: 4px 0; }
.dt-day { aspect-ratio: 1; border: none; background: none; border-radius: 8px; cursor: pointer;
    color: var(--text-primary); font-size: .82rem; display: flex; align-items: center; justify-content: center; padding: 0; font-family: inherit; }
.dt-day:hover:not(:disabled) { background: rgba(255,255,255,.07); }
.dt-day.other { color: var(--text-faint); }
.dt-day.today { outline: 1px solid var(--border-mid); }
.dt-day.sel { background: var(--gold-bright); color: #0a0a14; font-weight: 700; }
.dt-day:disabled { color: var(--text-faint); opacity: .3; cursor: not-allowed; }
.dt-time { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-subtle); }
.dt-time .dt-time__lbl { font-size: .72rem; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.dt-time select { flex: 1; padding: 8px 6px; border-radius: 8px; border: 1px solid var(--border-subtle);
    background: var(--bg-base); color: var(--text-primary); font-family: var(--font-mono); font-size: .85rem; }
.dt-actions { display: flex; gap: 8px; margin-top: 12px; }
.dt-actions .btn { flex: 1; }
