/* ============================================================
   Zeiterfassung – Design System
   Premium dark/light theme with glassmorphism
   ============================================================ */

/* ── CSS Custom Properties ──────────────────────────────────── */
:root {
    /* Base colors */
    --accent-h: 199;
    --accent-s: 89%;
    --accent-l: 48%;
    --accent: hsl(var(--accent-h), var(--accent-s), var(--accent-l));
    --accent-hover: hsl(var(--accent-h), var(--accent-s), 58%);
    --accent-glow: hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.3);

    --success: #10b981;
    --success-soft: rgba(16, 185, 129, 0.15);
    --warning: #f59e0b;
    --warning-soft: rgba(245, 158, 11, 0.15);
    --purple: #a855f7;
    --purple-soft: rgba(168, 85, 247, 0.15);
    --error: #ef4444;
    --error-soft: rgba(239, 68, 68, 0.15);

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

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

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.15);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.2);
    --shadow-glow: 0 0 20px var(--accent-glow);

    /* Layout */
    --sidebar-width: 260px;
    --header-height: 64px;
    --bottom-nav-height: 64px;
    --content-max-width: 1200px;
}

/* ── Dark Theme (default) ───────────────────────────────────── */
[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-card: rgba(30, 41, 59, 0.8);
    --bg-card-hover: rgba(51, 65, 85, 0.8);
    --bg-input: rgba(15, 23, 42, 0.6);
    --bg-overlay: rgba(0, 0, 0, 0.6);

    --border-color: rgba(148, 163, 184, 0.1);
    --border-color-hover: rgba(148, 163, 184, 0.2);

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-inverse: #0f172a;

    --glass-bg: rgba(30, 41, 59, 0.6);
    --glass-border: rgba(148, 163, 184, 0.08);
    --glass-blur: 12px;

    --scrollbar-track: #1e293b;
    --scrollbar-thumb: #475569;
}

/* ── Light Theme ────────────────────────────────────────────── */
[data-theme="light"] {
    --accent-h: 207;
    --accent-s: 100%;
    --accent-l: 24%;
    --accent: #004278;
    --accent-hover: #00538f;
    --accent-glow: rgba(0, 66, 120, 0.2);

    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-card-hover: rgba(241, 245, 249, 0.9);
    --bg-input: rgba(241, 245, 249, 0.8);
    --bg-overlay: rgba(0, 0, 0, 0.4);

    --border-color: rgba(148, 163, 184, 0.2);
    --border-color-hover: rgba(148, 163, 184, 0.35);

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-inverse: #f1f5f9;

    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(148, 163, 184, 0.15);
    --glass-blur: 12px;

    --scrollbar-track: #f1f5f9;
    --scrollbar-thumb: #cbd5e1;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.1);
}

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

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

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background var(--transition-base), color var(--transition-base);
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--scrollbar-track); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ── App Layout ─────────────────────────────────────────────── */
#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-layout {
    display: flex;
    flex: 1;
    min-height: calc(100vh - var(--header-height));
}

/* ── Header ─────────────────────────────────────────────────── */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-bottom: 1px solid var(--glass-border);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
}

.header-logo-icon {
    font-size: 1.5rem;
}

.header-logo-img {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.header-logo h1 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.header-logo h1 span {
    color: var(--accent);
}

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

.header-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.875rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.header-user:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.header-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #a855f7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
}

/* ── Sidebar (Desktop) ──────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 24px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    transition: background var(--transition-base), border-color var(--transition-base);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.nav-item:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-glow);
    color: var(--accent);
    font-weight: 600;
}

.nav-item .nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.nav-separator {
    height: 1px;
    background: var(--border-color);
    margin: 12px 8px;
}

/* ── Bottom Nav (Mobile) ────────────────────────────────────── */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--bottom-nav-height);
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-top: 1px solid var(--glass-border);
    padding: 0 8px;
    align-items: center;
    justify-content: space-around;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.65rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    background: none;
    min-width: 0;
}

.bottom-nav-item .nav-icon {
    font-size: 1.25rem;
    line-height: 1;
}

.bottom-nav-item.active {
    color: var(--accent);
}

.bottom-nav-item:hover {
    color: var(--text-primary);
}

/* ── Main Content ───────────────────────────────────────────── */
.main-content {
    flex: 1;
    padding: 24px;
    max-width: var(--content-max-width);
    width: 100%;
    margin: 0 auto;
    overflow-y: auto;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-title .icon {
    font-size: 1.5rem;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: -16px;
    margin-bottom: 24px;
}

/* ── Views ──────────────────────────────────────────────────── */
.view {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.view.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Glass Card ─────────────────────────────────────────────── */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all var(--transition-fast);
}

.glass-card:hover {
    border-color: var(--border-color-hover);
}

.glass-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.glass-card-title {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.glass-card-sub {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-secondary);
}

/* ── Tabs ───────────────────────────────────────────────────── */
.tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: 4px;
}

.tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* ── Stat Cards ─────────────────────────────────────────────── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--stat-color, var(--accent));
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

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

.stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--stat-color, var(--accent));
}

.stat-card .stat-sub {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.stat-card.accent { --stat-color: var(--accent); }
.stat-card.success { --stat-color: var(--success); }
.stat-card.warning { --stat-color: var(--warning); }
.stat-card.purple { --stat-color: var(--purple); }
.stat-card.error { --stat-color: var(--error); }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

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

.btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 8px var(--accent-glow);
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-card-hover);
    border-color: var(--border-color-hover);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 8px 12px;
}

.btn-ghost:hover:not(:disabled) {
    background: var(--bg-card);
    color: var(--text-primary);
}

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

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
    transform: translateY(-1px);
}

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

.btn-success:hover:not(:disabled) {
    background: #059669;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-family);
}

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

.btn-group {
    display: flex;
    gap: 8px;
}

/* ── Forms ──────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 0.9rem;
    transition: all var(--transition-fast);
    outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input::placeholder {
    color: var(--text-muted);
}

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

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

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

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

.form-error {
    font-size: 0.75rem;
    color: var(--error);
    margin-top: 4px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.9rem;
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 48px;
    height: 26px;
    display: inline-block;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition-fast);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: var(--transition-fast);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--accent);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(22px);
}

/* ── Tables ─────────────────────────────────────────────────── */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table thead th {
    text-align: left;
    padding: 12px 16px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

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

.data-table tbody tr {
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: var(--bg-card-hover);
}

.data-table .text-right { text-align: right; }
.data-table .text-center { text-align: center; }

.data-table .row-weekend { opacity: 0.5; }
.data-table .row-holiday { background: var(--purple-soft); }
.data-table .row-vacation { background: var(--success-soft); }
.data-table .row-sick { background: var(--warning-soft); }
.data-table .row-total {
    font-weight: 700;
    border-top: 2px solid var(--border-color);
}

.data-table .delta-positive { color: var(--success); }
.data-table .delta-negative { color: var(--error); }

/* ── Tabs ───────────────────────────────────────────────────── */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    background: var(--bg-card);
    padding: 4px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.tab {
    flex: 1;
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-family);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    text-align: center;
}

.tab:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.tab.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 8px var(--accent-glow);
}

/* ── Badge ──────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-accent { background: var(--accent-glow); color: var(--accent); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-purple { background: var(--purple-soft); color: var(--purple); }
.badge-error { background: var(--error-soft); color: var(--error); }

/* ── Toast ──────────────────────────────────────────────────── */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    padding: 12px 20px;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastIn 0.3s ease-out;
    pointer-events: auto;
    max-width: 400px;
}

.toast.toast-success { border-left: 3px solid var(--success); }
.toast.toast-error { border-left: 3px solid var(--error); }
.toast.toast-info { border-left: 3px solid var(--accent); }
.toast.toast-warning { border-left: 3px solid var(--warning); }

.toast.removing {
    animation: toastOut 0.3s ease-in forwards;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
    to { opacity: 0; transform: translateX(40px); }
}

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-overlay);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease-out;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 32px;
    max-width: 500px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95);
    transition: transform var(--transition-base);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* ── Calendar ───────────────────────────────────────────────── */
.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.calendar-nav-title {
    font-size: 1.1rem;
    font-weight: 700;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-header-cell {
    text-align: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    padding: 8px 0;
}

.calendar-cell {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    gap: 2px;
    border: 1px solid transparent;
}

.calendar-cell:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-color-hover);
}

.calendar-cell.today {
    border-color: var(--accent);
    font-weight: 700;
}

.calendar-cell.other-month {
    opacity: 0.3;
}

.calendar-cell.has-entry::after {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
}

.calendar-cell.has-vacation::after {
    background: var(--success);
}

.calendar-cell.has-sickness::after {
    background: var(--warning);
}

.calendar-cell.has-holiday {
    color: var(--purple);
    background: var(--purple-soft);
    border-color: var(--purple);
    font-weight: 700;
}

.calendar-cell.has-holiday::after {
    background: var(--purple);
}

.calendar-cell.weekend {
    opacity: 0.4;
}

/* ── Week Grid (Dashboard) ──────────────────────────────────── */
.week-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.week-day-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.week-day-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.week-day-card.today {
    border-color: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}

.week-day-card.filled {
    border-left: 3px solid var(--accent);
}

.week-day-card.vacation-day {
    border-left: 3px solid var(--success);
    background: var(--success-soft);
}

.week-day-card.sick-day {
    border-left: 3px solid var(--warning);
    background: var(--warning-soft);
}

.week-day-card.holiday-day {
    border-left: 3px solid var(--purple);
    background: var(--purple-soft);
}

.week-day-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.week-day-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 4px 0;
}

.week-day-hours {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
}

.week-day-status {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ── Progress Bar ───────────────────────────────────────────── */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin: 8px 0;
}

.progress-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: var(--accent);
    transition: width var(--transition-slow);
}

.progress-fill.success { background: var(--success); }
.progress-fill.warning { background: var(--warning); }
.progress-fill.error { background: var(--error); }

/* ── Auth View ──────────────────────────────────────────────── */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--bg-primary);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 40px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 12px;
}

.auth-logo-img {
    width: 96px;
    height: 96px;
    border-radius: var(--radius-lg);
    object-fit: cover;
    margin-bottom: 12px;
}

.auth-logo h2 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.auth-logo h2 span {
    color: var(--accent);
}

.auth-tabs {
    display: flex;
    margin-bottom: 28px;
    border-bottom: 1px solid var(--border-color);
}

.auth-tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border: none;
    background: none;
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
    font-family: var(--font-family);
}

.auth-tab:hover {
    color: var(--text-primary);
}

.auth-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

.auth-error {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    background: var(--error-soft);
    color: var(--error);
    font-size: 0.85rem;
    margin-bottom: 16px;
    display: none;
}

.auth-error.visible {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

/* ── Empty State ────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.9rem;
    max-width: 300px;
    margin: 0 auto;
}

/* ── Loading ────────────────────────────────────────────────── */
.loading-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
}

/* ── Quick Entry (Dashboard) ────────────────────────────────── */
.quick-entry {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 12px;
    align-items: end;
}

.quick-entry .form-group {
    margin-bottom: 0;
}

/* ── Timeline ───────────────────────────────────────────────── */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.timeline-item {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}

.timeline-item:last-child {
    border-bottom: none;
}

.timeline-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    margin-top: 6px;
    flex-shrink: 0;
}

.timeline-dot.vacation { background: var(--success); }
.timeline-dot.sick { background: var(--warning); }
.timeline-dot.holiday { background: var(--purple); }

.timeline-content {
    flex: 1;
    min-width: 0;
}

.timeline-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.timeline-text {
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 2px;
}

.timeline-sub {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ── Vacation/Sickness List ─────────────────────────────────── */
.entry-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.entry-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all var(--transition-fast);
}

.entry-card:hover {
    border-color: var(--border-color-hover);
}

.entry-card-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.entry-card-dates {
    font-weight: 600;
    font-size: 0.9rem;
}

.entry-card-days {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.entry-card-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

.entry-card-actions {
    display: flex;
    gap: 8px;
}

/* ── Holiday List ───────────────────────────────────────────── */
.holiday-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.holiday-item:last-child {
    border-bottom: none;
}

.holiday-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.holiday-date {
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 90px;
}

.holiday-name {
    font-size: 0.9rem;
}

/* ── Chart (CSS-based bar chart) ────────────────────────────── */
.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 200px;
    padding: 0 8px;
}

.bar-chart-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    height: 100%;
    justify-content: flex-end;
}

.bar-chart-bar {
    width: 100%;
    max-width: 40px;
    background: var(--accent);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    transition: height var(--transition-slow);
    min-height: 2px;
    position: relative;
}

.bar-chart-bar.negative {
    background: var(--error);
}

.bar-chart-bar.positive {
    background: var(--success);
}

.bar-chart-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-align: center;
    font-weight: 600;
}

.bar-chart-value {
    font-size: 0.65rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* ── Build Footer ───────────────────────────────────────────── */
.build-footer {
    text-align: center;
    padding: 12px;
    font-size: 0.7rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
}

/* ── Report Nav ─────────────────────────────────────────────── */
.report-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.report-nav-center {
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Settings Section ───────────────────────────────────────── */
.settings-section {
    margin-bottom: 32px;
}

.settings-section-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    gap: 12px;
    flex-wrap: wrap;
}

.settings-row:last-child {
    border-bottom: none;
}

.settings-label {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.settings-label-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
    margin-top: 2px;
}

.work-days-grid {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.work-day-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-family);
}

.work-day-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* ── Theme Toggle ───────────────────────────────────────────── */
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 1.1rem;
}

.theme-toggle:hover {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-color-hover);
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .bottom-nav {
        display: flex;
    }

    .main-content {
        padding: 16px;
        padding-bottom: calc(var(--bottom-nav-height) + 16px);
    }

    .page-title {
        font-size: 1.375rem;
    }

    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-card {
        padding: 14px;
    }

    .stat-card .stat-value {
        font-size: 1.375rem;
    }

    .week-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 6px;
    }

    .week-day-card {
        padding: 10px 6px;
    }

    .week-day-hours {
        font-size: 1rem;
    }

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

    .quick-entry {
        grid-template-columns: 1fr 1fr;
    }

    .quick-entry .btn {
        grid-column: 1 / -1;
    }

    .auth-card {
        padding: 24px;
        border-radius: var(--radius-lg);
    }

    .modal {
        padding: 20px;
        max-width: 100%;
        margin: 0 10px;
    }

    .modal-actions {
        flex-wrap: wrap;
    }

    .modal-actions .btn-danger {
        width: 100%;
        order: 10;
        margin-top: 4px;
    }

    .calendar-cell {
        font-size: 0.75rem;
    }

    .bar-chart {
        height: 150px;
    }

    .header-logo h1 {
        font-size: 1rem;
    }

    .toast-container {
        left: 20px;
        right: 20px;
    }

    .toast {
        max-width: 100%;
    }

    .data-table {
        font-size: 0.8rem;
    }

    .data-table thead th,
    .data-table tbody td {
        padding: 8px 10px;
    }

    .entry-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .entry-card-actions {
        align-self: flex-end;
    }

    .settings-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .holiday-label {
        display: none;
    }
}

@media (max-width: 480px) {
    .week-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 4px;
    }

    .week-day-card {
        padding: 8px 4px;
    }

    .week-day-name {
        font-size: 0.65rem;
    }

    .week-day-hours {
        font-size: 0.9rem;
    }

    .stat-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 1200px) {
    .stat-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ── Holiday Label in Calendar ──────────────────────────────── */
.holiday-label {
    font-size: 0.5rem;
    line-height: 1.1;
    color: var(--purple);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    padding: 0 2px;
}

/* ── Utility Classes (replacing inline styles) ─────────────── */
.mb-0 { margin-bottom: 0; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.p-16 { padding: 16px; }
.w-full { width: 100%; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-end { align-items: end; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.85rem; }
.text-muted-color { color: var(--text-muted); }
.text-secondary-color { color: var(--text-secondary); }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.min-w-200 { min-width: 200px; }
.min-w-140 { min-width: 140px; }
.max-w-200 { max-width: 200px; }
.max-w-250 { max-width: 250px; }
.overflow-x-auto { overflow-x: auto; }

/* Quick entry secondary row */
.quick-entry-secondary {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-top: 12px;
}

.quick-entry-secondary .form-group {
    margin: 0;
    flex: 1;
}

.quick-entry-secondary .form-check {
    margin-top: 16px;
}

/* Calendar legend */
.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.8rem;
}

/* Progress meta */
.progress-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.85rem;
}

.progress-sub {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Report nav center stacked */
.report-nav-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.report-nav-sub {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-secondary);
}

/* Sickness button */
.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-warning:hover:not(:disabled) {
    background: #d97706;
    transform: translateY(-1px);
}

/* Export bar */
.export-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.export-bar-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Settings regions & reminder fields */
.reminder-fields {
    margin-top: 12px;
}

.reminder-fields.hidden {
    display: none;
}

/* Settings theme buttons row */
.theme-buttons {
    display: flex;
    gap: 8px;
}

/* Form input computed (read-only display) */
.form-input-computed {
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    font-weight: 700;
    color: var(--accent);
}

/* Holiday import row */
.import-row {
    display: flex;
    gap: 12px;
    align-items: end;
    flex-wrap: wrap;
}

.holiday-manual-form {
    display: flex;
    gap: 12px;
    align-items: end;
    flex-wrap: wrap;
}

/* File import hint */
.import-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

/* Auth full-width button */
.btn-full {
    width: 100%;
    margin-top: 8px;
}

/* Delta colors outside tables */
.delta-positive { color: var(--success); }
.delta-negative { color: var(--error); }
