:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --light: #f8fafc;
    --dark: #1e293b;
    --gray: #94a3b8;
    --light-gray: #e2e8f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f1f5f9;
    color: var(--dark);
    line-height: 1.6;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: var(--dark);
    color: white;
    transition: all 0.3s ease;
}

.sidebar-header {
    padding: 20px;
    background: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
}

.sidebar-header i {
    font-size: 1.5rem;
}

.sidebar-menu {
    padding: 15px 0;
}

.sidebar-menu ul {
    list-style: none;
}

.sidebar-menu li {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.sidebar-menu li:hover {
    background: #334155;
}

.sidebar-menu li.active {
    background: var(--primary);
    border-left: 4px solid white;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--light-gray);
}

.header h1 {
    font-size: 1.8rem;
    color: var(--dark);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

/* Dashboard Cards */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.stat-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-card i {
    font-size: 2.5rem;
    color: var(--primary);
}

.stat-info h3 {
    font-size: 2rem;
    margin-bottom: 5px;
}

.stat-info p {
    color: var(--secondary);
}

/* Settings Controls */
.settings-controls {
    background: white;
    border-radius: 10px;
    padding: 15px 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    display: flex;
    gap: 30px;
    align-items: center;
    flex-wrap: wrap;
}

.settings-controls h3 {
    font-size: 1rem;
    color: var(--dark);
    margin-right: 10px;
}

.toggle-option {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--primary);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.toggle-option label {
    font-weight: 500;
    cursor: pointer;
}

.toggle-option.closed-mode input:checked + .toggle-slider {
    background-color: var(--danger);
}

/* Color Legend */
.color-legend {
    background: white;
    border-radius: 10px;
    padding: 15px 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.color-legend h3 {
    font-size: 1rem;
    margin-bottom: 10px;
    color: var(--dark);
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    display: inline-block;
}

/* Calendar Controls */
.calendar-controls {
    background: white;
    border-radius: 10px;
    padding: 15px 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.date-navigation {
    display: flex;
    align-items: center;
    gap: 10px;
}

#current-date {
    font-weight: 600;
    font-size: 1.1rem;
    margin-left: 10px;
}

.view-options {
    display: flex;
    gap: 5px;
}

.view-btn {
    padding: 8px 16px;
}

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

/* Boat Schedule */
.boat-schedule {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
    display: flex;
}

.time-column {
    min-width: 80px;
    border-right: 2px solid var(--light-gray);
}

.time-header {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    border-bottom: 2px solid var(--light-gray);
}

.time-slot {
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--light-gray);
    font-size: 0.9rem;
    color: var(--secondary);
}

.time-slot.hour {
    font-weight: 600;
    color: var(--dark);
}

.time-slot.half-hour {
    border-bottom: 1px dashed var(--light-gray);
}

.boats-grid {
    display: flex;
    flex: 1;
}

.boat-column {
    flex: 1;
    min-width: 150px;
    border-right: 1px solid var(--light-gray);
}

.boat-column:last-child {
    border-right: none;
}

.boat-header {
    height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-bottom: 2px solid var(--light-gray);
    background: var(--light);
}

.boat-header h3 {
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.boat-header .boat-type {
    font-size: 0.8rem;
    color: var(--secondary);
}

.time-cell {
    height: 30px;
    border-bottom: 1px solid var(--light-gray);
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
}

.time-cell.half-hour {
    border-bottom: 1px dashed var(--light-gray);
}

.time-cell:hover {
    background: rgba(37, 99, 235, 0.05);
}

.time-cell.drag-over {
    background: rgba(37, 99, 235, 0.2);
    border: 2px dashed var(--primary);
}

/* Booking Slots */
.booking-slot {
    position: absolute;
    top: 0;
    left: 2px;
    right: 2px;
    background: var(--success);
    color: white;
    padding: 4px 6px;
    font-size: 0.75rem;
    border-radius: 4px;
    cursor: move;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.booking-slot.paid {
    background: var(--success);
}

.booking-slot.cash {
    background: var(--warning);
}

.booking-slot.pending {
    background: var(--danger);
}

.booking-slot.admin {
    background: var(--primary);
}

.booking-slot.office {
    background: #9333ea;
}

.booking-slot:hover {
    opacity: 0.9;
    z-index: 10;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

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

.btn-secondary:hover {
    background: #475569;
}

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

.btn-danger:hover {
    background: #dc2626;
}

/* Content Sections */
.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--light-gray);
}

th {
    background: var(--light);
    font-weight: 600;
}

tr:hover {
    background: var(--light);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: var(--gray);
    cursor: pointer;
}

.close:hover {
    color: var(--dark);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--light-gray);
    border-radius: 5px;
    font-size: 1rem;
}

.modal-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-badge.paid {
    background: #dcfce7;
    color: #166534;
}

.status-badge.cash {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.pending {
    background: #fee2e2;
    color: #991b1b;
}

/* Map */
#map {
    height: 500px;
    border-radius: 10px;
}

/* Mobile Responsive - Move sidebar to top */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        position: sticky;
        top: 0;
        z-index: 100;
    }

    .sidebar-header {
        padding: 15px;
    }

    .sidebar-header h2 {
        font-size: 1rem;
    }

    .sidebar-menu {
        padding: 0;
    }

    .sidebar-menu ul {
        display: flex;
        overflow-x: auto;
        white-space: nowrap;
    }

    .sidebar-menu li {
        padding: 12px 15px;
        border-left: none;
        border-bottom: 3px solid transparent;
        flex-shrink: 0;
    }

    .sidebar-menu li.active {
        border-left: none;
        border-bottom: 3px solid white;
    }

    .main-content {
        padding: 15px;
    }

    .header h1 {
        font-size: 1.4rem;
    }

    .dashboard-cards {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .calendar-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .date-navigation {
        justify-content: center;
    }

    .view-options {
        justify-content: center;
    }

    .boat-schedule {
        padding: 10px;
    }

    .time-column {
        min-width: 60px;
    }

    .boat-column {
        min-width: 120px;
    }

    .settings-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    #map {
        height: 350px;
    }
}

@media (max-width: 480px) {
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .dashboard-cards {
        grid-template-columns: 1fr;
    }

    .stat-card {
        flex-direction: row-reverse;
    }

    .boat-column {
        min-width: 100px;
    }

    .booking-slot {
        font-size: 0.7rem;
        padding: 2px 4px;
    }
}
