:root {
    --navy: #1B4A82;
    --navy-deep: #0C2340;
    --ink: #0A0A0A;
    --gold: #D4A017;
    --gold-bright: #E8C547;
    --paper: #F4F2EE;
    --card: #FFFFFF;
    --muted: #6B7280;
    --line: #E6E1D8;
    --red: #C44536;
    --green: #3B7A57;
    --sky: #4A9BB5;
    --shadow: 0 18px 50px rgba(10, 10, 10, 0.12);
    --radius: 18px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    background: var(--paper);
    color: var(--navy-deep);
    font-family: "Poppins", sans-serif;
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.02em; }
p { margin: 0; }
button, input, select, textarea { font-family: inherit; }

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

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

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.splash {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: var(--ink);
}

.splash img {
    height: 56px;
    width: auto;
}

.app-shell {
    min-height: 100vh;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 28px;
    background: var(--ink);
    border-bottom: 3px solid var(--gold);
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
    color: #fff;
}

.brand img {
    height: 42px;
    width: auto;
}

.brand-divider {
    width: 1px;
    height: 28px;
    background: rgba(232, 197, 71, 0.45);
}

.brand-title {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.app-main {
    max-width: 1120px;
    margin: 0 auto;
    padding: 36px 24px 72px;
}

.login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    background:
        radial-gradient(circle at 18% 20%, rgba(27, 74, 130, 0.45), transparent 36%),
        radial-gradient(circle at 82% 80%, rgba(212, 160, 23, 0.18), transparent 30%),
        var(--ink);
}

.login-card {
    width: min(440px, 100%);
    background: rgba(255, 255, 255, 0.97);
    border-radius: 24px;
    padding: 32px;
    box-shadow: var(--shadow);
    text-align: center;
}

.login-logo {
    height: 64px;
    width: auto;
    margin-bottom: 28px;
}

.login-gold-line {
    width: 64px;
    height: 3px;
    margin: 0 auto 24px;
    background: var(--gold-bright);
    border-radius: 99px;
}

.login-card h1 {
    color: var(--navy);
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.login-subtitle {
    color: var(--muted);
    margin-bottom: 28px;
    line-height: 1.5;
}

.phone-row {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.country-select {
    width: 88px;
    flex: 0 0 88px;
}

.text-input,
.country-select {
    width: 100%;
    border: 1px solid var(--line);
    background: #fbfaf7;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 1rem;
    color: var(--navy-deep);
}

.text-input:focus,
.country-select:focus {
    outline: none;
    border-color: var(--navy);
    box-shadow: 0 0 0 4px rgba(27, 74, 130, 0.12);
    background: #fff;
}

.code-input {
    text-align: center;
    letter-spacing: 0.42em;
    font-size: 1.25rem;
    margin-bottom: 16px;
}

.primary-btn,
.ghost-btn,
.link-btn,
.danger-btn,
.icon-btn,
.chip {
    cursor: pointer;
    border: none;
}

.primary-btn {
    width: 100%;
    padding: 13px 18px;
    border-radius: 12px;
    background: var(--navy);
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    transition: transform 0.15s ease, background 0.15s ease;
}

.primary-btn:hover:not(:disabled) {
    background: var(--navy-deep);
    transform: translateY(-1px);
}

.primary-btn:disabled {
    background: #c9c4ba;
    cursor: not-allowed;
}

.ghost-btn {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 999px;
    padding: 8px 16px;
    font-weight: 500;
}

.ghost-btn.dark {
    color: var(--navy);
    border-color: var(--line);
    width: auto;
}

.link-btn {
    margin-top: 12px;
    background: none;
    color: var(--navy);
    text-decoration: underline;
    font-size: 0.92rem;
}

.danger-btn {
    background: none;
    color: var(--red);
    font-weight: 600;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--paper);
    font-size: 1.4rem;
    line-height: 1;
    color: var(--navy-deep);
}

.error-banner {
    margin-top: 16px;
    padding: 12px;
    border-radius: 12px;
    background: #fff1f0;
    color: var(--red);
    border: 1px solid #f3c6c1;
}

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 28px;
}

.page-head .primary-btn { width: auto; }

.eyebrow {
    color: var(--gold);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.lede {
    margin-top: 8px;
    color: var(--muted);
}

.stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 22px;
}

.stat-card {
    background: var(--card);
    border-radius: 16px;
    padding: 16px 18px;
    border: 1px solid var(--line);
}

.stat-label {
    display: block;
    color: var(--muted);
    font-size: 0.8rem;
    margin-bottom: 6px;
}

.stat-card strong {
    font-size: 1.5rem;
    color: var(--navy);
}

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

.search { max-width: 420px; }

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

.chip {
    padding: 8px 14px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--line);
    color: var(--navy-deep);
    font-size: 0.88rem;
}

.chip.active {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff;
}

.empty {
    background: #fff;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    padding: 56px 24px;
    text-align: center;
}

.empty-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--navy);
    background: #eef3f8;
}

.empty h2 { margin-bottom: 8px; }
.empty p {
    color: var(--muted);
    max-width: 440px;
    margin: 0 auto 20px;
    line-height: 1.5;
}
.empty .primary-btn { width: auto; }

.quote-list {
    display: grid;
    gap: 12px;
}

.quote-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 18px 20px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.quote-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.quote-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.quote-number {
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    color: var(--navy);
    font-weight: 600;
}

.quote-card h3 { font-size: 1.15rem; }
.quote-meta {
    color: var(--muted);
    margin: 6px 0 14px;
}

.quote-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: var(--navy-deep);
    font-size: 0.9rem;
}

.quote-amount { font-weight: 600; color: var(--navy); }
.muted { color: var(--muted); }

.badge {
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-draft { background: #f3eee4; color: #8a6d1f; }
.badge-sent { background: #e7f2f6; color: var(--sky); }
.badge-ok { background: #e7f4ec; color: var(--green); }
.badge-no { background: #fbeceb; color: var(--red); }

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 10, 0.45);
    z-index: 30;
}

.drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    height: 100dvh;
    width: min(520px, 100%);
    background: #fff;
    z-index: 40;
    padding: 24px 24px calc(24px + env(safe-area-inset-bottom, 0px));
    overflow: auto;
    box-shadow: -16px 0 40px rgba(0,0,0,0.18);
}

.drawer-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-grid label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--navy);
}

.form-grid .span-2 { grid-column: span 2; }
.form-grid textarea { resize: vertical; }

.check {
    flex-direction: row !important;
    align-items: center;
    gap: 8px !important;
    margin-top: 28px;
}

.drawer-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 24px;
}

.drawer-actions .primary-btn,
.drawer-actions .ghost-btn { width: auto; }

.spacer { flex: 1; }
.not-found { padding: 48px 0; text-align: center; }

.badge-done { background: #ece8f6; color: var(--navy); }
.wizard { width: min(560px, 100%); }
.steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 20px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}
.steps .active { color: var(--gold); font-weight: 600; }
.type-picks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.type-pick {
    padding: 12px 8px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--navy-deep);
    font-weight: 600;
}
.type-pick.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.service-list { display: flex; flex-direction: column; gap: 10px; }
.service-item { display: flex; gap: 10px; align-items: center; color: var(--navy); }
.calendar { margin: 16px 0; }
.calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    text-transform: capitalize;
}
.calendar-week, .calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    text-align: center;
}
.calendar-week { color: var(--muted); font-size: 0.75rem; margin-bottom: 6px; }
.calendar-grid .day {
    height: 38px;
    border-radius: 10px;
    border: none;
    background: var(--paper);
    color: var(--navy-deep);
}
.calendar-grid .day.selected { background: var(--navy); color: #fff; }
.slot-list, .slot-read { margin-top: 12px; padding: 0; }
.slot-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: center; margin-bottom: 8px; }
.accept-row { grid-template-columns: 1fr 1fr auto; }
.accept-row .ghost-btn { width: 40px; padding: 0; }
.slot-read { color: var(--muted); line-height: 1.7; }
.amount-step { display: flex; flex-direction: column; gap: 8px; }

@media (max-width: 800px) {
    .stats { grid-template-columns: 1fr 1fr; }
    .page-head { flex-direction: column; align-items: stretch; }
    .app-header { padding: 10px 16px; }
    .brand-title { display: none; }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid .span-2 { grid-column: span 1; }
    .drawer {
        padding-bottom: calc(140px + env(safe-area-inset-bottom, 0px));
    }
    .drawer-actions { margin-bottom: 24px; }
}
