/* ==============================================
   layout.css
   Body styles, containers, page structure, header,
   navigation, sections, validation overlay,
   and responsive layout media queries.
   ============================================== */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
}

/* Minimal Professional Header */
.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
    padding: 16px 24px;
    margin: -20px -20px 20px -20px;
    box-shadow: var(--shadow-sm);
}

.header-content {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Fullscreen mode - expand header to full width */
body.fullscreen-mode .header-content {
    max-width: 100%;
}

body.fullscreen-mode .container {
    max-width: 100%;
}

/* Browser fullscreen mode - preserve CSS variables and styles */
:fullscreen {
    background: var(--bg-primary);
}

:fullscreen .theme-toggle-switch {
    background: var(--border-medium);
    border: 1px solid var(--border-light);
}

:fullscreen .theme-toggle-switch::after {
    background: var(--bg-secondary);
}

:fullscreen.dark-theme .theme-toggle-switch,
.dark-theme:fullscreen .theme-toggle-switch {
    background: var(--status-info);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.header-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

.header-button-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px;
    align-items: center;
}

.fullscreen-btn {
    display: flex;
    min-width: 40px;
    padding: 7px 10px;
}

.small-btn {
    min-width: 60px;
}

.last-updated {
    color: var(--text-secondary);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Page Navigation Tabs */
.page-nav {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
    margin: -20px -20px 20px -20px;
    padding: 0 24px;
    box-shadow: var(--shadow-sm);
}

.page-nav-content {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    gap: 0;
}

.page-tab {
    flex: 1;
    padding: 14px 20px;
    border: none;
    background: transparent;
    border-bottom: 2px solid transparent;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.page-tab:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.page-tab.active {
    color: var(--text-primary);
    border-bottom-color: var(--status-info);
}

.page-content {
    display: none;
}

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

/* Sections */
.section {
    background: var(--bg-secondary);
    border-radius: 6px;
    border: 1px solid var(--border-light);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.section-header {
    margin-bottom: 20px;
}

.section-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-light);
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.01em;
}

.section-count {
    background: var(--bg-hover);
    color: var(--text-primary);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--border-light);
}

/* Search and Filters */
.section-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.search-box {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    font-size: 16px;
}

/* Card Grid */
.card-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
}

/* Breach Grid */
.breach-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
}

/* Performance Stats Grid */
.stats-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    margin-bottom: 30px;
}

/* Manager Performance Grid */
.manager-perf-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

/* Validation Overlay */
#validation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

#validation-container {
    text-align: center;
    padding: 40px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-lg);
    max-width: 400px;
}

#validation-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

#validation-message {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

#validation-detail {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.validation-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-light);
    border-top-color: var(--status-info);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.validation-error {
    background: rgba(220, 53, 69, 0.08);
    border: 1px solid var(--status-danger);
    padding: 12px 16px;
    border-radius: 6px;
    color: var(--status-danger);
    font-size: 13px;
    margin-top: 16px;
}

body.dark-theme .validation-error {
    background: rgba(248, 81, 73, 0.15);
    color: #ff7b72;
}

/* Employee Database Spreadsheet Container Layout */
#employee-database-modal .modal-content {
    max-width: 95vw;
    max-height: 95vh;
    width: 1400px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    padding: 0;
}

.db-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.db-modal-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.db-title-full {
    display: inline;
}

.db-title-mobile {
    display: none;
}

.db-modal-subtitle {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-tertiary);
}

.db-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.db-close-btn {
    flex-shrink: 0;
    margin-left: auto;
}

.db-toolbar {
    padding: 12px 24px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.db-toolbar-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.db-toolbar-separator {
    width: 1px;
    height: 24px;
    background: var(--border-medium);
    margin: 0 4px;
}

.db-spreadsheet-container {
    flex: 1;
    overflow: auto;
    background: var(--bg-primary);
}

.db-status-bar {
    padding: 8px 24px;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-light);
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.db-status-info {
    display: flex;
    gap: 20px;
}

/* Schedule View Containers */
#schedule-view-container {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

#schedule-view-container.active {
    display: flex;
}

#spreadsheet-view-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

#spreadsheet-view-container.hidden {
    display: none;
}

/* Edit mode locked state */
#spreadsheet-view-container.locked .db-table-input,
#spreadsheet-view-container.locked .db-table-select {
    pointer-events: none;
    background: transparent;
    border-color: transparent;
    cursor: default;
}

#spreadsheet-view-container.locked .db-table-input:focus,
#spreadsheet-view-container.locked .db-table-select:focus {
    outline: none;
    border-color: transparent;
    box-shadow: none;
}

#spreadsheet-view-container.locked .db-row-actions {
    visibility: hidden;
}

#spreadsheet-view-container.locked .db-toolbar-group .btn:not(#selectAllBtn):not(#edit-mode-btn):not([onclick*="clearAllEmployees"]) {
    display: none;
}

/* Schedule grid layout */
.schedule-grid-container {
    flex: 1;
    overflow: auto;
    background: var(--bg-primary);
}

.schedule-grid {
    display: grid;
    min-width: max-content;
}

.schedule-header-row {
    display: contents;
}

.schedule-row {
    display: contents;
}

/* Header actions stacked layout for mobile */
.db-header-actions-stacked {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.db-header-actions-stacked .btn {
    padding: 4px 8px !important;
    font-size: 11px !important;
}

/* Desktop: Make import/export buttons match view tabs */
.db-header-actions .btn {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
}

/* ============================================
   RESPONSIVE MEDIA QUERIES - LAYOUT
   ============================================ */

/* Employee Database Responsive Styles */

/* Large Desktop (1600px+) - More spacious layout */
@media (min-width: 1600px) {
    #employee-database-modal .modal-content {
        width: 1600px;
        max-width: 96vw;
    }

    .db-table th,
    .db-cell {
        padding: 14px 20px;
    }

    .db-modal-header {
        padding: 24px 32px;
    }

    .db-toolbar {
        padding: 16px 32px;
    }

    .db-status-bar {
        padding: 10px 32px;
    }
}

/* Desktop (1200px - 1599px) - Standard layout */
@media (min-width: 1200px) and (max-width: 1599px) {
    #employee-database-modal .modal-content {
        width: 1200px;
    }
}

/* Tablet Landscape (768px - 1199px) */
@media (max-width: 1199px) {
    #employee-database-modal .modal-content {
        width: 95vw;
        height: 92vh;
    }

    .db-modal-title {
        font-size: 18px;
    }

    .db-table th {
        font-size: 12px;
        padding: 10px 12px;
    }

    .db-cell {
        font-size: 13px;
        padding: 8px 12px;
    }
}

/* Tablet Portrait & Mobile (max 767px) */
@media (max-width: 767px) {
    #employee-database-modal {
        align-items: center; /* Center vertically */
        justify-content: center; /* Center horizontally */
        padding: 20px;
    }

    #employee-database-modal .modal-content {
        width: calc(100vw - 40px);
        height: calc(100vh - 40px);
        max-width: calc(100vw - 40px);
        max-height: calc(100vh - 40px);
        border-radius: 12px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    }

    .db-modal-header {
        padding: 12px 16px;
        flex-wrap: nowrap;
        gap: 12px;
        align-items: flex-start;
    }

    .db-modal-title {
        font-size: 16px;
        flex: 1;
    }

    .db-modal-subtitle {
        display: none; /* Hide subtitle on mobile */
    }

    .db-header-actions {
        flex-shrink: 0;
        gap: 8px;
    }

    .db-header-actions .btn {
        padding: 6px 10px !important;
        font-size: 12px;
    }

    .db-header-actions .modal-close {
        position: relative;
        right: 0;
        top: 0;
        font-size: 32px;
        padding: 0;
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .db-toolbar {
        padding: 10px 16px;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
    }

    .db-toolbar-group {
        display: flex;
        gap: 6px;
        flex-wrap: nowrap;
    }

    .db-toolbar-group:first-child {
        width: 100%;
        margin-bottom: 4px;
    }

    .db-toolbar-separator {
        display: none;
    }

    .db-search-box {
        width: 100%;
        min-width: 100%;
    }

    .db-status-bar {
        padding: 8px 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .db-status-bar > div:last-child {
        display: none; /* Hide tip on mobile */
    }

    /* Make table horizontally scrollable on mobile */
    .db-spreadsheet-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .db-table {
        min-width: 800px; /* Force horizontal scroll */
    }

    .db-table th,
    .db-cell {
        font-size: 12px;
        padding: 8px 10px;
        white-space: nowrap;
    }

    /* Smaller buttons on mobile */
    .btn {
        padding: 8px 12px;
        font-size: 13px;
        min-width: auto;
    }

    .db-btn-compact {
        padding: 6px 10px !important;
        font-size: 13px !important;
    }

    /* Compact button text on mobile */
    #selectAllBtn {
        font-size: 12px;
    }

    .modal-close {
        font-size: 28px;
        padding: 0 8px;
    }
}

/* Small Mobile (max 480px) */
@media (max-width: 480px) {
    #employee-database-modal {
        padding: 15px;
    }

    #employee-database-modal .modal-content {
        width: calc(100vw - 30px);
        height: calc(100vh - 30px);
        max-width: calc(100vw - 30px);
        max-height: calc(100vh - 30px);
        border-radius: 10px;
    }

    .db-modal-header {
        padding: 10px 12px;
    }

    .db-modal-title {
        font-size: 14px;
    }

    .db-header-actions .btn {
        padding: 5px 8px !important;
        font-size: 11px;
    }

    .db-header-actions .modal-close {
        font-size: 28px !important;
        width: 28px !important;
        height: 28px !important;
    }

    .db-toolbar {
        padding: 8px 12px;
    }

    .db-toolbar-group {
        gap: 5px;
    }

    .db-btn-compact {
        padding: 5px 8px !important;
        font-size: 11px !important;
    }

    .db-status-bar {
        padding: 6px 12px;
        font-size: 10px;
    }

    .db-table th,
    .db-cell {
        font-size: 11px;
        padding: 6px 8px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .db-cell {
        min-height: 44px; /* Larger touch target */
    }

    .db-table th {
        min-height: 44px;
    }

    .db-row-number {
        min-width: 44px;
    }

    /* Disable hover effects on touch devices */
    .db-table th:hover,
    .db-table tbody tr:hover,
    .db-row-number:hover {
        background: inherit;
    }
}

/* Main Responsive */
@media (max-width: 768px) {
    .sales-btn-separator {
        display: none !important;
    }
    body {
        padding: 10px;
    }

    .header {
        padding: 12px 16px;
        margin: -10px -10px 20px -10px;
    }

    /* 2x2 Grid: Title/Right-buttons on top, Time/Left-buttons on bottom */
    .header-content {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
        gap: 8px 12px;
        align-items: center;
    }

    /* Override desktop flex layout for mobile */
    .header-left {
        display: contents; /* Children become direct grid items */
    }

    /* Row 1, Col 1: Title */
    .header-title {
        font-size: 16px;
        font-weight: 600;
        grid-column: 1;
        grid-row: 1;
    }

    /* Row 1, Col 2: Button grid */
    .header-button-grid {
        grid-column: 2;
        grid-row: 1 / 3;
        align-self: center;
    }

    /* Row 2, Col 1: Time + Timezone */
    .last-updated {
        grid-column: 1;
        grid-row: 2;
        font-size: 10px;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 6px;
        line-height: 1.3;
    }

    .timezone-badge {
        font-size: 9px;
        padding: 2px 6px;
        margin: 0;
    }

    /* All buttons in mobile grid - same size */
    .refresh-btn {
        padding: 6px 12px;
        font-size: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 32px;
        white-space: nowrap;
        min-width: 60px;
    }

    /* Theme toggle - match refresh button exactly */
    .theme-toggle {
        padding: 6px 12px;
        background: var(--bg-secondary);
        border: 1px solid var(--border-medium);
        border-radius: 6px;
        gap: 5px;
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 32px;
        white-space: nowrap;
    }

    .theme-toggle:hover {
        background: var(--bg-hover);
        border-color: var(--border-dark);
    }

    .theme-toggle:active {
        background: var(--bg-active);
        transform: scale(0.98);
    }

    .theme-toggle-switch {
        width: 32px;
        height: 18px;
    }

    .theme-toggle-switch::after {
        width: 12px;
        height: 12px;
    }

    body.dark-theme .theme-toggle-switch::after {
        transform: translateX(14px);
    }

    .theme-toggle-icon {
        font-size: 14px;
        line-height: 1;
    }

    /* Dark theme adjustments for mobile */
    body.dark-theme .theme-toggle {
        background: var(--bg-tertiary);
        border-color: var(--border-light);
    }

    body.dark-theme .theme-toggle:hover {
        background: var(--bg-hover);
        border-color: var(--border-dark);
    }

    body.dark-theme .theme-toggle:active {
        background: var(--bg-active);
    }

    /* Hide desktop header-controls wrapper on mobile (grid replaces it) */
    .header-controls {
        display: contents;
    }

    .page-nav {
        padding: 0 16px;
        margin: -10px -10px 20px -10px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .page-nav-content {
        min-width: max-content;
    }

    #current-role-label {
        max-width: 60px !important;
    }

    .header-button-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 6px;
        width: auto;
    }

    .header-button-grid > .fullscreen-btn {
        display: none;
    }

    .page-tab {
        padding: 11px 12px;
        font-size: 13px;
        white-space: nowrap;
    }

    /* Keep stats compact on mobile - all in one row */
    .stats-bar {
        gap: 5px;
        width: 100%;
        justify-content: space-between;
    }

    .stat-mini {
        flex: 1;
        min-width: 0;
        padding: 4px 8px;
        font-size: 12px;
        justify-content: center;
        gap: 4px;
    }

    .stat-value {
        font-size: 15px;
    }

    .section {
        padding: 18px;
    }

    .section-title {
        font-size: 17px;
    }

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

    .search-box {
        width: 100%;
    }

    .filter-tabs {
        width: 100%;
        justify-content: space-between;
    }

    .filter-tab {
        flex: 1;
        padding: 6px 8px;
        font-size: 12px;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .breach-grid {
        grid-template-columns: 1fr;
    }

    .sort-controls {
        width: 100%;
        justify-content: flex-start;
        margin-top: 8px;
        flex-wrap: wrap;
    }

    .sort-label {
        font-size: 11px;
    }

    .sort-buttons {
        flex: 1;
    }

    .sort-btn {
        padding: 6px 10px;
        font-size: 11px;
        flex: 1;
    }

    .section-top {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 8px;
    }

    .date-filter-tabs {
        width: 100%;
        overflow-x: auto;
        gap: 4px;
        padding: 3px;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .date-filter-btn {
        padding: 8px 12px;
        font-size: 12px;
        white-space: nowrap;
        flex-shrink: 0;
        min-width: fit-content;
    }

    .export-pdf-btn {
        width: 100%;
        margin-top: 8px;
        padding: 10px 16px;
        font-size: 14px;
    }

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

    .manager-perf-grid {
        grid-template-columns: 1fr;
    }

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

    .leaderboard-item {
        flex-wrap: wrap;
        padding: 10px 12px;
        gap: 8px;
    }

    .leaderboard-rank {
        font-size: 14px;
        min-width: 24px;
        margin-right: 6px;
    }

    .leaderboard-name {
        font-size: 13px;
        flex: 1;
        margin-right: 8px;
        margin-left: 0;
    }

    .leaderboard-value {
        font-size: 14px;
        font-weight: 600;
    }

    .leaderboard-bar-container {
        width: 100%;
        order: 4;
        margin: 0;
    }

    .heatmap-bars-container {
        height: 150px;
        gap: 1px;
        overflow-x: auto;
        padding-bottom: 5px;
    }

    .heatmap-bar-wrapper {
        min-width: 8px;
        flex: 0 0 auto;
    }

    .heatmap-hour-label {
        font-size: 7px;
        writing-mode: horizontal-tb;
        white-space: nowrap;
    }

    .activity-heatmap-section {
        overflow-x: auto;
    }

    .heatmap-legend {
        flex-wrap: wrap;
        gap: 8px;
        font-size: 10px;
    }

    .bulk-action-toolbar {
        bottom: 24px;
    }
}

/* Extra small screens - even more compact */
@media (max-width: 400px) {
    .stat-mini {
        padding: 3px 6px;
        font-size: 11px;
        gap: 3px;
    }

    .stat-value {
        font-size: 13px;
    }

    .page-tab {
        padding: 10px 12px;
        font-size: 12px;
    }
}

/* Schedule View Mobile Responsive */
@media (max-width: 767px) {
    /* View tabs match stacked buttons height */
    .db-view-tabs {
        margin-left: 10px;
    }

    .db-view-tab {
        padding: 4px 8px;
        font-size: 10px;
        height: auto;
    }

    .db-view-tab .tab-icon {
        display: none;
    }

    /* Show mobile title, hide full title */
    .db-title-full {
        display: none;
    }

    .db-title-mobile {
        display: inline;
    }

    /* Hide desktop CSV buttons, show mobile dropdown */
    .csv-btn-desktop,
    .schedule-csv-btn-desktop {
        display: none !important;
    }

    .csv-dropdown-mobile,
    .schedule-csv-dropdown-mobile {
        display: flex !important;
        align-items: center;
    }

    /* Vertically center CSV dropdown with stacked view tabs */
    #spreadsheet-header-actions,
    #schedule-header-actions {
        align-self: center;
    }

    /* Keep view tabs horizontal and consistent height */
    .db-modal-title {
        flex-wrap: wrap;
    }

    .db-view-tabs {
        display: flex;
        flex-direction: row;
        gap: 0;
        margin-left: 0;
        width: 100%;
    }

    .db-view-tab {
        flex: 1;
        white-space: nowrap;
        padding: 8px 12px;
        font-size: 12px;
        text-align: center;
    }

    .db-view-tab:first-child {
        border-radius: 6px 0 0 6px;
        border-right: none;
    }

    .db-view-tab:last-child {
        border-radius: 0 6px 6px 0;
    }

    /* Center team tabs on mobile */
    .schedule-team-tabs {
        justify-content: center;
        padding: 0 12px;
    }

    .schedule-team-tab {
        padding: 10px 14px;
        font-size: 12px;
    }

    /* Center and stack schedule controls on mobile */
    .schedule-controls {
        flex-direction: column;
        align-items: center;
        padding: 10px 12px;
        gap: 10px;
    }

    .schedule-date-nav {
        width: 100%;
        justify-content: center;
    }

    .schedule-month-label {
        font-size: 14px;
        min-width: 120px;
    }

    .schedule-date-inputs {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .schedule-date-input {
        font-size: 12px;
        padding: 5px 8px;
    }

    .schedule-legend {
        display: flex;
        width: 100%;
        justify-content: center;
        margin-left: 0;
        gap: 10px;
    }

    .legend-item {
        font-size: 10px;
    }

    .legend-color {
        width: 12px;
        height: 12px;
    }

    /* Hide separator on mobile */
    .schedule-controls .db-toolbar-separator {
        display: none;
    }

    /* Smaller grid cells on mobile */
    .schedule-header-cell.name-col,
    .schedule-cell.name-col {
        min-width: 100px;
        padding-left: 8px;
    }

    .schedule-cell {
        min-width: 40px;
    }

    .schedule-shift {
        font-size: 9px;
        padding: 2px 4px;
    }
}
