/* ==========================================================================
   CHECKLIST V1.0 Design System (Matching Official Screenshot Layout & Style)
   HELVETIA WÄRMEBEHANDLUNG AG | Target Host: http://checklist.int.helvetia-ht.ch/
   ========================================================================== */

:root {
    --sidebar-bg: #252e3d;
    --sidebar-text: #94a3b8;
    --sidebar-active-bg: #8ebdff;
    --sidebar-active-text: #0f172a;

    --bg-main: #f1f5f9;
    --card-bg: #ffffff;
    --border-light: #e2e8f0;

    --primary-blue: #38bdf8;
    --primary-blue-dark: #0284c7;
    --accent-orange: #f97316;
    --accent-green: #10b981;

    --text-dark: #0f172a;
    --text-muted: #64748b;

    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    --shadow-card: 0 10px 30px -5px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body.light-theme {
    background-color: var(--bg-main);
    color: var(--text-dark);
    font-family: var(--font-body);
    font-size: 13.5px;
    line-height: 1.45;
    min-height: 100vh;
    overflow-x: hidden;
}

/* App Container Layout */
.wartungsplan-app-container {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR (Left) - MATCHING SCREENSHOT EXACTLY */
.sidebar {
    width: 250px;
    min-width: 250px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    padding: 1.2rem 1rem;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-brand {
    padding-bottom: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    margin-bottom: 1.25rem;
}

.brand-logo-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.helvetia-logo-badge {
    flex-shrink: 0;
}

.sidebar-brand-img {
    width: 95px;
    height: auto;
    aspect-ratio: 662 / 392;
    display: block;
    object-fit: contain;
}

.brand-text-stack {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.brand-title-bold {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: 0.5px;
    line-height: 1.1;
}

.brand-title-sub {
    font-family: var(--font-heading);
    font-size: 0.82rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.5px;
    line-height: 1.1;
}

.brand-badge-status {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.35rem;
    font-size: 0.66rem;
    font-weight: 700;
    color: #94a3b8;
}

.blue-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #38bdf8;
    display: inline-block;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex-grow: 1;
}

/* ZENTRALE STATISTIK BUTTON IN SIDEBAR */
.sidebar-item.item-zentrale {
    padding: 1rem 0.9rem;
    margin-bottom: 0.85rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.sidebar-item.item-zentrale:hover {
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-item.item-zentrale.active {
    background: rgba(255, 255, 255, 0.08);
}

.zentrale-btn-content {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.sidebar-icon-large {
    width: 24px;
    height: 24px;
    color: #ffffff;
    flex-shrink: 0;
}

.zentrale-btn-text {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 0.95rem;
    line-height: 1.2;
    letter-spacing: 0.5px;
    color: #ffffff;
    text-transform: uppercase;
    text-align: left;
}

.sidebar-section-header {
    font-size: 0.68rem;
    font-weight: 800;
    color: #64748b;
    letter-spacing: 1.5px;
    margin: 0.8rem 0 0.5rem 0.5rem;
    text-transform: uppercase;
}

.dept-nav-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.sidebar-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.75rem 0.9rem;
    background: transparent;
    border: none;
    border-radius: 12px;
    color: #cbd5e1;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
}

.sidebar-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.sidebar-item-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.25;
    font-size: 0.82rem;
    word-break: break-word;
    white-space: normal;
    text-align: left;
}

/* MATCHING PASTEL BLUE ACTIVE PILL FROM SCREENSHOT */
.sidebar-item.active {
    background: var(--sidebar-active-bg) !important;
    color: var(--sidebar-active-text) !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 14px rgba(142, 189, 255, 0.35) !important;
}

.sidebar-item.active i {
    color: var(--sidebar-active-text) !important;
    opacity: 1 !important;
}

/* ==========================================================================
   EXPLORER-STYLE COLLAPSIBLE FOLDER TREE NAVIGATION
   ========================================================================== */
.dept-nav-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.tree-folder-group {
    display: flex;
    flex-direction: column;
}

.tree-folder-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.6rem 0.65rem;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: #cbd5e1;
    font-family: var(--font-body);
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    user-select: none;
}

.tree-folder-header:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.tree-folder-header.active {
    background: var(--sidebar-active-bg) !important;
    color: var(--sidebar-active-text) !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 14px rgba(142, 189, 255, 0.35) !important;
}

.tree-folder-header.active i,
.tree-folder-header.active .tree-unit-badge {
    color: var(--sidebar-active-text) !important;
}

.tree-folder-left {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
    flex-grow: 1;
}

.tree-expander {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    transition: transform 0.2s ease, background 0.15s ease;
    flex-shrink: 0;
    cursor: pointer;
}

.tree-expander:hover {
    background: rgba(255, 255, 255, 0.15);
}

.tree-folder-header.active .tree-expander:hover {
    background: rgba(15, 23, 42, 0.15);
}

.tree-folder-icon {
    width: 16px;
    height: 16px;
    opacity: 0.9;
    flex-shrink: 0;
}

.tree-folder-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.83rem;
}

.tree-unit-badge {
    font-size: 0.65rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.12);
    color: #94a3b8;
    padding: 0.1rem 0.4rem;
    border-radius: 9999px;
    flex-shrink: 0;
    margin-left: 0.3rem;
}

.tree-folder-header.active .tree-unit-badge {
    background: rgba(15, 23, 42, 0.15) !important;
    color: #0f172a !important;
}

/* SUB-TREE CHILDREN (EQUIPMENT UNITS / ANLAGEN) */
.tree-children-container {
    display: none;
    flex-direction: column;
    margin-left: 1.15rem;
    padding-left: 0.45rem;
    margin-top: 0.2rem;
    margin-bottom: 0.35rem;
    border-left: 1px dashed rgba(255, 255, 255, 0.18);
    gap: 0.2rem;
}

.tree-folder-group.expanded > .tree-children-container {
    display: flex;
}

.tree-unit-item {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
    padding: 0.42rem 0.6rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #94a3b8;
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tree-unit-item:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #f1f5f9;
}

.tree-unit-item.active {
    background: rgba(142, 189, 255, 0.22) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    border-left: 2px solid #38bdf8;
    padding-left: 0.5rem;
}

.tree-unit-icon {
    width: 13px;
    height: 13px;
    opacity: 0.75;
    flex-shrink: 0;
}

.sidebar-footer {
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sidebar-copy {
    font-size: 0.65rem;
    color: #475569;
    text-align: center;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* MAIN WRAPPER (Right Content Area) */
.main-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--bg-main);
}

/* TOP BAR */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 2rem;
    background: #ffffff;
    border-bottom: 1px solid var(--border-light);
}

.breadcrumb {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}

.breadcrumb .active-sub {
    color: var(--primary-blue-dark);
    font-weight: 700;
}

.active-dept-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-dark);
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.kpi-pill {
    display: flex;
    flex-direction: column;
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-md);
    background: #f8fafc;
    border: 1px solid var(--border-light);
    text-align: right;
}

.kpi-pill-title {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.kpi-pill-val {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--accent-green);
}

/* MAIN NAVIGATION PILL TABS SWITCHER */
.pill-tabs-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 2rem 0 2rem;
    overflow-x: auto;
}

.pill-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 1.1rem;
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.pill-tab:hover {
    background: #f8fafc;
    color: var(--text-dark);
}

.pill-tab.active {
    background: var(--primary-blue-dark);
    color: #ffffff;
    border-color: var(--primary-blue-dark);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
}

/* WORKSPACE & PANELS */
.workspace {
    padding: 1.5rem 2rem;
    flex-grow: 1;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.panel-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-card);
    padding: 1.5rem;
}

.panel-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.header-title-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-icon-badge {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    background: var(--sidebar-active-bg);
    color: var(--primary-blue-dark);
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-controls-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrapper i {
    position: absolute;
    left: 0.75rem;
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.search-input-wrapper input {
    padding: 0.55rem 0.75rem 0.55rem 2.2rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-light);
    background: #f8fafc;
    font-size: 0.78rem;
    width: 220px;
    outline: none;
    transition: all 0.2s ease;
}

.search-input-wrapper input:focus {
    background: #ffffff;
    border-color: var(--primary-blue-dark);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

/* BUTTONS */
.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.78rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--primary-blue-dark);
    color: #ffffff;
}

.btn-primary:hover {
    background: #0369a1;
}

.btn-pdf {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid var(--border-light);
}

.btn-pdf:hover {
    background: #e2e8f0;
}

/* ==========================================================================
   MATRIX TABLE & STICKY HEADERS (2020 - 2050)
   Full Equipment Name Visibility (330px width + line break wrapping)
   ========================================================================== */
.matrix-scroll-wrapper {
    width: 100%;
    max-height: calc(100vh - 280px);
    overflow: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    position: relative;
    background: #ffffff;
}

.wartungsplan-matrix-table {
    width: max-content;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.75rem;
}

/* STICKY TOP YEAR HEADERS (Row 1) */
.wartungsplan-matrix-table thead th {
    position: sticky;
    top: 0;
    z-index: 30;
    background: #f8fafc;
    border-bottom: 2px solid var(--border-light);
    padding: 0.65rem 0.5rem;
    font-family: var(--font-heading);
    font-weight: 800;
    color: var(--text-dark);
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

/* STICKY LEFT EQUIPMENT COLUMNS */
.wartungsplan-matrix-table th.sticky-head,
.wartungsplan-matrix-table td.sticky-head {
    position: sticky;
    background: #ffffff;
    z-index: 20;
    border-right: 1px solid var(--border-light);
}

/* INTERSECTION: Top Left Sticky Cells must sit ABOVE both vertical and horizontal scroll */
.wartungsplan-matrix-table thead th.sticky-head {
    z-index: 40 !important;
    background: #f1f5f9 !important;
}

.wartungsplan-matrix-table .col-actions { left: 0; width: 55px; min-width: 55px; }
.wartungsplan-matrix-table .col-aufgabe {
    left: 55px;
    width: 270px;
    min-width: 270px;
    max-width: 270px;
    white-space: normal !important;
    word-break: break-word;
}
.wartungsplan-matrix-table .col-ver { left: 325px; width: 95px; min-width: 95px; max-width: 95px; text-align: center; }
.wartungsplan-matrix-table .col-freq { left: 420px; width: 80px; min-width: 80px; text-align: center; }
.wartungsplan-matrix-table .col-baujahr { left: 500px; width: 60px; min-width: 60px; text-align: center; border-right: 2px solid #cbd5e1 !important; }

/* Table Body Styles */
.wartungsplan-matrix-table tbody tr:hover td {
    background-color: #f8fafc;
}

.wartungsplan-matrix-table tbody tr:hover td.sticky-head {
    background-color: #f1f5f9;
}

.wartungsplan-matrix-table td {
    padding: 0.6rem 0.4rem;
    border-bottom: 1px solid #f1f5f9;
    text-align: center;
    vertical-align: middle;
}

.col-aufgabe-title {
    font-weight: 700;
    color: var(--text-dark);
    display: block;
    line-height: 1.3;
}

.col-aufgabe-sub {
    font-size: 0.68rem;
    color: var(--text-muted);
    display: block;
    margin-top: 0.15rem;
}

/* YEAR COLUMNS */
.th-year-col {
    min-width: 58px;
    width: 58px;
    font-size: 0.72rem;
    white-space: nowrap;
}

.th-year-col.current-year-col {
    background: #e0f2fe !important;
    color: var(--primary-blue-dark) !important;
    border-left: 2px solid var(--primary-blue-dark);
    border-right: 2px solid var(--primary-blue-dark);
}

.year-cell-checkbox {
    width: 15px;
    height: 15px;
    accent-color: var(--primary-blue-dark);
    cursor: pointer;
}

.year-cell-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 0.68rem;
    font-weight: 800;
}

.year-cell-badge.done {
    background: #dcfce7;
    color: #15803d;
}

/* INLINE FORM: ADD TASK */
.add-task-form-card {
    margin-top: 1.25rem;
    padding: 1.1rem 1.25rem;
    background: #f8fafc;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.add-task-form-grid {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.add-task-form-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.add-task-form-row .form-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.add-task-form-row .form-field label {
    font-size: 0.68rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.add-task-form-row input,
.add-task-form-row select {
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    font-size: 0.8rem;
    background: #ffffff;
}

.btn-add-submit {
    background: var(--accent-green);
    color: #ffffff;
    white-space: nowrap;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-add-submit:hover {
    background: #059669;
}

/* JOURNAL TABLE */
.journal-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.journal-data-table th {
    background: #f8fafc;
    padding: 0.75rem 1rem;
    text-align: left;
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-dark);
    border-bottom: 1px solid var(--border-light);
}

.journal-data-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.badge-status {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
}

.badge-status.open { background: #fef3c7; color: #b45309; }
.badge-status.done { background: #dcfce7; color: #15803d; }
.badge-status.late { background: #fee2e2; color: #b91c1c; }

.row-action-btn {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    background: #ffffff;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.row-action-btn:hover { background: #f1f5f9; color: var(--text-dark); }
.row-action-btn.danger:hover { background: #fee2e2; color: #b91c1c; border-color: #fca5a5; }

/* MODALS */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal-overlay.active { opacity: 1; pointer-events: auto; }

.modal-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    width: 92%;
    max-width: 680px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    overflow: hidden;
    box-sizing: border-box;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.modal-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-sizing: border-box;
    width: 100%;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

.form-group label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
}

.form-group input, .form-group select, .form-group textarea {
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

.form-group select {
    text-overflow: ellipsis;
    overflow: hidden;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

/* ==========================================================================
   ZENTRALE STATISTIK EXECUTIVE DASHBOARD
   ========================================================================== */
.zentrale-dashboard-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.zentrale-hero-banner {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-radius: var(--radius-lg);
    padding: 1.75rem 2rem;
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.3);
}

.zentrale-hero-title h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.5px;
}

.zentrale-hero-title p {
    color: #94a3b8;
    font-size: 0.85rem;
    margin-top: 0.3rem;
}

.zentrale-kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

.zentrale-kpi-card {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    position: relative;
    overflow: hidden;
}

.zentrale-kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-blue-dark);
}

.zentrale-kpi-card.kpi-success::before { background: var(--accent-green); }
.zentrale-kpi-card.kpi-warning::before { background: #f59e0b; }
.zentrale-kpi-card.kpi-danger::before { background: #ef4444; }

.zentrale-kpi-label {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.zentrale-kpi-value {
    font-family: var(--font-heading);
    font-size: 2.1rem;
    font-weight: 800;
    color: var(--text-dark);
}

.zentrale-kpi-sub {
    font-size: 0.76rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.zentrale-dept-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.zentrale-dept-card {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.zentrale-dept-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.1);
}

.zentrale-dept-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.zentrale-dept-title {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-dark);
}

.zentrale-dept-badge {
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    background: #e0f2fe;
    color: #0284c7;
}

.zentrale-progress-track {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.zentrale-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #38bdf8 0%, #10b981 100%);
    border-radius: 4px;
    transition: width 0.4s ease;
}

.zentrale-dept-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.5rem;
    border-top: 1px solid #f1f5f9;
}

.btn-open-dept {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    border: none;
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.78rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.2s ease;
}

.btn-open-dept:hover {
    background: var(--primary-blue-dark);
    color: #ffffff;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.sidebar-copy {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.68rem;
    font-weight: 700;
    color: #64748b;
    letter-spacing: 0.5px;
    padding-left: 0.4rem;
}

/* ==========================================================================
   CUSTOM CONTEXT MENU (BOTÓN DERECHO / CONTEXTMENU)
   ========================================================================== */
.helvetia-context-menu {
    position: fixed;
    z-index: 999999;
    min-width: 230px;
    max-width: 320px;
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 12px;
    box-shadow: 0 12px 36px -4px rgba(15, 23, 42, 0.18), 0 4px 12px -2px rgba(15, 23, 42, 0.08);
    padding: 0.4rem;
    font-family: var(--font-main, 'Inter', sans-serif);
    font-size: 0.82rem;
    color: #1e293b;
    opacity: 0;
    transform: scale(0.95);
    transform-origin: top left;
    transition: opacity 0.15s cubic-bezier(0.16, 1, 0.3, 1), transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    user-select: none;
}

.helvetia-context-menu.active {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.context-menu-header {
    padding: 0.45rem 0.65rem 0.35rem 0.65rem;
    margin-bottom: 0.25rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.context-menu-title {
    font-weight: 800;
    font-size: 0.73rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.context-menu-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: 6px;
    background: #e0f2fe;
    color: #0284c7;
}

.context-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.45rem 0.65rem;
    border-radius: 7px;
    color: #334155;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
    gap: 0.6rem;
}

.context-menu-item:hover {
    background: #f0f9ff;
    color: #0284c7;
}

.context-menu-item.danger:hover {
    background: #fef2f2;
    color: #dc2626;
}

.context-menu-item-left {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.context-menu-item i,
.context-menu-item svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    color: #64748b;
    transition: color 0.12s ease;
}

.context-menu-item:hover i,
.context-menu-item:hover svg {
    color: #0284c7;
}

.context-menu-item.danger:hover i,
.context-menu-item.danger:hover svg {
    color: #dc2626;
}

.context-menu-shortcut {
    font-size: 0.68rem;
    font-weight: 600;
    color: #94a3b8;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 0.05rem 0.35rem;
    border-radius: 4px;
}

.context-menu-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 0.3rem 0;
}

