/* ========================================
   dm-Cockpit - Styles
   ======================================== */

/* Font Faces */
@font-face {
    font-family: 'DMOffice';
    src: url('../fonts/DMOffice-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'DMOffice';
    src: url('../fonts/DMOffice-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'DMOffice';
    src: url('../fonts/DMOffice-Italic.ttf') format('truetype');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

/* CSS Variables */
:root {
    --color-primary: #0ea5e9;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-surface: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.08);
}

* {
    font-family: 'DMOffice', system-ui, sans-serif;
}

body {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%);
    min-height: 100vh;
}

/* Dark Mode */
.dark body {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
}

.dark .card {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.12);
}

.dark .input {
    background: #334155;
    border-color: #475569;
    color: #f1f5f9;
}

.dark .input:hover {
    border-color: #64748b;
    background: #3f4f63;
}

.dark .input:focus {
    border-color: var(--color-primary);
    background: #3f4f63;
}

.dark .label {
    color: #94a3b8;
}

.dark .year-card {
    background: #334155;
    border-color: #475569;
}

.dark .year-card:hover {
    background: #3f4f63;
    border-color: #64748b;
}

.dark .year-card.base {
    background: linear-gradient(135deg, #1e3a5f 0%, #1e3a5f 100%);
    border-color: #3b82f6;
}

.dark .data-table tbody tr {
    background: #1e293b;
}

.dark .data-table tbody tr:hover {
    background: #334155;
}

.dark .data-table tbody tr.base-row {
    background: #1e3a5f;
}

.dark .data-table tbody td {
    border-color: #334155;
    color: #cbd5e1;
}

.dark nav {
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(255, 255, 255, 0.1);
}

.dark footer {
    background: rgba(30, 41, 59, 0.5);
    border-color: rgba(255, 255, 255, 0.1);
}

.dark .text-gray-900 { color: #f1f5f9; }
.dark .text-gray-800 { color: #e2e8f0; }
.dark .text-gray-700 { color: #cbd5e1; }
.dark .text-gray-600 { color: #94a3b8; }
.dark .text-gray-500 { color: #64748b; }
.dark .text-gray-400 { color: #475569; }

/* Card Styles */
.card {
    background: var(--color-surface);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

/* Input Styles */
.input {
    width: 100%;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    transition: all 0.2s ease;
}

.input:hover {
    border-color: #cbd5e1;
    background: #fff;
}

.input:focus {
    outline: none;
    border-color: var(--color-primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.input-with-suffix {
    padding-right: 36px;
}

.input-suffix {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 13px;
    font-weight: 600;
    pointer-events: none;
}

/* Label Styles */
.label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 6px;
    letter-spacing: 0.025em;
}

/* Button Styles */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;
    font-size: 13px;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(14, 165, 233, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(14, 165, 233, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #f1f5f9;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
    border-radius: 8px;
    border: 1.5px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

.dark .btn-secondary {
    background: #334155;
    color: #cbd5e1;
    border-color: #475569;
}

.dark .btn-secondary:hover {
    background: #3f4f63;
    border-color: #64748b;
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: #fee2e2;
    color: #ef4444;
}

.btn-icon-neutral:hover {
    background: #f1f5f9;
    color: #64748b;
}

.dark .btn-icon-neutral:hover {
    background: #334155;
    color: #cbd5e1;
}

/* Year Card */
.year-card {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px;
    transition: all 0.2s ease;
}

.year-card:hover {
    border-color: #cbd5e1;
    background: #fff;
}

.year-card.base {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-color: #bae6fd;
}

.year-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    color: white;
}

/* Stats Card */
.stat-card {
    padding: 16px 20px;
    border-radius: 14px;
    transition: all 0.25s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

/* Table */
.table-container {
    overflow-x: auto;
    margin: 0 -20px;
    padding: 0 20px;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}

.data-table thead th {
    background: #1e293b;
    color: white;
    padding: 14px 16px;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table thead th:first-child {
    border-radius: 10px 0 0 0;
}

.data-table thead th:last-child {
    border-radius: 0 10px 0 0;
}

.data-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    color: #475569;
}

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

.data-table tbody tr:last-child td:first-child {
    border-radius: 0 0 0 10px;
}

.data-table tbody tr:last-child td:last-child {
    border-radius: 0 0 10px 0;
}

.data-table tbody tr {
    background: white;
    transition: background 0.15s ease;
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

.data-table tbody tr.base-row {
    background: #f0f9ff;
}

/* Value Styles */
.value-positive {
    color: #10b981;
    font-weight: 600;
}

.value-negative {
    color: #ef4444;
    font-weight: 600;
}

.value-highlight {
    color: #0ea5e9;
    font-weight: 700;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeInUp 0.4s ease-out forwards;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.dark ::-webkit-scrollbar-thumb {
    background: #475569;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Responsive */
@media (max-width: 768px) {
    .stat-card {
        padding: 14px 16px;
    }
}

/* Number input */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    opacity: 0;
}

input[type=number]:hover::-webkit-inner-spin-button,
input[type=number]:hover::-webkit-outer-spin-button {
    opacity: 0.7;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #1e293b;
    color: white;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    background: linear-gradient(135deg, #10b981, #059669);
}

.toast.info {
    background: linear-gradient(135deg, #0ea5e9, #0284c7);
}

/* Modal */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: white;
    border-radius: 20px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    z-index: 101;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.modal.show {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.dark .modal {
    background: #1e293b;
}

/* Print Styles */
@media print {
    body { background: white !important; }
    nav, footer, .btn-primary, .btn-secondary, .btn-icon, .no-print, .sidebar { display: none !important; }
    .card { box-shadow: none !important; border: 1px solid #e2e8f0 !important; }
    .stat-card { box-shadow: none !important; }
    .main-content { margin-left: 0 !important; }
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 260px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-right: 1px solid #e2e8f0;
    z-index: 60;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.dark .sidebar {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.dark .sidebar-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
}

.sidebar-logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-logo-text {
    color: #1e293b;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.dark .sidebar-logo-text {
    color: white;
}

.sidebar-logo-sub {
    color: #94a3b8;
    font-size: 11px;
    font-weight: 500;
}

.dark .sidebar-logo-sub {
    color: #64748b;
}

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

.sidebar-section {
    margin-bottom: 24px;
}

.sidebar-section-title {
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0 12px;
    margin-bottom: 8px;
}

.dark .sidebar-section-title {
    color: #475569;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

.dark .sidebar-item {
    color: #94a3b8;
}

.sidebar-item:hover {
    background: rgba(0, 0, 0, 0.04);
    color: #1e293b;
}

.dark .sidebar-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
}

.sidebar-item.active {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(217, 119, 6, 0.08) 100%);
    color: #b45309;
}

.dark .sidebar-item.active {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(217, 119, 6, 0.1) 100%);
    color: #fbbf24;
}

.sidebar-item.active .sidebar-item-icon {
    color: #b45309;
}

.dark .sidebar-item.active .sidebar-item-icon {
    color: #fbbf24;
}

.sidebar-item-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid #e2e8f0;
    margin-top: auto;
}

.dark .sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.main-content {
    margin-left: 260px;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

/* Mobile Sidebar */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 55;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .sidebar-overlay.show {
        opacity: 1;
        pointer-events: auto;
    }
}

/* View containers - see enhanced section below */

/* Dashboard specific styles */
.dashboard-card {
    background: var(--color-surface);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: all 0.25s ease;
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.dark .dashboard-card {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.12);
}

.quick-action {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1.5px solid transparent;
}

.quick-action:hover {
    background: #f1f5f9;
    border-color: #e2e8f0;
}

.dark .quick-action {
    background: #334155;
}

.dark .quick-action:hover {
    background: #3f4f63;
    border-color: #475569;
}

/* Overtime tracker styles */
.overtime-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: #f8fafc;
    border-radius: 10px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.overtime-entry:hover {
    background: #f1f5f9;
}

.dark .overtime-entry {
    background: #334155;
}

.dark .overtime-entry:hover {
    background: #3f4f63;
}

.overtime-month {
    font-weight: 600;
    color: #1e293b;
}

.dark .overtime-month {
    color: #f1f5f9;
}

.overtime-hours {
    font-weight: 700;
    color: #0ea5e9;
}

.overtime-positive {
    color: #10b981;
}

.overtime-negative {
    color: #ef4444;
}

/* Time Tracking Styles */
.timer-display {
    font-family: 'DMOffice', monospace;
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: 2px;
}

.timer-running {
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Editable Timer Start Time */
.timer-start-editable {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
}

.timer-start-editable:hover {
    background: rgba(14, 165, 233, 0.1);
}

.timer-start-editable .edit-icon {
    opacity: 0;
    transition: opacity 0.2s ease;
    color: #0ea5e9;
}

.timer-start-editable:hover .edit-icon {
    opacity: 1;
}

.timer-time-editor {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 2px solid #0ea5e9;
    border-radius: 12px;
    padding: 6px 12px;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.2);
    animation: fadeInScale 0.2s ease;
}

.dark .timer-time-editor {
    background: #334155;
    border-color: #38bdf8;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.timer-time-input {
    font-size: 1.1rem;
    font-weight: 600;
    width: 80px;
    text-align: center;
    border: none;
    background: transparent;
    color: #0ea5e9;
    outline: none;
}

.dark .timer-time-input {
    color: #38bdf8;
}

.timer-time-input::-webkit-calendar-picker-indicator {
    filter: invert(50%) sepia(100%) saturate(500%) hue-rotate(175deg);
    cursor: pointer;
}

.timer-editor-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.timer-editor-btn.confirm {
    background: #10b981;
    color: white;
}

.timer-editor-btn.confirm:hover {
    background: #059669;
    transform: scale(1.05);
}

.timer-editor-btn.cancel {
    background: #f1f5f9;
    color: #64748b;
}

.dark .timer-editor-btn.cancel {
    background: #475569;
    color: #94a3b8;
}

.timer-editor-btn.cancel:hover {
    background: #e2e8f0;
}

.dark .timer-editor-btn.cancel:hover {
    background: #64748b;
}

.break-btn {
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.break-btn.active {
    border-color: #0ea5e9 !important;
    background-color: rgba(14, 165, 233, 0.1) !important;
    color: #0ea5e9 !important;
    transform: scale(1.02);
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2);
}

.dark .break-btn.active {
    border-color: #38bdf8 !important;
    background-color: rgba(56, 189, 248, 0.15) !important;
    color: #38bdf8 !important;
}

.time-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: #f8fafc;
    border-radius: 10px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.time-entry:hover {
    background: #f1f5f9;
}

.dark .time-entry {
    background: #334155;
}

.dark .time-entry:hover {
    background: #3f4f63;
}

.time-entry-date {
    font-weight: 600;
    color: #1e293b;
}

.dark .time-entry-date {
    color: #f1f5f9;
}

.time-entry-hours {
    font-weight: 700;
    color: #0ea5e9;
}

.week-day-cell {
    min-height: 60px;
    transition: all 0.2s ease;
}

.week-day-cell:hover {
    background: #f1f5f9;
}

.dark .week-day-cell:hover {
    background: #3f4f63;
}

/* Clickable week day rows */
.week-day-clickable {
    cursor: pointer;
}

.week-day-clickable:active {
    transform: scale(0.995);
}

/* Day detail accordion */
.day-detail-row td {
    background: transparent;
}

.day-detail-content {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease-out;
    padding-bottom: 4px;
}

.day-detail-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    margin: 4px 0;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 3px solid #8b5cf6;
}

.dark .day-detail-entry {
    background: #334155;
    border-left-color: #a78bfa;
}

.day-detail-chevron {
    flex-shrink: 0;
}

/* ========================================
   KPI Detail Modal
   ======================================== */

/* Make stat-cards clickable */
.stat-card {
    cursor: pointer;
}

.stat-card:active {
    transform: scale(0.97);
}

/* Backdrop */
.kpi-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.kpi-modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Card */
.kpi-detail-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.92);
    z-index: 56;
    width: 92%;
    max-width: 420px;
    max-height: 85vh;
    overflow-y: auto;
    background: var(--color-surface);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 28px 24px 24px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}

.kpi-detail-modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* Close Button */
.kpi-detail-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: #f1f5f9;
    border-radius: 50%;
    font-size: 18px;
    color: #64748b;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.kpi-detail-close:hover {
    background: #e2e8f0;
    color: #334155;
}

/* Title */
.kpi-detail-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-primary);
    margin: 0;
}

/* Value */
.kpi-detail-value {
    font-size: 2rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 20px;
    line-height: 1.2;
}

/* Section */
.kpi-detail-section {
    margin-bottom: 16px;
}

.kpi-detail-section:last-child {
    margin-bottom: 0;
}

.kpi-detail-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    margin-bottom: 6px;
}

.kpi-detail-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-right: 28px;
}

.kpi-detail-icon {
    font-size: 2rem;
    line-height: 1;
}

/* Formula */
.kpi-detail-formula {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.82rem;
    line-height: 1.6;
    background: #f1f5f9;
    color: #334155;
    padding: 12px 14px;
    border-radius: 10px;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Explanation */
.kpi-detail-explanation {
    font-size: 0.88rem;
    line-height: 1.6;
    color: #475569;
}

/* ---- Dark Mode ---- */
.dark .kpi-detail-modal {
    background: #1e293b;
}

.dark .kpi-detail-close {
    background: #334155;
    color: #94a3b8;
}

.dark .kpi-detail-close:hover {
    background: #475569;
    color: #e2e8f0;
}

.dark .kpi-detail-title {
    color: #38bdf8;
}

.dark .kpi-detail-value {
    color: #f1f5f9;
}

.dark .kpi-detail-label {
    color: #64748b;
}

.dark .kpi-detail-formula {
    background: #0f172a;
    color: #cbd5e1;
}

.dark .kpi-detail-explanation {
    color: #94a3b8;
}

/* ---- Mobile ---- */
@media (max-width: 480px) {
    .kpi-detail-modal {
        width: 95%;
        padding: 24px 18px 20px;
    }
}

/* ========================================
   Arbeitsstunden-Heatmap
   ======================================== */
.heatmap-container {
    padding-bottom: 4px;
}

.heatmap-grid {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.heatmap-months {
    display: flex;
    gap: 2px;
    margin-bottom: 4px;
}

.heatmap-month-spacer {
    width: 28px;
    flex-shrink: 0;
}

.heatmap-month-label {
    flex: 1;
    min-width: 0;
    font-size: 9px;
    font-weight: 500;
    color: #94a3b8;
    text-align: left;
    white-space: nowrap;
    overflow: visible;
}

.heatmap-weeks {
    display: flex;
    gap: 2px;
    width: 100%;
}

.heatmap-week {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.heatmap-day-labels {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-right: 4px;
    flex-shrink: 0;
}

.heatmap-day-label {
    width: 24px;
    font-size: 9px;
    font-weight: 500;
    color: #94a3b8;
    display: flex;
    align-items: center;
    aspect-ratio: 1;
}

.heatmap-cell {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 2px;
    background: #e2e8f0;
    transition: transform 0.1s ease, box-shadow 0.15s ease;
    cursor: default;
}

.dark .heatmap-cell {
    background: #334155;
}

.heatmap-cell:hover {
    transform: scale(1.35);
    box-shadow: 0 0 6px rgba(0,0,0,0.2);
    z-index: 2;
    position: relative;
}

.heatmap-empty {
    background: transparent;
}

.heatmap-weekend {
    opacity: 0.5;
}

.heatmap-today {
    outline: 2px solid #6366f1;
    outline-offset: 1px;
    border-radius: 2px;
}

/* Heatmap color levels (light): Amber → Grün Verlauf */
.heatmap-level-1 { background: #fbbf24; }
.heatmap-level-2 { background: #d4a72c; }
.heatmap-level-3 { background: #84cc16; }
.heatmap-level-4 { background: #22c55e; }
.heatmap-level-5 { background: #059669; }

/* Heatmap color levels (dark) */
.dark .heatmap-level-1 { background: #b45309; }
.dark .heatmap-level-2 { background: #a16207; }
.dark .heatmap-level-3 { background: #65a30d; }
.dark .heatmap-level-4 { background: #16a34a; }
.dark .heatmap-level-5 { background: #34d399; }

@media (max-width: 640px) {
    .heatmap-cell {
        width: 10px;
        height: 10px;
    }
    .heatmap-weeks, .heatmap-week {
        gap: 2px;
    }
    .heatmap-month-label {
        width: 10px;
        font-size: 8px;
    }
    .heatmap-day-label {
        width: 18px;
        height: 10px;
        font-size: 8px;
    }
}

/* ========================================
   Import Styles
   ======================================== */

.import-drop-zone {
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f8fafc;
}

.import-drop-zone:hover {
    border-color: var(--color-primary);
    background: #f0f9ff;
}

.import-drop-zone.drag-over {
    border-color: var(--color-success);
    background: #ecfdf5;
    transform: scale(1.01);
}

.dark .import-drop-zone {
    border-color: #475569;
    background: #1e293b;
}

.dark .import-drop-zone:hover {
    border-color: var(--color-primary);
    background: #0f172a;
}

.dark .import-drop-zone.drag-over {
    border-color: var(--color-success);
    background: #064e3b;
}

.import-preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.import-preview-table th {
    text-align: left;
    padding: 6px 10px;
    font-weight: 600;
    color: #64748b;
    border-bottom: 2px solid #e2e8f0;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.import-preview-table td {
    padding: 6px 10px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
}

.import-preview-table tr:last-child td {
    border-bottom: none;
}

.dark .import-preview-table th {
    color: #94a3b8;
    border-bottom-color: #334155;
}

.dark .import-preview-table td {
    color: #cbd5e1;
    border-bottom-color: #1e293b;
}

.import-preview-count {
    font-size: 0.8125rem;
    color: #10b981;
    font-weight: 600;
    margin-bottom: 8px;
}

.import-preview-scroll {
    max-height: 200px;
    overflow-y: auto;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.dark .import-preview-scroll {
    border-color: #334155;
}

/* ========================================
   Inline Entry Form (Wochenübersicht)
   ======================================== */

.inline-entry-form {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.inline-entry-form.open {
    overflow: visible;
}

.inline-entry-form-inner {
    padding: 16px;
    margin-top: 16px;
    background: linear-gradient(135deg, #f0f9ff 0%, #ecfdf5 100%);
    border-radius: 16px;
    border: 1px solid #bae6fd;
}

.dark .inline-entry-form-inner {
    background: linear-gradient(135deg, #0c4a6e20 0%, #064e3b20 100%);
    border-color: #1e3a5f;
}

/* "+" Button in Wochenzeilen */
.week-add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    background: transparent;
    color: #94a3b8;
    border: 1.5px dashed #cbd5e1;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-left: 4px;
    opacity: 0;
    flex-shrink: 0;
}

.week-day-cell:hover .week-add-btn {
    opacity: 1;
}

.week-add-btn:hover {
    background: #0ea5e9;
    border-color: #0ea5e9;
    color: white;
    border-style: solid;
    transform: scale(1.1);
}

.dark .week-add-btn {
    border-color: #475569;
    color: #64748b;
}

.dark .week-add-btn:hover {
    background: #0ea5e9;
    border-color: #0ea5e9;
    color: white;
}

/* Mobile: immer sichtbar */
@media (max-width: 640px) {
    .week-add-btn {
        opacity: 0.6;
    }
}

/* ========================================
   Overflow Menu (Toolbar)
   ======================================== */
.overflow-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
    padding: 6px;
    z-index: 100;
    animation: overflowFadeIn 0.15s ease;
}

.dark .overflow-menu {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.overflow-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}

.overflow-menu-item:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.dark .overflow-menu-item {
    color: #cbd5e1;
}

.dark .overflow-menu-item:hover {
    background: #334155;
    color: #f1f5f9;
}

@keyframes overflowFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========================================
   View Transitions (Fade-In)
   ======================================== */
.view-container {
    display: none;
    opacity: 0;
}

.view-container.active {
    display: block;
    animation: viewFadeIn 0.2s ease forwards;
}

@keyframes viewFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ========================================
   Enhanced Hover States
   ======================================== */
.stat-card:hover {
    transform: scale(1.01) translateY(-2px);
}

.card {
    transition: box-shadow 0.25s ease;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.quick-action:hover {
    border-color: rgba(14, 165, 233, 0.3);
}

/* ========================================
   Focus-Visible (Accessibility)
   ======================================== */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
label[tabindex]:focus-visible,
.sidebar-item:focus-visible,
.stat-card:focus-visible,
.quick-action:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: 8px;
}

/* ========================================
   Toast with Undo
   ======================================== */
.toast-undo {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    margin-left: 12px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.toast-undo:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* ========================================
   Empty States
   ======================================== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    text-align: center;
}

.empty-state-icon {
    width: 48px;
    height: 48px;
    color: #cbd5e1;
    margin-bottom: 12px;
}

.dark .empty-state-icon {
    color: #475569;
}

.empty-state-text {
    font-size: 14px;
    color: #94a3b8;
    margin-bottom: 4px;
}

.empty-state-hint {
    font-size: 12px;
    color: #cbd5e1;
}

.dark .empty-state-hint {
    color: #475569;
}

/* ========================================
   Skeleton Loading
   ======================================== */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton {
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
}

.dark .skeleton {
    background: linear-gradient(90deg, #334155 25%, #3f4f63 50%, #334155 75%);
    background-size: 200% 100%;
}

.skeleton-card {
    height: 100px;
    border-radius: 14px;
}

.skeleton-line {
    height: 16px;
    margin-bottom: 10px;
    border-radius: 4px;
}

.skeleton-line.short { width: 60%; }
.skeleton-line.medium { width: 80%; }

/* ========================================
   Dark Mode Polishing (Enhanced Contrasts)
   ======================================== */
.dark .text-gray-500 { color: #94a3b8 !important; }
.dark .text-gray-400 { color: #64748b !important; }
