:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #64748b;
    --bg-dark: #0f172a;
    --bg-sidebar: #1e293b;
    --bg-card: #ffffff;
    --text-main: #334155;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --success: #10b981;
    --danger: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Kanit', sans-serif;
}

body {
    background-color: #f8fafc;
    color: var(--text-main);
}

/* Login Page */
.login-page {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-dark) 0%, #1e1b4b 100%);
}

.login-card {
    background: white;
    padding: 2.5rem;
    border-radius: 1.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header img {
    width: 80px;
    height: 80px;
    border-radius: 1rem;
    margin-bottom: 1rem;
    object-fit: cover;
}

.login-header h2 {
    font-size: 1.5rem;
    color: var(--bg-dark);
    margin-bottom: 0.5rem;
}

/* Dashboard Layout */
.dashboard {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    color: white;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
}

.sidebar-logo {
    text-align: center;
    margin-bottom: 3rem;
}

.sidebar-logo img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.1);
    object-fit: cover;
}

.sidebar-menu {
    flex-grow: 1;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 0.875rem 1rem;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 0.75rem;
    margin-bottom: 0.5rem;
    transition: 0.3s;
}

.menu-item i {
    width: 20px;
    margin-right: 1rem;
}

.menu-item:hover,
.menu-item.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.menu-item.logout:hover {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.main-content {
    flex-grow: 1;
    margin-left: 260px;
    padding: 2rem 3rem;
}

/* Tabs */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-right: 1rem;
}

.stat-icon.blue {
    background-color: #eff6ff;
    color: #3b82f6;
}

.stat-icon.purple {
    background-color: #f5f3ff;
    color: #8b5cf6;
}

/* Table */
.card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 1rem;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 500;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.data-table img {
    width: 50px;
    height: 50px;
    border-radius: 0.5rem;
    object-fit: cover;
}

/* Components */
.btn {
    padding: 0.625rem 1.25rem;
    border-radius: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.875rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    outline: none;
    transition: 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

input[type="date"] {
    cursor: pointer;
    font-family: inherit;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 600px;
    border-radius: 1.5rem;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Image Upload */
.image-upload {
    border: 2px dashed var(--border-color);
    padding: 2rem;
    text-align: center;
    border-radius: 1rem;
    cursor: pointer;
    transition: 0.3s;
}

.image-upload:hover {
    border-color: var(--primary-color);
    background-color: #f8fafc;
}

.image-upload i {
    font-size: 2rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.images-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.image-item {
    position: relative;
}

.image-item img {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 0.5rem;
    object-fit: cover;
}

.image-item .delete-btn {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 2rem;
    background: var(--bg-dark);
    color: white;
    border-radius: 0.75rem;
    transform: translateY(150%);
    transition: 0.3s;
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
}

.toast.error {
    background: var(--danger);
}

/* Van Layout */
.van-layout {
    background-color: #ffffff;
    border: 2px solid #333;
    border-radius: 40px 40px 10px 10px;
    padding: 30px 20px 20px;
    margin: 0 auto;
    width: 320px;
}

.van-title-wrap {
    text-align: center;
    margin-bottom: 20px;
}

.van-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

.van-title .vip {
    color: #e74c3c;
}

.van-subtitle {
    font-size: 0.85rem;
    color: #e74c3c;
    font-weight: 500;
}

.van-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.van-front-row {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px dashed #ccc;
    align-items: center;
}

.driver {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    width: 150px;
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.driver-steering-wheel {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid #333;
    background-color: transparent;
    position: relative;
}

.driver-steering-wheel::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40%;
    height: 40%;
    background-color: #333;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.driver-steering-wheel::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #333;
    transform: translateY(-50%);
}

.seat {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #333;
    user-select: none;
}

.seat-staff {
    background-color: #00ff00;
    color: #e74c3c;
    text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
    cursor: default;
    font-size: 1.6rem;
    letter-spacing: -1px;
}

.seat-available {
    background-color: #00ff00;
    color: #000;
}

.seat-available:hover {
    transform: scale(1.05);
}

.seat-booked {
    background-color: #e74c3c;
    color: #000;
}

.seat-booked:hover {
    transform: scale(1.05);
}

.seat-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 500;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid #333;
}

.legend-available {
    background-color: #00ff00;
}

.legend-booked {
    background-color: #e74c3c;
}

/* For User site, no hover cursor pointer for seats */
.trip-details-seats .seat {
    cursor: default;
}

.trip-details-seats .seat:hover {
    transform: none;
}