:root {
    --rider-theme-cream: #f7f3eb;
    --rider-theme-peach: #e9d4b5;
    --rider-theme-card: #fffdfa;
    --rider-theme-card-soft: #f8f0e2;
    --rider-theme-border: #e5d8c5;
    --rider-theme-brown: #39261b;
    --rider-theme-muted: #766456;
    --rider-theme-accent: #a85f3c;
    --rider-theme-accent-dark: #633b29;
    --rider-theme-success: #42634d;
    --rider-theme-danger: #a64f43;
    --rider-gingham: conic-gradient(
        var(--rider-theme-peach) 25%,
        var(--rider-theme-cream) 0 50%,
        var(--rider-theme-peach) 0 75%,
        var(--rider-theme-cream) 0
    );
}

body {
    background-color: var(--rider-theme-cream) !important;
    background-image: radial-gradient(ellipse at 88% 4%, rgba(198, 145, 91, .14), transparent 30rem), linear-gradient(145deg, #f7f3eb, #f3eee5) !important;
    background-size: auto !important;
    background-attachment: fixed !important;
    color: var(--rider-theme-brown) !important;
}

.rider-shell,
.rider-main {
    background: transparent !important;
}

.rider-sidebar {
    color: #fffaf0 !important;
    background: linear-gradient(155deg, #68402d 0%, #42291f 54%, #2e1c15 100%) !important;
    box-shadow: 10px 0 34px rgba(46, 28, 21, .2), inset -1px 0 rgba(255, 255, 255, .08) !important;
}

.rider-nav a:hover,
.rider-nav a.active {
    background: rgba(241, 201, 168, .2) !important;
    border-color: rgba(241, 201, 168, .42) !important;
}

.rider-nav i,
.rider-avatar,
.rider-mobile-toggle {
    color: var(--rider-theme-accent-dark) !important;
}

.rider-avatar,
.rider-mobile-toggle {
    background: var(--rider-theme-cream) !important;
}

.rider-mobile-bar {
    color: var(--rider-theme-brown) !important;
    background: var(--rider-theme-card) !important;
}

.rd-wrapper,
.rider-page,
.rider-settings,
.history-page,
.rider-payments {
    background: transparent !important;
}

.rd-wrapper {
    --bg-from: #fff0d1 !important;
    --bg-via: #fff7e8 !important;
    --bg-to: #f1c9a8 !important;
    --surface: rgba(255, 250, 240, .94) !important;
    --surface-hover: #fffaf0 !important;
    --border: #e7c4a4 !important;
    --text-primary: #563621 !important;
    --text-muted: #8b6b52 !important;
    --accent: #bd7950 !important;
    --accent-dark: #75442d !important;
    --accent-soft: #f1c9a8 !important;
    --pink: #d99570 !important;
    --pink-dark: #75442d !important;
    --pink-soft: #fce8d2 !important;
    --success: #557448 !important;
    --danger: #a14a3b !important;
    --warning: #9b642d !important;
}

.rd-blob {
    display: none !important;
}

.rd-stat-card,
.rd-progress-card,
.rd-shift-card,
.rd-actions,
.rd-table-wrap {
    border-color: var(--rider-theme-border) !important;
    background-color: rgba(255, 250, 240, .95) !important;
    box-shadow: 0 14px 34px rgba(86, 54, 33, .1) !important;
}

.rd-table thead tr {
    background: #f6dfc5 !important;
}

.rd-stat-icon,
.rd-order-code {
    background: #f6dfc5 !important;
}

.rd-stop {
    border-color: var(--rider-theme-border) !important;
    background: rgba(255, 250, 240, .92) !important;
}

.page-card,
.payments-card,
.settings-card,
.history-card {
    border-color: var(--rider-theme-border) !important;
    background: rgba(255, 250, 240, .95) !important;
    box-shadow: 0 14px 34px rgba(86, 54, 33, .1) !important;
}

.page-head h1,
.settings-head h1,
.history-head h1,
.payments-head h1,
.page-card h2,
.settings-card h2 {
    color: var(--rider-theme-brown) !important;
}

.settings-card h2 i,
.field label {
    color: var(--rider-theme-accent-dark) !important;
}

.page-kicker,
.settings-kicker,
.history-kicker,
.payments-kicker {
    color: var(--rider-theme-accent-dark) !important;
}

.page-head p,
.page-card p,
.order-meta span,
.settings-head p,
.settings-card p,
.field-hint,
.history-head p,
.empty,
.payments-head p {
    color: var(--rider-theme-muted) !important;
}

.order-item,
.empty-state,
.stat-item {
    border-color: var(--rider-theme-border) !important;
    background: var(--rider-theme-card-soft) !important;
}

.order-meta strong {
    color: var(--rider-theme-brown) !important;
}

.status-pill,
.status-pending {
    color: var(--rider-theme-accent-dark) !important;
    background: #f6dfc5 !important;
}

.field input,
.field select,
.field textarea,
.history-tools input {
    border-color: var(--rider-theme-border) !important;
    color: var(--rider-theme-brown) !important;
    background: var(--rider-theme-card) !important;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.history-tools input:focus {
    border-color: var(--rider-theme-accent) !important;
    box-shadow: 0 0 0 4px rgba(189, 121, 80, .16) !important;
}

.settings-btn,
.settings-btn-secondary,
.payments-btn,
.history-tools button {
    color: #fffaf0 !important;
    background: linear-gradient(135deg, #bd7950, #75442d) !important;
}

.history-tools button,
.history-filter {
    border-color: var(--rider-theme-border) !important;
}

.history-filter {
    color: var(--rider-theme-accent-dark) !important;
}

.history-filter.active,
.history-filter:hover {
    color: var(--rider-theme-brown) !important;
    background: #f6dfc5 !important;
}

.history-table th {
    color: var(--rider-theme-accent-dark) !important;
    background: #f6dfc5 !important;
}

.history-table td {
    border-color: var(--rider-theme-border) !important;
    color: var(--rider-theme-brown) !important;
}

.history-table tr:hover {
    background: #fff3df !important;
}

.order-code {
    color: var(--rider-theme-accent-dark) !important;
}

.status.delivered,
.status-active,
.stat-value {
    color: var(--rider-theme-success) !important;
}

.status.delivered,
.status-active {
    background: #e8eddc !important;
}

.status-note {
    color: var(--rider-theme-muted) !important;
}

.rider-theme-auth .auth-bg {
    background-color: var(--rider-theme-cream) !important;
    background-image: radial-gradient(ellipse at 15% 12%, rgba(184, 124, 73, .2), transparent 34rem), radial-gradient(ellipse at 85% 85%, rgba(239, 215, 174, .5), transparent 30rem), linear-gradient(145deg, #f7f3eb, #efe5d5) !important;
    background-size: auto !important;
}

.rider-theme-auth .auth-grid,
.rider-theme-auth .auth-orb,
.rider-theme-auth .auth-particle,
.rider-theme-auth .auth-radar-ring,
.rider-theme-auth .auth-radar-sweep {
    display: none !important;
}

.rider-theme-auth .auth-card {
    background: rgba(255, 250, 240, .96) !important;
    border-color: var(--rider-theme-border) !important;
    box-shadow: 0 20px 45px rgba(86, 54, 33, .16) !important;
}

.rider-theme-auth .auth-card-strip {
    background: linear-gradient(90deg, #bd7950, #f1c9a8, #bd7950) !important;
}

.rider-theme-auth .auth-title,
.rider-theme-auth .auth-label,
.rider-theme-auth .auth-status {
    color: var(--rider-theme-brown) !important;
}

.rider-theme-auth .auth-subtitle,
.rider-theme-auth .auth-link-row {
    color: var(--rider-theme-muted) !important;
}

.rider-theme-auth .auth-input {
    border-color: var(--rider-theme-border) !important;
    color: var(--rider-theme-brown) !important;
    background: #fff7e8 !important;
}

.rider-theme-auth .auth-input:focus {
    border-color: var(--rider-theme-accent) !important;
    box-shadow: 0 0 0 3px rgba(189, 121, 80, .16) !important;
}

.rider-theme-auth .auth-input-icon,
.rider-theme-auth .auth-label i,
.rider-theme-auth .auth-link {
    color: var(--rider-theme-accent-dark) !important;
}

.rider-theme-auth .auth-btn {
    color: #fffaf0 !important;
    background: linear-gradient(135deg, #bd7950, #75442d) !important;
    box-shadow: 0 10px 24px -8px rgba(117, 68, 45, .38) !important;
}

.rider-theme-chat {
    --navy: #75442d !important;
    --navy-deep: #4e3022 !important;
    --navy-mid: #a26946 !important;
    --red: #bd7950 !important;
    --red-bright: #d99570 !important;
    --red-soft: rgba(217, 149, 112, .14) !important;
    --off: #fff4df !important;
    --off2: #f6dfc5 !important;
    --border: #e7c4a4 !important;
    --text: #563621 !important;
    --muted: #8b6b52 !important;
}

.rider-theme-chat .chat-panel,
.rider-theme-chat .chat-header,
.rider-theme-chat .composer,
.rider-theme-chat .detail-panel {
    background-color: var(--rider-theme-card) !important;
}

.rider-theme-chat .chat-header,
.rider-theme-chat .composer,
.rider-theme-chat .detail-panel {
    border-color: var(--rider-theme-border) !important;
}

/* Shared rider portal refresh */
.rider-shell,
.rider-main {
    color: var(--rider-theme-brown);
}

.rider-nav a {
    color: rgba(255, 250, 240, .88) !important;
}

.rider-nav a:hover,
.rider-nav a.active {
    color: #fffaf0 !important;
    background: linear-gradient(110deg, rgba(239, 215, 174, .2), rgba(239, 215, 174, .07)) !important;
    border-color: rgba(239, 215, 174, .28) !important;
}

.rider-nav i {
    color: #f2d7a4 !important;
}

.rider-sidebar-footer {
    border-color: rgba(255, 250, 240, .16) !important;
}

.rider-logout {
    color: #fffaf0 !important;
    background: rgba(255, 255, 255, .08) !important;
    border-color: rgba(255, 255, 255, .18) !important;
    transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

.rider-logout:hover {
    background: rgba(255, 255, 255, .14) !important;
    border-color: rgba(255, 255, 255, .3) !important;
    transform: translateY(-1px);
}

.rider-mobile-bar {
    color: var(--rider-theme-brown) !important;
    background: rgba(255, 253, 248, .94) !important;
    border-color: var(--rider-theme-border) !important;
}

.rider-mobile-toggle {
    color: var(--rider-theme-accent-dark) !important;
    background: var(--rider-theme-card) !important;
    border-color: var(--rider-theme-border) !important;
}

.rider-mobile-toggle:focus-visible,
.rider-close:focus-visible,
.rider-nav a:focus-visible,
.rider-logout:focus-visible {
    outline: 3px solid #e5bd78;
    outline-offset: 3px;
}

.rd-wrapper {
    --bg-from: #f7f3eb !important;
    --bg-via: #fffdfa !important;
    --bg-to: #efe5d5 !important;
    --surface: rgba(255, 253, 250, .94) !important;
    --surface-hover: #fff !important;
    --border: #e5d8c5 !important;
    --text-primary: #39261b !important;
    --text-muted: #766456 !important;
    --accent: #a85f3c !important;
    --accent-dark: #633b29 !important;
    --accent-soft: #f1dfc3 !important;
    --pink: #b67853 !important;
    --pink-dark: #633b29 !important;
    --pink-soft: #f2e5d4 !important;
    --success: #42634d !important;
    --warning: #99622e !important;
    --danger: #a64f43 !important;
    padding-top: clamp(24px, 4vw, 42px) !important;
}

.rd-stat-card,
.rd-progress-card,
.rd-shift-card,
.rd-actions,
.rd-table-wrap,
.page-card,
.payments-card,
.settings-card,
.history-card {
    border-radius: 20px !important;
    box-shadow: 0 16px 38px rgba(57, 38, 27, .075), inset 0 1px rgba(255, 255, 255, .8) !important;
}

.rd-stat-card:hover,
.rd-actions a:hover,
.page-card:hover,
.payments-card:hover,
.settings-card:hover {
    box-shadow: 0 20px 42px rgba(57, 38, 27, .12), inset 0 1px rgba(255, 255, 255, .86) !important;
}

.rd-stat-icon,
.rd-order-code,
.order-code,
.payments-pill,
.status-pill {
    border-radius: 11px !important;
}

.rd-table,
.history-table {
    color: var(--rider-theme-brown);
}

.rd-table th,
.history-table th {
    color: var(--rider-theme-accent-dark) !important;
    background: #f4ead9 !important;
}

.rd-table td,
.history-table td {
    color: var(--rider-theme-brown) !important;
    border-color: var(--rider-theme-border) !important;
}

.rd-table tbody tr:hover,
.history-table tbody tr:hover {
    background: #fbf5eb !important;
}

.rd-btn,
.rd-shift-primary,
.rd-action-btn,
.settings-btn,
.payments-btn,
.history-tools button {
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.rd-btn:hover,
.rd-shift-primary:hover,
.rd-action-btn:hover,
.settings-btn:hover,
.payments-btn:hover,
.history-tools button:hover {
    filter: brightness(1.04);
    transform: translateY(-1px);
}

.field input,
.field select,
.field textarea,
.history-tools input {
    min-height: 46px;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.history-tools input:focus {
    outline: none;
}

.rider-theme-auth .auth-card {
    border-radius: 24px !important;
    overflow: hidden;
}

.rider-theme-auth .auth-title,
.rider-theme-auth .auth-label,
.rider-theme-auth .auth-status {
    color: var(--rider-theme-brown) !important;
}

.rider-theme-auth .auth-input {
    border-radius: 12px !important;
}

.rider-theme-auth .auth-btn {
    border-radius: 12px !important;
    background: linear-gradient(135deg, #70452f, #42291f) !important;
}

.rider-theme-chat {
    --navy: #68402d !important;
    --navy-deep: #2e1c15 !important;
    --navy-mid: #8a5b40 !important;
    --red: #a85f3c !important;
    --red-bright: #c78358 !important;
    --red-soft: rgba(168, 95, 60, .14) !important;
    --off: #f7f3eb !important;
    --off2: #efe5d5 !important;
    --border: #e5d8c5 !important;
    --text: #39261b !important;
    --muted: #766456 !important;
}

@media (max-width: 767px) {
    .rider-page,
    .rider-settings,
    .history-page,
    .rider-payments {
        padding: 24px 16px 40px !important;
    }

    .settings-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .settings-card,
    .payments-card,
    .page-card {
        padding: 18px !important;
    }

    .history-tools form {
        min-width: 100% !important;
    }

    .history-tools input {
        min-width: 0;
    }

    .rd-wrapper {
        padding: 24px 14px 36px !important;
    }

    .rd-topbar {
        align-items: flex-start !important;
        margin-bottom: 20px !important;
    }

    .rd-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .rd-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (prefers-reduced-motion: reduce) {
    .rider-sidebar,
    .rider-backdrop,
    .rider-mobile-toggle,
    .rider-nav a,
    .rd-stat-card,
    .page-card,
    .payments-card,
    .settings-card {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .rider-theme-auth *,
    .rider-theme-chat * {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }
}
