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

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #dc2626;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-600: #4b5563;
    --gray-800: #1f2937;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.5;
}

/* Header */
header {
    background: var(--primary);
    color: white;
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

header h1 {
    font-size: 1.25rem;
    margin-bottom: 0;
    text-align: center;
}

/* Main */
main {
    padding: 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* Buttons */
.btn {
    padding: 0.625rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

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

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

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-800);
}

.btn-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
}

.btn-full {
    width: 100%;
}

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

/* Filters */
.job-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    overflow-x: auto;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-300);
    background: white;
    border-radius: 20px;
    font-size: 0.875rem;
    cursor: pointer;
    white-space: nowrap;
}

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

/* Jobs List */
.jobs-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.job-card {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: box-shadow 0.2s;
}

.job-card:active {
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.job-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.job-card h3 {
    font-size: 1rem;
    font-weight: 600;
}

.job-type {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.job-type.delivery {
    background: #dbeafe;
    color: #1e40af;
}

.job-type.collection {
    background: #fef3c7;
    color: #92400e;
}

.job-card-body {
    font-size: 0.875rem;
    color: var(--gray-600);
}

.job-card-body p {
    margin-bottom: 0.25rem;
}

.job-card-body .job-items {
    margin: 0.5rem 0;
    padding: 0.5rem;
    background: var(--gray-100);
    border-radius: 4px;
    font-size: 0.8rem;
}

.job-card-body .job-items strong {
    color: var(--gray-800);
}

.job-card-body .job-location {
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.job-card-body .job-mileage {
    font-size: 0.8rem;
    color: var(--gray-600);
    font-style: italic;
}

.job-card-body .job-haulier {
    margin-top: 0.5rem;
    font-weight: 500;
}

.job-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray-200);
    font-size: 0.8rem;
}

.job-status {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
}

.job-status.pending {
    background: var(--gray-200);
    color: var(--gray-600);
}

.job-status.in_progress {
    background: #fef3c7;
    color: #92400e;
}

.job-status.completed {
    background: #dcfce7;
    color: #166534;
}

.job-status.cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.job-price {
    font-weight: 600;
    color: var(--gray-800);
}

.loading, .no-jobs {
    text-align: center;
    padding: 2rem;
    color: var(--gray-600);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    overflow-y: auto;
    padding: 1rem;
}

.modal.open {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    margin-top: 2rem;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.modal-header h2 {
    font-size: 1.125rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-600);
    padding: 0.25rem;
}

.modal-body {
    padding: 1rem;
}

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

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.375rem;
}

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

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group input[readonly] {
    background: var(--gray-100);
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

.input-with-btn {
    display: flex;
    gap: 0.5rem;
}

.input-with-btn input {
    flex: 1;
}

/* Job info in modal */
.job-info {
    background: var(--gray-100);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.job-info p {
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
}

/* Hauliers list */
.hauliers-list {
    list-style: none;
    margin-top: 1rem;
}

.hauliers-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid var(--gray-200);
    gap: 0.75rem;
}

.hauliers-list li:last-child {
    border-bottom: none;
}

.haulier-item {
    display: flex;
    align-items: center;
}

.haulier-color-picker {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
}

.haulier-name {
    flex: 1;
    font-weight: 500;
}

/* Haulier add row */
.haulier-add-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.haulier-add-row input[type="color"] {
    width: 40px;
    height: 38px;
    padding: 2px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
}

.haulier-add-row input[type="text"] {
    flex: 1;
}

/* Haulier badge (colored) */
.haulier-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    color: white;
    text-shadow: 0 1px 1px rgba(0,0,0,0.2);
}

/* Sync result */
.sync-result {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 6px;
    text-align: center;
}

.sync-result.success {
    background: #dcfce7;
    color: #166534;
}

.sync-result.error {
    background: #fee2e2;
    color: #991b1b;
}

/* Jobs info */
.jobs-info {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 0.75rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding: 1rem 0;
}

.pagination #pageInfo {
    font-size: 0.875rem;
    color: var(--gray-600);
}

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

/* Job date display */
.job-date {
    font-size: 0.85rem;
    color: var(--gray-800);
    font-weight: 500;
}

.job-date .job-time {
    color: var(--gray-600);
    font-weight: 400;
}

.movement-badge {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    background: var(--gray-200);
    color: var(--gray-600);
    font-size: 0.7rem;
    border-radius: 3px;
    font-weight: 500;
    margin-left: 0.25rem;
    vertical-align: middle;
}

/* Login page */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 80px);
    padding: 1rem;
}

.login-box {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 360px;
}

.login-box h2 {
    margin-bottom: 1.5rem;
    text-align: center;
    color: var(--gray-800);
}

.error-message {
    color: var(--danger);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    text-align: center;
}

/* User info in header */
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
}

.user-info .username {
    opacity: 0.9;
}

.user-info .role-badge {
    padding: 0.125rem 0.375rem;
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
    font-size: 0.7rem;
    text-transform: uppercase;
}

.btn-logout {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
}

.btn-logout:hover {
    background: rgba(255,255,255,0.3);
}

/* Users list (admin) */
.users-list {
    list-style: none;
    margin-top: 1rem;
}

.users-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid var(--gray-200);
    gap: 0.75rem;
}

.users-list li:last-child {
    border-bottom: none;
}

.user-item-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.user-item-name {
    font-weight: 500;
}

.user-item-role {
    padding: 0.125rem 0.375rem;
    background: var(--gray-200);
    border-radius: 3px;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--gray-600);
}

.user-item-role.admin {
    background: #dbeafe;
    color: #1e40af;
}

.user-actions {
    display: flex;
    gap: 0.375rem;
}

/* Add user form */
.add-user-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.add-user-form .form-row {
    display: flex;
    gap: 0.5rem;
}

.add-user-form input,
.add-user-form select {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-size: 0.875rem;
}

/* Responsive */
@media (min-width: 640px) {
    header h1 {
        font-size: 1.5rem;
    }
    
    .actions {
        justify-content: flex-start;
    }
}

/* ============================================
   TABLE VIEW STYLES
   ============================================ */

/* View navigation in header */
.view-nav {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 0.75rem;
}

.view-nav .btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
}

.view-nav .btn-secondary {
    background: rgba(255,255,255,0.2);
    color: white;
}

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

/* Table view body */
body.table-view {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

body.table-view main.table-layout {
    flex: 1;
    display: flex;
    max-width: none;
    padding: 0;
    overflow: hidden;
}

/* Table panel (left side) */
.table-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: white;
    border-right: 1px solid var(--gray-200);
}

/* Toolbar */
.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--gray-100);
    border-bottom: 1px solid var(--gray-200);
    gap: 1rem;
    flex-wrap: wrap;
}

.table-filters {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.table-filters select,
.table-filters input[type="date"] {
    padding: 0.375rem 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-size: 0.8rem;
    background: white;
}

.table-filters .date-separator {
    color: var(--gray-600);
    font-size: 0.8rem;
}

.table-actions {
    display: flex;
    gap: 0.5rem;
}

/* Table container */
.table-container {
    flex: 1;
    overflow: auto;
}

#jobsTable {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

#jobsTable thead {
    position: sticky;
    top: 0;
    background: var(--gray-100);
    z-index: 10;
}

#jobsTable th {
    padding: 0.625rem 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--gray-600);
    border-bottom: 2px solid var(--gray-300);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}

#jobsTable th:hover {
    background: var(--gray-200);
}

#jobsTable td {
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid var(--gray-200);
    vertical-align: middle;
}

#jobsTable tbody tr {
    cursor: pointer;
    transition: background 0.1s;
}

#jobsTable tbody tr:hover {
    background: var(--gray-100);
}

#jobsTable tbody tr.selected {
    background: #dbeafe;
}

#jobsTable tbody tr.selected:hover {
    background: #bfdbfe;
}

#jobsTable td.event-name {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

#jobsTable td.destination {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#jobsTable td.destination .postcode {
    color: var(--gray-600);
    font-size: 0.75rem;
}

#jobsTable td.number {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

#jobsTable td .unassigned {
    color: var(--gray-300);
}

#jobsTable td .movement-count {
    display: inline-block;
    margin-left: 0.375rem;
    padding: 0.125rem 0.375rem;
    background: var(--gray-200);
    color: var(--gray-600);
    font-size: 0.65rem;
    border-radius: 3px;
    font-weight: 500;
}

#jobsTable td.transport-cell {
    white-space: nowrap;
}

/* Job type badge in table */
.job-type-badge {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
}

.job-type-badge.delivery {
    background: #dbeafe;
    color: #1e40af;
}

.job-type-badge.collection {
    background: #fef3c7;
    color: #92400e;
}

/* Status badge in table */
.status-badge {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 500;
}

.status-badge.pending {
    background: var(--gray-200);
    color: var(--gray-600);
}

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

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

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

/* Table footer */
.table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--gray-100);
    border-top: 1px solid var(--gray-200);
    font-size: 0.8rem;
    color: var(--gray-600);
}

.table-pagination {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.table-pagination .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

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

/* Detail panel (right side) */
.detail-panel {
    width: 320px;
    flex-shrink: 0;
    background: white;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.detail-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--gray-600);
    padding: 2rem;
    text-align: center;
}

.detail-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
}

.detail-header {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
}

.detail-header h2 {
    font-size: 1rem;
    font-weight: 600;
    word-break: break-word;
}

.detail-info {
    padding: 1rem;
    background: var(--gray-100);
    border-bottom: 1px solid var(--gray-200);
}

.detail-row {
    display: flex;
    margin-bottom: 0.375rem;
    font-size: 0.8rem;
}

.detail-row:last-child {
    margin-bottom: 0;
}

.detail-label {
    font-weight: 500;
    color: var(--gray-600);
    width: 80px;
    flex-shrink: 0;
}

.detail-value {
    color: var(--gray-800);
    word-break: break-word;
}

.detail-form {
    padding: 1rem;
    flex: 1;
}

.detail-form .form-group {
    margin-bottom: 0.75rem;
}

.detail-form .form-group label {
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
}

.detail-form .form-group input,
.detail-form .form-group select,
.detail-form .form-group textarea {
    padding: 0.5rem;
    font-size: 0.85rem;
}

.detail-form .form-row {
    gap: 0.75rem;
}

.detail-form .input-with-btn {
    gap: 0.375rem;
}

.detail-form .input-with-btn .btn {
    padding: 0.5rem;
    font-size: 0.75rem;
}

/* Table loading state */
#jobsTable td.loading {
    text-align: center;
    padding: 2rem;
    color: var(--gray-600);
}

/* Responsive for table view */
@media (max-width: 1024px) {
    .detail-panel {
        width: 280px;
    }
}

@media (max-width: 768px) {
    body.table-view main.table-layout {
        flex-direction: column;
    }
    
    .table-panel {
        border-right: none;
        border-bottom: 1px solid var(--gray-200);
    }
    
    .detail-panel {
        width: 100%;
        max-height: 50vh;
    }
}

/* ============================================
   CALENDAR VIEW STYLES
   ============================================ */

body.calendar-view {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.calendar-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: none;
    padding: 1rem;
    overflow: hidden;
}

/* Calendar toolbar */
.calendar-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.calendar-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.calendar-nav h2 {
    font-size: 1.25rem;
    min-width: 180px;
    text-align: center;
}

.calendar-actions {
    display: flex;
    gap: 0.5rem;
}

/* Calendar grid */
.calendar-grid {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--gray-100);
    border-bottom: 1px solid var(--gray-200);
}

.calendar-day-header {
    padding: 0.75rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--gray-600);
}

.calendar-day-header.weekend {
    color: var(--gray-400);
}

.calendar-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.calendar-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    flex: 1;
    min-height: 120px;
}

.calendar-cell {
    border-right: 1px solid var(--gray-200);
    border-bottom: 1px solid var(--gray-200);
    padding: 0.25rem;
    display: flex;
    flex-direction: column;
    min-height: 100px;
    cursor: pointer;
    transition: background 0.1s;
}

.calendar-cell:nth-child(7) {
    border-right: none;
}

.calendar-cell:hover {
    background: var(--gray-100);
}

.calendar-cell.today {
    background: #eff6ff;
}

.calendar-cell.today:hover {
    background: #dbeafe;
}

.calendar-cell.other-month {
    background: var(--gray-100);
}

.calendar-cell.other-month .cell-date {
    color: var(--gray-400);
}

.calendar-cell.weekend {
    background: #fafafa;
}

.cell-date {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-700);
    padding: 0.25rem;
}

.calendar-cell.today .cell-date {
    background: var(--primary);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cell-movements {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

/* Movement mini-cards */
.calendar-movement {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 4px;
    background: white;
    border-left: 3px solid var(--gray-400);
    border-radius: 2px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: background 0.1s;
    overflow: hidden;
    white-space: nowrap;
}

.calendar-movement:hover {
    background: var(--gray-100);
}

.calendar-movement.delivery {
    background: #eff6ff;
}

.calendar-movement.delivery:hover {
    background: #dbeafe;
}

.calendar-movement.collection {
    background: #fefce8;
}

.calendar-movement.collection:hover {
    background: #fef9c3;
}

.movement-type {
    font-weight: 600;
    font-size: 0.6rem;
    color: var(--gray-500);
    flex-shrink: 0;
}

.movement-title {
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--gray-700);
}

.calendar-more {
    font-size: 0.65rem;
    color: var(--gray-500);
    padding: 2px 4px;
    font-weight: 500;
}

/* Calendar legend */
.calendar-legend {
    display: flex;
    gap: 1.5rem;
    padding: 0.75rem;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--gray-600);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.legend-dot.delivery {
    background: #dbeafe;
    border-left: 3px solid var(--primary);
}

.legend-dot.collection {
    background: #fef9c3;
    border-left: 3px solid #ca8a04;
}

.legend-dot.unassigned {
    background: var(--gray-200);
    border-left: 3px solid var(--gray-400);
}

/* Responsive calendar */
@media (max-width: 900px) {
    .calendar-nav h2 {
        font-size: 1rem;
        min-width: 140px;
    }

    .calendar-cell {
        min-height: 80px;
    }

    .calendar-movement {
        font-size: 0.65rem;
    }

    .movement-type {
        display: none;
    }
}

@media (max-width: 600px) {
    .calendar-day-header {
        font-size: 0.7rem;
        padding: 0.5rem 0.25rem;
    }

    .calendar-cell {
        min-height: 60px;
        padding: 2px;
    }

    .cell-date {
        font-size: 0.7rem;
    }

.calendar-movement {
    padding: 1px 2px;
    font-size: 0.6rem;
}
}

/* ============================================
   ROUTE MAP MODAL STYLES
   ============================================ */

/* Wide modal variant for route map */
.modal-content-wide {
    max-width: 600px;
}

/* Route map container */
.route-map {
    width: 100%;
    height: 300px;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
    background: var(--gray-100);
    margin-bottom: 1rem;
}

/* Loading state for map */
.route-map.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
}

/* Route info section */
.route-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1rem;
    background: var(--gray-100);
    border-radius: 8px;
    margin-bottom: 1rem;
    gap: 1rem;
}

.route-endpoints {
    flex: 1;
}

.route-endpoints p {
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
}

.route-endpoints p:last-child {
    margin-bottom: 0;
}

.route-distance {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
    padding: 0.5rem 0.75rem;
    background: white;
    border-radius: 6px;
    border: 1px solid var(--gray-200);
}

/* Button with outline style */
.btn-outline {
    background: white;
    border: 1px solid var(--gray-300);
    color: var(--gray-800);
}

.btn-outline:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
}

/* Button icon */
.btn-icon {
    margin-right: 0.375rem;
}

/* External link icon */
.external-link-icon {
    margin-left: 0.375rem;
    font-size: 0.9em;
}

/* Leaflet popup customization */
.leaflet-popup-content {
    font-size: 0.85rem;
    margin: 0.75rem 1rem;
}

.leaflet-popup-content strong {
    display: block;
    margin-bottom: 0.25rem;
}

/* Custom marker styles */
.route-marker-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--primary);
    color: white;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    font-weight: 600;
    font-size: 0.75rem;
}

.route-marker-icon span {
    transform: rotate(45deg);
}

.route-marker-icon.origin {
    background: var(--success);
}

.route-marker-icon.destination {
    background: var(--danger);
}

/* ============================================
   SETTINGS PAGE STYLES
   ============================================ */

.settings-main {
    padding: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.settings-container {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.settings-container h2 {
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.settings-description {
    color: var(--gray-600);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.settings-form {
    margin-bottom: 2rem;
}

.settings-form h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.form-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-600);
    margin-top: 0.25rem;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

.save-result {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 6px;
    text-align: center;
    font-size: 0.9rem;
}

.save-result.success {
    background: #dcfce7;
    color: #166534;
}

.save-result.error {
    background: #fee2e2;
    color: #991b1b;
}

.save-result:empty {
    display: none;
}

/* Settings info table */
.settings-info {
    background: var(--gray-100);
    padding: 1rem;
    border-radius: 8px;
}

.settings-info h4 {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    color: var(--gray-700);
}

.info-table {
    width: 100%;
    font-size: 0.8rem;
    border-collapse: collapse;
}

.info-table th,
.info-table td {
    padding: 0.5rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.info-table th {
    font-weight: 600;
    color: var(--gray-600);
}

.info-table tr:last-child td {
    border-bottom: none;
}

/* Access denied message */
.access-denied {
    text-align: center;
    padding: 3rem 1rem;
}

.access-denied h3 {
    color: var(--danger);
    margin-bottom: 0.5rem;
}

.access-denied p {
    color: var(--gray-600);
    margin-bottom: 1.5rem;
}
