/* ========================================
   Dienstplan — Main Stylesheet (v3.0)
   Consolidated: no inline CSS, no duplicates
   ======================================== */

:root {
    /* Primary palette — blue accent */
    /* Action-/Akzent-Blau ist seit 2026-04-27 das Navi-Hintergrund-Blau (--dark).
       Buttons, Form-Focus, aktive Tabs, Sortier-Header, Sidebar-Akzente und
       FullCalendar-Toolbar greifen damit auf eine konsistente Palette zu. */
    --primary-color: #2c3e50;
    --primary-hover: #1a252f;
    --primary-light: #ebeef1;

    /* Dark palette */
    --dark: #2c3e50;
    --dark-hover: #1a252f;

    /* Neutral palette */
    --secondary-color: #64748b;
    --bg-color: #eef0f2;
    --card-bg: #ffffff;
    --text-color: #222;
    --text-muted: #666;
    --text-light: #999;
    --border-color: #d5d8dc;

    /* Status colors */
    --success-color: #16a34a;
    --success-hover: #15803d;
    --success-bg: #f0fdf4;
    --warning-color: #f97316;
    --warning-hover: #ea580c;
    --warning-bg: #fffbeb;
    --danger-color: #dc2626;
    --danger-hover: #b91c1c;
    --danger-bg: #fef2f2;
    --secondary-hover: #475569;

    /* Calendar colors */
    --today-bg: #e0e5ec;
    --today-border: #2c3e50;
    --weekend-bg: #eef1f3;
    --past-bg: #e8e9ec;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
    --shadow: 0 2px 8px rgba(0,0,0,0.12);
    --shadow-md: 0 2px 10px rgba(0,0,0,0.15);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.18);

    /* Spacing & Radius */
    --radius: 4px;
    --radius-sm: 3px;
    --radius-lg: 6px;

    /* Transitions */
    --transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Reset ─── */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }

/* ─── Global focus indicator (WCAG 2.4.7 AA) ─── */
/* Keyboard-only focus ring. Form inputs keep their own :focus style below. */
:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}
.form-control:focus-visible,
.toolbar-select:focus-visible { outline: none; }
/* On dark sidebar/header, primary blue has enough contrast but offset-bg differs */
.sidebar :focus-visible,
.mobile-menu :focus-visible,
.header :focus-visible {
    outline-color: #fff;
    outline-offset: 2px;
}

body {
    font-family: 'Segoe UI', Arial, Helvetica, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.4;
    font-size: 15px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ─── App Layout (sidebar + main) ─── */
.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Desktop: sidebar + main side-by-side */
@media (min-width: 1001px) {
    body.has-sidebar {
        flex-direction: row;
    }
    body.has-sidebar .header {
        display: none;
    }
}

/* ─── Layout ─── */
.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 12px 16px;
    flex: 1;
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 16px;
    margin-bottom: 12px;
}

/* Sidebar layout: container becomes transparent wrapper */
@media (min-width: 1001px) {
    body.has-sidebar .container {
        max-width: none;
        padding: 12px;
    }
}

/* Flush pages (calendars): no card chrome at all */
.container-flush { max-width: none; padding: 0; }
.container-flush .card { box-shadow: none; border-radius: 0; border: none; margin-bottom: 0; padding: 8px 12px; }

/* ─── Header (mobile only — hidden on desktop via sidebar layout) ─── */
.header {
    background: var(--dark);
    color: white;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 50px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    flex-shrink: 0;
    position: relative;
    z-index: 100;
}

.header h1 {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

/* ─── Sidebar (desktop only — hidden on mobile) ─── */
.sidebar {
    display: none;
    flex-direction: column;
    width: 220px;
    flex-shrink: 0;
    background: var(--dark);
    color: white;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

@media (min-width: 1001px) {
    .sidebar { display: flex; }
}

.sidebar-brand {
    padding: 16px 20px;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
}

.sidebar-nav {
    flex: 1;
    padding: 8px 0;
    overflow-y: auto;
}

.sidebar-nav a {
    display: block;
    padding: 9px 20px;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    border-left: 3px solid transparent;
}
.sidebar-nav a:hover {
    background: rgba(255,255,255,0.08);
    color: white;
}
.sidebar-nav a.active {
    background: rgba(44,62,80,0.2);
    color: white;
    border-left-color: var(--primary-color);
}

.sidebar-section {
    padding: 14px 20px 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255,255,255,0.4);
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Collapsible admin group (rendered as <button> for a11y) */
.sidebar-toggle {
    cursor: pointer;
    user-select: none;
    transition: color 0.15s;
    background: transparent;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    color: inherit;
    font: inherit;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: 100%;
    text-align: left;
}
.sidebar-toggle:hover { color: rgba(255,255,255,0.7); }
.sidebar-arrow {
    font-size: 0.6rem;
    transition: transform 0.2s;
}
.sidebar-toggle.open .sidebar-arrow { transform: rotate(180deg); }

.sidebar-group + .sidebar-group .sidebar-section {
    margin-top: 0;
}

.sidebar-sub {
    display: none;
}
.sidebar-sub.open { display: block; }
.sidebar-sub a { padding-left: 28px; font-size: 0.82rem; }

/* Nested submenu (level 2) — e.g. System → Einstellungen → Kalender */
.sidebar-sub-toggle {
    cursor: pointer;
    user-select: none;
    background: transparent;
    border: 0;
    color: rgba(255,255,255,0.7);
    font: inherit;
    font-size: 0.82rem;
    width: 100%;
    text-align: left;
    padding: 8px 20px 8px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.15s, color 0.15s;
}
.sidebar-sub-toggle:hover {
    background: rgba(255,255,255,0.08);
    color: white;
}
.sidebar-sub-toggle.open { color: white; }
.sidebar-sub-toggle .sidebar-arrow {
    font-size: 0.55rem;
    transition: transform 0.2s;
}
.sidebar-sub-toggle.open .sidebar-arrow { transform: rotate(180deg); }

.sidebar-sub-2 {
    display: none;
}
.sidebar-sub-2.open { display: block; }
.sidebar-sub-2 a {
    padding-left: 44px;
    font-size: 0.78rem;
}

.sidebar-badge {
    background: var(--danger-color);
    color: white;
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 700;
}

/* Highlight sidebar link when pending leaves exist */
.sidebar-nav a.sidebar-alert {
    color: #ff6b6b;
    font-weight: 700;
}
.sidebar-nav a.sidebar-alert:hover {
    color: #fff;
    background: rgba(220,38,38,0.3);
}

.sidebar-footer {
    position: relative;
    border-top: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
}

/* User dropdown trigger (footer) */
.sidebar-user-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 12px 20px;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.75);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.sidebar-user-btn:hover {
    background: rgba(255,255,255,0.08);
    color: white;
}
.sidebar-user-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sidebar-user-arrow {
    font-size: 0.6rem;
    transition: transform 0.2s;
    flex-shrink: 0;
    margin-left: 8px;
}
.sidebar-user-btn.open .sidebar-user-arrow {
    transform: rotate(180deg);
}

/* User dropdown popover (opens upward above the footer button) */
.sidebar-user-menu {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: var(--dark);
    border-top: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 -4px 12px rgba(0,0,0,0.3);
    padding: 4px 0;
    z-index: 10;
}
.sidebar-user-menu.open {
    display: block;
}
.sidebar-user-menu a {
    display: block;
    padding: 9px 20px;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    font-size: 0.85rem;
    border-left: 3px solid transparent;
    transition: background 0.15s, color 0.15s;
}
.sidebar-user-menu a:hover {
    background: rgba(255,255,255,0.08);
    color: white;
}
.sidebar-user-menu a.active {
    background: rgba(44,62,80,0.2);
    color: white;
    border-left-color: var(--primary-color);
}

/* ─── Mobile Menu (hamburger overlay) ─── */
.mobile-admin-sub { display: none; padding-left: 16px; border-left: 3px solid var(--primary-color); margin-left: 12px; }
.mobile-admin-sub.open { display: block; }
.mobile-menu-links .admin-link,
.mobile-menu-links .mobile-sub-toggle { cursor: pointer; }
.mobile-menu-links .admin-link.open,
.mobile-menu-links .mobile-sub-toggle.open { color: var(--primary-color); }
.mobile-admin-sub a { font-size: 0.85rem !important; padding: 8px 12px !important; }

/* Nested submenu (level 2) inside mobile-admin-sub */
.mobile-admin-sub .mobile-sub-toggle {
    display: block;
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: 0;
    color: var(--text-color);
    font: inherit;
    font-size: 0.85rem;
    text-align: left;
    cursor: pointer;
}
.mobile-admin-sub .mobile-sub-toggle.open { color: var(--primary-color); }
.mobile-admin-sub-2 {
    display: none;
    padding-left: 16px;
    border-left: 2px solid var(--border-color);
    margin-left: 8px;
}
.mobile-admin-sub-2.open { display: block; }
.mobile-admin-sub-2 a {
    font-size: 0.8rem !important;
    padding: 6px 12px !important;
}

/* Admin group toggle as <button> in mobile menu */
.mobile-menu-links button.admin-link {
    display: block;
    width: 100%;
    padding: 14px 20px;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
    font: inherit;
    font-size: 0.95rem;
    text-align: left;
}
.mobile-menu-links button.admin-link:hover,
.mobile-menu-links button.admin-link.open { background: var(--bg-color); color: var(--primary-color); }

/* Hide mobile elements on desktop */
.mobile-menu-btn, .mobile-menu, .mobile-menu-overlay { display: none; }

.btn-logout {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
    font-size: 0.85rem;
}
.btn-logout:hover { background: rgba(255,255,255,0.3); }

/* ─── Footer ─── */
.footer {
    padding: 10px 12px;
    background: #f7f9fa;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-light);
    margin-top: auto;
}
.footer a { color: var(--primary-color); text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }

.btn-primary { background: var(--primary-color); color: white; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--secondary-color); color: white; }
.btn-secondary:hover { background: var(--secondary-hover); }
.btn-success { background: var(--success-color); color: white; }
.btn-success:hover { background: var(--success-hover); }
.btn-warning { background: var(--warning-color); color: white; }
.btn-warning:hover { background: var(--warning-hover); }
.btn-danger { background: var(--danger-color); color: white; }
.btn-danger:hover { background: var(--danger-hover); }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-icon { padding: 8px; min-width: auto; }

/* ─── ICS Abo ─── */
.ics-abo { font-size: 0.82rem; }
.ics-abo .settings-heading { margin-top: 0; }
.ics-abo .settings-row > label:first-child { min-width: 110px; font-size: 0.82rem; }
.ics-abo .form-control { font-size: 0.78rem; padding: 6px 8px; }

/* ─── Forms ─── */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; color: var(--text-color); }

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    background: var(--card-bg);
}
.form-control:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(44,62,80,0.1); }

.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; }
@media (max-width: 400px) { .form-row { grid-template-columns: 1fr; } }

input[type="color"] { width: 50px; height: 40px; padding: 2px; border: 1px solid var(--border-color); border-radius: var(--radius-sm); cursor: pointer; }

/* ─── Tables ─── */
.table-container { overflow-x: auto; }
.my-shifts-table { overflow-x: hidden; }
.my-shifts-table table { width: 100%; table-layout: fixed; }

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { padding: 8px 10px; text-align: left; border: 1px solid var(--border-color); }
th { background: #ecf0f1; font-weight: 700; font-size: 0.8rem; color: #555; position: sticky; top: 0; z-index: 1; }
/* Row-hover only on real data tables — exclude FullCalendar's internal <tr>s */
.table tbody tr:hover,
.my-shifts-table tbody tr:hover,
table.data-table tbody tr:hover { background: #f7f9fa; }

/* Sortable table headers */
th.sortable { cursor: pointer; user-select: none; transition: background var(--transition); }
th.sortable:hover { background: var(--border-color); }
th.sortable.active-sort { color: var(--primary-color); }
.sort-icon { font-size: 0.7em; margin-left: 4px; opacity: 0.7; }

/* ─── Filter Tabs ─── */
.filter-tabs { display: inline-flex; }
.filter-tabs a { padding: 8px 16px; border: 1px solid var(--border-color); text-decoration: none; color: inherit; background: white; }
.filter-tabs a:not(:first-child) { border-left: none; }
.filter-tabs a:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.filter-tabs a:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.filter-tabs a.active { background: var(--primary-color); color: white; }

/* ─── Status & Leave Badges ─── */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.status-badge.genehmigt, .status-badge.status-published { background: var(--success-bg); color: var(--success-color); }
.status-badge.angefragt, .status-badge.status-draft { background: var(--warning-bg); color: var(--warning-color); }
.status-badge.abgelehnt { background: var(--danger-bg); color: var(--danger-color); }
.status-badge.status-warning { background: #fed7aa; color: #c2410c; }
.status-badge.status-empty { background: #e5e7eb; color: #6b7280; }

/* Event-type badges (admin/events.php) */
.status-badge.event-feiertag { background: var(--danger-bg); color: #991b1b; }
.status-badge.event-info { background: var(--warning-bg); color: #92400e; }
.status-badge.event-ereignis { background: #e0f2fe; color: #0369a1; }

.leave-badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 0.75rem; font-weight: 500; margin: 2px; }

/* Zeiterfassung status labels */
.ze-status-label { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 100px; font-size: 0.75rem; font-weight: 600; }
.ze-status-label.status-active { background: #dcfce7; color: #166534; }
.ze-status-label.status-confirmed { background: var(--today-bg); color: var(--primary-color); }
.ze-status-label.status-open { background: #fef3c7; color: #92400e; }
.row-pending { background: #fffbeb; }

/* Month navigation */
.month-nav { display: flex; align-items: center; gap: 8px; }
.month-label { font-weight: 600; min-width: 140px; text-align: center; }
.leave-badge.approved { background: #dcfce7; color: #166534; }
.leave-badge.requested { background: #fef3c7; color: #92400e; }
.leave-badge.rejected { background: #fee2e2; color: #991b1b; }

.leave-type-badge { display: inline-block; padding: 4px 10px; border-radius: 100px; font-size: 0.75rem; font-weight: 600; color: white; white-space: nowrap; }
.leave-type-indicator { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 10px; font-size: 0.7rem; font-weight: 600; color: white; margin: 1px 0; }

.status-date { font-size: 0.75rem; color: var(--text-muted); }

/* ─── Roster Toolbar ─── */
.roster-controls { margin-bottom: 20px; }
.roster-card { display: block; }
.roster-card > .table-container { overflow-x: auto; }

.roster-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
    background: #f7f9fa;
    border-radius: var(--radius);
    margin-bottom: 8px;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}
.toolbar-left, .toolbar-center, .toolbar-right { display: flex; align-items: center; gap: 8px; }

.quick-add-group { display: flex; gap: 4px; padding-right: 12px; margin-right: 8px; border-right: 1px solid var(--border-color); }
.quick-add-group .btn { white-space: nowrap; }

.toolbar-nav { display: flex; align-items: center; gap: 4px; background: white; border: 1px solid var(--border-color); border-radius: var(--radius-sm); padding: 2px; }
.nav-btn { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: var(--radius-sm); color: var(--text-color); text-decoration: none; font-weight: 500; transition: background 0.15s; }
.nav-btn:hover { background: var(--bg-color); }
.nav-btn.nav-today { width: auto; padding: 0 12px; font-size: 0.8rem; color: var(--primary-color); }
.nav-title { font-weight: 600; font-size: 0.95rem; min-width: 140px; text-align: center; padding: 0 8px; }

.toolbar-select { padding: 8px 12px; border: 1px solid var(--border-color); border-radius: var(--radius-sm); background: white; font-size: 0.85rem; color: var(--text-color); cursor: pointer; min-width: 100px; }
.toolbar-select:hover { border-color: var(--primary-color); }
.toolbar-select:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 2px rgba(44,62,80,0.1); }
.toolbar-label { padding: 8px 12px; font-size: 0.85rem; font-weight: 500; color: var(--text-color); }

.view-toggle { display: flex; gap: 4px; }
.view-toggle button { padding: 8px 16px; border: 1px solid var(--border-color); background: white; cursor: pointer; transition: all 0.2s; }
.view-toggle button:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.view-toggle button:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.view-toggle button.active { background: var(--primary-color); color: white; border-color: var(--primary-color); }

.shift-model-select { display: flex; align-items: center; gap: 8px; }
.publication-status { display: flex; align-items: center; gap: 12px; }

/* ─── Modal ─── */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-overlay.hidden { display: none; }
.modal { background: white; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); max-width: 500px; width: 90%; max-height: 90vh; overflow-y: auto; border: 1px solid var(--border-color); }
.modal-header { padding: 16px 20px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { margin: 0; }
.modal-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-muted); line-height: 1; }
.modal-body { padding: 20px; }
.modal-footer { padding: 16px 20px; border-top: 1px solid var(--border-color); display: flex; justify-content: flex-end; gap: 12px; }

/* Color Picker Grid */
.color-picker-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.color-swatch { width: 32px; height: 32px; border-radius: 6px; border: 2px solid transparent; cursor: pointer; transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s; padding: 0; }
.color-swatch:hover { transform: scale(1.1); box-shadow: 0 2px 8px rgba(0,0,0,0.2); }
.color-swatch.selected { border-color: var(--text-color); box-shadow: 0 0 0 2px white, 0 0 0 4px var(--text-color); }

/* ─── Alerts ─── */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 0.9rem; font-weight: 500; }
.alert-success { background: var(--success-bg); color: var(--success-color); border: 1px solid #bbf7d0; }
.alert-error { background: var(--danger-bg); color: var(--danger-color); border: 1px solid #fecaca; }
.alert-warning { background: var(--warning-bg); color: var(--warning-color); border: 1px solid #fde68a; }
.alert-info { background: var(--primary-light); color: #1e40af; border: 1px solid #bfdbfe; }
.alert-info a { color: var(--primary-color); font-weight: 600; }

/* ─── Misc ─── */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-state-icon { font-size: 3rem; margin-bottom: 16px; }
.btn-note { background: none; border: none; cursor: pointer; font-size: 1rem; padding: 2px 4px; border-radius: var(--radius-sm); transition: background var(--transition); }
.btn-note:hover { background: var(--bg-color); }
.action-buttons { display: flex; gap: 8px; }
.hidden { display: none !important; }

/* ─── Login Page ─── */
body.login-body { background: var(--bg-color); }
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.login-card {
    width: 100%;
    max-width: 380px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}
.login-header {
    background: var(--dark);
    color: white;
    padding: 16px 22px;
}
.login-header h1 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: white;
}
.login-content { padding: 22px 22px 24px; }
.login-subtitle {
    margin: 0 0 18px;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.login-card .form-group { margin-bottom: 12px; }
.login-card .form-group label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 5px;
}
.login-card .form-control {
    border-width: 1px;
    padding: 10px 12px;
    font-size: 0.9rem;
}
.login-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 14px 0 18px;
}
.login-remember label {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-muted);
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0;
}
.login-submit {
    width: 100%;
    padding: 11px 16px;
    font-size: 0.9rem;
}
.login-card .alert { margin-bottom: 16px; }

/* Align login accents with the sidebar/dark palette (mirrors settings-card pattern) */
.login-card input[type="checkbox"] { accent-color: var(--dark); }
.login-card .form-control:focus {
    border-color: var(--dark);
    box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.12);
}
.login-card .btn-primary {
    background: var(--dark);
    border-color: var(--dark);
}
.login-card .btn-primary:hover {
    background: var(--dark-hover);
    border-color: var(--dark-hover);
}

/* ─── Page Title ─── */
.page-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.page-title h2 { margin: 0; }

/* Mobile password change link */
.mobile-pw-link { display: block; text-align: center; padding: 10px; color: var(--text-muted); text-decoration: none; font-size: 0.85rem; margin-bottom: 8px; }

/* ─── Toggle Bar ─── */
.toggle-bar { display: inline-flex; border: 1px solid var(--border-color); border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 16px; }
.toggle-bar a { padding: 8px 16px; text-decoration: none; color: var(--text-color); font-size: 0.85rem; border-right: 1px solid var(--border-color); background: var(--card-bg); }
.toggle-bar a:last-child { border-right: none; }
.toggle-bar a.active { background: var(--primary-color); color: white; }

/* ─── Toolbar Responsive ─── */
@media (max-width: 900px) {
    .roster-toolbar { flex-wrap: wrap; gap: 6px; padding: 6px 10px; }
    .toolbar-left { order: 1; flex: 1; min-width: 0; }
    .toolbar-center { order: 2; display: none; }
    .toolbar-right { order: 3; flex-shrink: 0; }
}
@media (max-width: 600px) {
    .roster-toolbar { padding: 6px 8px; gap: 4px; }
    .toolbar-nav { gap: 2px; padding: 1px; }
    .nav-title { min-width: auto; flex: 1; font-size: 0.8rem; padding: 0 4px; }
    .nav-btn { width: 28px; height: 28px; font-size: 0.85rem; }
    .nav-btn.nav-today { padding: 0 8px; font-size: 0.7rem; }
    .toolbar-right { flex-wrap: wrap; gap: 4px; }
    .toolbar-right .btn-print { display: none; }
    .status-badge { font-size: 0.65rem; padding: 3px 8px; }
    .status-date { display: none; }
    .my-shifts-table table { font-size: 0.7rem; }
    .my-shifts-table th, .my-shifts-table td { padding: 4px 2px; word-break: break-word; overflow: hidden; text-overflow: ellipsis; }
    .card { max-width: 100%; overflow-x: auto; }
    .form-control { max-width: 100%; min-width: 0; }
}

/* ========================================
   FullCalendar v6 Overrides
   ======================================== */
#ec {
    font-family: 'Segoe UI', Arial, Helvetica, sans-serif;
    width: 100%;
    --fc-border-color: var(--border-color);
    --fc-today-bg-color: var(--today-bg);
    --fc-neutral-bg-color: #f8f8f8;
    --fc-page-bg-color: #fff;
}
#ec table { table-layout: fixed !important; width: 100% !important; }

/* FullCalendar toolbar */
#ec .fc-header-toolbar { margin-bottom: 12px !important; }
#ec .fc-toolbar-title { font-size: 1.05rem !important; font-weight: 700; }
#ec .fc-button { font-size: 0.82rem; padding: 6px 12px; border-radius: var(--radius-sm); }
#ec .fc-button-primary { background: var(--primary-color); border-color: var(--primary-color); color: white; }
/* hover removed — calendar-redesign.css enforces no-hover policy in #ec */
#ec .fc-button-primary:disabled { background: var(--border-color); border-color: var(--border-color); color: var(--text-muted); opacity: 1; }
#ec .fc-button-primary:not(:disabled).fc-button-active { background: var(--dark); border-color: var(--dark); }
#ec .fc-today-button { text-transform: none; }
#ec .fc-today-button:disabled { opacity: 0.5; }

/* Weekday column headers */
#ec .fc-col-header-cell { background: var(--dark) !important; color: #fff !important; font-weight: 700; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; padding: 8px 4px; }
#ec .fc-col-header-cell a { color: #fff !important; text-decoration: none; }

/* Day cells */
#ec .fc-daygrid-day { min-height: 80px; }
#ec .fc-daygrid-day-frame { min-height: 80px; }

/* Day number */
#ec .fc-daygrid-day-number { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: #555; padding: 6px 6px 2px; text-decoration: none; }

/* Events */
#ec .fc-daygrid-event { border-radius: 3px; font-size: 0.75rem; font-weight: 600; padding: 1px 4px; border: none; cursor: pointer; margin: 1px 2px; }
#ec .fc-event-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#ec .fc-event-time { display: none !important; }

/* Today highlight */
#ec .fc-day-today { background: var(--today-bg) !important; border: 2px solid var(--today-border) !important; }
#ec .fc-day-today .fc-daygrid-day-number { background: var(--primary-color); color: #fff !important; border-radius: 50%; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.85rem; }

/* Weekend */
#ec .fc-day-sat, #ec .fc-day-sun { background: var(--weekend-bg); }

/* Other month / past days */
#ec .fc-day-other { background: #f8f8f8; }
#ec .fc-day-other .fc-daygrid-day-number { opacity: 0.4; }
#ec .fc-past, #ec .fc-daygrid-day.fc-past { background: var(--past-bg) !important; }
#ec .fc-day-today.fc-past { background: var(--today-bg) !important; }

/* More link */
#ec .fc-daygrid-more-link { font-size: 0.7rem; font-weight: 600; color: var(--primary-color); }

/* Draft events (semi-transparent) */
#ec .fc-daygrid-event.dp-draft { opacity: 0.55; }

/* Requested leave — dashed, semi-transparent, italic */
#ec .dp-leave-requested { border: 1.5px dashed currentColor !important; opacity: 0.7; font-style: italic; }

/* Custom shifts: bold text — border width/style now driven by per-type setting (eventDidMount applies inline) */
#ec .fc-daygrid-event.dp-custom-shift { font-weight: 700; }

/* Events with transparent fill: bold text — border width/style now driven by per-type setting */
#ec .fc-daygrid-event.dp-event-transparent { font-weight: 700; }

/* List view (mobile) */
#ec .fc-list { border: 1px solid var(--border-color); border-radius: var(--radius); }
#ec .fc-list-day-cushion { background: var(--dark); color: #fff; font-weight: 600; font-size: 0.9rem; padding: 8px 12px; }
#ec .fc-list-event td { padding: 8px 12px; font-size: 0.9rem; border-bottom: 1px solid var(--border-color); }
#ec .fc-list-event-dot { border-radius: 50%; }
#ec .fc-list-event-title a { color: var(--text-color); text-decoration: none; }
#ec .fc-list-empty { padding: 24px; text-align: center; color: var(--text-muted); font-size: 0.9rem; }

/* Calendar nav link */
.dp-cal-link { font-size: 0.8rem; color: var(--primary-color); text-decoration: none; font-weight: 500; }
@media (max-width: 480px) { .dp-cal-link { display: none; } }

/* ========================================
   Calendar Redesign — Pastel Event Style
   Active only when <body class="cal-style-pastel">
   (formerly calendar-redesign.css — consolidated 2026-04-27)
   ======================================== */

body.cal-style-pastel #ec .fc-daygrid-event {
    border-radius: 9px;
    padding: 6px 8px;
    margin: 2px 4px;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.15;
    border: 1px solid rgba(0, 0, 0, 0.03);
    cursor: pointer;
    position: relative;
}

body.cal-style-pastel #ec .fc-daygrid-event .fc-event-main {
    padding: 0;
}

body.cal-style-pastel #ec .fc-event-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    display: block;
}

body.cal-style-pastel #ec .dp-event-line-main {
    display: block;
    font-weight: 700;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

body.cal-style-pastel #ec .dp-event-line-sub {
    display: block;
    margin-top: 2px;
    font-size: 0.74rem;
    font-weight: 700;
    opacity: 0.85;
    line-height: 1.1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

/* Day cells: a touch more breathing room to fit larger pills (pastel only) */
body.cal-style-pastel #ec .fc-daygrid-day-frame {
    min-height: 96px;
}

/* ─── Drafts: opacity + diagonal hatch overlay for unmistakable in-progress signal */
body.cal-style-pastel #ec .fc-daygrid-event.dp-draft {
    opacity: 0.7;
}
body.cal-style-pastel #ec .fc-daygrid-event.dp-draft::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background-image: repeating-linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.06) 0,
        rgba(0, 0, 0, 0.06) 4px,
        transparent 4px,
        transparent 9px
    );
}

/* ─── Custom shifts (Sonderdienst): bold — border width/style driven by per-type setting (eventDidMount inline) */
body.cal-style-pastel #ec .fc-daygrid-event.dp-custom-shift {
    font-weight: 700;
}
/* Other transparent events (holidays, info events): compact, colored border via per-type setting */
body.cal-style-pastel #ec .fc-daygrid-event.dp-event-transparent:not(.dp-custom-shift) {
    font-weight: 600;
    padding: 2px 8px;
    font-size: 0.75rem;
    line-height: 1.2;
}
body.cal-style-pastel #ec .fc-daygrid-event.dp-event-transparent:not(.dp-custom-shift) .fc-event-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Requested leaves: dashed dimmed italic — keep pastel-friendly */
body.cal-style-pastel #ec .fc-daygrid-event.dp-leave-requested {
    border: 1.5px dashed currentColor !important;
    opacity: 0.7;
    font-style: italic;
}

/* List-item events (leaves) → keep FullCalendar's native bullet+text look,
   no pill, no background, no border. */

/* "More" link: align with the softer look */
body.cal-style-pastel #ec .fc-daygrid-more-link {
    font-size: 0.72rem;
    font-weight: 700;
    margin: 2px 6px;
}

/* ─── Past-day events: gently desaturate so the current/future days stand out
   Applies in both solid and pastel modes (ungated). Today is excluded.
   Note: header.php injects a settings-driven override for this same selector
   that wins by source-order — the rule here is the static fallback. */
#ec .fc-past:not(.fc-day-today) .fc-daygrid-event {
    filter: saturate(0.6) opacity(0.88);
}

/* ──────────────────────────────────────────────────────────────────────
   Calendar hover suppression — surgical, not a global hammer.

   Instead of overriding "*:hover" globally (which fights with itself
   and breaks normal-state styling), we override exactly the FullCalendar
   vendor :hover rules that produce visible flicker, plus the matching
   FC CSS variables. Each override pins the hover state to the EXACT
   normal-state value of the same element — so the cascade stays
   well-defined and no element ever changes appearance on mouseover.
   ────────────────────────────────────────────────────────────────────── */

#ec {
    /* Neutralise FC's built-in "hover" CSS variables */
    --fc-button-hover-bg-color: var(--primary-color);
    --fc-button-hover-border-color: var(--primary-color);
    --fc-event-hover-bg-color: transparent;
    --fc-event-hover-border-color: transparent;
    --fc-list-event-hover-bg-color: transparent;
}

/* No transitions inside the calendar — kills any color/transform animations */
#ec * { transition: none !important; }

/* Vendor FC hover rules — neutralise each to its normal state */
#ec .fc-button-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}
#ec .fc-button-primary:not(:disabled).fc-button-active:hover {
    background-color: var(--dark);
    border-color: var(--dark);
}
#ec .fc-button:disabled:hover {
    background-color: var(--border-color);
    border-color: var(--border-color);
    color: var(--text-muted);
}
#ec .fc-daygrid-more-link:hover { background-color: transparent; }
#ec .fc-daygrid-dot-event:hover { background: transparent; }
#ec .fc-list-event:hover td      { background-color: transparent; }
#ec .fc a[data-navlink]:hover    { text-decoration: none; }
#ec .fc-list-event.fc-event-forced-url:hover a { text-decoration: none; }

/* Past-day filter must persist on hover (no "restore to full saturation") */
#ec .fc-past:not(.fc-day-today) .fc-daygrid-event:hover {
    filter: saturate(0.6) opacity(0.88);
}

/* ─── Inline-Events (Ereignisse/Feiertage neben Datum) ───
   Per JS in eventDidMount aus .fc-daygrid-day-events nach
   .fc-daygrid-day-top verschoben. Der Selektor zielt auf alle
   event-harnesses INNERHALB von day-top — dort landen sie nur, weil
   wir sie aktiv dorthin schieben. Settings-driven Pillen-Formatierung
   wird hier ueberstimmt; das Event rendert kompakt neben der Datumszahl.
   FullCalendar nutzt flex-direction: row-reverse auf .fc-daygrid-day-top,
   der appended last-child landet damit visuell links, Day-Number rechts. */
#ec .fc-daygrid-day-top { align-items: center; gap: 4px; padding: 4px 6px 0 6px; }
#ec .fc-daygrid-day-top .fc-daygrid-event-harness {
    flex: 1 1 0;
    min-width: 0;
    max-width: calc(100% - 32px);
    margin: 0 !important;
    inset: auto !important;
    position: static !important;
    height: auto !important;
}
#ec .fc-daygrid-day-top .fc-daygrid-event-harness .fc-daygrid-event,
#ec .fc-daygrid-day-top .fc-daygrid-event-harness .fc-daygrid-dot-event {
    background: transparent !important;
    border: none !important;
    padding: 0 4px !important;
    margin: 0 !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    color: #555 !important;            /* gleiche Farbe wie .fc-daygrid-day-number */
    text-transform: none !important;
    letter-spacing: 0.3px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    width: 100%;
    box-shadow: none !important;
    filter: none !important;
    text-decoration: none !important;
}
#ec .fc-daygrid-day-top .fc-daygrid-event-harness .fc-daygrid-event::after,
#ec .fc-daygrid-day-top .fc-daygrid-event-harness .fc-daygrid-event::before {
    display: none !important;
}
/* Bullet komplett unsichtbar — Settings-Style aushebeln */
#ec .fc-daygrid-day-top .fc-daygrid-event-harness .fc-daygrid-event-dot {
    display: none !important;
}
#ec .fc-daygrid-day-top .fc-daygrid-event-harness .fc-event-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

/* ─── Calendar Legend ─── */
.calendar-legend { display: flex; flex-wrap: wrap; gap: 10px 16px; padding: 12px 16px; background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow-sm); margin-top: 8px; }
.calendar-legend-item { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; font-weight: 500; color: var(--text-color); }
.calendar-legend-swatch { width: 14px; height: 14px; border-radius: 3px; flex-shrink: 0; border: 1px solid rgba(0,0,0,0.1); }
.calendar-legend-code { font-weight: 700; font-size: 0.75rem; }
.calendar-legend-name { color: var(--text-muted); font-size: 0.75rem; }

/* ─── Event Click Tooltip ─── */
.dp-event-tooltip { position: fixed; z-index: 2000; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 12px 16px; max-width: 280px; font-size: 0.85rem; line-height: 1.5; pointer-events: auto; }
.dp-event-tooltip-close { position: absolute; top: 4px; right: 8px; background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--text-muted); line-height: 1; padding: 0; }
.dp-event-tooltip-title { font-weight: 700; margin-bottom: 4px; padding-right: 20px; }
.dp-event-tooltip-detail { color: var(--text-muted); font-size: 0.8rem; }
.dp-event-tooltip-badge { display: inline-block; padding: 2px 8px; border-radius: 100px; font-size: 0.7rem; font-weight: 600; color: white; margin-top: 4px; }

/* Mobile tooltip */
@media (max-width: 768px) {
    .dp-event-tooltip { max-width: calc(100vw - 20px); left: 10px !important; }
}

/* ─── Session Timeout Warning ─── */
.session-warning { position: fixed; top: 0; left: 0; right: 0; z-index: 5000; background: var(--warning-color); color: white; text-align: center; padding: 10px 16px; font-size: 0.85rem; font-weight: 600; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.3); display: none; }
.session-warning:hover { background: #c2620a; }

/* ─── Notification Toast ─── */
.notification-toast { position: fixed; bottom: 20px; right: 20px; z-index: 4000; background: var(--primary-color); color: white; padding: 12px 20px; border-radius: var(--radius); box-shadow: var(--shadow-lg); font-size: 0.85rem; font-weight: 500; max-width: 350px; display: none; cursor: pointer; animation: slideInRight 0.3s ease; }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.notification-toast-close { background: none; border: none; color: white; font-size: 1.2rem; cursor: pointer; float: right; margin-left: 8px; line-height: 1; opacity: 0.8; }
.notification-toast-close:hover { opacity: 1; }

/* ─── Dashboard Cards ─── */
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-bottom: 16px; }
.dashboard-card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-sm); }
.dashboard-card h3 { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 8px; font-weight: 600; }
.dashboard-card .big-number { font-size: 2rem; font-weight: 700; color: var(--text-color); line-height: 1.2; }
.dashboard-card .card-link { display: inline-block; margin-top: 8px; font-size: 0.8rem; color: var(--primary-color); text-decoration: none; }
.dashboard-card .card-link:hover { text-decoration: underline; }
.dashboard-card .employee-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.dashboard-card .employee-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 100px; font-size: 0.8rem; font-weight: 600; border: 1px solid var(--border-color); background: var(--card-bg); }
.dashboard-card .employee-chip .color-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.dashboard-card .activity-list { list-style: none; padding: 0; margin: 8px 0 0 0; }
.dashboard-card .activity-list li { padding: 6px 0; border-bottom: 1px solid var(--border-color); font-size: 0.8rem; color: var(--text-color); }
.dashboard-card .activity-list li:last-child { border-bottom: none; }

/* ─── Hours Overview Table ─── */
.hours-table { width: 100%; border-collapse: collapse; }
.hours-table th, .hours-table td { padding: 8px 12px; text-align: center; border: 1px solid var(--border-color); font-size: 0.85rem; }
.hours-table th { background: var(--bg-color); font-weight: 600; font-size: 0.8rem; }
.hours-table td:first-child, .hours-table th:first-child { text-align: left; }
.hours-table .hours-match { background: #d4edda; color: #155724; }
.hours-table .hours-under { background: #fff3cd; color: #856404; }
.hours-table .hours-over { background: #f8d7da; color: #721c24; }
.hours-table .hours-leave { color: #94a3b8; font-style: italic; }
.hours-table .hours-leave-marker { color: #94a3b8; font-style: italic; font-size: 0.85em; }

/* ─── Pagination ─── */
.pagination { display: flex; gap: 4px; align-items: center; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.pagination a, .pagination span { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 8px; border: 1px solid var(--border-color); border-radius: var(--radius-sm); text-decoration: none; color: var(--text-color); font-size: 0.85rem; background: var(--card-bg); }
.pagination a:hover { background: var(--bg-color); }
.pagination .active { background: var(--primary-color); color: white; border-color: var(--primary-color); }

/* ─── System Info ─── */
.system-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.system-card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-sm); }
.system-card h3 { font-size: 0.95rem; margin-bottom: 12px; color: var(--text-color); font-weight: 700; }
.system-card dl { margin: 0; }
.system-card dt { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; margin-top: 8px; }
.system-card dt:first-child { margin-top: 0; }
.system-card dd { margin: 2px 0 0 0; font-size: 0.9rem; color: var(--text-color); }

/* ─── Print Legend ─── */
.legend-items { display: flex; flex-wrap: wrap; gap: 12px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; }
.legend-color { width: 16px; height: 16px; border-radius: 4px; }

/* ─── Settings Page ─── */
.settings-heading { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin: 20px 0 10px; padding-bottom: 6px; border-bottom: 2px solid var(--border-color); }
.settings-heading:first-of-type { margin-top: 0; }
.settings-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.settings-row > label:first-child { font-size: 0.9rem; font-weight: 600; min-width: 140px; flex-shrink: 0; }
.settings-row select { max-width: 320px; }
.settings-checkbox { display: inline-flex; align-items: center; gap: 6px; font-size: 0.9rem; cursor: pointer; }

/* Color table */
.settings-color-table { width: 100%; border-collapse: collapse; margin-bottom: 4px; }
.settings-color-table td { padding: 8px 6px; border-bottom: 1px solid var(--border-color); vertical-align: middle; font-size: 0.9rem; }
.settings-color-table td:first-child { font-weight: 600; min-width: 120px; }
.color-input { width: 32px; height: 26px; border: 1px solid var(--border-color); border-radius: 3px; cursor: pointer; padding: 1px; vertical-align: middle; }
.color-input:disabled { opacity: 0.3; cursor: not-allowed; }
.color-label { font-size: 0.8rem; color: var(--text-muted); margin-left: 4px; }
.color-toggle { font-size: 0.8rem; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; margin-left: 4px; }
.color-preview-badge { display: inline-block; padding: 2px 10px; border-radius: 3px; font-size: 0.8rem; font-weight: 600; white-space: nowrap; }

/* Entry type settings table (uniform style/color/preview per type) */
.settings-type-table { width: 100%; border-collapse: collapse; margin-bottom: 4px; }
.settings-type-table th { text-align: left; font-size: 0.75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; padding: 4px 8px 6px; border-bottom: 2px solid var(--border-color); }
.settings-type-table td { padding: 8px; border-bottom: 1px solid var(--border-color); vertical-align: middle; font-size: 0.85rem; }
.settings-type-table td:first-child { font-weight: 600; white-space: nowrap; }
.settings-type-table .form-control-sm { padding: 3px 6px; font-size: 0.82rem; }
.settings-type-table .color-preview-badge { min-width: 80px; text-align: center; }
.settings-type-table .color-cell { display: flex; align-items: center; gap: 4px; white-space: nowrap; }

/* Settings page card + sub-nav (kategorisierte Einstellungen) */
.settings-card { max-width: none; width: 100%; }
.settings-subnav {
    display: flex;
    gap: 4px;
    margin: 0 0 20px;
    padding: 0 0 8px;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}
.settings-subnav-tab {
    padding: 8px 14px;
    border-radius: 6px 6px 0 0;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    border: 1px solid transparent;
    border-bottom: 0;
    margin-bottom: -9px;
    background: transparent;
    transition: background 0.15s, color 0.15s;
}
.settings-subnav-tab:hover {
    background: var(--bg-color);
    color: var(--text-color);
}
.settings-subnav-tab.active {
    color: var(--dark);
    background: var(--card-bg, #fff);
    border-color: var(--border-color);
    border-bottom-color: var(--card-bg, #fff);
}

/* Settings pages: align all accent colors with the sidebar dark blue */
.settings-card input[type="checkbox"],
.settings-card input[type="radio"],
.settings-card input[type="range"] {
    accent-color: var(--dark);
}
.settings-card .form-control:focus {
    border-color: var(--dark);
    box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.12);
}
.settings-card .btn-primary {
    background: var(--dark);
    border-color: var(--dark);
}
.settings-card .btn-primary:hover {
    background: var(--dark-hover);
    border-color: var(--dark-hover);
}
.settings-hint { font-size: 0.78rem; }
.settings-note { font-size: 0.8rem; margin-top: 4px; }
.settings-actions { padding-top: 16px; margin-top: 16px; border-top: 1px solid var(--border-color); }
.settings-inline-row { display: flex; gap: 8px; align-items: center; }
.settings-inline-row.settings-inline-wrap { flex-wrap: wrap; }
.settings-inline-select { width: auto; }
.settings-inline-num { width: 60px; }
.settings-token-input { font-size: 0.85rem; background: #f8f9fa; }
.settings-token-actions { margin-top: 6px; }

/* ========================================
   Print Styles — A4 Optimized
   ======================================== */
@media print {
    * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; color-adjust: exact !important; }
    @page { size: A4 portrait; margin: 3mm 2mm; }

    html, body { height: auto !important; width: 100% !important; overflow: visible !important; background: white !important; font-size: 6pt !important; line-height: 1.2 !important; padding: 0 !important; margin: 0 !important; }

    .no-print, .header, .header-nav, .desktop-nav, .user-info, .btn-logout, .mobile-menu, .mobile-menu-overlay, .mobile-menu-btn, .roster-toolbar, .toolbar-left, .toolbar-center, .toolbar-right, .btn, .btn-print, .btn-primary, .btn-secondary, .btn-success, .btn-warning, .btn-danger, .modal-overlay, .modal, form, select, .event-add-btn, .event-delete-btn, .leave-action-cell, .th-leave-action, .alert, .footer, .status-badge, .status-date, .nav-btn, .nav-title, .toolbar-nav, .toolbar-select, .toolbar-label, .quick-add-group, .print-header-block, .print-footer-block, .print-legend-block { display: none !important; }

    .container { max-width: none !important; width: 100% !important; padding: 0 !important; margin: 0 !important; overflow: visible !important; }
    .card, .roster-card { box-shadow: none !important; padding: 0 !important; margin: 0 !important; overflow: visible !important; border: none !important; border-radius: 0 !important; width: 100% !important; }
    .table-container { overflow: visible !important; max-height: none !important; height: auto !important; width: 100% !important; }
}

@media screen {
    .btn-print { background: #6b7280; color: white; }
    .btn-print:hover { background: #4b5563; }
}

/* ========================================
   Responsive — Nav: Hamburger (max 1000px)
   ======================================== */
@media (max-width: 1000px) {
    .header { padding: 10px 12px; justify-content: space-between; }
    .header h1 { font-size: 1rem; flex: 1; white-space: nowrap; }

    .mobile-menu-btn { display: flex !important; flex-direction: column; justify-content: center; gap: 4px; width: 32px; height: 32px; padding: 6px; background: rgba(255,255,255,0.2); border: none; border-radius: 4px; cursor: pointer; }
    .mobile-menu-btn span { display: block; width: 100%; height: 2px; background: white; border-radius: 1px; }

    .mobile-menu-overlay { display: block; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 998; opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s; }
    .mobile-menu-overlay.open { opacity: 1; visibility: visible; }

    .mobile-menu { display: flex !important; flex-direction: column; position: fixed; top: 0; right: -280px; width: 280px; height: 100%; background: white; z-index: 999; box-shadow: -2px 0 10px rgba(0,0,0,0.2); transition: right 0.3s ease; }
    .mobile-menu.open { right: 0; }
    .mobile-menu-header { display: flex; justify-content: space-between; align-items: center; padding: 16px; background: var(--dark); color: white; }
    .mobile-menu-user { font-weight: 600; font-size: 0.95rem; }
    .mobile-menu-close { background: none; border: none; color: white; font-size: 1.5rem; cursor: pointer; padding: 0; line-height: 1; }
    .mobile-menu-links { flex: 1; padding: 8px 0; overflow-y: auto; }
    .mobile-menu-links a { display: block; padding: 14px 20px; color: var(--text-color); text-decoration: none; font-size: 0.95rem; border-bottom: 1px solid var(--border-color); }
    .mobile-menu-links a:hover, .mobile-menu-links a.active { background: var(--bg-color); color: var(--primary-color); }
    .mobile-menu-links hr { margin: 8px 16px; border: none; border-top: 1px solid var(--border-color); }
    .mobile-menu-footer { padding: 16px; border-top: 1px solid var(--border-color); }
    .btn-logout-mobile { display: block; width: 100%; padding: 12px; background: var(--danger-color); color: white; text-align: center; text-decoration: none; border-radius: var(--radius-sm); font-size: 0.9rem; }
    body.mobile-menu-open { overflow: hidden; }
}

/* ========================================
   Responsive — Compact Layout (max 1100px)
   Applies to tablets and phones in landscape.
   FullCalendar is NOT touched here except font sizes —
   it handles its own grid layout via table-layout: fixed.
   ======================================== */
@media (max-width: 1100px) {

    /* --- Base layout --- */
    body { font-size: 14px; background: #fff; }
    .container { padding: 4px 2px; display: block; }
    .card { padding: 4px 2px; border-radius: 0; box-shadow: none; border: none; border-bottom: 1px solid var(--border-color); margin-bottom: 4px; }

    /* --- Data tables (scoped — never affects #ec) --- */
    .table-container { margin: 0; border-radius: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .table-container table { font-size: 0.82rem; table-layout: auto; width: 100%; min-width: 0; }
    .table-container th, .table-container td { padding: 6px 5px; white-space: normal; word-break: break-word; vertical-align: top; }
    /* Columns that should never wrap (opt-in) */
    .table-container th.nowrap, .table-container td.nowrap,
    .table-container .status-badge, .table-container .leave-type-badge { white-space: nowrap; }
    /* Numeric / narrow columns */
    .table-container td.num, .table-container th.num { text-align: right; white-space: nowrap; }

    /* --- FullCalendar compact (font sizes only) --- */
    #ec .fc-header-toolbar { flex-wrap: wrap; gap: 4px; margin-bottom: 6px !important; }
    #ec .fc-toolbar-title { font-size: 0.88rem !important; }
    #ec .fc-button { font-size: 0.72rem; padding: 4px 8px; }
    #ec .fc-col-header-cell { font-size: 0.7rem; padding: 5px 2px; }
    #ec .fc-daygrid-day-number { font-size: 0.68rem; padding: 3px 4px 1px; }
    #ec .fc-daygrid-event { font-size: 0.65rem; padding: 0 2px; margin: 0 1px 1px; }
    #ec .fc-daygrid-day, #ec .fc-daygrid-day-frame { min-height: 50px; }
    #ec .fc-list-day-cushion { font-size: 0.78rem; padding: 5px 8px; }
    #ec .fc-list-event td { padding: 4px 8px; font-size: 0.78rem; }
    #ec .fc-list-empty { font-size: 0.78rem; }

    /* --- Calendar legend --- */
    .calendar-legend { padding: 8px 10px; gap: 6px 12px; box-shadow: none; border: 1px solid var(--border-color); border-radius: 4px; margin-top: 4px; }
    .calendar-legend-item { font-size: 0.72rem; gap: 4px; }
    .calendar-legend-swatch { width: 10px; height: 10px; }
    .calendar-legend-code, .calendar-legend-name { font-size: 0.68rem; }

    /* --- Forms & page structure --- */
    .form-row { grid-template-columns: 1fr; }
    .page-title { flex-direction: column; align-items: stretch; gap: 12px; }
    .page-title h2 { font-size: 1.2rem; }
    .page-title .btn { width: 100%; justify-content: center; }
    .shift-model-select { flex-direction: column; align-items: flex-start; gap: 4px; }
    .shift-model-select select { width: 100%; }
    .publication-status { flex-wrap: wrap; justify-content: center; text-align: center; }
    .view-toggle { width: 100%; }
    .view-toggle button, .view-toggle a { flex: 1; text-align: center; padding: 10px 8px; }

    /* --- Buttons & badges --- */
    .btn { padding: 10px 16px; }
    .btn-sm { padding: 8px 12px; }
    .btn-logout { padding: 5px 10px; font-size: 0.7rem; }
    .action-buttons { flex-direction: column; gap: 4px; }
    .action-buttons .btn { width: 100%; justify-content: center; }
    .status-badge, .leave-type-badge { font-size: 0.7rem; padding: 3px 8px; }
    .leave-type-indicator { padding: 1px 3px; font-size: 0.55rem; white-space: nowrap; }
    .alert { padding: 10px 12px; font-size: 0.85rem; }

    /* --- Modal --- */
    .modal { width: 95%; max-height: 85vh; margin: 20px auto; }
    .modal-header, .modal-body, .modal-footer { padding: 12px 16px; }

    /* --- Login --- */
    .login-container { padding: 12px; }
    .login-header { padding: 14px 18px; }
    .login-header h1 { font-size: 0.95rem; }
    .login-content { padding: 18px 18px 20px; }

    /* --- Footer --- */
    .footer { padding: 12px 16px; font-size: 0.75rem; }
}

/* Generic nowrap utility for table cells — opt-in via class.
   Prevents mid-token breaks like "2024-10-|01" on dates and codes. */
.table-container th.nowrap,
.table-container td.nowrap { white-space: nowrap; }

/* Employee color dot — reusable decoration for lists/tables.
   Dynamic color is applied via inline style on the element. */
.emp-color-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
    border: 1px solid rgba(0,0,0,0.1);
}

/* ========================================
   Responsive — Desktop with narrow content (769–1100px)
   Overrides mobile-compact rules that are too aggressive when the
   sidebar eats width or the user zooms the browser beyond 100%.
   ======================================== */
@media (min-width: 769px) and (max-width: 1100px) {
    /* Table headers must not break mid-word — column labels are short */
    .table-container th { white-space: nowrap; word-break: normal; }

    /* Data cells break at word boundaries only, never mid-token.
       Prevents "2024-10-|01", "Bearbeite|n", "Kristina Matijev|ic". */
    .table-container td { word-break: normal; overflow-wrap: break-word; }

    /* Action-button labels are short — never break mid-word */
    .table-container .action-buttons .btn { white-space: nowrap; }

    /* Keep page-title compact (title left, button right) instead of stretching */
    .page-title { flex-direction: row; align-items: center; }
    .page-title .btn { width: auto; }

    /* Action buttons stay horizontal in this range */
    .action-buttons { flex-direction: row; gap: 6px; }
    .action-buttons .btn { width: auto; }
}

/* ========================================
   Responsive — Small Phones (max 480px)
   ======================================== */
@media (max-width: 480px) {
    .header h1 { font-size: 1rem; }
    td.action-buttons { white-space: nowrap; }
}

/* ========================================
   Responsive — Login Landscape (short viewport)
   ======================================== */
@media (max-height: 500px) {
    .login-container { align-items: flex-start; min-height: auto; padding-top: 10px; }
    .login-header { padding: 10px 18px; }
    .login-header h1 { font-size: 0.9rem; }
    .login-content { padding: 14px 18px 16px; }
    .login-subtitle { font-size: 0.8rem; margin-bottom: 10px; }
    .login-card .form-group { margin-bottom: 8px; }
    .login-remember { margin: 8px 0 12px; }
}

/* ─── Portrait hint for calendar ─── */
.portrait-hint { display: none; text-align: center; padding: 8px 12px; background: var(--primary-light); color: var(--primary-color); font-size: 0.8rem; border-radius: var(--radius-sm); margin-bottom: 8px; }
@media (max-width: 767px) and (orientation: portrait) {
    .portrait-hint { display: block; }
}

/* ─── Touch-friendly ─── */
@media (hover: none) and (pointer: coarse) {
    .btn { min-height: 44px; }
    .form-control { min-height: 44px; font-size: 16px; }
    select.form-control { font-size: 16px; }
}
