:root {
    --primary: #1e3a8a;
    --primary-dark: #1e40af;
    --primary-light: #dbeafe;
    --secondary: #0891b2;
    --accent: #f59e0b;
    --accent-light: #fef3c7;
    --success: #059669;
    --success-light: #d1fae5;
    --warning: #d97706;
    --warning-light: #fef3c7;
    --danger: #dc2626;
    --danger-light: #fee2e2;

    --bg-primary: #f1f5f9;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --border-color: #e2e8f0;
    --border-radius: 12px;
    --border-radius-lg: 16px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

    --transition: all 0.2s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1.5rem 0;
    text-align: center;
}

.header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.header p {
    opacity: 0.9;
    margin-top: 0.25rem;
}

/* Direction Selector */
.direction-selector {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-card);
    padding: 0.5rem;
    border-radius: var(--border-radius);
    margin: 1rem 0;
}

.direction-btn {
    flex: 1;
    padding: 1rem;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
    transition: var(--transition);
}

.direction-btn:hover {
    border-color: var(--primary);
}

.direction-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.direction-btn .route {
    font-weight: 700;
    font-size: 0.9rem;
}

.direction-btn .arrow {
    color: var(--accent);
    margin: 0 0.25rem;
}

.direction-btn.active .arrow {
    color: white;
}

/* Date Filter */
.date-filter {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.5rem 0;
    -webkit-overflow-scrolling: touch;
}

.date-btn {
    flex-shrink: 0;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: var(--border-radius);
    cursor: pointer;
    text-align: center;
    min-width: 70px;
    transition: var(--transition);
}

.date-btn:hover {
    border-color: var(--primary);
}

.date-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.date-btn .date-name {
    font-size: 0.75rem;
    opacity: 0.8;
}

.date-btn .date-num {
    font-size: 1.25rem;
    font-weight: 700;
}

.date-btn .date-month {
    font-size: 0.7rem;
    opacity: 0.7;
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 1rem;
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-primary);
}

.card-header h3 {
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-body {
    padding: 1.25rem;
}

/* Schedule Cards */
.schedule-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.schedule-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    align-items: center;
}

.schedule-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.schedule-card.sold-out {
    opacity: 0.5;
    cursor: not-allowed;
}

.schedule-vessel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.vessel-icon {
    font-size: 1.5rem;
}

.vessel-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    text-align: center;
    max-width: 80px;
}

.schedule-route {
    text-align: center;
}

.route-origin,
.route-destination {
    font-weight: 600;
}

.route-arrow {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0.25rem 0;
}

.route-arrow .arrow {
    color: var(--accent);
    margin: 0 0.5rem;
}

.schedule-info {
    text-align: right;
}

.info-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

.info-price small {
    font-size: 0.7rem;
    opacity: 0.7;
}

.info-seats {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.info-seats.low {
    color: var(--danger);
    font-weight: 600;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #047857;
}

.btn-secondary {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

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

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-input,
.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Passenger Counter */
.passenger-counter {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-primary);
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

.counter-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--primary);
    color: white;
    font-size: 1.25rem;
    border-radius: 50%;
    cursor: pointer;
}

.counter-btn:disabled {
    background: var(--border-color);
    color: var(--text-muted);
}

.counter-display {
    font-size: 1.5rem;
    font-weight: 700;
    min-width: 50px;
    text-align: center;
}

/* Modal - Premium Design */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: white;
    border-radius: 24px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalPop 0.3s ease;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

@keyframes modalPop {
    from {
        transform: scale(0.95);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: white;
    z-index: 1;
    border-radius: 24px 24px 0 0;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-close {
    width: 36px;
    height: 36px;
    background: #f1f5f9;
    border: none;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #fee2e2;
    color: #dc2626;
}

.modal-body {
    padding: 1.5rem;
}

/* Selected Schedule Info - Premium */
.selected-schedule {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    padding: 1.25rem;
    border-radius: 16px;
    margin-bottom: 1.5rem;
    border: 1px solid #bfdbfe;
}

.schedule-vessel-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.15rem;
    margin-bottom: 1rem;
    color: #1e40af;
}

.vessel-icon-lg {
    font-size: 1.25rem;
}

.schedule-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 0.9rem;
    border-bottom: 1px dashed #bfdbfe;
}

.schedule-detail-row:last-child {
    border-bottom: none;
}

.schedule-detail-row .label {
    color: #64748b;
}

.schedule-detail-row .value {
    font-weight: 600;
    color: #1e293b;
}

.schedule-detail-row.highlight {
    background: white;
    margin: 0.75rem -0.75rem 0;
    padding: 0.75rem;
    border-radius: 10px;
    border: none;
}

.schedule-detail-row.highlight .value {
    color: #059669;
    font-size: 1.15rem;
    font-weight: 700;
}

/* Passenger Counter - Premium */
.passenger-counter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 1rem 1.25rem;
    border-radius: 14px;
    margin-bottom: 1.5rem;
    border: 1px solid #e2e8f0;
}

.passenger-counter span:first-child {
    font-weight: 600;
    color: #334155;
}

.counter-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.counter-btn {
    width: 44px;
    height: 44px;
    border: 2px solid #e2e8f0;
    background: white;
    color: #1e293b;
    font-size: 1.25rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.counter-btn:hover:not(:disabled) {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.counter-btn:disabled {
    background: #f1f5f9;
    color: #cbd5e1;
    cursor: not-allowed;
}

.counter-display {
    font-size: 1.75rem;
    font-weight: 800;
    min-width: 50px;
    text-align: center;
    color: #1e293b;
}

/* Form Fields - Premium */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: #334155;
}

.form-input,
.form-select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s;
    background: #f8fafc;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: #3b82f6;
    background: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input::placeholder {
    color: #94a3b8;
}

.form-hint {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Total Summary - Premium */
.total-summary {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    padding: 1.25rem;
    border-radius: 16px;
    margin: 1.5rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #fcd34d;
}

.total-summary .label {
    font-weight: 700;
    color: #92400e;
    font-size: 0.95rem;
}

.total-summary .text-muted {
    font-size: 0.8rem;
    color: #a16207;
    margin-top: 0.25rem;
}

.total-summary .value {
    font-size: 1.75rem;
    font-weight: 800;
    color: #1e40af;
}

/* Submit Button - Premium */
.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    font-weight: 700;
    padding: 1rem 1.5rem;
    border-radius: 14px;
    font-size: 1rem;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
    transition: all 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

/* Confirmation */
.booking-success {
    text-align: center;
    padding: 1rem 0;
}

.booking-code-display {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 0.1em;
    padding: 1.5rem;
    background: var(--primary-light);
    border-radius: var(--border-radius);
    margin: 1rem 0;
    font-family: 'Courier New', monospace;
}

.confirm-section {
    text-align: left;
    background: var(--bg-primary);
    padding: 1rem;
    border-radius: var(--border-radius);
    margin: 1rem 0;
}

.confirm-section h4 {
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.confirm-section .detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.35rem 0;
    font-size: 0.9rem;
}

.confirm-section .label {
    color: var(--text-secondary);
}

.confirm-section .value {
    font-weight: 600;
}

.confirm-section .value.price {
    color: var(--primary);
    font-size: 1.25rem;
}

.confirm-section.highlight {
    background: var(--accent-light);
}

.confirm-section .passenger-list {
    margin-left: 1.25rem;
}

.confirm-section .passenger-list li {
    padding: 0.25rem 0;
}

.confirm-note {
    background: var(--warning-light);
    color: #92400e;
    padding: 1rem;
    border-radius: var(--border-radius);
    margin: 1rem 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 1rem;
    border-radius: 99px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-reserved_pending,
.badge-waiting_payment {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: 1px solid #f59e0b;
}

.badge-payment_confirmed {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    border: 1px solid #3b82f6;
}

.badge-collected_at_counter {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border: 1px solid #10b981;
}

.badge-boarded {
    background: linear-gradient(135deg, #a7f3d0 0%, #6ee7b7 100%);
    color: #047857;
    border: 1px solid #059669;
}

.badge-cancelled,
.badge-no_show {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border: 1px solid #ef4444;
}

/* Agent Dashboard */
.dashboard-header {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

.dashboard-header .form-group {
    margin: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.stat-card {
    background: white;
    padding: 1rem;
    border-radius: var(--border-radius);
    text-align: center;
    border: 2px solid var(--border-color);
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.stat-card.warning .stat-value {
    color: var(--warning);
}

.stat-card.success .stat-value {
    color: var(--success);
}

.booking-card {
    background: white;
    border-radius: var(--border-radius);
    border: 2px solid var(--border-color);
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.booking-card.status-reserved_pending {
    border-left: 4px solid var(--warning);
}

.booking-card.status-collected_at_counter {
    border-left: 4px solid var(--success);
}

.booking-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-primary);
}

.booking-code {
    font-family: monospace;
    font-weight: 700;
    color: var(--primary);
}

.booking-body {
    padding: 1rem;
}

.booking-passengers {
    margin-bottom: 0.5rem;
}

.booking-contact,
.booking-schedule,
.booking-price {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.35rem;
}

.booking-actions {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-color);
}

.ticket-number {
    font-family: monospace;
    color: var(--success);
}

/* Utilities */
.loading {
    padding: 3rem;
    text-align: center;
    color: var(--text-muted);
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 0.5rem;
}

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

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.empty-state .icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.text-center {
    text-align: center;
}

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

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

/* Footer */
.footer {
    background: var(--text-primary);
    color: var(--text-muted);
    padding: 1.5rem 0;
    text-align: center;
    margin-top: 2rem;
}

.footer a {
    color: inherit;
}

/* Responsive */
@media (max-width: 640px) {
    .header h1 {
        font-size: 1.5rem;
    }

    .direction-selector {
        flex-direction: column;
    }

    .schedule-card {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 0.75rem;
    }

    .schedule-info {
        text-align: center;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .booking-code-display {
        font-size: 1.75rem;
    }
}

@media (min-width: 640px) {
    .modal {
        border-radius: var(--border-radius-lg);
        max-height: 85vh;
        margin: auto;
    }

    .modal-overlay {
        align-items: center;
    }
}