/* ============================================================
   Arcade Hotel Dienstplan – Stylesheet
   Mobile-first, kein externes Framework
   ============================================================ */

/* ── CSS Custom Properties ── */
:root {
    --color-primary:       #302715;
    --color-primary-light: #4a3a1e;
    --color-primary-dark:  #1e1608;
    --color-accent:        #ddbb78;
    --color-accent-light:  #e8d0a0;
    --color-accent-dark:   #b89848;
    --color-bg:            #F7F4EF;
    --color-surface:       #FFFFFF;
    --color-text:          #2a1f12;
    --color-text-muted:    #6b5c48;
    --color-border:        #E0D5C8;
    --color-border-light:  #EDE8E0;
    --color-success:       #4CAF50;
    --color-warning:       #FF9800;
    --color-danger:        #F44336;
    --color-info:          #2196F3;

    /* Schicht-Farben */
    --shift-frueh:   #2196F3;
    --shift-spaet:   #FF9800;
    --shift-frei:    #9E9E9E;
    --shift-urlaub:  #4CAF50;
    --shift-krank:   #F44336;
    --shift-wunsch:  #9C27B0;
    --shift-sonder:  #00BCD4;
    --shift-schule:  #5C6BC0;

    /* Abstände */
    --space-xs:  4px;
    --space-sm:  8px;
    --space-md:  16px;
    --space-lg:  24px;
    --space-xl:  32px;
    --space-2xl: 48px;

    /* Typografie */
    --font-family: 'Source Sans 3', 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-size-xs:   11px;
    --font-size-sm:   13px;
    --font-size-base: 15px;
    --font-size-md:   17px;
    --font-size-lg:   20px;
    --font-size-xl:   24px;
    --font-size-2xl:  30px;
    --line-height:    1.5;

    /* Radien */
    --radius-sm:  4px;
    --radius-md:  8px;
    --radius-lg:  12px;
    --radius-xl:  16px;
    --radius-full: 9999px;

    /* Schatten */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.10), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.12), 0 4px 8px rgba(0,0,0,0.08);

    /* Navigation */
    --nav-height: 60px;
    --nav-bg:     #302715;

    /* Transition */
    --transition: 0.2s ease;
}

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family:      var(--font-family);
    font-size:        var(--font-size-base);
    line-height:      var(--line-height);
    color:            var(--color-text);
    background-color: var(--color-bg);
    min-height:       100vh;
    padding-top:      var(--nav-height);
}

a {
    color:           var(--color-primary);
    text-decoration: none;
    transition:      color var(--transition);
}
a:hover { color: var(--color-primary-light); }

img { max-width: 100%; height: auto; }

ul, ol { list-style: none; }

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color:       var(--color-text);
}

h1 { font-size: var(--font-size-xl); }
h2 { font-size: var(--font-size-lg); }
h3 { font-size: var(--font-size-md); }

p { margin-bottom: var(--space-md); }
p:last-child { margin-bottom: 0; }

/* ── Navigation ── */
.navbar {
    position:   fixed;
    top:        0;
    left:       0;
    right:      0;
    height:     var(--nav-height);
    background: var(--nav-bg);
    z-index:    1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    display:    flex;
    align-items: center;
}

.navbar-brand {
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    width:           100%;
    padding:         0 var(--space-md);
}

.brand-link {
    display:     flex;
    align-items: center;
    gap:         var(--space-sm);
    color:       #fff;
    text-decoration: none;
}
.brand-link:hover { color: var(--color-accent-light); }

.brand-icon { font-size: 22px; }

.brand-name {
    font-size:   var(--font-size-md);
    font-weight: 700;
    color:       #fff;
    letter-spacing: 0.3px;
}

.brand-subtitle {
    font-size:   var(--font-size-sm);
    color:       var(--color-accent);
    font-weight: 400;
    margin-left: 4px;
}

/* Hamburger */
.hamburger {
    display:        flex;
    flex-direction: column;
    justify-content: space-around;
    width:          36px;
    height:         36px;
    background:     transparent;
    border:         none;
    cursor:         pointer;
    padding:        6px 4px;
    border-radius:  var(--radius-sm);
    transition:     background var(--transition);
}
.hamburger:hover { background: rgba(255,255,255,0.1); }

.hamburger-line {
    display:       block;
    width:         100%;
    height:        2px;
    background:    #fff;
    border-radius: var(--radius-full);
    transition:    transform var(--transition), opacity var(--transition);
}

.hamburger.is-active .hamburger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.hamburger.is-active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.hamburger.is-active .hamburger-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Mobile Nav Menu */
.nav-menu {
    display:    none;
    position:   fixed;
    top:        var(--nav-height);
    left:       0;
    right:      0;
    background: var(--color-primary-dark);
    z-index:    999;
    padding:    var(--space-sm) 0;
    box-shadow: var(--shadow-lg);
    max-height: calc(100vh - var(--nav-height));
    overflow-y: auto;
}
.nav-menu.is-open { display: flex; flex-direction: column; }

.nav-link {
    display:     flex;
    align-items: center;
    gap:         var(--space-sm);
    padding:     12px var(--space-lg);
    color:       rgba(255,255,255,0.85);
    font-size:   var(--font-size-base);
    font-weight: 500;
    transition:  background var(--transition), color var(--transition);
    position:    relative;
}
.nav-link:hover {
    background: rgba(255,255,255,0.08);
    color:      #fff;
}
.nav-link.active {
    background: rgba(221,187,120,0.15);
    color:      var(--color-accent);
    border-left: 3px solid var(--color-accent);
}
.nav-icon { font-size: 18px; width: 24px; text-align: center; }
.nav-link-logout { color: rgba(244,67,54,0.8); }
.nav-link-logout:hover { background: rgba(244,67,54,0.1); color: #F44336; }

.nav-divider {
    height:     1px;
    background: rgba(255,255,255,0.1);
    margin:     var(--space-sm) var(--space-md);
}

.nav-user {
    padding:    var(--space-sm) var(--space-lg);
    display:    flex;
    flex-direction: column;
}
.nav-user-name {
    color:       #fff;
    font-weight: 600;
    font-size:   var(--font-size-base);
}
.nav-user-role {
    color:     var(--color-accent-light);
    font-size: var(--font-size-sm);
}

/* Page Overlay (für Mobile-Menü) */
.page-overlay {
    display:    none;
    position:   fixed;
    inset:      0;
    background: rgba(0,0,0,0.4);
    z-index:    998;
}
.page-overlay.is-active { display: block; }

/* ── Main Content ── */
.main-content {
    padding:    var(--space-md);
    max-width:  1400px;
    margin:     0 auto;
}

/* ── Page Header ── */
.page-header {
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    flex-wrap:       wrap;
    gap:             var(--space-sm);
    margin-bottom:   var(--space-lg);
    padding-bottom:  var(--space-md);
    border-bottom:   2px solid var(--color-border);
}
.page-title {
    font-size:   var(--font-size-xl);
    font-weight: 700;
    color:       var(--color-primary);
}
.page-actions {
    display:   flex;
    gap:       var(--space-sm);
    flex-wrap: wrap;
}

/* ── Cards ── */
.card {
    background:    var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow:    var(--shadow-sm);
    border:        1px solid var(--color-border-light);
    overflow:      hidden;
}
.card-header {
    padding:         var(--space-md) var(--space-lg);
    border-bottom:   1px solid var(--color-border-light);
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    background:      #FAFBFD;
}
.card-title {
    font-size:   var(--font-size-md);
    font-weight: 600;
    color:       var(--color-primary);
}
.card-body    { padding: var(--space-lg); }
.card-footer  {
    padding:     var(--space-md) var(--space-lg);
    border-top:  1px solid var(--color-border-light);
    background:  #FAFBFD;
}

/* ── Buttons ── */
.btn {
    display:         inline-flex;
    align-items:     center;
    justify-content: center;
    gap:             var(--space-xs);
    padding:         10px 18px;
    font-size:       var(--font-size-sm);
    font-weight:     600;
    font-family:     var(--font-family);
    border:          1px solid transparent;
    border-radius:   var(--radius-md);
    cursor:          pointer;
    text-decoration: none;
    transition:      background var(--transition), border-color var(--transition),
                     box-shadow var(--transition), transform var(--transition);
    white-space:     nowrap;
    user-select:     none;
    -webkit-tap-highlight-color: transparent;
    min-height:      40px;
}
.btn:active { transform: scale(0.97); }
.btn:disabled {
    opacity: 0.55;
    cursor:  not-allowed;
    pointer-events: none;
}

.btn-primary {
    background: var(--color-primary);
    color:      #fff;
    border-color: var(--color-primary);
}
.btn-primary:hover {
    background:   var(--color-primary-light);
    border-color: var(--color-primary-light);
    color: #fff;
    box-shadow:   0 2px 8px rgba(27,58,92,0.3);
}

.btn-accent {
    background: var(--color-accent);
    color:      #fff;
    border-color: var(--color-accent);
}
.btn-accent:hover {
    background: var(--color-accent-dark);
    border-color: var(--color-accent-dark);
    color: #fff;
}

.btn-secondary {
    background:   #fff;
    color:        var(--color-primary);
    border-color: var(--color-border);
}
.btn-secondary:hover {
    background:   var(--color-bg);
    border-color: var(--color-primary);
}

.btn-success {
    background:   var(--color-success);
    color:        #fff;
    border-color: var(--color-success);
}
.btn-success:hover { background: #388E3C; border-color: #388E3C; color: #fff; }

.btn-danger {
    background:   var(--color-danger);
    color:        #fff;
    border-color: var(--color-danger);
}
.btn-danger:hover { background: #C62828; border-color: #C62828; color: #fff; }

.btn-warning {
    background:   var(--color-warning);
    color:        #fff;
    border-color: var(--color-warning);
}
.btn-warning:hover { background: #E65100; border-color: #E65100; color: #fff; }

.btn-sm {
    padding:   6px 12px;
    font-size: var(--font-size-xs);
    min-height: 30px;
}
.btn-lg {
    padding:   14px 24px;
    font-size: var(--font-size-base);
    min-height: 48px;
}
.btn-block {
    display: flex;
    width:   100%;
}

.btn-group {
    display:   flex;
    gap:       var(--space-sm);
    flex-wrap: wrap;
}
.btn-group-right { justify-content: flex-end; }
.btn-group-center { justify-content: center; }

/* ── Forms ── */
.form-group {
    margin-bottom: var(--space-md);
}
.form-label {
    display:       block;
    font-size:     var(--font-size-sm);
    font-weight:   600;
    color:         var(--color-text);
    margin-bottom: var(--space-xs);
}
.form-label.required::after {
    content: ' *';
    color:   var(--color-danger);
}

.form-control {
    display:       block;
    width:         100%;
    padding:       10px 12px;
    font-size:     var(--font-size-base);
    font-family:   var(--font-family);
    color:         var(--color-text);
    background:    var(--color-surface);
    border:        1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    transition:    border-color var(--transition), box-shadow var(--transition);
    -webkit-appearance: none;
    appearance:    none;
    min-height:    44px;
}
.form-control:focus {
    outline:      none;
    border-color: var(--color-primary);
    box-shadow:   0 0 0 3px rgba(27,58,92,0.12);
}
.form-control::placeholder { color: var(--color-text-muted); }
.form-control:disabled {
    background: var(--color-bg);
    color:      var(--color-text-muted);
    cursor:     not-allowed;
}

select.form-control {
    background-image:    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235E6E82' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat:   no-repeat;
    background-position: right 10px center;
    padding-right:       36px;
}

textarea.form-control {
    min-height: 100px;
    resize:     vertical;
}

.form-text {
    font-size: var(--font-size-xs);
    color:     var(--color-text-muted);
    margin-top: var(--space-xs);
}

.form-error {
    font-size: var(--font-size-xs);
    color:     var(--color-danger);
    margin-top: var(--space-xs);
}

.form-control.is-invalid {
    border-color: var(--color-danger);
    box-shadow:   0 0 0 3px rgba(244,67,54,0.12);
}

.form-row {
    display:               grid;
    grid-template-columns: 1fr;
    gap:                   var(--space-md);
}

/* ── Tables ── */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-lg);
    box-shadow:    var(--shadow-sm);
}

.table {
    width:           100%;
    border-collapse: collapse;
    background:      var(--color-surface);
    font-size:       var(--font-size-sm);
}
.table th {
    background:    var(--color-primary);
    color:         #fff;
    font-weight:   600;
    padding:       10px 12px;
    text-align:    left;
    white-space:   nowrap;
    font-size:     var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.table td {
    padding:       10px 12px;
    border-bottom: 1px solid var(--color-border-light);
    vertical-align: middle;
}
.table tbody tr:hover { background: #FAFBFD; }
.table tbody tr:last-child td { border-bottom: none; }
.table-sm th, .table-sm td { padding: 6px 10px; }

/* ── Shift Table (Dienstplan) ── */
.schedule-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-lg);
    box-shadow:    var(--shadow-md);
    margin-bottom: var(--space-lg);
}

.schedule-table {
    width:           100%;
    min-width:       700px;
    border-collapse: separate;
    border-spacing:  0;
    background:      var(--color-surface);
    font-size:       var(--font-size-xs);
}

.schedule-table th {
    padding:     8px 6px;
    text-align:  center;
    white-space: nowrap;
    position:    sticky;
    top:         0;
    z-index:     10;
    font-size:   var(--font-size-xs);
}

.schedule-table th.col-name {
    background:  var(--color-primary);
    color:       #fff;
    text-align:  left;
    padding-left: 12px;
    min-width:   120px;
    left:        0;
    z-index:     20;
}

.schedule-table th.col-day {
    background:  var(--color-primary);
    color:       #fff;
    min-width:   110px;
}

.schedule-table th.col-day.today {
    background: var(--color-accent-dark);
}

.day-header { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.day-name   { font-weight: 600; font-size: 11px; text-transform: uppercase; }
.day-date   { font-size: 13px; font-weight: 700; }
.day-guests { font-size: 10px; color: var(--color-accent-light); }
.day-status { font-size: 14px; }

.schedule-table td {
    padding:       4px 6px;
    border-bottom: 1px solid var(--color-border-light);
    border-right:  1px solid var(--color-border-light);
    vertical-align: top;
    min-height:    50px;
}

.schedule-table td.cell-name {
    font-weight: 600;
    font-size:   var(--font-size-xs);
    color:       var(--color-text);
    white-space: nowrap;
    padding:     8px 12px;
    position:    sticky;
    left:        0;
    background:  var(--color-surface);
    z-index:     5;
    border-right: 2px solid var(--color-border);
}

.schedule-table td.cell-name .employee-dept {
    font-size:   9px;
    color:       var(--color-text-muted);
    font-weight: 400;
}

.schedule-table td.cell-shift {
    min-width:   110px;
    cursor:      pointer;
    transition:  background var(--transition);
    min-height:  50px;
}
.schedule-table td.cell-shift:hover { background: rgba(27,58,92,0.05); }
.schedule-table td.cell-shift.today { background: rgba(200,168,106,0.06); }

.cell-shift-inner {
    display:        flex;
    flex-direction: column;
    gap:            3px;
    min-height:     46px;
}

.abteilung-header {
    background:  #EEF2F8;
    font-weight: 700;
    font-size:   var(--font-size-xs);
    color:       var(--color-primary);
    padding:     6px 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.abteilung-header td { background: #EEF2F8 !important; }

/* ── Shift Badges ── */
.shift-badge {
    display:       inline-flex;
    align-items:   center;
    gap:           3px;
    padding:       3px 7px;
    border-radius: var(--radius-full);
    font-size:     10px;
    font-weight:   700;
    white-space:   nowrap;
    cursor:        pointer;
    transition:    opacity var(--transition), transform var(--transition);
    color:         #fff;
    letter-spacing: 0.3px;
    line-height:   1.3;
}
.shift-badge:hover { opacity: 0.85; transform: scale(1.04); }
.shift-badge.large { font-size: var(--font-size-sm); padding: 5px 12px; }
.shift-badge.clickable { box-shadow: 0 1px 3px rgba(0,0,0,0.2); }

.shift-badge-frueh  { background: var(--shift-frueh); }
.shift-badge-spaet  { background: var(--shift-spaet); }
.shift-badge-frei   { background: var(--shift-frei); }
.shift-badge-urlaub { background: var(--shift-urlaub); }
.shift-badge-krank  { background: var(--shift-krank); }
.shift-badge-wunsch { background: var(--shift-wunsch); }
.shift-badge-sonder { background: var(--shift-sonder); }
.shift-badge-schule { background: var(--shift-schule); }

.add-shift-btn {
    display:       flex;
    align-items:   center;
    justify-content: center;
    width:         28px;
    height:        28px;
    border-radius: 50%;
    background:    transparent;
    border:        1.5px dashed var(--color-border);
    color:         var(--color-text-muted);
    font-size:     18px;
    cursor:        pointer;
    transition:    all var(--transition);
    line-height:   1;
    margin:        4px auto;
}
.add-shift-btn:hover {
    background:   rgba(27,58,92,0.08);
    border-color: var(--color-primary);
    color:        var(--color-primary);
}

/* Konflikt-Markierungen */
.conflict-cell { background: rgba(244,67,54,0.06) !important; }
.conflict-badge {
    background:    #fff0f0;
    border:        1px solid var(--color-danger);
    color:         var(--color-danger);
    border-radius: var(--radius-sm);
    font-size:     9px;
    padding:       2px 5px;
    display:       inline-block;
    font-weight:   600;
}
.warning-row td { background: rgba(255,152,0,0.05) !important; }

/* ── Modals ── */
.modal-overlay {
    display:         none;
    position:        fixed;
    inset:           0;
    background:      rgba(0,0,0,0.55);
    z-index:         2000;
    align-items:     flex-end;
    justify-content: center;
    padding:         0;
}
.modal-overlay.is-open {
    display: flex;
}

.modal-container {
    background:      var(--color-surface);
    border-radius:   var(--radius-xl) var(--radius-xl) 0 0;
    width:           100%;
    max-height:      90vh;
    overflow-y:      auto;
    -webkit-overflow-scrolling: touch;
    box-shadow:      var(--shadow-lg);
    animation:       slideUp 0.25s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

.modal-sm { max-width: 400px; border-radius: var(--radius-xl); }

.modal-header {
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    padding:         var(--space-md) var(--space-lg);
    border-bottom:   1px solid var(--color-border-light);
    position:        sticky;
    top:             0;
    background:      var(--color-surface);
    z-index:         1;
}

.modal-title {
    font-size:   var(--font-size-md);
    font-weight: 700;
    color:       var(--color-primary);
}

.modal-close {
    background:    transparent;
    border:        none;
    font-size:     24px;
    cursor:        pointer;
    color:         var(--color-text-muted);
    width:         36px;
    height:        36px;
    display:       flex;
    align-items:   center;
    justify-content: center;
    border-radius: 50%;
    transition:    background var(--transition), color var(--transition);
    line-height:   1;
}
.modal-close:hover { background: var(--color-bg); color: var(--color-danger); }

.modal-body    { padding: var(--space-lg); }
.modal-footer  {
    padding:    var(--space-md) var(--space-lg);
    border-top: 1px solid var(--color-border-light);
    display:    flex;
    gap:        var(--space-sm);
    justify-content: flex-end;
    flex-wrap:  wrap;
}

/* ── Badges & Pills ── */
.badge {
    display:       inline-flex;
    align-items:   center;
    padding:       2px 8px;
    border-radius: var(--radius-full);
    font-size:     var(--font-size-xs);
    font-weight:   700;
    line-height:   1.4;
}
.badge-primary { background: var(--color-primary);      color: #fff; }
.badge-accent  { background: var(--color-accent);       color: #fff; }
.badge-success { background: var(--color-success);      color: #fff; }
.badge-warning { background: var(--color-warning);      color: #fff; }
.badge-danger  { background: var(--color-danger);       color: #fff; }
.badge-info    { background: var(--color-info);         color: #fff; }
.badge-muted   { background: var(--color-border);       color: var(--color-text-muted); }

/* ── Alerts ── */
.alert {
    display:       flex;
    align-items:   flex-start;
    gap:           var(--space-sm);
    padding:       var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
    font-size:     var(--font-size-sm);
    border:        1px solid transparent;
}
.alert-success {
    background:   #E8F5E9;
    border-color: #A5D6A7;
    color:        #1B5E20;
}
.alert-danger {
    background:   #FFEBEE;
    border-color: #FFCDD2;
    color:        #B71C1C;
}
.alert-warning {
    background:   #FFF8E1;
    border-color: #FFECB3;
    color:        #E65100;
}
.alert-info {
    background:   #E3F2FD;
    border-color: #BBDEFB;
    color:        #0D47A1;
}
.alert-dismissible { position: relative; padding-right: 40px; }
.alert-close {
    position:   absolute;
    right:      12px;
    top:        50%;
    transform:  translateY(-50%);
    background: none;
    border:     none;
    font-size:  20px;
    cursor:     pointer;
    opacity:    0.6;
    line-height: 1;
}
.alert-close:hover { opacity: 1; }

/* ── Toast Notifications ── */
#toast-container {
    position:       fixed;
    bottom:         var(--space-lg);
    right:          var(--space-md);
    z-index:        9999;
    display:        flex;
    flex-direction: column;
    gap:            var(--space-sm);
    max-width:      320px;
    width:          calc(100% - var(--space-xl));
}

.toast {
    display:       flex;
    align-items:   center;
    gap:           var(--space-sm);
    padding:       12px var(--space-md);
    border-radius: var(--radius-md);
    box-shadow:    var(--shadow-lg);
    font-size:     var(--font-size-sm);
    font-weight:   500;
    animation:     toastIn 0.3s ease;
    backdrop-filter: blur(4px);
}
@keyframes toastIn {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}
.toast-success { background: #1B5E20; color: #fff; }
.toast-error   { background: #B71C1C; color: #fff; }
.toast-warning { background: #E65100; color: #fff; }
.toast-info    { background: var(--color-primary); color: #fff; }

/* ── Tabs ── */
.tabs {
    display:       flex;
    gap:           0;
    border-bottom: 2px solid var(--color-border);
    margin-bottom: var(--space-lg);
    overflow-x:    auto;
    -webkit-overflow-scrolling: touch;
}
.tab-btn {
    display:     flex;
    align-items: center;
    gap:         var(--space-xs);
    padding:     10px var(--space-md);
    border:      none;
    background:  none;
    font-size:   var(--font-size-sm);
    font-weight: 600;
    color:       var(--color-text-muted);
    cursor:      pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition:  color var(--transition), border-color var(--transition);
}
.tab-btn:hover { color: var(--color-primary); }
.tab-btn.active {
    color:        var(--color-primary);
    border-color: var(--color-primary);
}
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── Week Navigation ── */
.week-nav {
    display:         flex;
    align-items:     center;
    justify-content: center;
    gap:             var(--space-md);
    margin-bottom:   var(--space-lg);
    flex-wrap:       wrap;
}
.week-nav-btn {
    display:       flex;
    align-items:   center;
    gap:           var(--space-xs);
    padding:       8px 16px;
    background:    var(--color-surface);
    border:        1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    color:         var(--color-primary);
    font-weight:   600;
    font-size:     var(--font-size-sm);
    cursor:        pointer;
    text-decoration: none;
    transition:    all var(--transition);
}
.week-nav-btn:hover {
    background:   var(--color-primary);
    color:        #fff;
    border-color: var(--color-primary);
}
.week-label {
    font-size:   var(--font-size-base);
    font-weight: 700;
    color:       var(--color-primary);
    min-width:   200px;
    text-align:  center;
}

/* ── Stats Cards ── */
.stats-grid {
    display:               grid;
    grid-template-columns: repeat(2, 1fr);
    gap:                   var(--space-md);
    margin-bottom:         var(--space-lg);
}
.stats-grid-3 { grid-template-columns: repeat(3, 1fr); }
.stat-card {
    background:    var(--color-surface);
    border-radius: var(--radius-lg);
    padding:       var(--space-md);
    box-shadow:    var(--shadow-sm);
    border-left:   4px solid var(--color-primary);
    text-align:    center;
}
.stat-card.success { border-left-color: var(--color-success); }
.stat-card.warning { border-left-color: var(--color-warning); }
.stat-card.danger  { border-left-color: var(--color-danger);  }
.stat-card.info    { border-left-color: var(--color-info);    }
.stat-value {
    font-size:   var(--font-size-2xl);
    font-weight: 700;
    color:       var(--color-primary);
    line-height: 1;
    margin-bottom: 4px;
}
.stat-label {
    font-size: var(--font-size-xs);
    color:     var(--color-text-muted);
    font-weight: 500;
}

/* ── Day Cards (Mitarbeiter Plan) ── */
.day-card {
    background:    var(--color-surface);
    border-radius: var(--radius-lg);
    border:        1px solid var(--color-border-light);
    padding:       var(--space-md);
    margin-bottom: var(--space-sm);
    display:       flex;
    align-items:   center;
    gap:           var(--space-md);
    box-shadow:    var(--shadow-sm);
}
.day-card.today { border-color: var(--color-accent); box-shadow: 0 0 0 2px rgba(200,168,106,0.2); }
.day-card-date {
    min-width:   52px;
    text-align:  center;
    flex-shrink: 0;
}
.day-card-weekday {
    font-size:   var(--font-size-xs);
    color:       var(--color-text-muted);
    text-transform: uppercase;
    font-weight: 600;
}
.day-card-num {
    font-size:   var(--font-size-xl);
    font-weight: 700;
    color:       var(--color-primary);
    line-height: 1;
}
.day-card-body {
    flex:     1;
    min-width: 0;
}
.day-card-actions { flex-shrink: 0; }

/* ── Stunden / Hours Bars ── */
.hours-bar-container {
    background:    var(--color-border-light);
    border-radius: var(--radius-full);
    height:        8px;
    overflow:      hidden;
    margin:        4px 0;
}
.hours-bar {
    height:        100%;
    border-radius: var(--radius-full);
    background:    var(--color-success);
    transition:    width 0.4s ease;
    min-width:     2px;
}
.hours-bar.over  { background: var(--color-warning); }
.hours-bar.under { background: var(--color-danger); }

/* Bar chart für Jahresübersicht */
.bar-chart {
    display:   flex;
    align-items: flex-end;
    gap:       var(--space-sm);
    height:    120px;
    padding:   0;
}
.bar-chart-item {
    flex:      1;
    display:   flex;
    flex-direction: column;
    align-items: center;
    gap:       4px;
    height:    100%;
    justify-content: flex-end;
}
.bar-chart-bar {
    width:         100%;
    background:    var(--color-primary);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    min-height:    4px;
    transition:    height 0.4s ease;
    position:      relative;
}
.bar-chart-bar.current { background: var(--color-accent); }
.bar-chart-bar.under   { background: var(--color-danger); }
.bar-chart-label {
    font-size: 9px;
    color:     var(--color-text-muted);
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

/* ── Antrag Cards ── */
.antrag-card {
    background:    var(--color-surface);
    border-radius: var(--radius-lg);
    border:        1px solid var(--color-border-light);
    padding:       var(--space-md);
    margin-bottom: var(--space-md);
    box-shadow:    var(--shadow-sm);
}
.antrag-card-header {
    display:         flex;
    justify-content: space-between;
    align-items:     flex-start;
    margin-bottom:   var(--space-sm);
    flex-wrap:       wrap;
    gap:             var(--space-sm);
}
.antrag-name    { font-weight: 700; color: var(--color-primary); }
.antrag-dates   { font-size: var(--font-size-sm); color: var(--color-text-muted); }
.antrag-actions { display: flex; gap: var(--space-sm); flex-wrap: wrap; }

/* ── Loading Spinner ── */
.spinner {
    display:        inline-block;
    width:          24px;
    height:         24px;
    border:         3px solid rgba(27,58,92,0.2);
    border-top-color: var(--color-primary);
    border-radius:  50%;
    animation:      spin 0.7s linear infinite;
}
.spinner-sm { width: 16px; height: 16px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
    position:  absolute;
    inset:     0;
    background: rgba(255,255,255,0.8);
    display:   flex;
    align-items: center;
    justify-content: center;
    z-index:   100;
    border-radius: inherit;
}

/* ── Kapazität Form ── */
.kap-grid {
    display:               grid;
    grid-template-columns: 1fr;
    gap:                   var(--space-md);
}
.kap-card {
    background:    var(--color-surface);
    border-radius: var(--radius-lg);
    border:        1px solid var(--color-border-light);
    padding:       var(--space-md);
    box-shadow:    var(--shadow-sm);
}
.kap-card-header {
    font-weight:   700;
    color:         var(--color-primary);
    margin-bottom: var(--space-sm);
    font-size:     var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.kap-inputs { display: flex; gap: var(--space-sm); flex-wrap: wrap; }
.kap-input-group {
    flex:       1;
    min-width:  80px;
}
.kap-input-group label {
    font-size:     var(--font-size-xs);
    color:         var(--color-text-muted);
    display:       block;
    margin-bottom: 4px;
}

/* ── Substitution Suggestions ── */
.vertretung-list {
    list-style: none;
    padding:    0;
    margin:     0;
}
.vertretung-item {
    display:       flex;
    align-items:   center;
    gap:           var(--space-sm);
    padding:       8px 0;
    border-bottom: 1px solid var(--color-border-light);
}
.vertretung-item:last-child { border-bottom: none; }
.vertretung-name   { font-weight: 600; flex: 1; }
.vertretung-hours  { font-size: var(--font-size-xs); color: var(--color-text-muted); }
.vertretung-badge  { }

/* ── Conflict Warnings Panel ── */
.conflicts-panel {
    background:    #FFF8E1;
    border:        1px solid #FFECB3;
    border-radius: var(--radius-md);
    padding:       var(--space-md);
    margin-bottom: var(--space-md);
}
.conflicts-title {
    font-weight:   700;
    color:         #E65100;
    margin-bottom: var(--space-sm);
    font-size:     var(--font-size-sm);
}
.conflict-item {
    display:       flex;
    align-items:   center;
    gap:           var(--space-sm);
    font-size:     var(--font-size-xs);
    color:         #BF360C;
    padding:       3px 0;
}

/* ── Urlaubs-Konto Widget ── */
.urlaub-widget {
    background:     linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    border-radius:  var(--radius-lg);
    padding:        var(--space-lg);
    color:          #fff;
    margin-bottom:  var(--space-lg);
}
.urlaub-widget-title { font-size: var(--font-size-sm); opacity: 0.8; margin-bottom: var(--space-sm); }
.urlaub-numbers {
    display: flex;
    gap:     var(--space-xl);
    flex-wrap: wrap;
}
.urlaub-number-item { text-align: center; }
.urlaub-number-val {
    font-size:   var(--font-size-2xl);
    font-weight: 700;
    line-height: 1;
}
.urlaub-number-lbl { font-size: var(--font-size-xs); opacity: 0.8; margin-top: 4px; }
.urlaub-bar-wrap {
    margin-top: var(--space-md);
    background: rgba(255,255,255,0.2);
    border-radius: var(--radius-full);
    height: 8px;
    overflow: hidden;
}
.urlaub-bar-fill {
    height:        100%;
    background:    var(--color-accent);
    border-radius: var(--radius-full);
    transition:    width 0.4s ease;
}

/* ── Utilities ── */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-xs); }
.mt-2 { margin-top: var(--space-sm); }
.mt-3 { margin-top: var(--space-md); }
.mt-4 { margin-top: var(--space-lg); }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-xs); }
.mb-2 { margin-bottom: var(--space-sm); }
.mb-3 { margin-bottom: var(--space-md); }
.mb-4 { margin-bottom: var(--space-lg); }
.ml-auto { margin-left: auto; }

.text-center   { text-align: center; }
.text-right    { text-align: right; }
.text-muted    { color: var(--color-text-muted); }
.text-success  { color: var(--color-success); }
.text-danger   { color: var(--color-danger); }
.text-warning  { color: var(--color-warning); }
.text-primary  { color: var(--color-primary); }
.text-sm       { font-size: var(--font-size-sm); }
.text-xs       { font-size: var(--font-size-xs); }
.fw-bold       { font-weight: 700; }
.fw-semibold   { font-weight: 600; }

.d-flex        { display: flex; }
.align-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm        { gap: var(--space-sm); }
.gap-md        { gap: var(--space-md); }
.flex-wrap     { flex-wrap: wrap; }
.flex-1        { flex: 1; }

.hidden        { display: none !important; }
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

.divider {
    border: none;
    border-top: 1px solid var(--color-border-light);
    margin: var(--space-md) 0;
}

/* ── Login Page ── */
.login-page {
    min-height:      100vh;
    display:         flex;
    align-items:     center;
    justify-content: center;
    background:      linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 50%, var(--color-primary-light) 100%);
    padding:         var(--space-md);
}

.login-card {
    width:         100%;
    max-width:     420px;
    background:    var(--color-surface);
    border-radius: var(--radius-xl);
    box-shadow:    var(--shadow-lg);
    overflow:      hidden;
}

.login-header {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    padding:    var(--space-2xl) var(--space-xl) var(--space-xl);
    text-align: center;
    color:      #fff;
}
.login-logo   { font-size: 48px; margin-bottom: var(--space-sm); }
.login-title  { font-size: var(--font-size-xl); font-weight: 700; color: #fff; margin-bottom: 4px; }
.login-subtitle { font-size: var(--font-size-sm); color: var(--color-accent-light); }

.login-body { padding: var(--space-xl); }

/* ── Print Styles ── */
@media print {
    .navbar, .week-nav, .page-actions, .btn, .hamburger,
    #toast-container, .modal-overlay, .add-shift-btn,
    .nav-menu { display: none !important; }

    body { background: #fff; padding-top: 0; font-size: 11px; }
    .main-content { max-width: none; padding: 0; }

    .schedule-wrapper { overflow: visible; box-shadow: none; }
    .schedule-table   { min-width: 0; font-size: 9px; }
    .schedule-table th, .schedule-table td { padding: 4px 6px; }
    .shift-badge { print-color-adjust: exact; -webkit-print-color-adjust: exact; }

    .card { box-shadow: none; border: 1px solid #ccc; }

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

/* ── Responsive: 768px (Tablet) ── */
@media (min-width: 768px) {
    body { padding-top: var(--nav-height); }

    .navbar-brand { width: auto; }
    .hamburger    { display: none; }

    .nav-menu {
        display:     flex;
        flex-direction: row;
        align-items: center;
        position:    static;
        background:  transparent;
        padding:     0;
        box-shadow:  none;
        gap:         0;
        flex:        1;
        overflow:    visible;
    }

    .nav-link {
        padding:   0 var(--space-md);
        height:    var(--nav-height);
        font-size: var(--font-size-xs);
        border-bottom: 3px solid transparent;
    }
    .nav-link.active { border-bottom-color: var(--color-accent); background: transparent; border-left: none; }
    .nav-link:hover  { background: rgba(255,255,255,0.08); }

    .nav-divider     { display: none; }
    .nav-user {
        flex-direction: column;
        padding:        0 var(--space-sm);
        margin-left:    auto;
        border-left:    1px solid rgba(255,255,255,0.15);
    }
    .nav-user-name { font-size: var(--font-size-xs); }
    .nav-user-role { font-size: 10px; }

    .main-content     { padding: var(--space-lg); }
    .stats-grid       { grid-template-columns: repeat(4, 1fr); }
    .form-row         { grid-template-columns: 1fr 1fr; }
    .kap-grid         { grid-template-columns: repeat(3, 1fr); }

    .modal-overlay { align-items: center; padding: var(--space-lg); }
    .modal-container {
        border-radius: var(--radius-xl);
        max-width:     560px;
        animation:     fadeIn 0.2s ease;
    }
    @keyframes fadeIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
}

/* ── Responsive: 1024px (Desktop) ── */
@media (min-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(4, 1fr); }
    .kap-grid   { grid-template-columns: repeat(7, 1fr); }
    .form-row   { grid-template-columns: 1fr 1fr 1fr; }
}

/* ── Responsive: 1200px ── */
@media (min-width: 1200px) {
    .main-content { padding: var(--space-xl) var(--space-2xl); }
}

/* ── Wunschfrei-Kalender — worker calendar grid ─────────────────────────── */

.wunschfrei-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin: 16px 0;
}

.wunschfrei-cell {
    border: 2px solid var(--border-color, #e0e0e0);
    border-radius: 6px;
    padding: 12px 4px;
    text-align: center;
    cursor: pointer;
    user-select: none;
    font-size: 0.85rem;
    transition: background-color 0.15s;
}

.wunschfrei-cell:hover:not(.wunschfrei-locked):not(.wunschfrei-blocked) {
    border-color: #9C27B0; /* --shift-wunsch */
}

/* Selected: worker has toggled this day */
.wunschfrei-cell.wunschfrei-selected {
    background-color: rgba(156, 39, 176, 0.15); /* --shift-wunsch 15% tint */
    border-color: #9C27B0;
    font-weight: 600;
}

/* Blocked: approved Antrag covers this day — non-interactive */
.wunschfrei-cell.wunschfrei-blocked {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
    font-style: italic;
}

/* Locked: deadline has passed for this week */
.wunschfrei-cell.wunschfrei-locked {
    cursor: default;
    opacity: 0.8;
}

.wunschfrei-locked-notice {
    color: #b00020;
    font-weight: 500;
    margin-bottom: 12px;
}

.wunschfrei-cell-day {
    font-weight: 700;
    font-size: 0.9rem;
}

.wunschfrei-cell-date {
    font-size: 0.8rem;
    color: var(--color-text-muted, #666);
    margin-top: 2px;
}

.wunschfrei-cell-label {
    font-size: 0.7rem;
    margin-top: 4px;
    color: #888;
}

@media (max-width: 600px) {
    .wunschfrei-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ── Wunschfrei preference overlay — chef Dienstplan ────────────────────── */
/* rgba(156, 39, 176, 0.12) = --shift-wunsch (#9C27B0) at 12% opacity      */
.has-wunschfrei {
    background-color: rgba(156, 39, 176, 0.12);
}
.has-wunschfrei.wunschfrei-overlay-hidden {
    background-color: unset;
}

/* ── Notification List (mitarbeiter/benachrichtigungen.php) ────────────────── */
.notification-item {
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
}
.notification-item.ungelesen {
    font-weight: 600;
    border-left: 3px solid #dc2626;
    padding-left: 13px;
}
.notification-time {
    font-size: 0.75rem;
    color: #6b7280;
    display: block;
    margin-top: 4px;
}

/* ── Mobile: 375px–480px phones ────────────────────────────────────────────── */
/* Research: 06-RESEARCH.md — Pitfalls 1–3, Pattern 1–2                        */
@media (max-width: 480px) {

    /* week-nav: remove 200px min-width that causes 3-row wrap on 375px screens */
    /* At 375px (343px usable): label + two buttons now fit in one flex row      */
    .week-label {
        min-width: 0;
        font-size: var(--font-size-sm);
    }

    /* week-nav buttons: ensure 44px minimum tap target height (WCAG 2.5.5)     */
    .week-nav-btn {
        min-height: 44px;
        padding: 8px 12px;
    }

    /* wunschfrei cells: enforce 44px min tap height; :active replaces hover     */
    .wunschfrei-cell {
        min-height: 44px;
    }

    /* Touch press feedback on wunschfrei cells (replaces desktop :hover)        */
    .wunschfrei-cell:active:not(.wunschfrei-locked):not(.wunschfrei-blocked) {
        background-color: rgba(156, 39, 176, 0.08);
    }

    /* Notification items: increase padding for comfortable touch reading        */
    .notification-item {
        padding: 14px 16px;
    }
}

/* ── Urlaub-Kalender: day dot indicators ─────────────────────────────────── */
.cal-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    margin: 1px;
}

.cal-month-cell {
    vertical-align: top;
    min-width: 40px;
    max-width: 56px;
    width: 56px;
    padding: 4px !important;
    line-height: 1.4;
}

.cal-year-table th {
    white-space: nowrap;
    font-size: 12px;
}

.cal-year-table td:first-child,
.cal-year-table th:first-child {
    width: 130px;
    min-width: 100px;
    max-width: 150px;
}

.cal-legend {
    font-size: 12px;
    color: var(--color-text-muted, #666);
}
