/**
 * Driver Hours Compliance Admin Panel Styles
 * Professional dark sidebar with light content area
 */

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

html {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

:root {
    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    --sidebar-active: #3b82f6;
    --main-bg: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --progress-bg: #e2e8f0;
    --progress-fill: #3b82f6;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--main-bg);
    color: var(--text-primary);
    line-height: 1.6;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 260px;
    height: 100vh;
    background-color: var(--sidebar-bg);
    color: #ffffff;
    padding: 2rem 0;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    padding: 0 1.5rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1.5rem;
}

.sidebar-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.sidebar-header .subtitle {
    font-size: 0.75rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar-nav {
    padding: 0 1rem;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: #cbd5e1;
    text-decoration: none;
    border-radius: 0.5rem;
    margin-bottom: 0.25rem;
    transition: all 0.2s;
}

.nav-item:hover {
    background-color: var(--sidebar-hover);
    color: #ffffff;
}

.nav-item.active {
    background-color: var(--sidebar-active);
    color: #ffffff;
}

.nav-icon {
    margin-right: 0.75rem;
    font-size: 1.25rem;
}

/* Main Content */
.main-content {
    margin-left: 260px;
    min-height: 100vh;
    padding: 2rem;
    width: calc(100% - 260px);
    max-width: calc(100% - 260px);
    overflow-x: hidden;
}

.content-header {
    margin-bottom: 2rem;
}

.content-header h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.header-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Dashboard */
.dashboard-container {
    background-color: transparent;
    padding: 0;
}

.drivers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.driver-card {
    background-color: var(--card-bg);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.driver-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.driver-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.driver-card-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.driver-card-name.clickable {
    cursor: pointer;
    color: var(--sidebar-active);
    transition: color 0.2s;
    text-decoration: none;
}

.driver-card-name.clickable:hover {
    color: #2563eb;
    text-decoration: underline;
}

.driver-card-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-tile {
    background-color: #f8fafc;
    border-radius: 0.5rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
}

.tile-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.tile-icon {
    font-size: 1.25rem;
}

.tile-header h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tile-content {
    color: var(--text-secondary);
}

.remaining-info {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    text-align: center;
    color: var(--text-secondary);
}

.remaining-info strong {
    color: var(--sidebar-active);
    font-weight: 600;
}

.next-work-time {
    text-align: center;
}

.rest-options {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.rest-option {
    flex: 1;
    min-width: 140px;
    padding: 0.75rem;
    border-radius: 8px;
    background-color: var(--main-bg);
    border: 2px solid var(--border-color);
}

.rest-option.regular-rest {
    border-color: var(--progress-fill);
}

.rest-option.reduced-rest {
    border-color: var(--warning-color);
}

.rest-option.split-rest {
    border-color: #8b5cf6;
}

.rest-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.rest-option.regular-rest .rest-label {
    color: var(--progress-fill);
}

.rest-option.reduced-rest .rest-label {
    color: var(--warning-color);
}

.rest-option.split-rest .rest-label {
    color: #8b5cf6;
}

.split-rest-note {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    font-style: italic;
}

.rest-option.can-start {
    border-color: var(--success-color);
    background-color: #f0fdf4;
}

.rest-option.can-start .rest-label {
    color: var(--success-color);
    font-weight: 700;
}

.rest-option .time-display {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.rest-option .time-display.time-hour {
    font-size: 1.5rem;
    color: var(--text-primary);
}

.next-work-time.can-start-now .time-display.time-hour {
    color: var(--success-color);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.time-display {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.time-display.time-hour {
    font-size: 2rem;
    color: var(--sidebar-active);
    margin-bottom: 0.5rem;
}

.time-info {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.time-status {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    font-style: italic;
}

.next-work-time.can-start-now .time-status {
    color: var(--success-color);
    font-weight: 600;
    font-style: normal;
}

.no-data {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: 0.5rem 0;
}

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

.rest-required {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.rest-time-remaining {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.rest-time-remaining strong {
    color: var(--text-primary);
    font-size: 1rem;
}

.rest-required strong {
    color: var(--sidebar-active);
    font-weight: 700;
}

.rest-message {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.rest-tile.rest-completed {
    background-color: #d1fae5;
    border-color: var(--success-color);
    border-width: 2px;
}

.rest-tile.rest-completed .rest-required strong {
    color: var(--success-color);
}

.rest-tile.rest-completed .rest-message {
    color: #065f46;
    font-weight: 500;
}

.rest-status-icon {
    color: var(--success-color);
    font-size: 1.5rem;
    font-weight: 700;
    margin-left: auto;
}

.rest-completed-badge {
    background-color: var(--success-color);
    color: #ffffff;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.rest-completed-badge strong {
    color: #ffffff;
}

.rest-tile.rest-required {
    background-color: #fee2e2;
    border-color: var(--error-color);
}

.rest-tile.rest-required .rest-required strong {
    color: var(--error-color);
}

.rest-tile.rest-pending {
    background-color: #fef3c7;
    border-color: var(--warning-color);
}

.rest-tile.rest-pending .rest-required strong {
    color: var(--warning-color);
}

.rest-tile.rest-partial {
    background-color: #fef3c7;
    border-color: var(--warning-color);
}

.rest-tile.rest-partial .rest-required strong {
    color: var(--warning-color);
}

.rest-tile.rest-required_reduced {
    background-color: #fee2e2;
    border-color: var(--error-color);
}

.rest-tile.rest-required_reduced .rest-required strong {
    color: var(--error-color);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background-color: var(--card-bg);
    margin: 5% auto;
    padding: 0;
    border-radius: 0.75rem;
    width: 90%;
    max-width: 900px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 2px solid var(--border-color);
    background-color: var(--sidebar-active);
    color: #ffffff;
    border-radius: 0.75rem 0.75rem 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.modal-close {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
    cursor: pointer;
    line-height: 1;
    transition: transform 0.2s;
    user-select: none;
}

.modal-close:hover {
    transform: scale(1.2);
    opacity: 0.8;
}

.modal-body {
    padding: 1.5rem 2rem;
    overflow-y: auto;
    flex: 1;
}

.shifts-list {
    min-height: 200px;
}

.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
    font-style: italic;
}

.no-shifts {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
    font-style: italic;
}

.error-message {
    text-align: center;
    padding: 3rem;
    color: var(--error-color);
}

.shifts-table-container {
    overflow-x: auto;
}

.shifts-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.shifts-table thead {
    background-color: #f1f5f9;
    border-bottom: 2px solid var(--border-color);
}

.shifts-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.shifts-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.shifts-table tbody tr:hover {
    background-color: #f8fafc;
}

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

.shifts-table td strong {
    color: var(--sidebar-active);
    font-weight: 600;
}

.table-container {
    overflow-x: auto;
    margin-bottom: 2rem;
}

/* Recent shifts section */
.recent-shifts-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.compliance-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.compliance-table thead {
    background-color: #f1f5f9;
    border-bottom: 2px solid var(--border-color);
}

.compliance-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.compliance-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.compliance-table tbody tr:hover {
    background-color: #f8fafc;
}

.driver-name {
    font-weight: 600;
    color: var(--text-primary);
}

.hours-cell {
    font-family: 'Courier New', monospace;
    color: var(--text-secondary);
}

.remaining-cell {
    font-size: 1.1rem;
}

.weekly-progress-cell {
    min-width: 200px;
}

.weekly-progress-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.weekly-progress-text {
    font-size: 0.9rem;
    color: var(--text-primary);
    text-align: center;
}

.weekly-progress-text strong {
    font-weight: 700;
    color: var(--sidebar-active);
}

.weekly-progress-bar {
    width: 100%;
    height: 20px;
    margin-top: 0.25rem;
}

.weekly-progress-bar .progress-bar {
    height: 100%;
}

.weekly-progress-bar .progress-text {
    font-size: 0.65rem;
}

.status-badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-compliant {
    background-color: #d1fae5;
    color: #065f46;
}

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

/* Progress Bar */
.progress-bar-container {
    width: 100%;
    height: 24px;
    background-color: var(--progress-bg);
    border-radius: 0.375rem;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--progress-fill) 0%, #60a5fa 100%);
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Progress bar colors for weekly progress */
.weekly-progress-bar .progress-bar.progress-warning {
    background: linear-gradient(90deg, var(--warning-color) 0%, #fbbf24 100%);
}

.weekly-progress-bar .progress-bar.progress-danger {
    background: linear-gradient(90deg, var(--error-color) 0%, #dc2626 100%);
}

.progress-text {
    font-size: 0.7rem;
    font-weight: 600;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Info Panel */
.info-panel {
    background-color: #f1f5f9;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-top: 2rem;
}

.info-panel h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.rules-list {
    list-style: none;
    padding: 0;
}

.rules-list li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color);
}

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

.rules-list strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Form Styles */
.form-container {
    background-color: var(--card-bg);
    border-radius: 0.75rem;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    max-width: 800px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

input[type="text"],
input[type="datetime-local"],
select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: #ffffff;
}

/* Flatpickr Styles */
.flatpickr-input {
    cursor: pointer;
}

.flatpickr-calendar {
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    font-family: inherit;
}

.flatpickr-months {
    background-color: var(--sidebar-active);
    border-radius: 0.5rem 0.5rem 0 0;
    padding: 0.75rem;
}

.flatpickr-month {
    color: #ffffff;
}

.flatpickr-current-month {
    color: #ffffff;
    font-weight: 600;
}

.flatpickr-prev-month,
.flatpickr-next-month {
    color: #ffffff;
    fill: #ffffff;
}

.flatpickr-prev-month:hover,
.flatpickr-next-month:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 0.25rem;
}

.flatpickr-weekdays {
    background-color: #f1f5f9;
    padding: 0.5rem 0;
}

.flatpickr-weekday {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.85rem;
}

.flatpickr-day {
    border-radius: 0.25rem;
    color: var(--text-primary);
    transition: all 0.2s;
}

.flatpickr-day:hover {
    background-color: #e2e8f0;
    border-color: #e2e8f0;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
    background-color: var(--sidebar-active);
    border-color: var(--sidebar-active);
    color: #ffffff;
}

.flatpickr-day.selected:hover,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange:hover {
    background-color: #2563eb;
    border-color: #2563eb;
}

.flatpickr-day.today {
    border-color: var(--sidebar-active);
    font-weight: 600;
}

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

.flatpickr-time input {
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    padding: 0.5rem;
    font-size: 0.9rem;
}

.flatpickr-time input:hover {
    background-color: #f8fafc;
}

.flatpickr-time input:focus {
    outline: none;
    border-color: var(--sidebar-active);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.flatpickr-am-pm {
    background-color: var(--sidebar-active);
    color: #ffffff;
    border-radius: 0.25rem;
    padding: 0.5rem;
    font-weight: 600;
}

.flatpickr-am-pm:hover {
    background-color: #2563eb;
}

/* Flatpickr Time Only Styles */
.flatpickr-calendar.timeOnly {
    width: 200px;
}

.flatpickr-calendar.timeOnly .flatpickr-time {
    border-top: none;
    padding: 1rem;
}

.flatpickr-calendar.timeOnly .flatpickr-time input {
    font-size: 1.1rem;
    font-weight: 600;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
}

.flatpickr-calendar.timeOnly .flatpickr-time input:hover {
    background-color: #f8fafc;
    border-color: var(--sidebar-active);
}

.flatpickr-calendar.timeOnly .flatpickr-time input:focus {
    border-color: var(--sidebar-active);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Date Tiles Styles */
.date-tiles-container {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    justify-content: space-between;
}

.date-tile {
    flex: 1;
    min-width: 0;
    padding: 0.875rem 0.5rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    background-color: #ffffff;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80px;
}

.date-tile:hover {
    border-color: var(--sidebar-active);
    background-color: #eff6ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.date-tile.selected {
    border-color: var(--sidebar-active);
    background-color: var(--sidebar-active);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.date-tile.today {
    border-color: var(--warning-color);
    background-color: #fef3c7;
}

.date-tile.today.selected {
    background-color: var(--sidebar-active);
    border-color: var(--sidebar-active);
    color: #ffffff;
}

.date-tile .date-number {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    line-height: 1.2;
    color: var(--text-primary);
}

.date-tile .date-month {
    font-size: 0.7rem;
    text-transform: lowercase;
    opacity: 0.8;
    margin-bottom: 0.2rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.date-tile .date-day {
    font-size: 0.65rem;
    text-transform: lowercase;
    opacity: 0.7;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Driver Tiles Styles */
.driver-tiles-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.driver-tile {
    padding: 1rem 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    background-color: #ffffff;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 90px;
}

.driver-tile:hover {
    border-color: var(--sidebar-active);
    background-color: #eff6ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.driver-tile.selected {
    border-color: var(--sidebar-active);
    background-color: var(--sidebar-active);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    transform: translateY(-2px);
}

.driver-tile-icon {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

.driver-tile.selected .driver-tile-icon {
    opacity: 1;
}

.driver-tile-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    word-break: break-word;
}

.driver-tile.selected .driver-tile-name {
    color: #ffffff;
}

.date-tile.selected .date-number,
.date-tile.selected .date-month,
.date-tile.selected .date-day {
    color: #ffffff;
    opacity: 1;
}

.time-picker-container {
    margin-top: 1rem;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.time-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background-color: #f8fafc;
    padding: 1.5rem;
    border-radius: 0.75rem;
    border: 2px solid var(--sidebar-active);
}

.time-input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.time-input-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

.time-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.time-input {
    width: 70px;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    background-color: #ffffff;
    color: var(--text-primary);
    transition: all 0.2s;
    -moz-appearance: textfield;
}

.time-input::-webkit-outer-spin-button,
.time-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.time-input:focus {
    outline: none;
    border-color: var(--sidebar-active);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.time-btn {
    width: 44px;
    height: 44px;
    border: 2px solid var(--sidebar-active);
    border-radius: 0.5rem;
    background-color: var(--sidebar-active);
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    user-select: none;
}

.time-btn:hover {
    background-color: #2563eb;
    border-color: #2563eb;
    transform: scale(1.05);
}

.time-btn:active {
    transform: scale(0.95);
}

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

.time-separator {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 1.5rem;
}

.time-picker-container input:focus {
    outline: none;
    border-color: var(--sidebar-active);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

input[type="text"]:focus,
input[type="datetime-local"]:focus,
select:focus {
    outline: none;
    border-color: var(--sidebar-active);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

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

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--sidebar-active);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
    background-color: #e2e8f0;
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: #cbd5e1;
}

/* Messages */
.message {
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.message.success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.message.error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

.validation-message {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    display: none;
}

.validation-message.show {
    display: block;
}

.validation-message.error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

.validation-message.success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.validation-message.warning {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid var(--warning-color);
}

.message.warning {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid var(--warning-color);
}

.remaining-budget {
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 0.5rem;
    padding: 1rem;
}

.remaining-budget h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.budget-section {
    margin-bottom: 1.5rem;
    padding: 0.75rem;
    background-color: #ffffff;
    border-radius: 0.5rem;
    border: 1px solid #e0e7ff;
}

.budget-section:last-child {
    margin-bottom: 0;
}

.budget-section-header {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.budget-info {
    margin-bottom: 0.5rem;
}

.budget-info p {
    margin: 0.25rem 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.budget-info strong {
    color: var(--text-primary);
}

.future-status {
    border-color: var(--warning-color);
    background-color: #fffbeb;
}

.current-status {
    border-color: #bfdbfe;
}
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    display: none;
}

.remaining-budget.show {
    display: block;
}

.remaining-budget h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.remaining-budget p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0.25rem 0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.empty-state p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    /* Sidebar przekształcony w dolne menu */
    .sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        width: 100%;
        height: auto;
        padding: 0;
        padding-bottom: env(safe-area-inset-bottom);
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        z-index: 1000;
    }
    
    .sidebar-header {
        display: none;
    }
    
    .sidebar-nav {
        display: flex;
        flex-direction: row;
        justify-content: space-around;
        padding: 0.5rem;
        background-color: var(--sidebar-bg);
    }
    
    .nav-item {
        flex-direction: column;
        align-items: center;
        padding: 0.5rem 0.75rem;
        margin-bottom: 0;
        flex: 1;
        min-width: 0;
        border-radius: 0.5rem;
    }
    
    .nav-item .nav-icon {
        margin-right: 0;
        margin-bottom: 0.25rem;
        font-size: 1.5rem;
    }
    
    .nav-item span:not(.nav-icon) {
        font-size: 0.7rem;
        text-align: center;
    }
    
    /* Main content bez marginesu bocznego */
    .main-content {
        margin-left: 0;
        margin-bottom: 70px; /* Miejsce na dolne menu */
        padding: 1rem;
        padding-bottom: calc(2rem + env(safe-area-inset-bottom));
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    /* Zapewnienie, że wszystkie kontenery mieszczą się w szerokości ekranu */
    .container {
        width: 100%;
        max-width: 100%;
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .driver-cards-grid {
        width: 100%;
        max-width: 100%;
    }
    
    .driver-card {
        width: 100%;
        max-width: 100%;
    }
    
    .form-container {
        width: 100%;
        max-width: 100%;
    }
    
    /* Zapobieganie przewijaniu poziomemu */
    .info-tile,
    .tile-content,
    .rest-info,
    .time-display,
    .rest-options,
    .rest-option {
        max-width: 100%;
        overflow-x: hidden;
        word-wrap: break-word;
    }
    
    /* Recent shifts section */
    .recent-shifts-section {
        margin-top: 2rem;
        padding-top: 1.5rem;
    }
    
    .section-title {
        font-size: 1.25rem;
    }
    
    .shifts-table {
        font-size: 0.85rem;
    }
    
    .shifts-table th,
    .shifts-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .content-header {
        padding: 1rem 0;
    }
    
    .content-header h2 {
        font-size: 1.5rem;
    }
    
    .header-subtitle {
        font-size: 0.85rem;
    }
    
    /* Karty kierowców - jedna kolumna */
    .driver-cards-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .driver-card {
        padding: 1rem;
    }
    
    .driver-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .driver-card-name {
        font-size: 1.1rem;
    }
    
    .info-tile {
        padding: 0.75rem;
    }
    
    .tile-header h4 {
        font-size: 0.9rem;
    }
    
    .time-display {
        font-size: 1.2rem;
    }
    
    .time-display.time-hour {
        font-size: 1.4rem;
    }
    
    /* Formularze */
    .form-container {
        padding: 1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    /* Kafelki kierowców */
    .driver-tiles-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .driver-tile {
        padding: 0.75rem;
    }
    
    /* Kafelki dat */
    .date-tiles-container {
        gap: 0.375rem;
    }
    
    .date-tile {
        padding: 0.75rem 0.375rem;
        min-height: 70px;
    }
    
    .date-tile .date-number {
        font-size: 1.25rem;
    }
    
    .date-tile .date-month {
        font-size: 0.65rem;
    }
    
    .date-tile .date-day {
        font-size: 0.6rem;
    }
    
    .driver-tiles-container {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.5rem;
    }
    
    .driver-tile {
        padding: 0.875rem 0.5rem;
        min-height: 80px;
    }
    
    .driver-tile-icon {
        font-size: 1.5rem;
    }
    
    .driver-tile-name {
        font-size: 0.85rem;
    }
    
    /* Time picker */
    .time-picker-container {
        margin-top: 0.75rem;
    }
    
    .time-selector {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .time-input-group {
        width: 100%;
    }
    
    .time-controls {
        width: 100%;
        max-width: 200px;
        margin: 0 auto;
    }
    
    .time-input {
        font-size: 1.2rem;
        padding: 0.75rem;
    }
    
    .time-separator {
        display: none;
    }
    
    /* Rest options */
    .rest-options {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .rest-option {
        min-width: 100%;
    }
    
    /* Modal */
    .modal {
        z-index: 2000; /* Wyżej niż dolne menu (1000) */
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
        max-height: 85vh;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-header h2 {
        font-size: 1.2rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    /* Tabele */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .shifts-table {
        font-size: 0.8rem;
        min-width: 600px;
    }
    
    .shifts-table th,
    .shifts-table td {
        padding: 0.5rem 0.25rem;
    }
    
    /* Przyciski */
    .btn {
        width: 100%;
        padding: 0.75rem;
        font-size: 1rem;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    /* Progress bars */
    .progress-bar-container {
        margin: 0.5rem 0;
    }
    
    /* Validation messages */
    .validation-message {
        font-size: 0.85rem;
        padding: 0.75rem;
    }
    
    .remaining-budget {
        font-size: 0.85rem;
        padding: 0.75rem;
    }
    
    /* Compliance summary */
    .compliance-summary {
        padding: 1rem;
        font-size: 0.85rem;
    }
    
    .compliance-summary h3 {
        font-size: 1.1rem;
    }
    
    /* Status badges */
    .status-badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
    
    /* Weekly progress */
    .weekly-progress-text {
        font-size: 0.9rem;
    }
    
    .remaining-text {
        font-size: 0.85rem;
    }
    
    /* Dodatkowe poprawki dla bardzo małych ekranów */
    @media (max-width: 480px) {
        .main-content {
            padding: 0.75rem;
            width: 100%;
            max-width: 100%;
        }
        
        .driver-card {
            padding: 0.75rem;
            width: 100%;
            max-width: 100%;
        }
        
        .form-container {
            padding: 0.75rem;
            width: 100%;
            max-width: 100%;
        }
        
        /* Zapobieganie przewijaniu poziomemu dla wszystkich elementów */
        * {
            max-width: 100%;
        }
        
        img, video, iframe, table {
            max-width: 100%;
            height: auto;
        }
        
        table {
            display: block;
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
        }
        
        .date-tile {
            min-height: 60px;
            padding: 0.5rem 0.25rem;
        }
        
        .date-tile .date-number {
            font-size: 1.1rem;
        }
        
        .nav-item {
            padding: 0.4rem 0.5rem;
        }
        
        .nav-item .nav-icon {
            font-size: 1.3rem;
        }
        
        .nav-item span:not(.nav-icon) {
            font-size: 0.65rem;
        }
        
        .content-header h2 {
            font-size: 1.3rem;
        }
        
        .driver-card-name {
            font-size: 1rem;
        }
        
        .time-display {
            font-size: 1.1rem;
        }
        
        .time-display.time-hour {
            font-size: 1.3rem;
        }
    }
}

