/* ==========================================
   VARIABLES & THEME
   ========================================== */
:root {
    --bg-primary: #f0f4f8;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-input: #f8fafc;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --border-focus: #4c51bf;
    --accent-primary: #4c51bf;
    --accent-secondary: #6366f1;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    --accent-info: #06b6d4;
    --accent-purple: #8b5cf6;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.12);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --transition: 0.25s ease;
}

[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #1e293b;
    --bg-input: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #334155;
    --border-focus: #818cf8;
    --accent-primary: #818cf8;
    --accent-secondary: #6366f1;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.5);
}

/* ==========================================
   RESET & BASE
   ========================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: background var(--transition), color var(--transition);
}

/* ==========================================
   LAYOUT
   ========================================== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    text-align: center;
    font-size: 1.5em;
    margin-bottom: 20px;
    color: var(--accent-primary);
}

/* ==========================================
   THEME TOGGLE
   ========================================== */
.theme-toggle {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 1000;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition);
}

.theme-toggle:hover {
    transform: scale(1.1);
}

/* ==========================================
   COLLAPSIBLE SECTIONS
   ========================================== */
.collapsible-section {
    margin-bottom: 15px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
}

.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    cursor: pointer;
    background: var(--bg-secondary);
    font-weight: 600;
    user-select: none;
    transition: background var(--transition);
}

.collapsible-header:hover {
    background: var(--bg-input);
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.collapsible-section.open .collapsible-content {
    max-height: 2000px;
}

.collapsible-section.open .collapse-icon {
    transform: rotate(180deg);
}

.collapse-icon {
    transition: transform var(--transition);
    font-size: 12px;
}

/* ==========================================
   CONFIG
   ========================================== */
#db-config-area, #config-panel {
    padding: 20px;
}

#db-config-area h3, #config-panel h3 {
    color: var(--accent-primary);
    margin-bottom: 15px;
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 15px;
}

.config-grid-main {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.config-block {
    background: var(--bg-input);
    padding: 15px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.config-block h4 {
    margin-bottom: 12px;
    font-size: 0.95em;
    color: var(--accent-primary);
}

.config-block label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.85em;
    color: var(--text-secondary);
}

.config-block input,
.config-block select {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9em;
    transition: border-color var(--transition);
}

.config-block input:focus,
.config-block select:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(76, 81, 191, 0.15);
}

.config-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.cloud-status {
    margin-top: 10px;
    padding: 10px;
    border-radius: var(--radius-sm);
    font-size: 0.9em;
    display: none;
}

.cloud-status.success {
    display: block;
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-success);
    border: 1px solid var(--accent-success);
}

.cloud-status.error {
    display: block;
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-danger);
    border: 1px solid var(--accent-danger);
}

/* ==========================================
   CONTROLS
   ========================================== */
.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.period-selector {
    display: flex;
    gap: 8px;
    align-items: center;
}

.period-selector select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9em;
}

.action-buttons,
.template-actions,
.batch-actions,
.data-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.batch-actions label {
    font-size: 0.85em;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.batch-actions select {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* ==========================================
   BUTTONS
   ========================================== */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.85em;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

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

.btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.btn-info {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    color: white;
}

.btn-purple {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
}

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

.btn-outline:hover:not(:disabled) {
    background: var(--bg-input);
}

/* ==========================================
   TABS
   ========================================== */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.tab {
    padding: 10px 20px;
    border: none;
    background: var(--bg-card);
    color: var(--text-secondary);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9em;
    white-space: nowrap;
    transition: all var(--transition);
    border-bottom: 3px solid transparent;
}

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

.tab.active {
    color: var(--accent-primary);
    background: var(--bg-card);
    border-bottom-color: var(--accent-primary);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================
   CALENDAR GRID
   ========================================== */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 12px;
}

/* ==========================================
   DAY CARD
   ========================================== */
.day-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 14px;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    position: relative;
}

.day-card:hover {
    box-shadow: var(--shadow-md);
}

.day-card.selected {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(76, 81, 191, 0.2);
}

.day-card.type-OFF {
    border-left: 4px solid #94a3b8;
    opacity: 0.7;
}

.day-card.type-ON {
    border-left: 4px solid var(--accent-success);
}

.day-card.type-CP {
    border-left: 4px solid var(--accent-info);
}

.day-card.type-MAL {
    border-left: 4px solid var(--accent-danger);
}

.day-card.type-VAC {
    border-left: 4px solid var(--accent-warning);
}

.day-card.type-TRAIN {
    border-left: 4px solid var(--accent-purple);
}

.day-card.type-RECUP {
    border-left: 4px solid #f472b6;
}

.day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.day-date {
    font-weight: 700;
    font-size: 1em;
    color: var(--text-primary);
}

.day-date.sunday {
    color: var(--accent-danger);
}

.day-date.holiday {
    color: var(--accent-warning);
}

.day-total {
    font-weight: 700;
    font-size: 1.1em;
    color: var(--accent-primary);
    background: var(--bg-input);
    padding: 2px 10px;
    border-radius: 20px;
}

.day-type-selector {
    display: flex;
    gap: 4px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.type-radio {
    display: none;
}

.type-label {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-secondary);
    transition: all var(--transition);
}

.type-radio:checked + .type-label {
    color: white;
}

.type-radio[value="ON"]:checked + .type-label {
    background: var(--accent-success);
    border-color: var(--accent-success);
}

.type-radio[value="OFF"]:checked + .type-label {
    background: #94a3b8;
    border-color: #94a3b8;
}

.type-radio[value="CP"]:checked + .type-label {
    background: var(--accent-info);
    border-color: var(--accent-info);
}

.type-radio[value="MAL"]:checked + .type-label {
    background: var(--accent-danger);
    border-color: var(--accent-danger);
}

.type-radio[value="VAC"]:checked + .type-label {
    background: var(--accent-warning);
    border-color: var(--accent-warning);
}

.type-radio[value="TRAIN"]:checked + .type-label {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
}

.type-radio[value="RECUP"]:checked + .type-label {
    background: #f472b6;
    border-color: #f472b6;
}

.day-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.day-fields label {
    font-size: 0.75em;
    color: var(--text-muted);
    display: block;
}

.day-fields input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.85em;
    transition: border-color var(--transition);
}

.day-fields input:focus {
    outline: none;
    border-color: var(--border-focus);
}

.day-fields.hidden {
    display: none;
}

.day-activities {
    display: flex;
    gap: 4px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.activity-btn {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.7em;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

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

.activity-btn.vo.active { background: #f59e0b; border-color: #f59e0b; }
.activity-btn.aboard.active { background: #3b82f6; border-color: #3b82f6; }
.activity-btn.astreinte.active { background: #ef4444; border-color: #ef4444; }

.rest-warning {
    margin-top: 8px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75em;
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-danger);
    display: none;
}

.rest-warning.visible {
    display: block;
}

/* ==========================================
   STATS
   ========================================== */
.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.stats-actions {
    display: flex;
    gap: 10px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    text-align: center;
    transition: all var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-card.wide {
    grid-column: span 2;
}

.stat-card h3 {
    font-size: 0.8em;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-card .value {
    font-size: 1.8em;
    font-weight: 800;
    color: var(--accent-primary);
    line-height: 1.2;
}

.stat-card .trend {
    font-size: 0.75em;
    margin-top: 4px;
    color: var(--text-muted);
}

.trend.up { color: var(--accent-success); }
.trend.down { color: var(--accent-danger); }

/* ==========================================
   CHARTS
   ========================================== */
.chart-container {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-top: 20px;
    position: relative;
    min-height: 300px;
}

.chart-container canvas {
    max-height: 400px;
}

/* ==========================================
   ANALYSIS
   ========================================== */
.analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
    padding: 20px;
    border-radius: var(--radius-lg);
    color: white;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.analysis-title h2 {
    margin: 0 0 5px 0;
    font-size: 1.4em;
    color: white;
}

.analysis-title p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.9em;
}

.analysis-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.analysis-controls select {
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.15);
    color: white;
    font-size: 0.9em;
}

.analysis-controls select option {
    background: #1e293b;
    color: white;
}

.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

/* ==========================================
   COMPARISON
   ========================================== */
.comparison-header {
    background: var(--bg-card);
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.comparison-header h2 {
    margin-bottom: 12px;
    color: var(--accent-primary);
}

.comparison-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.comparison-hint {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin: 10px 0 0 0;
}

.bulletin-history {
    background: var(--bg-card);
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.bulletin-history h3 {
    margin-bottom: 12px;
    color: var(--accent-primary);
}

#bulletinComparisonZone {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.comparison-table th,
.comparison-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.comparison-table th {
    background: var(--bg-input);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85em;
}

.comparison-table td {
    color: var(--text-primary);
}

.comparison-match { color: var(--accent-success); font-weight: 600; }
.comparison-warn { color: var(--accent-warning); font-weight: 600; }
.comparison-error { color: var(--accent-danger); font-weight: 600; }

/* ==========================================
   ESCALES / MAP
   ========================================== */
.escales-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 12px;
}

.escales-header h2 {
    color: var(--accent-primary);
}

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

#escaleSearch {
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.9em;
    min-width: 220px;
}

.map-container {
    position: relative;
    height: 500px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #1a1a2e;
}

#escalesMap {
    width: 100%;
    height: 100%;
}

#mapLoading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
}

#escalesLegend {
    margin-top: 15px;
    padding: 15px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

#escalesLegend h4 {
    margin: 0 0 10px 0;
    font-size: 0.9em;
    color: var(--text-primary);
}

#escalesListContainer {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 150px;
    overflow-y: auto;
}

.escale-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

/* ==========================================
   EXPORTS
   ========================================== */
.exports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.export-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    text-align: center;
}

.export-card h3 {
    margin-bottom: 8px;
    color: var(--accent-primary);
}

.export-card p {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* ==========================================
   MODALS
   ========================================== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(3px);
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 550px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal.modal-large {
    max-width: 750px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    color: var(--accent-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.3em;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}

.modal-close:hover {
    background: var(--bg-input);
}

.modal-body {
    margin-bottom: 18px;
}

.modal-body textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: monospace;
    font-size: 0.85em;
    resize: vertical;
}

.modal-body label {
    display: block;
    margin-bottom: 10px;
    font-size: 0.85em;
    color: var(--text-secondary);
}

.modal-body input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    margin-top: 4px;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ==========================================
   NOTIFICATIONS
   ========================================== */
.notification-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.notification {
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9em;
    box-shadow: var(--shadow-lg);
    animation: notifIn 0.3s ease, notifOut 0.3s ease 2.7s forwards;
    pointer-events: auto;
    max-width: 450px;
    text-align: center;
}

.notification.success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.notification.error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.notification.warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.notification.info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

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

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

/* ==========================================
   PRINT
   ========================================== */
@media print {
    body { background: white; }

    .theme-toggle,
    .controls,
    .noprint,
    .tabs,
    .tab,
    #db-config-area,
    .collapsible-section {
        display: none !important;
    }

    .container {
        box-shadow: none;
        padding: 0;
    }

    .day-card {
        break-inside: avoid;
    }
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 768px) {
    .container { padding: 10px; }

    h1 { font-size: 1.1em; }

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

    .period-selector {
        justify-content: center;
    }

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

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

    .stat-card.wide {
        grid-column: span 2;
    }

    .tabs {
        justify-content: center;
    }

    .analysis-header {
        flex-direction: column;
    }
}
