/* ============================================================
   unablenkbar - Internal Business Platform
   ADHD Clinic · CSS Stylesheet
   ============================================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

/* --- CSS Custom Properties --- */
:root {
    --color-primary: #825AA5;
    --color-accent: #372887;
    --color-teal: #64C8D7;
    --color-green: #37B4A0;
    --color-lime: #BED750;
    --color-text: #54595F;
    --color-text-light: #8a8f95;

    --color-white: #ffffff;
    --color-bg: #f4f3f8;
    --color-bg-alt: #f9f8fc;

    --color-success: #16a34a;
    --color-success-bg: #f0fdf4;
    --color-error: #dc2626;
    --color-error-bg: #fef2f2;
    --color-info: #2563eb;
    --color-info-bg: #eff6ff;
    --color-warning: #d97706;
    --color-warning-bg: #fffbeb;

    --color-gray-50: #f9fafb;
    --color-gray-100: #f3f4f6;
    --color-gray-200: #e5e7eb;
    --color-gray-300: #d1d5db;
    --color-gray-400: #9ca3af;
    --color-gray-500: #6b7280;
    --color-gray-600: #4b5563;
    --color-gray-700: #374151;
    --color-gray-800: #1f2937;

    --font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    --shadow-xs: 0 1px 2px rgba(55, 40, 135, 0.04);
    --shadow-sm: 0 1px 3px rgba(55, 40, 135, 0.06), 0 1px 2px rgba(55, 40, 135, 0.04);
    --shadow-md: 0 4px 6px rgba(55, 40, 135, 0.06), 0 2px 4px rgba(55, 40, 135, 0.04);
    --shadow-lg: 0 10px 20px rgba(55, 40, 135, 0.08), 0 4px 8px rgba(55, 40, 135, 0.04);
    --shadow-xl: 0 20px 40px rgba(55, 40, 135, 0.1);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-pill: 24px;
    --radius-full: 50%;

    --transition: 200ms ease;
}


/* =============================================================
   1. BASE STYLES / RESET
   ============================================================= */

*, *::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: 0.9375rem;
    font-weight: 400;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

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

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

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

::selection {
    background: rgba(130, 90, 165, 0.2);
    color: var(--color-gray-800);
}


/* =============================================================
   2. NAVBAR
   ============================================================= */

nav.navbar {
    background: var(--color-accent);
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(55, 40, 135, 0.25);
}

.navbar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.navbar-logo img {
    height: 28px;
    width: auto;
}

.navbar-logo span,
.navbar-logo a {
    color: var(--color-white);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -0.01em;
    text-decoration: none;
}

.navbar-brand {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-decoration: none;
    background: linear-gradient(135deg, var(--color-teal), var(--color-lime));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-brand:hover {
    text-decoration: none;
    opacity: 0.85;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
}

.navbar-nav a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    text-decoration: none;
    transition: all var(--transition);
    white-space: nowrap;
    position: relative;
}

.navbar-nav a:hover {
    color: var(--color-white);
    background: rgba(255, 255, 255, 0.08);
    text-decoration: none;
}

.navbar-nav a.active {
    color: var(--color-white);
    font-weight: 600;
}

.navbar-nav a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: var(--color-lime);
    border-radius: 2px;
}

.nav-tool-name {
    color: var(--color-lime) !important;
    font-weight: 600 !important;
    opacity: 1 !important;
}

.nav-sep {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.15);
    margin: 0 8px;
    flex-shrink: 0;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.8125rem;
    font-weight: 400;
}

.navbar-user .user-name {
    font-weight: 500;
    color: var(--color-white);
}

.navbar-user a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
    text-decoration: none;
    padding: 4px 10px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-pill);
    transition: all var(--transition);
}

.navbar-user a:hover {
    color: var(--color-white);
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.08);
    text-decoration: none;
}


/* =============================================================
   3. CONTAINER
   ============================================================= */

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px 24px;
}

.container-narrow {
    max-width: 960px;
    margin: 0 auto;
    padding: 20px 24px;
}

.container-wide {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px 24px;
}


/* =============================================================
   4. ALERTS
   ============================================================= */

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.4;
}

.alert-success {
    background: var(--color-success-bg);
    color: var(--color-success);
    border: 1px solid rgba(22, 163, 74, 0.15);
}

.alert-error,
.alert-danger {
    background: var(--color-error-bg);
    color: var(--color-error);
    border: 1px solid rgba(220, 38, 38, 0.15);
}

.alert-info {
    background: var(--color-info-bg);
    color: var(--color-info);
    border: 1px solid rgba(37, 99, 235, 0.15);
}

.alert-warning {
    background: var(--color-warning-bg);
    color: var(--color-warning);
    border: 1px solid rgba(217, 119, 6, 0.15);
}

.alert .close-btn {
    margin-left: auto;
    cursor: pointer;
    opacity: 0.5;
    background: none;
    border: none;
    font-size: 1.1rem;
    color: inherit;
    transition: opacity var(--transition);
}

.alert .close-btn:hover {
    opacity: 1;
}


/* =============================================================
   5. BUTTONS
   ============================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 22px;
    font-family: var(--font-family);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.4;
    border: 1.5px solid var(--color-accent);
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--color-accent);
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition);
    white-space: nowrap;
    user-select: none;
}

.btn:hover {
    background: var(--color-accent);
    color: var(--color-white);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}

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

.btn:focus-visible {
    outline: 2px solid var(--color-lime);
    outline-offset: 2px;
}

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

.btn-primary:hover {
    background: #2a1f6e;
    border-color: #2a1f6e;
    box-shadow: 0 4px 12px rgba(55, 40, 135, 0.3);
}

.btn-secondary {
    background: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}

.btn-secondary:hover {
    background: #6f4a92;
    border-color: #6f4a92;
}

.btn-success {
    background: var(--color-success);
    color: var(--color-white);
    border-color: var(--color-success);
}

.btn-success:hover {
    background: #15803d;
    border-color: #15803d;
}

.btn-danger {
    background: var(--color-error);
    color: var(--color-white);
    border-color: var(--color-error);
}

.btn-danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
}

.btn-teal {
    background: var(--color-teal);
    color: var(--color-white);
    border-color: var(--color-teal);
}

.btn-teal:hover {
    background: #50b5c4;
    border-color: #50b5c4;
}

.btn-sm {
    padding: 4px 14px;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 12px 32px;
    font-size: 1rem;
}

.btn-icon {
    padding: 6px;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
}

.btn[disabled],
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}


/* =============================================================
   6. SPREADSHEET TABLE (.spread)
   ============================================================= */

.spread-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    background: var(--color-white);
    margin-bottom: 24px;
}

.spread {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    line-height: 1.35;
}

.spread thead th {
    background: var(--color-accent);
    color: var(--color-white);
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 6px 6px;
    text-align: left;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 2px solid #2a1f6e;
}

.spread thead th:first-child {
    border-top-left-radius: var(--radius-xl);
}

.spread thead th:last-child {
    border-top-right-radius: var(--radius-xl);
}

.spread tbody td {
    padding: 2px 4px;
    border-bottom: 1px solid var(--color-gray-200);
    vertical-align: middle;
    white-space: nowrap;
}

.spread tbody tr:hover {
    background: rgba(130, 90, 165, 0.04);
}

.spread tbody tr:last-child td:first-child {
    border-bottom-left-radius: var(--radius-xl);
}

.spread tbody tr:last-child td:last-child {
    border-bottom-right-radius: var(--radius-xl);
}

/* Month row (collapsible header) */
.monat-row {
    background: #f0edfa !important;
    cursor: pointer;
    user-select: none;
}

.monat-row td {
    font-weight: 700;
    font-size: 12px;
    color: var(--color-accent);
    padding: 8px 6px !important;
    border-bottom: 2px solid #d8d0f0 !important;
}

.monat-row:hover {
    background: #e8e3f5 !important;
}

.monat-row td .expand-icon {
    display: inline-block;
    width: 16px;
    font-size: 10px;
    color: var(--color-primary);
    transition: transform var(--transition);
}

.monat-row.collapsed td .expand-icon {
    transform: rotate(-90deg);
}

/* Weekend rows */
.tag-sa,
.tag-so {
    background: var(--color-gray-50) !important;
}

.tag-sa td,
.tag-so td {
    color: var(--color-gray-400);
}

.tag-so {
    background: var(--color-gray-100) !important;
}

/* Non-working day */
.tag-frei {
    background: var(--color-gray-50) !important;
}

.tag-frei td {
    color: var(--color-gray-300);
    font-style: italic;
}

/* Total row */
.total-row {
    background: var(--color-bg-alt) !important;
}

.total-row td {
    font-weight: 700;
    border-bottom: 3px double var(--color-gray-400) !important;
    padding: 6px 4px !important;
    color: var(--color-gray-800);
}

/* Difference coloring */
.diff-pos {
    color: var(--color-success) !important;
    font-weight: 600;
}

.diff-neg {
    color: var(--color-error) !important;
    font-weight: 600;
}

/* Editable input cells */
.spread input[type="text"],
.spread input[type="number"],
.spread input[type="time"] {
    width: 100%;
    min-width: 50px;
    padding: 1px 3px;
    font-family: var(--font-family);
    font-size: 11px;
    border: 1px solid var(--color-gray-300);
    border-radius: 3px;
    background: #ffff00;
    color: var(--color-text);
    text-align: center;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.spread input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(130, 90, 165, 0.2);
    background: #fffde6;
}

/* Select dropdown for absences */
.spread select {
    padding: 1px 2px;
    font-family: var(--font-family);
    font-size: 10px;
    border: 1px solid var(--color-gray-300);
    border-radius: 3px;
    background: var(--color-white);
    color: var(--color-text);
    cursor: pointer;
    max-width: 90px;
}

.spread select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(130, 90, 165, 0.2);
}

/* Save button per row */
.spread .btn-save,
.spread .btn-ok {
    padding: 1px 8px;
    font-size: 10px;
    font-weight: 600;
    border-radius: var(--radius-pill);
    background: var(--color-success);
    color: var(--color-white);
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    line-height: 1.5;
}

.spread .btn-save:hover,
.spread .btn-ok:hover {
    background: #15803d;
    box-shadow: 0 2px 6px rgba(22, 163, 74, 0.3);
}

/* Numeric cells right-align */
.spread .num,
.spread td[data-type="number"] {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Compact column sizing helpers */
.spread .col-xs { width: 30px; }
.spread .col-sm { width: 50px; }
.spread .col-md { width: 80px; }
.spread .col-lg { width: 120px; }
.spread .col-xl { width: 160px; }


/* =============================================================
   7. KPI CARDS
   ============================================================= */

.kpi-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.kpi {
    flex: 1;
    min-width: 180px;
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--color-primary);
    transition: box-shadow var(--transition), transform var(--transition);
}

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

.kpi-green {
    border-left-color: var(--color-success);
}

.kpi-red {
    border-left-color: var(--color-error);
}

.kpi-teal {
    border-left-color: var(--color-teal);
}

.kpi-lime {
    border-left-color: var(--color-lime);
}

.kpi .kpi-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-light);
    margin-bottom: 4px;
}

.kpi .kpi-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-gray-800);
    line-height: 1.2;
}

.kpi .kpi-sub {
    font-size: 0.75rem;
    color: var(--color-text-light);
    margin-top: 2px;
}


/* =============================================================
   8. FERIEN BOX
   ============================================================= */

.ferien-box {
    background: var(--color-white);
    border-radius: var(--radius-xl);
    padding: 20px 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.ferien-box h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-accent);
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-gray-200);
}

.ferien-grid {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 6px 16px;
    align-items: center;
    font-size: 0.85rem;
}

.ferien-grid .ferien-label {
    color: var(--color-text-light);
    font-weight: 500;
}

.ferien-grid .ferien-value {
    text-align: right;
    font-weight: 600;
    color: var(--color-gray-800);
    font-variant-numeric: tabular-nums;
}

.ferien-grid .ferien-unit {
    color: var(--color-text-light);
    font-size: 0.75rem;
}

.ferien-grid .ferien-divider {
    grid-column: 1 / -1;
    height: 1px;
    background: var(--color-gray-200);
    margin: 4px 0;
}

.ferien-grid .ferien-total .ferien-label,
.ferien-grid .ferien-total .ferien-value {
    font-weight: 700;
    color: var(--color-accent);
}


/* =============================================================
   9. DASHBOARD RANKING TABLE
   ============================================================= */

.standort-section {
    background: var(--color-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    margin-bottom: 24px;
    overflow: hidden;
}

.standort-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-accent);
    margin-bottom: 14px;
}

.ranking-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.825rem;
}

.ranking-table thead th {
    background: var(--color-accent);
    color: var(--color-white);
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 8px 10px;
    text-align: left;
    white-space: nowrap;
}

.ranking-table thead th:first-child {
    border-top-left-radius: var(--radius-md);
}

.ranking-table thead th:last-child {
    border-top-right-radius: var(--radius-md);
}

.ranking-table tbody td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--color-gray-100);
    vertical-align: middle;
}

.ranking-table tbody tr:nth-child(even) {
    background: var(--color-gray-50);
}

.ranking-table tbody tr:hover {
    background: rgba(130, 90, 165, 0.04);
}

/* Total row */
.ranking-table .total-row td {
    background: var(--color-accent) !important;
    color: var(--color-white) !important;
    font-weight: 700;
    border-bottom: none;
}

.ranking-table .total-row:hover td {
    background: var(--color-accent) !important;
}

.ranking-table .total-row td:first-child {
    border-bottom-left-radius: var(--radius-md);
}

.ranking-table .total-row td:last-child {
    border-bottom-right-radius: var(--radius-md);
}

.diff-positive {
    color: var(--color-success) !important;
    font-weight: 600;
}

.diff-negative {
    color: var(--color-error) !important;
    font-weight: 600;
}

.ranking-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}


/* =============================================================
   10. FORMS
   ============================================================= */

.form-section {
    background: var(--color-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    padding: 24px 28px;
    margin-bottom: 24px;
}

.form-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-accent);
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--color-gray-200);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 24px;
}

.form-grid-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

.form-grid .full-width {
    grid-column: 1 / -1;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-light);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 8px 12px;
    font-family: var(--font-family);
    font-size: 0.875rem;
    border: 1.5px solid var(--color-gray-300);
    border-radius: var(--radius-md);
    background: var(--color-white);
    color: var(--color-text);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(130, 90, 165, 0.15);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--color-gray-400);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group input[readonly],
.form-group input:disabled {
    background: var(--color-gray-100);
    color: var(--color-gray-500);
    cursor: not-allowed;
}

.form-group .form-hint {
    font-size: 0.7rem;
    color: var(--color-gray-400);
    margin-top: 2px;
}

.form-group .form-error {
    font-size: 0.7rem;
    color: var(--color-error);
    font-weight: 500;
    margin-top: 2px;
}

.form-actions {
    display: flex;
    gap: 10px;
    padding-top: 16px;
    margin-top: 8px;
    border-top: 1px solid var(--color-gray-200);
}

.form-row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
}


/* =============================================================
   11. BADGES
   ============================================================= */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: var(--radius-pill);
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.badge-admin {
    background: rgba(55, 40, 135, 0.1);
    color: var(--color-accent);
}

.badge-hr {
    background: rgba(130, 90, 165, 0.1);
    color: var(--color-primary);
}

.badge-manager {
    background: rgba(100, 200, 215, 0.15);
    color: #3a9eab;
}

.badge-employee {
    background: rgba(55, 180, 160, 0.12);
    color: var(--color-green);
}

.badge-viewer {
    background: var(--color-gray-100);
    color: var(--color-gray-500);
}

.badge-active {
    background: rgba(22, 163, 74, 0.1);
    color: var(--color-success);
}

.badge-inactive {
    background: rgba(220, 38, 38, 0.08);
    color: var(--color-error);
}

.badge-lime {
    background: rgba(190, 215, 80, 0.2);
    color: #7a8f1a;
}


/* =============================================================
   12. DATA TABLE (Admin)
   ============================================================= */

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    background: var(--color-white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.data-table thead th {
    background: var(--color-accent);
    color: var(--color-white);
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 10px 12px;
    text-align: left;
    white-space: nowrap;
}

.data-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--color-gray-200);
    vertical-align: middle;
}

.data-table tbody tr:nth-child(even) {
    background: var(--color-gray-50);
}

.data-table tbody tr:hover {
    background: rgba(130, 90, 165, 0.04);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table .actions {
    display: flex;
    gap: 6px;
}


/* =============================================================
   13. PAGE HEADER / MA HEADER
   ============================================================= */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-gray-800);
}

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

.ma-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding: 16px 20px;
    background: var(--color-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
}

.ma-header .ma-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: var(--color-accent);
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.ma-header .ma-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-gray-800);
}

.ma-header .ma-name mark,
.ma-header .ma-name .highlight {
    background: var(--color-lime);
    color: var(--color-gray-800);
    padding: 0 6px;
    border-radius: 4px;
}

.ma-header .ma-info {
    font-size: 0.8rem;
    color: var(--color-text-light);
}

.ma-header .ma-meta {
    margin-left: auto;
    display: flex;
    gap: 8px;
    align-items: center;
}


/* =============================================================
   14. LOGIN CONTAINER
   ============================================================= */

.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-primary) 100%);
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 400px;
    background: var(--color-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 40px 36px;
    text-align: center;
}

.login-container .login-logo {
    margin-bottom: 24px;
}

.login-container .login-logo img {
    height: 40px;
    margin: 0 auto;
}

.login-container h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-accent);
    margin-bottom: 6px;
}

.login-container p {
    color: var(--color-text-light);
    font-size: 0.85rem;
    margin-bottom: 24px;
}

.login-container .form-group {
    text-align: left;
    margin-bottom: 14px;
}

.login-container .btn-primary {
    width: 100%;
    padding: 10px 24px;
    margin-top: 8px;
}

.login-container .login-footer {
    margin-top: 20px;
    font-size: 0.75rem;
    color: var(--color-gray-400);
}


/* =============================================================
   15. HOME PAGE TOOL TILES
   ============================================================= */

.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.home-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    background: var(--color-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: var(--color-text);
    transition: all var(--transition);
    cursor: pointer;
    border: 2px solid transparent;
    text-align: center;
    min-height: 180px;
}

.home-tile:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
    border-color: var(--color-primary);
    text-decoration: none;
}

.home-tile:active {
    transform: translateY(-1px);
}

.home-tile .tile-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    color: var(--color-accent);
    line-height: 1;
}

.home-tile .tile-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-gray-800);
    margin-bottom: 6px;
}

.home-tile .tile-desc {
    font-size: 0.8rem;
    color: var(--color-text-light);
    line-height: 1.4;
}

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

.home-tile.tile-accent .tile-icon,
.home-tile.tile-accent .tile-title {
    color: var(--color-white);
}

.home-tile.tile-accent .tile-desc {
    color: rgba(255, 255, 255, 0.8);
}

.home-tile.tile-accent:hover {
    border-color: var(--color-lime);
}


/* =============================================================
   UTILITY CLASSES
   ============================================================= */

/* Text */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-muted { color: var(--color-text-light); }
.text-small { font-size: 0.8rem; }
.text-xs { font-size: 0.7rem; }
.text-bold { font-weight: 700; }
.text-primary { color: var(--color-primary); }
.text-accent { color: var(--color-accent); }
.text-success { color: var(--color-success); }
.text-error { color: var(--color-error); }
.text-teal { color: var(--color-teal); }

/* Spacing */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }

/* Layout */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

/* Display */
.hidden { display: none; }
.block { display: block; }
.inline { display: inline; }

/* Card wrapper */
.card {
    background: var(--color-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    padding: 20px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--color-gray-200);
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-accent);
}

/* Dividers */
.divider {
    height: 1px;
    background: var(--color-gray-200);
    margin: 16px 0;
}

/* Loading spinner */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--color-gray-200);
    border-top-color: var(--color-primary);
    border-radius: var(--radius-full);
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Tooltip */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 10px;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--color-white);
    background: var(--color-gray-800);
    border-radius: var(--radius-sm);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
    margin-bottom: 6px;
}

[data-tooltip]:hover::after {
    opacity: 1;
}


/* =============================================================
   RESPONSIVE
   ============================================================= */

@media (max-width: 1024px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-grid-3 {
        grid-template-columns: 1fr 1fr;
    }

    .home-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

@media (max-width: 768px) {
    nav.navbar {
        flex-wrap: wrap;
        height: auto;
        padding: 8px 14px;
        gap: 6px;
    }

    .navbar-nav {
        order: 3;
        width: 100%;
        overflow-x: auto;
        padding-bottom: 4px;
        gap: 2px;
    }

    .navbar-nav a {
        font-size: 0.75rem;
        padding: 4px 10px;
    }

    .container {
        padding: 12px 14px;
    }

    .kpi-bar {
        flex-direction: column;
    }

    .kpi {
        min-width: auto;
    }

    .ma-header {
        flex-wrap: wrap;
    }

    .ma-header .ma-meta {
        margin-left: 0;
        width: 100%;
    }

    .form-grid-3 {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .spread-wrapper {
        margin: 0 -14px;
        border-radius: 0;
    }

    .home-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .home-tile {
        min-height: 140px;
        padding: 20px 16px;
    }
}

@media (max-width: 480px) {
    .home-grid {
        grid-template-columns: 1fr;
    }
}


/* =============================================================
   PRINT STYLES
   ============================================================= */

@media print {
    nav.navbar,
    .btn,
    .page-actions {
        display: none !important;
    }

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

    .container {
        max-width: 100%;
        padding: 0;
    }

    .card,
    .form-section,
    .standort-section,
    .ferien-box {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }

    .spread thead th {
        background: #372887 !important;
        color: white !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .spread input {
        border: none;
        background: none !important;
        padding: 0;
    }

    .ranking-table .total-row td {
        background: #372887 !important;
        color: white !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
