/**
 * Load Register - Premium Design System
 * Modern dark theme with glassmorphism
 */

/* ============================================
   IMPORTS & VARIABLES
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Colors - Dark Theme (default) */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;
    --bg-elevated: #222230;

    --surface-glass: rgba(255, 255, 255, 0.03);
    --surface-glass-hover: rgba(255, 255, 255, 0.06);
    --surface-glass-border: rgba(255, 255, 255, 0.08);

    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);

    --accent-primary: #00ff6a;
    --accent-primary-rgb: 0, 255, 106;
    --accent-secondary: #3b82f6;
    --accent-secondary-rgb: 59, 130, 246;

    --status-success: #00ff6a;
    --status-error: #ff4d6a;
    --status-warning: #ffb800;
    --status-info: #3b82f6;

    --gradient-primary: linear-gradient(135deg, #00ff6a 0%, #00cc55 100%);
    --gradient-secondary: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    --gradient-bg: radial-gradient(ellipse at top, #1a1a2e 0%, #0a0a0f 50%, #050508 100%);

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(var(--accent-primary-rgb), 0.15);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;

    /* Font */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Light Theme */
[data-theme="light"] {
    --bg-primary: #f5f5f7;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e8e8ed;
    --bg-elevated: #ffffff;

    --surface-glass: rgba(255, 255, 255, 0.7);
    --surface-glass-hover: rgba(255, 255, 255, 0.9);
    --surface-glass-border: rgba(0, 0, 0, 0.08);

    --text-primary: #1a1a1a;
    --text-secondary: rgba(0, 0, 0, 0.65);
    --text-muted: rgba(0, 0, 0, 0.4);

    --accent-primary: #00b84d;
    --accent-primary-rgb: 0, 184, 77;

    --gradient-bg: linear-gradient(180deg, #f0f0f5 0%, #e5e5ea 100%);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 40px rgba(var(--accent-primary-rgb), 0.1);
}

/* ============================================
   RESET & BASE
   ============================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: var(--gradient-bg);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   UTILITIES
   ============================================ */

.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ============================================
   LOGIN SCREEN
   ============================================ */

.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
}

.login-card {
    background: var(--surface-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--surface-glass-border);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

.login-card__logo {
    width: 100px;
    height: 100px;
    object-fit: cover;
    object-position: center;
    transform: scale(1.3);
    margin: 0 auto var(--space-xl);
    display: block;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-glow);
    overflow: hidden;
}

.login-card__title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--space-xs);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-card__subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: var(--space-xl);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.login-form__group {
    position: relative;
}

.login-form__input {
    width: 100%;
    padding: var(--space-md);
    padding-right: 48px;
    background: var(--bg-tertiary);
    border: 1px solid var(--surface-glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition-fast);
}

.login-form__input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(var(--accent-primary-rgb), 0.15);
}

.login-form__toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.login-form__toggle:hover {
    color: var(--text-primary);
}

.login-form__remember {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.login-form__remember input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-primary);
}

.login-form__submit {
    margin-top: var(--space-md);
}

/* Shake animation */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-8px);
    }

    40%,
    80% {
        transform: translateX(8px);
    }
}

.shake {
    animation: shake 0.5s ease;
}

/* ============================================
   APP CONTAINER
   ============================================ */

.app-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: var(--space-lg);
    min-height: 100vh;
}

/* ============================================
   HEADER
   ============================================ */

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--surface-glass-border);
}

.header__brand {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.header__logo {
    width: 56px;
    height: 56px;
    object-fit: cover;
    object-position: center;
    transform: scale(1.2);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-glow);
    overflow: hidden;
}

.header__title {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header__subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.header__actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn--primary {
    background: var(--gradient-primary);
    color: #000;
    box-shadow: var(--shadow-sm), 0 0 20px rgba(var(--accent-primary-rgb), 0.3);
}

.btn--primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), 0 0 30px rgba(var(--accent-primary-rgb), 0.4);
}

.btn--primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn--secondary {
    background: var(--gradient-secondary);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.btn--secondary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), 0 0 20px rgba(var(--accent-secondary-rgb), 0.3);
}

.btn--ghost {
    background: var(--surface-glass);
    color: var(--text-primary);
    border: 1px solid var(--surface-glass-border);
}

.btn--ghost:hover:not(:disabled) {
    background: var(--surface-glass-hover);
    border-color: var(--text-muted);
}

.btn--icon {
    padding: var(--space-sm);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
}

.btn--danger {
    background: linear-gradient(135deg, #ff4d6a 0%, #dc2626 100%);
    color: #fff;
}

.btn--full {
    width: 100%;
}

.btn--lg {
    padding: var(--space-lg) var(--space-xl);
    font-size: 1rem;
    border-radius: var(--radius-lg);
}

.btn--small {
    padding: var(--space-xs) var(--space-md);
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
}

.btn--warning {
    background: linear-gradient(135deg, #ffb800 0%, #e6a500 100%);
    color: #000;
}

.btn--warning:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), 0 0 20px rgba(255, 184, 0, 0.3);
}

.btn--success {
    background: linear-gradient(135deg, #00ff6a 0%, #00cc55 100%);
    color: #000;
}

.btn--success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), 0 0 20px rgba(0, 255, 106, 0.3);
}

/* ============================================
   FORM CARD
   ============================================ */

.form-card {
    background: var(--surface-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--surface-glass-border);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    box-shadow: var(--shadow-lg);
}

.form-card__section {
    margin-bottom: var(--space-xl);
}

.form-card__section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* ============================================
   SEARCH ROW
   ============================================ */

.search-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--space-md);
    align-items: end;
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-xl);
    border-bottom: 1px solid var(--surface-glass-border);
}

/* ============================================
   FORM GRID
   ============================================ */

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg) var(--space-xl);
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   FORM GROUP
   ============================================ */

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.form-group--inline {
    flex-direction: row;
    align-items: end;
    gap: var(--space-sm);
}

.form-group--inline .form-input {
    flex: 1;
}

.form-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input,
.form-select {
    width: 100%;
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--surface-glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-family: inherit;
    transition: var(--transition-fast);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(var(--accent-primary-rgb), 0.15);
}

.form-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: var(--bg-secondary);
}

/* Validation States */
.form-input.input-error {
    border-color: var(--status-error);
    box-shadow: 0 0 0 3px rgba(255, 77, 106, 0.15);
}

.form-input.input-ok {
    border-color: var(--status-success);
    box-shadow: 0 0 0 3px rgba(var(--accent-primary-rgb), 0.15);
}

/* Date Input */
.form-input[type="date"] {
    color-scheme: dark;
}

[data-theme="light"] .form-input[type="date"] {
    color-scheme: light;
}

/* Select */
.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23666' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

/* Autofill Fix */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text-primary);
    -webkit-box-shadow: 0 0 0px 1000px var(--bg-tertiary) inset;
    transition: background-color 5000s ease-in-out 0s;
}

/* ============================================
   SUBMIT AREA
   ============================================ */

.submit-area {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-xl);
    padding-top: var(--space-xl);
    border-top: 1px solid var(--surface-glass-border);
}

.submit-area .btn--primary {
    flex: 1;
}

/* ============================================
   VEHICLES SECTION
   ============================================ */

.vehicles-section {
    margin: var(--space-sm) 0;
}

.vehicles-section__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--surface-glass-border);
}

.vehicles-section__title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.vehicles-section__count {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-muted);
}

/* Vehicle Card */
.vehicle-card {
    background: var(--surface-glass);
    border: 1px solid var(--surface-glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
    position: relative;
    animation: vehicleSlideIn 0.3s ease;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.vehicle-card:hover {
    border-color: rgba(var(--accent-primary-rgb), 0.3);
    box-shadow: 0 0 20px rgba(var(--accent-primary-rgb), 0.05);
}

@keyframes vehicleSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.vehicle-card.removing {
    animation: vehicleSlideOut 0.25s ease forwards;
}

@keyframes vehicleSlideOut {
    from {
        opacity: 1;
        transform: translateY(0);
        max-height: 600px;
    }

    to {
        opacity: 0;
        transform: translateY(-10px);
        max-height: 0;
        padding: 0;
        margin: 0;
        overflow: hidden;
    }
}

.vehicle-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}

.vehicle-card__title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.vehicle-card__remove {
    background: none;
    border: 1px solid transparent;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition-fast);
}

.vehicle-card__remove:hover {
    color: var(--status-error);
    border-color: var(--status-error);
    background: rgba(255, 77, 106, 0.1);
}

/* Make/Model field inside vehicle card */
.vehicle-card__make-model {
    margin-bottom: var(--space-md);
}

/* Location sections (pickup & delivery) */
.vehicle-card__locations {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

@media (max-width: 768px) {
    .vehicle-card__locations {
        grid-template-columns: 1fr;
    }
}

.location-block {
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    border-left: 3px solid transparent;
}

.location-block--pickup {
    border-left-color: var(--status-success);
}

.location-block--delivery {
    border-left-color: var(--status-info);
}

.location-block__title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.location-block--pickup .location-block__title {
    color: var(--status-success);
}

.location-block--delivery .location-block__title {
    color: var(--status-info);
}

.location-block .form-group {
    margin-bottom: var(--space-sm);
}

/* Location Type Radio Group */
.location-type-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: var(--space-xs);
}

.location-type-group label {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--surface-glass-border);
    background: transparent;
    color: var(--text-muted);
    transition: var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.location-type-group label:hover {
    border-color: var(--text-secondary);
    color: var(--text-secondary);
}

.location-type-group input[type="radio"] {
    display: none;
}

/* Radio active states managed via JS toggle classes */

.location-block--pickup .location-type-group input[type="radio"]:checked~label,
.location-type-group .location-type--active-pickup {
    background: rgba(0, 255, 106, 0.15);
    border-color: var(--status-success);
    color: var(--status-success);
}

.location-block--delivery .location-type-group .location-type--active-delivery {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--status-info);
    color: var(--status-info);
}

/* Notes textarea */
.location-notes {
    width: 100%;
    min-height: 40px;
    max-height: 80px;
    padding: var(--space-sm);
    background: var(--bg-primary);
    border: 1px solid var(--surface-glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 0.8rem;
    resize: vertical;
    transition: var(--transition-fast);
}

.location-notes::placeholder {
    color: var(--text-muted);
}

.location-notes:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(var(--accent-primary-rgb), 0.15);
}

/* Add Vehicle button disabled state */
#btnAddVehicle:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ============================================
   MODALS
   ============================================ */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: var(--transition-normal);
}

.modal.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--surface-glass-border);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    width: 100%;
    max-width: 450px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.95) translateY(20px);
    transition: var(--transition-normal);
    box-shadow: var(--shadow-lg);
}

.modal.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--surface-glass-border);
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: var(--space-xs);
    display: flex;
    transition: var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
}

/* Modal List */
.modal-list {
    list-style: none;
}

.modal-list__item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--text-secondary);
}

.modal-list__item:hover {
    background: var(--surface-glass-hover);
    color: var(--text-primary);
}

.modal-list__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xl);
    color: var(--text-muted);
    text-align: center;
}

/* Order Item */
.order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.order-item__main {
    display: flex;
    flex-direction: column;
}

.order-item__model {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.order-item__status {
    font-size: 0.6875rem;
    padding: 4px 8px;
    border-radius: var(--radius-full);
    font-weight: 600;
}

/* Payment Status Badges - Modal */
.pstatus--pending {
    background: rgba(255, 184, 0, 0.2);
    color: var(--status-warning);
}

.pstatus--sent {
    background: rgba(59, 130, 246, 0.2);
    color: var(--status-info);
}

.pstatus--waiting {
    background: rgba(139, 92, 246, 0.2);
    color: #8b5cf6;
}

.pstatus--received {
    background: rgba(0, 255, 106, 0.3);
    color: var(--status-success);
}

/* Status Tags - Active/Inactive */
.status-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.status--active {
    background: rgba(0, 255, 106, 0.2);
    color: var(--status-success);
}

.status--inactive {
    background: rgba(255, 77, 106, 0.2);
    color: var(--status-error);
}

/* Role Tags - Admin/Dispatcher */
.status--role-admin {
    background: rgba(59, 130, 246, 0.2);
    color: var(--status-info);
}

.status--role-dispatcher {
    background: rgba(255, 184, 0, 0.2);
    color: var(--status-warning);
}

/* Payment Status Tags - Admin Table */
.pstatus--pending-tag {
    background: rgba(255, 184, 0, 0.2);
    color: var(--status-warning);
}

.pstatus--sent-tag {
    background: rgba(59, 130, 246, 0.2);
    color: var(--status-info);
}

.pstatus--waiting-tag {
    background: rgba(139, 92, 246, 0.2);
    color: #8b5cf6;
}

.pstatus--received-tag {
    background: rgba(0, 255, 106, 0.3);
    color: var(--status-success);
}

/* Admin Filters - Compact */
.admin-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.admin-filters .filter-select {
    width: auto;
    min-width: 140px;
    max-width: 180px;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}

.admin-filters .filter-date {
    width: auto;
    min-width: 130px;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}

/* History Item */
.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-item__content {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-item__main {
    display: flex;
    flex-direction: column;
}

.history-item__driver {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.history-item__date {
    font-size: 0.6875rem;
    color: var(--text-muted);
}

.history-item__status {
    font-size: 0.6875rem;
    padding: 4px 8px;
    border-radius: var(--radius-full);
    font-weight: 600;
    margin: 0 var(--space-md);
}

.history-item__delete {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: var(--space-xs);
    margin-left: var(--space-sm);
    display: flex;
    transition: var(--transition-fast);
    border-radius: var(--radius-sm);
}

.history-item__delete:hover {
    color: var(--status-error);
    background: rgba(255, 77, 106, 0.1);
}

/* Confirm Modal */
.confirm-modal .modal-content {
    max-width: 380px;
    text-align: center;
}

.confirm-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background: rgba(255, 184, 0, 0.15);
    color: var(--status-warning);
}

[data-type="danger"] .confirm-icon {
    background: rgba(255, 77, 106, 0.15);
    color: var(--status-error);
}

[data-type="info"] .confirm-icon {
    background: rgba(59, 130, 246, 0.15);
    color: var(--status-info);
}

.confirm-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.confirm-message {
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
}

.confirm-actions {
    display: flex;
    gap: var(--space-md);
}

.confirm-actions .btn {
    flex: 1;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.toast-container {
    position: fixed;
    top: var(--space-lg);
    right: var(--space-lg);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--surface-glass-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
    transform: translateX(120%);
    opacity: 0;
    transition: var(--transition-normal);
    max-width: 380px;
}

.toast--visible {
    transform: translateX(0);
    opacity: 1;
}

.toast--hiding {
    transform: translateX(120%);
    opacity: 0;
}

.toast__icon {
    flex-shrink: 0;
    display: flex;
}

.toast__message {
    flex: 1;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.toast__close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
    display: flex;
    transition: var(--transition-fast);
}

.toast__close:hover {
    color: var(--text-primary);
}

/* Toast Types */
.toast--success {
    border-left: 3px solid var(--status-success);
}

.toast--success .toast__icon {
    color: var(--status-success);
}

.toast--error {
    border-left: 3px solid var(--status-error);
}

.toast--error .toast__icon {
    color: var(--status-error);
}

.toast--warning {
    border-left: 3px solid var(--status-warning);
}

.toast--warning .toast__icon {
    color: var(--status-warning);
}

.toast--info {
    border-left: 3px solid var(--status-info);
}

.toast--info .toast__icon {
    color: var(--status-info);
}

/* ============================================
   LOADING
   ============================================ */

.global-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    z-index: 3000;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.global-loader.visible {
    opacity: 1;
}

.global-loader::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 30%;
    height: 100%;
    background: var(--gradient-primary);
    animation: loading 1s ease-in-out infinite;
}

@keyframes loading {
    0% {
        left: -30%;
    }

    100% {
        left: 100%;
    }
}

/* ============================================
   SHORTCUTS HINT
   ============================================ */

.shortcuts-hint {
    position: fixed;
    bottom: var(--space-lg);
    left: var(--space-lg);
    display: flex;
    gap: var(--space-lg);
    font-size: 0.6875rem;
    color: var(--text-muted);
}

.shortcut {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.shortcut kbd {
    background: var(--bg-tertiary);
    border: 1px solid var(--surface-glass-border);
    border-radius: 4px;
    padding: 2px 6px;
    font-family: inherit;
    font-size: 0.625rem;
}

@media (max-width: 768px) {
    .shortcuts-hint {
        display: none;
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .app-container {
        padding: var(--space-md);
    }

    .header {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }

    .header__brand {
        flex-direction: column;
    }

    .search-row {
        grid-template-columns: 1fr;
    }

    .submit-area {
        flex-direction: column;
    }

    .form-card {
        padding: var(--space-lg);
    }

    .toast-container {
        left: var(--space-md);
        right: var(--space-md);
    }

    .toast {
        max-width: 100%;
    }
}

/* ============================================
   INITIAL LOADER
   ============================================ */

.initial-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0f172a;
    /* Fallback for var(--bg-primary) if vars not loaded */
    background: var(--bg-primary);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s;
}

.initial-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.initial-loader .loader {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--accent-primary);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   ADMIN VIEW
   ============================================ */

.admin-view {
    animation: fadeIn 0.3s ease;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
    gap: var(--space-md);
}

.admin-tabs {
    display: flex;
    gap: var(--space-md);
    background: var(--bg-secondary);
    padding: 4px;
    border-radius: var(--radius-md);
    border: 1px solid var(--surface-glass-border);
}

.admin-tabs .btn {
    border: none;
    border-radius: var(--radius-sm);
    padding: var(--space-sm) var(--space-md);
}

.admin-tabs .btn.active {
    background: var(--bg-tertiary);
    color: var(--accent-primary);
    box-shadow: var(--shadow-sm);
}

.admin-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
    gap: var(--space-md);
}

.admin-filters {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.filter-select {
    min-width: 160px;
    padding: var(--space-sm) var(--space-md);
    padding-right: 32px;
    font-size: 0.875rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--surface-glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23666' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: var(--transition-fast);
}

.filter-select:hover {
    border-color: var(--text-muted);
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(var(--accent-primary-rgb), 0.15);
}

.filter-date {
    width: 140px;
    padding: var(--space-sm) var(--space-md);
    font-size: 0.875rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--surface-glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.filter-date:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(var(--accent-primary-rgb), 0.15);
}

.btn--small {
    padding: var(--space-sm) var(--space-md);
    font-size: 0.8125rem;
}

.btn-icon-small {
    background: transparent;
    border: 1px solid var(--surface-glass-border);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--text-secondary);
}

.btn-icon-small:hover {
    background: var(--surface-glass-hover);
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.btn-icon-small.btn-icon-danger:hover {
    background: rgba(255, 77, 106, 0.15);
    color: var(--status-error);
    border-color: var(--status-error);
}

.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--surface-glass-border);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-secondary);
    font-size: 0.875rem;
}

.data-table th,
.data-table td {
    padding: var(--space-md);
    text-align: left;
    border-bottom: 1px solid var(--surface-glass-border);
}

.data-table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.data-table tr:hover td {
    background: var(--surface-glass-hover);
}

.admin-tab {
    display: none;
}

.admin-tab.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Status Select */
.status-select {
    padding: 6px 12px;
    border-radius: 20px;
    border: none;
    font-weight: 600;
    font-size: 0.75rem;
    cursor: pointer;
    text-align: center;
    transition: background 0.2s, color 0.2s;
}

.status-select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.status-select.status-paid {
    background: #d1fae5;
    color: #065f46;
}

.status-select.status-pending {
    background: #fef3c7;
    color: #92400e;
}

/* Dark Mode Adjustments */
[data-theme="dark"] .status-select.status-paid {
    background: #064e3b;
    color: #a7f3d0;
}

[data-theme="dark"] .status-select.status-pending {
    background: #78350f;
    color: #fde68a;
}

/* ============================================
   PAYMENT SECTION
   ============================================ */

.payment-section {
    margin: var(--space-sm) 0;
}

.payment-section__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--surface-glass-border);
}

.payment-section__title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.payment-card {
    background: var(--surface-glass);
    border: 1px solid var(--surface-glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.payment-card:hover {
    border-color: rgba(var(--accent-secondary-rgb), 0.3);
    box-shadow: var(--shadow-md);
}

/* Driver Received Radio Group */
.radio-group {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-sm) 0;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    font-weight: 500;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    border: 1px solid var(--surface-glass-border);
    background: var(--bg-tertiary);
    transition: var(--transition-fast);
    user-select: none;
}

.radio-option:hover {
    border-color: var(--text-muted);
    color: var(--text-primary);
}

.radio-option input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--surface-glass-border);
    position: relative;
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.radio-option input[type="radio"]:checked~.radio-custom {
    border-color: var(--accent-primary);
    background: transparent;
}

.radio-option input[type="radio"]:checked~.radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-primary);
}

.radio-option:has(input[type="radio"]:checked) {
    border-color: rgba(var(--accent-primary-rgb), 0.4);
    color: var(--text-primary);
    background: rgba(var(--accent-primary-rgb), 0.05);
}

/* Hide animation for Driver Received */
#driverReceivedGroup {
    transition: opacity 0.25s ease, max-height 0.25s ease;
    overflow: hidden;
}

#driverReceivedGroup.hidden-field {
    opacity: 0;
    max-height: 0;
    margin: 0;
    padding: 0;
    pointer-events: none;
}