/* =============================================
   RWD Mitarbeiter-Portal – Modern Design System
   (Layout-Struktur: BAV-Style, Farben: RWD-CI)
   ============================================= */

:root {
    --sidebar-width: 260px;
    --header-height: 60px;

    /* RWD CI */
    --rwd-blue-900: #14375E;
    --rwd-blue-800: #1B4470;
    --rwd-blue-700: #1F4E7A;
    --rwd-blue-600: #2C5A8E;
    --rwd-teal-700: #1F8F75;
    --rwd-teal-600: #2BA587;
    --rwd-teal-500: #3DBFA0;

    --primary: var(--rwd-blue-700);
    --primary-dark: var(--rwd-blue-900);
    --success: #16a34a;
    --success-light: #dcfce7;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --warning: #d97706;
    --warning-light: #fef3c7;
    --info: #0891b2;
    --info-light: #e0f2fe;
    --purple: #7c3aed;
    --purple-light: #ede9fe;

    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border: #e5e7eb;
    --bg: #f3f4f6;
    --card-bg: #ffffff;
    --card-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
    --card-radius: 10px;
    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;

    /* Sidebar-Hintergrund: solides RWD-Dunkelblau (clean, kein Verlauf) */
    --sidebar-bg: #14375E;
}

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

html, body {
    margin: 0; padding: 0;
    font-family: var(--font);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg);
    height: 100%;
    /* horizontales Scrollen NIE zulassen (verhindert "verrutschte" Layouts auf Mobile) */
    overflow-x: hidden;
    /* iOS Safari: Auto-Vergrößerung von Text bei Rotation aus */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body { min-width: 320px; }

/* Bilder und Medien nie über Container hinaus */
img, video, svg { max-width: 100%; height: auto; }
table { max-width: 100%; }

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

/* ── App Layout ── */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    position: fixed;
    left: 0; top: 0;
    display: flex;
    flex-direction: column;
    z-index: 200;
    background: var(--sidebar-bg) !important;
    background-image: none !important;
}

.sidebar-header {
    padding: 20px 16px 16px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.12);
}

.sidebar-logo {
    max-width: 180px;
    max-height: 80px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    background: white;
    border-radius: 6px;
    padding: 6px 8px;
}

.sidebar-brand {
    color: rgba(255,255,255,0.85);
    font-size: 13px;
    font-weight: 500;
    margin-top: 10px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    overflow-y: auto;
}

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.user-avatar {
    width: 34px; height: 34px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.user-details { flex: 1; min-width: 0; }

.user-name {
    color: white;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    color: rgba(255,255,255,0.55);
    font-size: 11px;
}

.btn-logout {
    width: 100%;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.85);
    border-radius: 6px;
    padding: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-logout:hover { background: rgba(255,255,255,0.2); color: white; }

/* ── NavMenu ── */
.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 7px;
    color: rgba(255,255,255,0.78) !important;
    text-decoration: none !important;
    font-size: 13.5px;
    font-weight: 400;
    transition: background 0.15s, color 0.15s;
    margin-bottom: 2px;
}

.nav-link:hover {
    background: rgba(255,255,255,0.12);
    color: white !important;
}

.nav-link.active {
    background: rgba(255,255,255,0.22);
    color: white !important;
    font-weight: 600;
}

.nav-icon {
    width: 18px;
    display: inline-flex;
    justify-content: center;
    flex-shrink: 0;
}

.nav-divider {
    border-top: 1px solid rgba(255,255,255,0.1);
    margin: 8px 4px;
}

/* ── Main Wrapper ── */
.main-wrapper {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── Top Header ── */
.top-header {
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.header-left { display: flex; align-items: center; gap: 12px; flex: 1; }
.header-right { display: flex; align-items: center; gap: 12px; }

.header-title {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.header-username {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ── Main Content ── */
.main-content {
    flex: 1;
    padding: 24px;
    background: var(--bg);
}

/* ── Page Title ── */
h1, .page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 20px 0;
}
/* Blazor setzt nach Render automatisch Fokus auf h1 (Accessibility) – Browser-Outline
   und Text-Highlight unterdrücken, damit es nach Refresh nicht „markiert" aussieht. */
h1, h2, h3, .page-title { outline: none !important; }
h1:focus, h2:focus, h3:focus, .page-title:focus { outline: none !important; }

h2 { font-size: 18px; font-weight: 700; color: var(--text-primary); margin: 0 0 14px 0; }
h3 { font-size: 16px; font-weight: 600; color: var(--text-primary); margin: 0 0 12px 0; }
h4, h5, h6 { font-weight: 600; color: var(--text-primary); }

/* ── Animations (sparsam – nur wo es Mehrwert bietet) ── */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse-soft { 0%,100% { opacity: 1; } 50% { opacity: 0.6; } }

/* ── Info-Grid (robustes auto-wrappendes Grid für KPIs / Detail-Sections) ── */
.info-grid {
    display: grid;
    gap: 16px;
    margin-bottom: 24px;
}
.info-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.info-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.info-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

@media (max-width: 1199px) {
    .info-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .info-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
    .info-grid-4, .info-grid-3, .info-grid-2 { grid-template-columns: 1fr; }
}

/* Form-Grid: 2 Spalten ab Tablet, 3 ab Desktop, 4 auf großen Screens */
.form-grid {
    display: grid;
    gap: 14px 16px;
}
.form-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid-auto { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

@media (max-width: 767px) {
    .form-grid-2, .form-grid-3, .form-grid-auto { grid-template-columns: 1fr; }
}

/* ── Cards ── */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
}

.card-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    background: transparent;
    font-weight: 600;
    font-size: 13.5px;
    color: var(--text-primary);
}

.card-body { padding: 18px; }
.card-body.p-0 { padding: 0; }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.card-text { font-size: 13.5px; color: var(--text-secondary); }

/* ── Tables ── */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.table th {
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    color: var(--text-secondary);
    background: #f9fafb;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.table td {
    padding: 10px 14px;
    border-bottom: 1px solid #f3f4f6;
    color: var(--text-primary);
    vertical-align: middle;
}

.table tbody tr:hover { background: #fafafa; }
.table tbody tr:last-child td { border-bottom: none; }
.table-hover tbody tr:hover > * { background: rgba(31, 78, 122, 0.05); }
.table-sm th { padding: 8px 12px; }
.table-sm td { padding: 8px 12px; }
.table .align-middle td { vertical-align: middle; }

/* ── Badges / Pills ── */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
}

.bg-primary { background: var(--primary) !important; color: white !important; }
.bg-success { background: var(--success) !important; color: white !important; }
.bg-warning { background: var(--warning) !important; color: white !important; }
.bg-danger  { background: var(--danger) !important; color: white !important; }
.bg-secondary { background: #6c757d !important; color: white !important; }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 7px;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
}

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

.btn-success {
    background: var(--success);
    color: white;
    border-color: var(--success);
}
.btn-success:hover { background: #15803d; border-color: #15803d; color: white; }

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

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

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

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

.btn-outline-danger {
    background: white;
    color: var(--danger);
    border-color: #fca5a5;
}
.btn-outline-danger:hover { background: var(--danger-light); }

.btn-link {
    background: transparent;
    color: var(--primary);
    border: none;
    padding: 4px 8px;
}
.btn-link:hover { text-decoration: underline; color: var(--primary-dark); }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 10px 20px; font-size: 15px; }

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

/* ── Form Controls ── */
.form-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.form-control, .form-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 7px;
    font-size: 13.5px;
    color: var(--text-primary);
    background: white;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(31, 78, 122, 0.12);
}

.form-control:disabled, .form-select:disabled {
    background: #f9fafb;
    color: var(--text-muted);
}

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

.form-text {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Bootstrap-Defaults überschreiben (float/negative-margin der Inputs entfernen,
   sonst rutschen Checkboxen aus dem Container heraus) */
.form-check {
    display: flex !important;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 2px 0 !important;
    padding-left: 0 !important;
    margin-bottom: 0 !important;
    min-height: 0 !important;
}
.form-check-input {
    width: 16px; height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
    margin: 0 !important;
    float: none !important;
    flex-shrink: 0;
}
.form-check-label {
    font-size: 13.5px;
    cursor: pointer;
    margin: 0 !important;
}

.form-switch .form-check-input {
    width: 32px; height: 16px;
    accent-color: var(--primary);
}

/* ── Tabs ── */
.nav-tabs { border-bottom: 2px solid #d1d5db; display: flex; gap: 2px; flex-wrap: wrap; }
.nav-tabs .nav-link {
    color: #4b5563 !important;
    font-size: 13.5px;
    background: #f9fafb;
    border: 1px solid transparent;
    border-bottom: none;
    margin-bottom: -2px;
    border-radius: 6px 6px 0 0;
    padding: 9px 16px;
    cursor: pointer;
}
.nav-tabs .nav-link:hover { background: #eff6ff; color: var(--primary) !important; }
.nav-tabs .nav-link.active {
    color: var(--primary) !important;
    background: white;
    border-color: #d1d5db;
    border-bottom-color: white;
    font-weight: 600;
}

/* ── Alerts ── */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13.5px;
    margin-top: 12px;
}
.alert-success { background: var(--success-light); color: var(--success); border: 1px solid #86efac; }
.alert-danger  { background: var(--danger-light);  color: var(--danger);  border: 1px solid #fca5a5; }
.alert-warning { background: var(--warning-light); color: var(--warning); border: 1px solid #fcd34d; }
.alert-info    { background: var(--info-light);    color: var(--info);    border: 1px solid #7dd3fc; }
.alert.py-2 { padding-top: 8px; padding-bottom: 8px; }

/* ── List groups (Bootstrap-Kompatibilität) ── */
.list-group-flush > .list-group-item {
    background: white;
    border: 0;
    border-bottom: 1px solid var(--border);
    padding: 10px 14px;
}
.list-group-flush > .list-group-item:last-child { border-bottom: 0; }
.list-group-item-action:hover { background: #f9fafb; }

/* ── Modals (Bootstrap-Kompatibilität) ── */
.modal { display: none; }
.modal.show.d-block { display: block; }
.modal-dialog {
    margin: 5vh auto;
    max-width: 720px;
    width: calc(100% - 24px);
}
.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    overflow: hidden;
}
.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-title { font-size: 16px; font-weight: 700; margin: 0; }
.modal-body { padding: 20px; }
.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}
.btn-close {
    background: transparent;
    border: 0;
    width: 28px; height: 28px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
}
.btn-close::before { content: "\00d7"; font-size: 22px; line-height: 1; }
.btn-close:hover { background: var(--bg); }

/* ── Grid (Bootstrap-Kompatibilität) ── */
.row { display: flex; flex-wrap: wrap; margin: 0 -8px; }
.col { flex: 1; padding: 0 8px; }
.col-auto { flex: 0 0 auto; padding: 0 8px; }
.col-md-1  { flex: 0 0 8.333%;  max-width: 8.333%;  padding: 0 8px; }
.col-md-2  { flex: 0 0 16.667%; max-width: 16.667%; padding: 0 8px; }
.col-md-3  { flex: 0 0 25%;     max-width: 25%;     padding: 0 8px; }
.col-md-4  { flex: 0 0 33.333%; max-width: 33.333%; padding: 0 8px; }
.col-md-5  { flex: 0 0 41.667%; max-width: 41.667%; padding: 0 8px; }
.col-md-6  { flex: 0 0 50%;     max-width: 50%;     padding: 0 8px; }
.col-md-7  { flex: 0 0 58.333%; max-width: 58.333%; padding: 0 8px; }
.col-md-8  { flex: 0 0 66.667%; max-width: 66.667%; padding: 0 8px; }
.col-md-9  { flex: 0 0 75%;     max-width: 75%;     padding: 0 8px; }
.col-md-10 { flex: 0 0 83.333%; max-width: 83.333%; padding: 0 8px; }
.col-md-12, .col-12 { flex: 0 0 100%; max-width: 100%; padding: 0 8px; }

.g-1 { gap: 4px; }
.g-2 { gap: 8px; }
.g-3 { gap: 16px; }

/* ── Spacing ── */
.m-0 { margin: 0; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mt-auto { margin-top: auto; }
.ms-1 { margin-left: 4px; }
.ms-2 { margin-left: 8px; }
.ms-3 { margin-left: 16px; }
.me-1 { margin-right: 4px; }
.me-2 { margin-right: 8px; }
.me-3 { margin-right: 16px; }

.p-0 { padding: 0; }
.p-2 { padding: 8px; }
.p-3 { padding: 16px; }
.p-4 { padding: 24px; }
.px-3 { padding-left: 16px; padding-right: 16px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-3 { padding-top: 16px; padding-bottom: 16px; }

/* ── Flex helpers ── */
.d-flex { display: flex; }
.d-block { display: block; }
.d-inline-block { display: inline-block; }
.d-none { display: none; }
.flex-column { flex-direction: column; }
.flex-grow-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.flex-wrap { flex-wrap: wrap; }
.align-items-center { align-items: center; }
.align-items-start { align-items: flex-start; }
.align-items-end { align-items: flex-end; }
.justify-content-between { justify-content: space-between; }
.justify-content-end { justify-content: flex-end; }
.justify-content-center { justify-content: center; }
.justify-content-start { justify-content: flex-start; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 16px; }
.w-100 { width: 100%; }
.text-nowrap { white-space: nowrap; }

/* ── Text ── */
.text-end { text-align: right; }
.text-center { text-align: center; }
.text-start { text-align: left; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--primary) !important; }
.text-white { color: white; }
.text-dark { color: var(--text-primary); }
.fw-bold { font-weight: 700; }
.fw-semibold { font-weight: 600; }
.fw-normal { font-weight: 400; }
.small { font-size: 12px; }
.fst-italic { font-style: italic; }

/* ── Bootstrap-bi-Icons (Mitarbeiter-App nutzt eigene SVG-Klassen aus NavMenu.razor.css —
   die alten Klassen .bi-house-door-fill-nav-menu etc. werden weiterhin geladen über _Imports / scoped css) ── */

/* ── Code ── */
code {
    background: #f3f4f6;
    color: #be185d;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-family: 'Courier New', monospace;
}

/* === RWD Dashboard: Tool-Tiles auf der Übersicht === */
.tool-tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 22px;
    max-width: 1200px;
    margin: 0 auto;
}
.tool-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    text-decoration: none !important;
    color: var(--text-primary) !important;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 26px 22px 22px;
    min-height: 220px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(.2,.9,.3,1.2),
                box-shadow 0.4s ease,
                border-color 0.4s ease;
}
.tool-tile::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(31,78,122,0.0), rgba(43,165,135,0.10));
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}
.tool-tile::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--rwd-blue-700), var(--rwd-teal-600));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s ease;
}
.tool-tile-accent {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--tile-accent, var(--primary));
}
.tool-tile-logo {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 0 14px;
    min-height: 96px;
}
.tool-tile-logo img,
.tool-tile-logo svg {
    max-width: 75%;
    max-height: 92px;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.5s cubic-bezier(.2,.9,.3,1.2),
                filter 0.5s ease;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.06));
}
.tool-tile-body h2 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: var(--text-primary);
}
.tool-tile-body p {
    color: var(--text-secondary);
    font-size: 0.82rem;
    margin: 0;
    line-height: 1.4;
}
.tool-tile:hover {
    transform: translateY(-8px);
    border-color: transparent;
    box-shadow: 0 22px 50px rgba(20,55,94,0.18), 0 1px 2px rgba(0,0,0,0.05);
}
.tool-tile:hover::before { opacity: 1; }
.tool-tile:hover::after  { transform: scaleX(1); }
.tool-tile:hover .tool-tile-logo img,
.tool-tile:hover .tool-tile-logo svg {
    transform: scale(1.08) rotate(-1deg);
    filter: drop-shadow(0 10px 22px rgba(0,0,0,0.18));
}

/* === Sidebar-Logo: PNG statt Text === */
.sidebar-logo-img {
    max-width: 170px;
    max-height: 60px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 6px;
    padding: 8px 12px;
}

/* === Login-Card-Logo === */
.login-logo-img {
    display: block;
    max-width: 180px;
    height: auto;
    margin: 0 auto 1.5rem;
}

/* ── Misc ── */
.shadow-sm { box-shadow: var(--card-shadow); }
.rounded { border-radius: var(--card-radius); }
.border-top { border-top: 1px solid var(--border); }
.sticky-top { position: sticky; top: 0; z-index: 10; background: white; }
.w-100 { width: 100%; }

.blazor-error-boundary {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    padding: 16px;
    color: var(--danger);
    margin: 16px;
}
.blazor-error-boundary::after { content: "Ein Fehler ist aufgetreten. Bitte die Seite neu laden."; }

/* ── Login / Auth-Seiten (EmptyLayout) ── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #14375E;
    padding: 16px;
}

.login-card {
    background: white;
    border-radius: 14px;
    padding: 36px 32px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    border-top: 4px solid var(--rwd-teal-600);
}

.login-logo {
    display: block;
    max-width: 200px;
    width: 100%;
    height: auto;
    margin: 0 auto 1.5rem;
}

/* ── Loading ── */
.loading-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-muted);
    gap: 12px;
}
.loading-wrapper span { animation: pulse-soft 1.5s ease infinite; }

/* ── Hamburger Button (nur mobil sichtbar) ── */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    flex-direction: column;
    gap: 5px;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.hamburger-btn:hover { background: var(--bg); }
.hamburger-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.25s;
}
.hamburger-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger-btn.open span:nth-child(2) { opacity: 0; }
.hamburger-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Sidebar Overlay (Mobile-Dimmer) ── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 190;
    animation: fadeIn 0.2s ease;
}
.sidebar-overlay.visible { display: block; }

/* =============================================
   MOBILE & TABLET – Responsive
   ============================================= */

/* Tablet & Mobile: Sidebar als Drawer */
@media (max-width: 1023px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.28s ease;
        z-index: 200;
        box-shadow: none;
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0,0,0,0.18);
    }
    .main-wrapper { margin-left: 0; min-width: 0; }
    .hamburger-btn { display: flex; }
    .top-header { padding: 0 14px; }
    .main-content { padding: 16px; }

    /* KPI-Grids und Form-Grids dürfen NIE auseinanderfallen */
    .info-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .info-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    /* Tabellen-Wrapper ohne Wrapper trotzdem horizontal scrollbar */
    .card > .table,
    .card-body > .table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Smartphone */
@media (max-width: 767px) {
    html, body { font-size: 14px; }

    /* Sidebar etwas breiter für Touch */
    .sidebar { width: 280px; }
    .main-wrapper { margin-left: 0; min-width: 0; }
    .main-content { padding: 12px; }

    /* Top-Header kompakter */
    .top-header {
        padding: 0 12px;
        height: 52px;
        gap: 8px;
    }
    .header-username { display: none; } /* Username steht eh im Sidebar-Footer */

    /* Sidebar offen → Body nicht mitscrollen */
    body:has(.sidebar.open) { overflow: hidden; }

    /* Bootstrap-Grid auf Mobile = volle Breite */
    .col-md-1, .col-md-2, .col-md-3, .col-md-4,
    .col-md-5, .col-md-6, .col-md-7, .col-md-8,
    .col-md-9, .col-md-10 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    .col { flex: 0 0 100%; max-width: 100%; }
    .row { gap: 10px 0; }
    .g-2, .g-3 { gap: 10px; }

    /* Info-/Form-Grids alle 1-spaltig */
    .info-grid, .info-grid-2, .info-grid-3, .info-grid-4,
    .form-grid, .form-grid-2, .form-grid-3, .form-grid-auto {
        grid-template-columns: 1fr !important;
        gap: 10px;
    }
    /* Inline-style-Overrides aus ManagerDetail (2fr 1fr 1fr) zurücksetzen */
    .info-grid[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }

    /* Cards kompakter */
    .card-header { padding: 12px 14px; }
    .card-body { padding: 14px; }

    /* Tabellen: horizontal scrollbar */
    .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .table th, .table td { padding: 9px 10px; white-space: nowrap; }
    .table-sm th, .table-sm td { padding: 8px 8px; }

    /* Buttons: touch-freundlich (min 40px Hitfläche) */
    .btn {
        padding: 10px 14px;
        font-size: 14px;
        min-height: 40px;
    }
    .btn-sm { padding: 8px 12px; font-size: 13px; min-height: 36px; }

    /* Buttongruppen wrappen automatisch */
    .d-flex.gap-2, .d-flex.gap-3 { flex-wrap: wrap; }

    /* Formulare: 16px verhindert iOS Auto-Zoom; größere Hitfläche */
    .form-control, .form-select {
        font-size: 16px;
        padding: 10px 12px;
        min-height: 42px;
    }
    textarea.form-control { min-height: 80px; }

    /* Header-Bereich von Detail-Seiten (Avatar + Name + Buttons) wrappt sauber */
    .d-flex.justify-content-between.align-items-start,
    .d-flex.justify-content-between.align-items-center { flex-wrap: wrap; gap: 10px; }

    /* Login-Card responsive */
    .login-card {
        padding: 24px 18px;
        border-radius: 10px;
        max-width: calc(100vw - 24px);
    }
    .login-logo { max-width: 160px; }

    /* Modal als Bottom-Sheet auf Mobile (kein versehentliches Skalieren) */
    .modal.show.d-block { padding: 0; }
    .modal-dialog {
        margin: 0;
        max-width: 100%;
        width: 100%;
        position: fixed;
        bottom: 0; left: 0; right: 0;
        max-height: 92vh;
        animation: slideUpSheet 0.25s ease;
    }
    .modal-content {
        border-radius: 14px 14px 0 0;
        max-height: 92vh;
        overflow-y: auto;
    }
    @keyframes slideUpSheet {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }

    /* Ranking / Details: keine fixen min-widths sprengen */
    .toggle-pill { width: 100%; justify-content: center; }
    .toggle-pill .btn { flex: 1; }
}

/* Smartphone-Feintuning (greift zusätzlich zum 767px-Block oben) */
@media (max-width: 767px) {
    /* Page-Header kompakter, mehr Platz für Inhalt */
    h1, .page-title { font-size: 20px; margin: 0 0 14px 0; }
    h2 { font-size: 17px; }
    h3 { font-size: 15px; margin-bottom: 10px; }

    /* Big-Number-Kacheln (bAV, KPI) auf Mobile kleiner damit nichts überläuft */
    .card-body div[style*="font-size:32px"],
    .card-body div[style*="font-size: 32px"] {
        font-size: 24px !important;
    }

    /* Date/Time-Inputs: gleiche Touch-Größe wie andere Inputs */
    input[type="date"], input[type="time"], input[type="datetime-local"] {
        min-height: 44px;
        font-size: 16px;
        padding: 10px 12px;
    }

    /* Toggle-Pills sollen volle Breite + Buttons gleich groß */
    .toggle-pill {
        width: 100%;
        display: flex;
    }
    .toggle-pill .btn {
        flex: 1;
        padding: 10px 8px;
        font-size: 13.5px;
    }

    /* Header-Zeilen mit Titel + Toggle/Button immer voll-breit umbrechen */
    .d-flex.justify-content-between.align-items-center.flex-wrap > * {
        min-width: 0;
    }

    /* Sticky-Footer-Bars: einheitliche Mobile-Behandlung mit Safe-Area */
    .ds-sticky-bar, .pflicht-footer {
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }

    /* Kalender-Tabelle (admin/urlaub) muss horizontal scrollen können */
    .kal-wrap { -webkit-overflow-scrolling: touch; }
    .kal-table th, .kal-table td { min-width: 22px; height: 26px; font-size: 11px; }
    .kal-table th.kal-name, .kal-table td.kal-name { min-width: 130px; font-size: 12px; }

    /* Card-Inhalt etwas engerer */
    .card-body { padding: 12px; }
    .card-header { padding: 10px 12px; font-size: 13px; }

    /* Badges in Tabellenzellen sollen nicht expandieren */
    .table td .badge { white-space: nowrap; }

    /* Avatar im Sidebar-Footer kleiner damit Name nicht abgeschnitten wird */
    .user-avatar { width: 30px; height: 30px; font-size: 13px; }
}

/* Sehr kleine Phones (≤400px) */
@media (max-width: 400px) {
    .info-grid, .info-grid-2, .info-grid-3, .info-grid-4 { grid-template-columns: 1fr !important; }
    .login-card { padding: 20px 14px; }
    h1, .page-title { font-size: 18px; }
    .kpi-tile .kpi-num, .kpi-num { font-size: 22px; }
    .main-content { padding: 10px 8px; }
    .card-body div[style*="font-size:32px"],
    .card-body div[style*="font-size: 32px"] {
        font-size: 20px !important;
    }
    .toggle-pill .btn { padding: 8px 4px; font-size: 12.5px; }
}

/* === Page-Transition (Dashboard <-> Tool — wirken wie eine App) === */
html { background: var(--rwd-blue-900, #14375E); }
@keyframes rwdPageEnter { from { opacity: 0; } to { opacity: 1; } }
@keyframes rwdPageLeave { from { opacity: 1; } to { opacity: 0; } }
body { animation: rwdPageEnter 0.28s ease-out both; }
body.rwd-leaving { animation: rwdPageLeave 0.18s ease-in both; }
