:root {
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --success: #10b981;
    --border-color: #e2e8f0;
    --radius-lg: 16px;
    --radius-md: 10px;
    --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; 
}

body { 
    background-color: var(--bg-page); 
    color: var(--text-main); 
    padding: 12px; 
    max-width: 800px; 
    margin: 0 auto; 
    line-height: 1.5; 
}

header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 12px; 
    padding: 4px; 
}

h1 { 
    font-size: 1.4rem; 
    font-weight: 700; 
}

.live-clock-container { 
    text-align: left; 
    margin-bottom: 20px; 
    padding: 0 4px; 
    color: var(--text-muted); 
    font-size: 0.95rem; 
    font-weight: 500; 
}

.btn-settings { 
    background: var(--bg-card); 
    border: 1px solid var(--border-color); 
    padding: 8px 12px; 
    border-radius: var(--radius-md); 
    font-size: 0.9rem; 
    color: var(--text-muted); 
    cursor: pointer; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.05); 
}

.tab-nav { 
    display: flex; 
    gap: 8px; 
    margin-bottom: 20px; 
    background: #e2e8f0; 
    padding: 6px; 
    border-radius: var(--radius-md); 
}

.tab-btn { 
    flex: 1; 
    padding: 10px; 
    text-align: center; 
    border: none; 
    background: transparent; 
    font-weight: 600; 
    color: var(--text-muted); 
    border-radius: 8px; 
    cursor: pointer; 
    transition: 0.2s; 
}

.tab-btn.active { 
    background: white; 
    color: var(--primary); 
    box-shadow: 0 1px 3px rgba(0,0,0,0.05); 
}

.tab-content { 
    display: none; 
}

.tab-content.active { 
    display: block; 
}

.hero-card { 
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%); 
    color: white; 
    border-radius: var(--radius-lg); 
    padding: 20px; 
    box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.3); 
    margin-bottom: 20px; 
}

.hero-title { 
    font-size: 0.85rem; 
    text-transform: uppercase; 
    letter-spacing: 0.05em; 
    opacity: 0.85; 
    margin-bottom: 6px; 
    font-weight: 600; 
}

.hero-main-time { 
    font-size: 2.5rem; 
    font-weight: 800; 
    line-height: 1.1; 
    margin-bottom: 12px; 
}

.progress-container { 
    margin-top: 16px; 
}

.progress-bar-bg { 
    background: rgba(255, 255, 255, 0.25); 
    height: 10px; 
    border-radius: 5px; 
    overflow: hidden; 
    margin-bottom: 6px; 
}

.progress-bar-fill { 
    background: #10b981; 
    height: 100%; 
    width: 0%; 
    transition: width 0.5s ease; 
}

.progress-text { 
    display: flex; 
    justify-content: space-between; 
    font-size: 0.85rem; 
    opacity: 0.9; 
}

.card { 
    background: var(--bg-card); 
    border-radius: var(--radius-lg); 
    padding: 16px; 
    border: 1px solid var(--border-color); 
    box-shadow: 0 1px 3px rgba(0,0,0,0.05); 
    margin-bottom: 20px; 
}

.mode-toggle { 
    display: flex; 
    background: #f1f5f9; 
    padding: 4px; 
    border-radius: var(--radius-md); 
    gap: 4px; 
    margin-bottom: 20px; 
}

.mode-btn { 
    flex: 1; 
    padding: 10px; 
    border: none; 
    background: transparent; 
    font-size: 0.9rem; 
    font-weight: 600; 
    color: var(--text-muted); 
    border-radius: 6px; 
    cursor: pointer; 
}

.mode-btn.active { 
    background: white; 
    color: var(--primary); 
    box-shadow: 0 1px 3px rgba(0,0,0,0.05); 
}

.timeline-grid { 
    display: flex; 
    flex-direction: column; 
    gap: 12px; 
}

.time-row { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    gap: 12px; 
    background: #f8fafc; 
    padding: 12px; 
    border-radius: var(--radius-md); 
    border: 1px solid var(--border-color); 
}

.time-row.hidden { 
    display: none !important; 
}

.time-row label { 
    flex: 1; 
    font-size: 0.9rem; 
    font-weight: 600; 
    margin: 0; 
    color: var(--text-main); 
}

.input-group { 
    display: flex; 
    gap: 8px; 
    flex: 2; 
    justify-content: flex-end;
}

input, select { 
    padding: 8px 12px; 
    height: 42px; 
    border: 1px solid var(--border-color); 
    border-radius: 8px; 
    font-size: 1rem; 
    background-color: #fff; 
    width: 100%; 
    outline: none; 
    transition: border 0.2s;
    box-sizing: border-box;
}

input:focus, select:focus { 
    border-color: var(--primary); 
}

.btn { 
    padding: 10px 14px; 
    border: none; 
    border-radius: 8px; 
    font-size: 0.95rem; 
    font-weight: 600; 
    cursor: pointer; 
    white-space: nowrap; 
}

.btn-secondary { 
    background: #e2e8f0; 
    color: var(--text-main); 
}

.btn-success { 
    background: var(--success); 
    color: white; 
    width: 100%; 
    margin-top: 16px; 
    font-size: 1.05rem; 
    padding: 14px;
}

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

.stats-grid { 
    display: grid; 
    grid-template-columns: repeat(2, 1fr); 
    gap: 12px; 
    margin-bottom: 20px; 
}

.stat-box { 
    background: #f8fafc; 
    border-radius: var(--radius-md); 
    padding: 12px; 
    border: 1px solid var(--border-color); 
    text-align: center; 
}

.stat-val { 
    font-size: 1.4rem; 
    font-weight: 700; 
    color: var(--primary); 
}

.stat-lbl { 
    font-size: 0.75rem; 
    color: var(--text-muted); 
    text-transform: uppercase; 
    font-weight: 600; 
    margin-top: 4px; 
}

.table-responsive { 
    overflow-x: auto; 
    -webkit-overflow-scrolling: touch; 
}

table { 
    width: 100%; 
    border-collapse: collapse; 
    font-size: 0.85rem; 
    text-align: left; 
}

th { 
    background: #f8fafc; 
    color: var(--text-muted); 
    padding: 12px; 
    border-bottom: 2px solid var(--border-color); 
    white-space: nowrap;
}

td { 
    padding: 12px; 
    border-bottom: 1px solid var(--border-color); 
    white-space: nowrap;
}

.badge { 
    padding: 4px 8px; 
    border-radius: 12px; 
    font-size: 0.75rem; 
    font-weight: 600; 
}

.badge-office { 
    background: #e0f2fe; 
    color: #0369a1; 
}

.badge-ho { 
    background: #f3e8ff; 
    color: #6b21a8; 
}

.badge-plus { 
    color: #059669; 
    font-weight: 700; 
}

.badge-minus { 
    color: #dc2626; 
    font-weight: 700; 
}

.action-btns { 
    display: flex; 
    gap: 6px; 
}

.action-btns button { 
    background: #f1f5f9; 
    border: 1px solid var(--border-color); 
    cursor: pointer; 
    font-size: 1.1rem; 
    padding: 6px 8px; 
    border-radius: 6px; 
}

.action-btns button:hover { 
    background: #e2e8f0; 
}

/* Modal Base */
.modal-overlay { 
    position: fixed; 
    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 0; 
    background: rgba(15, 23, 42, 0.5); 
    backdrop-filter: blur(3px); 
    display: none; 
    justify-content: center; 
    align-items: center; 
    z-index: 100; 
    padding: 12px; 
}

.modal-overlay.active { 
    display: flex; 
}

/* Modal Content (Responsive & Scrollable) */
.modal { 
    background: white; 
    border-radius: var(--radius-lg); 
    width: 100%; 
    max-width: 500px; 
    padding: 20px; 
    max-height: 90vh; 
    overflow-y: auto; 
    box-shadow: var(--shadow-md); 
    position: relative; 
}

.form-group { 
    margin-bottom: 16px; 
}

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

/* Default Desktop Grids */
.modal-grid-2 { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 16px; 
}

/* ArbZG Warnungen & Monatsfilter */
.input-error {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
}

.text-warning {
    color: #ef4444;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: right;
    margin-top: 4px;
}

.history-filter-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
    background: var(--bg-card);
    padding: 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* MOBILE OPTIMIZATIONS */
@media (max-width: 600px) {
    .modal-grid-2 { grid-template-columns: 1fr; gap: 0; }
    
    .time-row { flex-direction: column; align-items: stretch; gap: 8px; padding: 12px; }
    .time-row label { margin-bottom: 4px; }
    
    .input-group { width: 100%; }
    .input-group input { flex: 1; }
    
    .modal { padding: 16px; max-height: 95vh; }
    
    header h1 { font-size: 1.2rem; }
    .btn-settings { padding: 8px 10px; font-size: 0.85rem; }
    
    .history-filter-bar { flex-direction: column; gap: 8px; }
    
    .stats-grid { gap: 8px; }
    .stat-box { padding: 10px 6px; }
    .stat-val { font-size: 1.15rem; }
    .stat-lbl { font-size: 0.65rem; }
}
