/* ============================================
   STAFF SCHEDULER - MODERN UI
   Polished SaaS Design + Print-optimized Roster
   ============================================ */

/* CSS Variables */
:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #eef2ff;
    --secondary: #6b7280;
    --secondary-hover: #4b5563;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --background: #f8fafc;
    --surface: #ffffff;
    --border: #e5e7eb;
    --border-light: #f1f5f9;
    --text: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;

    /* Shift Colors - Distinct per type */
    --shift-d: #f59e0b;
    --shift-e: #8b5cf6;
    --shift-n: #1e40af;
    --shift-s: #059669;
    --shift-f: #d97706;
    --shift-b: #10b981;
    --shift-a: #3b82f6;
    --shift-leave: #ef4444;
    --shift-tad: #a855f7;
    --shift-off: transparent;

    --sidebar-width: 380px;
    --radius: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 12px 24px -4px rgba(0, 0, 0, 0.07), 0 4px 8px -4px rgba(0, 0, 0, 0.04);
    --transition: 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Top Accent Bar */
body::before {
    content: '';
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #4f46e5, #7c3aed, #6366f1);
    z-index: 9999;
}

/* Layout */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-header {
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    padding: 1.125rem 1.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 3px;
    z-index: 100;
}

.header-content h1 {
    font-size: 1.625rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 0.813rem;
    color: var(--text-muted);
    letter-spacing: 0.01em;
}

.header-actions {
    display: flex;
    gap: 0.625rem;
}

.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Config Panel */
.config-panel {
    width: var(--sidebar-width);
    background: var(--surface);
    border-right: none;
    box-shadow: 1px 0 6px rgba(0, 0, 0, 0.03);
    overflow-y: auto;
    flex-shrink: 0;
    transition: width 0.3s ease;
}

.config-panel.collapsed {
    width: 50px;
    overflow: hidden;
}

.config-panel.collapsed .config-section,
.config-panel.collapsed .config-actions,
.config-panel.collapsed .panel-header h2 {
    display: none;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.125rem 1.25rem;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 10;
}

.panel-header h2 {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.375rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    border-radius: 999px;
    transition: all var(--transition);
}

.btn-icon:hover {
    background: var(--background);
    color: var(--text);
}

.config-section {
    padding: 1.25rem;
    border-bottom: 1px solid #f0f0f4;
}

.config-section h3 {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 0.875rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.config-actions {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Form Elements */
.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--text);
    background: var(--surface);
    transition: all var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1), inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

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

.form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

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

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

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.radio-label,
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    cursor: pointer;
}

.radio-label input,
.checkbox-label input {
    accent-color: var(--primary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1.125rem;
    border: none;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
}

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

.btn:active:not(:disabled) {
    transform: scale(0.97);
}

.btn-primary {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: white;
    box-shadow: 0 1px 3px rgba(79, 70, 229, 0.3), 0 1px 2px rgba(79, 70, 229, 0.15);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #4338ca, #4f46e5);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35), 0 2px 4px rgba(79, 70, 229, 0.2);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--surface);
    color: var(--primary);
    border: 1.5px solid var(--primary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--primary-light);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.12);
    transform: translateY(-1px);
}

.btn-outline {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.btn-outline:hover:not(:disabled) {
    background: var(--background);
    border-color: #cbd5e1;
    color: var(--text);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 0.375rem 0.875rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 0.75rem 1.75rem;
    font-size: 1rem;
    border-radius: 999px;
}

.btn-danger {
    background: var(--danger);
    color: white;
    box-shadow: 0 1px 3px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    transform: translateY(-1px);
}

/* Section Divider */
.section-divider {
    border: none;
    border-top: 1px dashed #e2e8f0;
    margin: 0.75rem 0;
}

/* Rotation Pattern Info */
.pattern-info {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: var(--radius);
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.75rem;
}

.pattern-info.warning {
    background: #fffbeb;
    border-color: #fde68a;
}

.pattern-info .pattern-title {
    font-weight: 600;
    color: #166534;
    margin-bottom: 0.25rem;
}

.pattern-info.warning .pattern-title {
    color: #92400e;
}

.pattern-info .pattern-desc {
    color: #15803d;
    line-height: 1.4;
}

.pattern-info.warning .pattern-desc {
    color: #a16207;
}

.pattern-visual {
    display: flex;
    gap: 2px;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.pattern-day {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 600;
}

.pattern-day.on {
    background: var(--success);
    color: white;
}

.pattern-day.off {
    background: #e5e7eb;
    color: #6b7280;
}

/* Shifts List */
.shifts-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.shift-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--background);
    border-radius: var(--radius);
    font-size: 0.813rem;
    transition: background var(--transition);
}

.shift-item:hover {
    background: #e2e8f0;
}

.shift-item .shift-code {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    font-size: 0.75rem;
}

.shift-item .shift-info {
    flex: 1;
}

.shift-item .shift-times {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.shift-item .shift-actions {
    display: flex;
    gap: 0.25rem;
}

.shift-item button {
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
}

/* Staff Presets */
.staff-presets {
    background: var(--primary-light);
    border: 1px solid #c7d2fe;
    border-radius: var(--radius);
    padding: 0.75rem;
    margin-bottom: 1rem;
}

.preset-row {
    display: flex;
    gap: 0.375rem;
}

.preset-row select {
    flex: 1;
}

.preset-save-row {
    display: flex;
    gap: 0.375rem;
}

.preset-save-row input {
    flex: 1;
}

/* Groups List */
.groups-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.group-item {
    background: var(--background);
    border-radius: 12px;
    padding: 0.75rem;
    border: 1px solid #eaecf0;
}

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

.group-header input {
    flex: 1;
    font-weight: 600;
    text-transform: uppercase;
}

.employees-list {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    margin-bottom: 0.5rem;
}

.employee-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.5rem;
    background: var(--surface);
    border-radius: 8px;
    font-size: 0.813rem;
    border: 1px solid transparent;
    transition: border-color var(--transition);
}

.employee-item:hover {
    border-color: var(--border);
}

.employee-item input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.813rem;
    font-family: inherit;
}

.employee-item input:focus {
    outline: none;
}

.employee-item .unavail-indicator {
    font-size: 0.7rem;
    color: var(--danger);
    cursor: pointer;
}

/* Coverage Grid */
.coverage-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.coverage-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.coverage-row .shift-badge {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
}

.coverage-row label {
    flex: 1;
    font-size: 0.75rem;
}

.coverage-row input {
    width: 50px;
    text-align: center;
}

/* Schedule Container */
.schedule-container {
    flex: 1;
    overflow: auto;
    padding: 1.5rem;
    background: var(--background);
}

.schedule-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.action-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.print-hint {
    cursor: help;
    font-size: 1rem;
    opacity: 0.7;
    transition: opacity var(--transition);
}

.print-hint:hover {
    opacity: 1;
}

/* Warnings Panel */
.warnings-panel {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--radius-lg);
    padding: 1rem;
    margin-bottom: 1rem;
}

.warnings-panel h4 {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    color: #92400e;
}

.warnings-panel ul {
    list-style: none;
    font-size: 0.813rem;
    color: #92400e;
}

.warnings-panel li {
    padding: 0.25rem 0;
}

.warnings-panel li::before {
    content: "\2022  ";
}

.hidden {
    display: none !important;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 5rem 2rem;
    color: var(--text-muted);
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 2px dashed #dde1e7;
}

.empty-icon {
    font-size: 5rem;
    margin-bottom: 1.25rem;
    opacity: 0.5;
    filter: grayscale(0.2);
}

.empty-state h3 {
    font-size: 1.375rem;
    color: var(--text);
    margin-bottom: 0.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.empty-state .hint {
    font-size: 0.875rem;
    margin-top: 1rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Schedule Output - Roster Grid */
.schedule-output {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.roster-wrapper {
    overflow-x: auto;
}

.roster-header {
    padding: 1.75rem 2rem;
    text-align: center;
    border-bottom: 2px solid var(--text);
    background: #fafbfc;
}

.roster-title {
    font-size: 1.625rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.025em;
}

.roster-period {
    font-size: 1rem;
    color: var(--text-muted);
    margin-top: 0.375rem;
    font-weight: 500;
    letter-spacing: -0.01em;
}

/* Roster Table */
.roster-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
    table-layout: fixed;
}

.roster-table th,
.roster-table td {
    border: 1px solid #cbd5e1;
    padding: 2px 4px;
    text-align: center;
    vertical-align: middle;
}

.roster-table th {
    background: #f1f5f9;
    font-weight: 600;
}

/* Day Numbers Row */
.roster-table .day-numbers th {
    background: #1e293b;
    color: white;
    font-size: 0.813rem;
    padding: 5px 4px;
}

.roster-table .day-numbers th.weekend {
    background: #dc2626;
}

/* Day Names Row */
.roster-table .day-names th {
    background: #334155;
    color: #e2e8f0;
    font-size: 0.7rem;
    padding: 3px;
    font-weight: 500;
}

.roster-table .day-names th.weekend {
    background: #b91c1c;
    color: white;
}

/* Staff Column */
.roster-table .staff-col {
    width: 100px;
    min-width: 100px;
    text-align: left;
    padding-left: 8px;
    font-weight: 500;
}

/* Totals Columns */
.roster-table .totals-col {
    width: 28px;
    min-width: 28px;
    background: #f8fafc;
}

.roster-table .totals-header {
    background: #0ea5e9;
    color: white;
    font-size: 0.7rem;
}

.roster-table .total-main {
    background: #fef3c7;
    font-weight: 600;
}

/* Group Header Row */
.roster-table .group-row td {
    background: linear-gradient(90deg, #334155, #475569);
    color: white;
    font-weight: 700;
    text-align: left;
    padding: 5px 10px;
    font-size: 0.813rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Employee Row */
.roster-table .employee-row td {
    height: 28px;
}

.roster-table .employee-row .staff-col {
    background: #f8fafc;
}

/* Shift Cells */
.roster-table .shift-cell {
    cursor: pointer;
    transition: opacity var(--transition);
    font-weight: 600;
    text-transform: lowercase;
    min-width: 24px;
    border-radius: 0;
}

.roster-table .shift-cell:hover {
    opacity: 0.75;
}

/* Distinct shift colors */
.roster-table .shift-cell.shift-d {
    background: var(--shift-d);
    color: #000;
}

.roster-table .shift-cell.shift-e {
    background: var(--shift-e);
    color: white;
}

.roster-table .shift-cell.shift-n {
    background: var(--shift-n);
    color: white;
}

.roster-table .shift-cell.shift-s {
    background: var(--shift-s);
    color: white;
}

.roster-table .shift-cell.shift-f {
    background: var(--shift-f);
    color: #000;
}

.roster-table .shift-cell.shift-b {
    background: var(--shift-b);
    color: white;
}

.roster-table .shift-cell.shift-a {
    background: var(--shift-a);
    color: white;
}

.roster-table .shift-cell.shift-leave {
    background: var(--shift-leave);
    color: white;
    font-size: 0.6rem;
    font-weight: 500;
}

.roster-table .shift-cell.shift-tad {
    background: var(--shift-tad);
    color: white;
    font-size: 0.6rem;
    font-weight: 500;
}

/* Additional shift codes (retail/manufacturing) */
.roster-table .shift-cell.shift-m {
    background: #f59e0b;
    color: #000;
}

.roster-table .shift-cell.shift-c {
    background: #7c3aed;
    color: white;
}

.roster-table .shift-cell.shift-r {
    background: #10b981;
    color: white;
}

/* Coverage Footer */
.roster-table .coverage-section td {
    background: #f1f5f9;
}

.roster-table .coverage-row-header {
    background: #e2e8f0 !important;
    text-align: left;
    padding-left: 8px;
}

.roster-table .coverage-label {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.roster-table .coverage-required {
    font-size: 0.7rem;
}

.roster-table .coverage-met {
    background: #dcfce7;
}

.roster-table .coverage-under {
    background: #fecaca;
    color: #991b1b;
    font-weight: 600;
}

.roster-table .coverage-over {
    background: #fef3c7;
    color: #92400e;
}

/* Legend */
.roster-legend {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.75rem;
    background: #f8fafc;
}

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

.legend-badge {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.7rem;
    color: white;
}

/* Distinct legend colors */
.legend-badge.shift-d {
    background: var(--shift-d);
    color: #000;
}

.legend-badge.shift-e {
    background: var(--shift-e);
}

.legend-badge.shift-n {
    background: var(--shift-n);
}

.legend-badge.shift-s {
    background: var(--shift-s);
}

.legend-badge.shift-f {
    background: var(--shift-f);
    color: #000;
}

.legend-badge.shift-b {
    background: var(--shift-b);
}

.legend-badge.shift-a {
    background: var(--shift-a);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fade-in 150ms ease;
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modal-enter {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-content {
    background: var(--surface);
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    animation: modal-enter 200ms ease;
}

.modal-sm {
    max-width: 320px;
}

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

.modal-header h3 {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
    padding: 0.25rem;
    border-radius: 999px;
    transition: all var(--transition);
}

.modal-close:hover {
    background: var(--background);
    color: var(--text);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
}

/* Shift Buttons in Cell Modal */
.shift-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.shift-btn {
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
}

.shift-btn:hover {
    border-color: var(--primary);
    transform: scale(1.03);
}

.shift-btn .code {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.shift-btn .label {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.shift-btn.active {
    border-color: var(--primary);
    background: var(--primary-light);
}

/* Unavailability Section */
.section-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.unavailability-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    max-height: 300px;
    overflow-y: auto;
}

.unavail-entry {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    padding: 0.625rem;
    background: var(--background);
    border-radius: var(--radius);
    border-left: 3px solid var(--danger);
}

.unavail-entry.tad {
    border-left-color: #a855f7;
}

.unavail-entry-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.unavail-entry-header select {
    flex: 1;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.unavail-entry-header .employee-select {
    flex: 2;
}

.unavail-entry-dates {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.unavail-entry-dates input {
    flex: 1;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.unavail-entry-dates span {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.unavail-empty {
    text-align: center;
    padding: 1rem;
    color: var(--text-muted);
    font-size: 0.813rem;
    background: var(--background);
    border-radius: var(--radius);
}

/* Unavailability List (in modal) */
.unavailability-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.unavail-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--background);
    border-radius: var(--radius);
}

.unavail-item select,
.unavail-item input {
    flex: 1;
    font-size: 0.75rem;
}

/* Period Config */
.period-config {
    margin-top: 0.75rem;
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    /* Force background colors to print */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    body {
        background: white;
        font-size: 10pt;
    }

    body::before {
        display: none !important;
    }

    .app-header,
    .config-panel,
    .schedule-actions,
    .warnings-panel,
    .modal {
        display: none !important;
    }

    .schedule-container {
        padding: 0;
        overflow: visible;
    }

    .schedule-output {
        box-shadow: none;
        border-radius: 0;
    }

    .roster-wrapper {
        overflow: visible;
    }

    .roster-header {
        padding: 0.5cm;
        background: white !important;
    }

    .roster-title {
        font-size: 18pt;
        color: #1e293b !important;
    }

    .roster-period {
        font-size: 14pt;
    }

    .roster-table {
        font-size: 8pt;
    }

    .roster-table th,
    .roster-table td {
        padding: 2px 3px;
    }

    /* Header rows */
    .roster-table .day-numbers th {
        background: #1e293b !important;
        color: white !important;
    }

    .roster-table .day-numbers th.weekend {
        background: #dc2626 !important;
    }

    .roster-table .day-names th {
        background: #334155 !important;
        color: #e2e8f0 !important;
    }

    .roster-table .day-names th.weekend {
        background: #b91c1c !important;
        color: white !important;
    }

    /* Shift cells - distinct colors */
    .roster-table .shift-cell {
        font-size: 8pt;
    }

    .roster-table .shift-cell.shift-d {
        background: #f59e0b !important;
        color: #000 !important;
    }

    .roster-table .shift-cell.shift-e {
        background: #8b5cf6 !important;
        color: white !important;
    }

    .roster-table .shift-cell.shift-n {
        background: #1e40af !important;
        color: white !important;
    }

    .roster-table .shift-cell.shift-s {
        background: #059669 !important;
        color: white !important;
    }

    .roster-table .shift-cell.shift-f {
        background: #d97706 !important;
        color: #000 !important;
    }

    .roster-table .shift-cell.shift-b {
        background: #10b981 !important;
        color: white !important;
    }

    .roster-table .shift-cell.shift-a {
        background: #3b82f6 !important;
        color: white !important;
    }

    .roster-table .shift-cell.shift-leave {
        background: #ef4444 !important;
        color: white !important;
        font-size: 6pt;
    }

    .roster-table .shift-cell.shift-tad {
        background: #a855f7 !important;
        color: white !important;
        font-size: 6pt;
    }

    /* Group header rows */
    .roster-table .group-row td {
        background: #475569 !important;
        color: white !important;
    }

    /* Totals columns */
    .roster-table .totals-header {
        background: #0ea5e9 !important;
        color: white !important;
    }

    .roster-table .total-main {
        background: #fef3c7 !important;
    }

    /* Coverage footer */
    .roster-table .coverage-met {
        background: #dcfce7 !important;
    }

    .roster-table .coverage-under {
        background: #fecaca !important;
        color: #991b1b !important;
    }

    .roster-table .coverage-over {
        background: #fef3c7 !important;
        color: #92400e !important;
    }

    /* Legend badges - distinct colors */
    .legend-badge {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .legend-badge.shift-d {
        background: #f59e0b !important;
        color: #000 !important;
    }

    .legend-badge.shift-e {
        background: #8b5cf6 !important;
        color: white !important;
    }

    .legend-badge.shift-n {
        background: #1e40af !important;
        color: white !important;
    }

    .legend-badge.shift-s {
        background: #059669 !important;
        color: white !important;
    }

    .legend-badge.shift-f {
        background: #d97706 !important;
        color: #000 !important;
    }

    .legend-badge.shift-b {
        background: #10b981 !important;
        color: white !important;
    }

    .legend-badge.shift-a {
        background: #3b82f6 !important;
        color: white !important;
    }

    .roster-legend {
        font-size: 8pt;
        padding: 0.25cm 0.5cm;
        background: #f8fafc !important;
    }

    /* Compact Mode */
    .compact-mode .roster-table {
        font-size: 7pt;
    }

    .compact-mode .roster-table th,
    .compact-mode .roster-table td {
        padding: 1px 2px;
    }

    .compact-mode .roster-header {
        padding: 0.25cm;
    }

    .compact-mode .roster-title {
        font-size: 14pt;
    }

    .compact-mode .roster-period {
        font-size: 11pt;
    }

    @page {
        size: landscape;
        margin: 0.5cm;
    }
}

/* Responsive */
@media (max-width: 1200px) {
    .config-panel {
        width: 320px;
    }
}

@media (max-width: 900px) {
    .main-content {
        flex-direction: column;
    }

    .config-panel {
        width: 100%;
        max-height: 50vh;
        border-right: none;
        border-bottom: 1px solid var(--border);
        box-shadow: none;
    }
}
