* { box-sizing: border-box; }
body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 20px;
    background: #f5f7fb;
}
.app { max-width: 1600px; margin: 0 auto; }
.container {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
h1 {
    font-size: 1.8rem;
    margin-top: 0;
    margin-bottom: 20px;
    color: #1e293b;
}
.auth-section {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
}
.auth-section input {
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    width: 250px;
    margin-right: 10px;
    margin-bottom: 10px;
}
.auth-section button {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
}
.auth-section .switch-link {
    margin-top: 10px;
    font-size: 0.85rem;
    color: #3b82f6;
    cursor: pointer;
    text-decoration: underline;
}
.error { color: #ef4444; margin-top: 8px; }
.success { color: #10b981; margin-top: 8px; }
.logout-btn {
    background: #ef4444;
    margin-left: 10px;
}
.controls {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
select, input[type="month"] {
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: white;
}
.calendar-layout {
    display: flex;
    gap: 24px;
    margin-top: 20px;
}
.calendar-main { flex: 3; min-width: 0; }
.right-panel {
    flex: 1;
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    position: sticky;
    top: 20px;
    height: fit-content;
}
.right-panel h3 {
    margin-top: 0;
    margin-bottom: 16px;
    color: #0f172a;
}
.day-details { margin-top: 20px; }
.day-details .field { margin-bottom: 16px; }
.day-details label {
    display: block;
    font-weight: 500;
    margin-bottom: 4px;
    color: #334155;
}
.day-details input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
}
.drawer-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}
.drawer-actions button { flex: 1; }
.reset-btn { background: #f59e0b; }
.reset-btn:hover { background: #d97706; }
.message {
    color: #64748b;
    font-style: italic;
    margin-top: 20px;
}
.error-message {
    color: #ef4444;
    background: #fee2e2;
    padding: 10px;
    border-radius: 8px;
}
.config-panel {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}
.config-panel h4 {
    margin: 0 0 12px 0;
    color: #0f172a;
}
.config-field { margin-bottom: 12px; }
.config-field label {
    display: block;
    font-size: 0.8rem;
    color: #475569;
    margin-bottom: 2px;
}
.config-field input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
}
.footnote {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 20px;
    text-align: center;
}
.fc-daygrid-day { cursor: pointer; }
.fc .fc-daygrid-day-number {
    color: #334155;
    font-weight: 500;
}
.fc .fc-event,
.fc .fc-daygrid-event {
    margin: 2px !important;
    border-radius: 10px !important;
    border: 1px solid transparent !important;
    padding: 0 !important;
    box-shadow: none !important;
}
.fc-price-card {
    position: relative;
    overflow: hidden;
}
.fc-price-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 78px;
    padding: 6px;
}
.fc-empty-card {
    font-size: 18px;
    font-weight: 700;
    color: #475569;
}
.fc-price {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.15;
    color: #1f2937;
}
.fc-badge {
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    background: rgba(255,255,255,0.7);
    border-radius: 999px;
    padding: 2px 7px;
    margin-top: 6px;
}
.fc-override-label {
    font-size: 10px;
    margin-top: 4px;
    color: #7c3aed;
    font-weight: 600;
}
.fc-inline-editor {
    position: absolute;
    inset: 0;
    z-index: 20;
    background: rgba(255,255,255,0.98);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 6px;
    pointer-events: auto;
}
.fc-daygrid-event:hover .fc-inline-editor {
    display: flex;
}
.fc-inline-editor input,
.fc-inline-editor button {
    pointer-events: auto;
}
.fc .fc-daygrid-event-harness {
    z-index: 3;
}
.fc-inline-editor input {
    width: 72px;
    padding: 4px 6px;
    font-size: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    text-align: center;
    background: white;
}
.fc-inline-actions {
    display: flex;
    gap: 4px;
}
.fc-inline-actions button {
    border: none;
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 11px;
    cursor: pointer;
    font-weight: 600;
}
.fc-inline-save {
    background: #10b981;
    color: white;
}
.fc-inline-reset {
    background: #f59e0b;
    color: white;
}
.price-low {
    background: #f7efb4 !important;
    border-color: #e8d985 !important;
}
.price-mid {
    background: #cfe8b4 !important;
    border-color: #b8d691 !important;
}
.price-high {
    background: #e8c694 !important;
    border-color: #d8af73 !important;
}
.status-booked {
    background: #e5e7eb !important;
    border-color: #cbd5e1 !important;
}
.status-blocked {
    background: #fecaca !important;
    border-color: #fca5a5 !important;
}
.has-override .fc-price {
    text-decoration: underline;
    text-decoration-thickness: 2px;
}
.legend-panel {
    margin: 18px 0 22px;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #334155;
}
.legend-swatch {
    width: 18px;
    height: 18px;
    border-radius: 6px;
    border: 1px solid rgba(0,0,0,0.08);
    display: inline-block;
}
.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #7c3aed;
    display: inline-block;
}
/* Accordion styles */
.accordion {
    margin: 12px 0;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}
.accordion-header {
    background: #f8fafc;
    padding: 10px 15px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}
.accordion-header:hover {
    background: #f1f5f9;
}
.accordion-icon {
    font-size: 1.2rem;
    transition: transform 0.2s;
}
.accordion-content {
    padding: 15px;
    border-top: 1px solid #e2e8f0;
    display: none;
}
.accordion.open .accordion-content {
    display: block;
}
.accordion.open .accordion-icon {
    transform: rotate(90deg);
}
.config-group {
    margin-bottom: 15px;
}
.config-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 4px;
    color: #334155;
    font-size: 0.85rem;
}
.config-group input, .config-group select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: white;
}
.config-group-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
}
.config-group-checkbox input {
    width: auto;
}
.config-group-checkbox label {
    margin-bottom: 0;
}
.intervals-input {
    font-family: monospace;
}
/* Toggle switch */
.toggle-switch {
    display: inline-block;
    position: relative;
    width: 48px;
    height: 24px;
    margin-left: 10px;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: 0.3s;
    border-radius: 24px;
}
.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}
input:checked + .toggle-slider {
    background-color: #3b82f6;
}
input:checked + .toggle-slider:before {
    transform: translateX(24px);
}
/* Disabled group */
.settings-group.disabled {
    opacity: 0.6;
    pointer-events: none;
}
/* Help text */
.help-text {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 4px;
}
/* Interval / factor table */
.interval-table {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0;
}
.interval-table th, .interval-table td {
    border: 1px solid #e2e8f0;
    padding: 6px;
    text-align: left;
}
.interval-table input {
    width: 100%;
    padding: 4px;
}
.add-row-btn, .remove-row-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0 4px;
}
.add-row-btn { color: #10b981; }
.remove-row-btn { color: #ef4444; }
/* Weekend checkboxes */
.weekend-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 8px 0;
}
.weekend-group label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
/* Config section spacing */
.config-section {
    margin: 20px 0;
    padding: 12px;
    background: #f9fafb;
    border-radius: 12px;
}
.config-section h4 {
    margin: 0 0 8px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}
.tab-btn {
    background: none;
    border: none;
    padding: 8px 16px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}
.tab-btn.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}
.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
}

/* Collapsible sections */
.config-section {
    margin: 20px 0;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}
.section-header {
    background: #f8fafc;
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    user-select: none;
}
.section-header:hover {
    background: #f1f5f9;
}
.section-badge {
    display: inline-flex;
    gap: 8px;
    font-size: 0.75rem;
    font-weight: normal;
    color: #475569;
}
.section-badge .badge {
    background: #eef2ff;
    padding: 2px 6px;
    border-radius: 12px;
}
.section-badge .status-on {
    color: #10b981;
    font-weight: 600;
}
.section-badge .status-off {
    color: #94a3b8;
}
.section-content {
    padding: 16px;
    border-top: 1px solid #e2e8f0;
    display: none;
}
.section-content.open {
    display: block;
}
.section-icon {
    font-size: 1.2rem;
    transition: transform 0.2s;
}
.section-header.open .section-icon {
    transform: rotate(90deg);
}

/* Disabled section fields */
.section-fields.disabled {
    opacity: 0.6;
    pointer-events: none;
}

/* Language switcher */
.lang-switcher {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
}
.lang-switcher select {
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: white;
}

/* Help text */
.help-text {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 4px;
}

/* Interval table */
.interval-table {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0;
}
.interval-table th, .interval-table td {
    border: 1px solid #e2e8f0;
    padding: 6px;
    text-align: left;
}
.interval-table input {
    width: 100%;
    padding: 4px;
}
.add-row-btn {
    background: none;
    border: none;
    color: #10b981;
    cursor: pointer;
    font-size: 0.85rem;
    margin-top: 8px;
}
.remove-row-btn {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
}