/* SanLog v3.6.10.2 - Dashboard Styles - DRK STYLEGUIDE */

/* ============================================================================
   CONTAINER & HEADER
   ============================================================================ */

.dashboard-container {
    padding: 10px 14px;
    max-width: 1400px;
    margin: 0 auto;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary);
}

.dashboard-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Lage-Info Banner */
.dashboard-lage-info {
    margin-bottom: 10px;
    padding: 8px 12px;
    background: var(--bg-input);
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.lage-info-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
}

.lage-info-item strong {
    color: var(--primary);
}

/* ============================================================================
   WETTER WIDGET - Einheitlich Dunkelgrau
   ============================================================================ */

.dashboard-weather {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    border-radius: 10px;
    color: white;
    font-weight: 500;
    flex-shrink: 0;
    max-width: 320px;
    margin-right: 8px;  /* v3.13.0: Abstand zum Rand */
}

.weather-main {
    display: flex;
    align-items: center;
    gap: 6px;
}

.weather-icon {
    font-size: 1.4rem;
}

.weather-temp {
    font-size: 1.2rem;
    font-weight: 700;
}

.weather-desc {
    font-size: 0.85rem;
    opacity: 0.9;
    max-width: 100px;
}

.weather-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.75rem;
    opacity: 0.9;
    border-left: 1px solid rgba(255,255,255,0.3);
    padding-left: 12px;
}

.weather-details span {
    white-space: nowrap;
}

.weather-radar-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.2s;
    white-space: nowrap;
}

.weather-radar-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* ============================================================================
   STAT CARDS - 4er Grid
   ============================================================================ */

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 6px 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 40px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.12);
}

.stat-card-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    line-height: 1;
    display: flex;
    align-items: center;
}

.stat-card-body {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 6px;
}

.stat-card-label {
    font-size: 0.6rem;
    color: rgba(255,255,255,0.85);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1;
    white-space: nowrap;
}

.stat-card-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    line-height: 1;
}

.stat-card-sub {
    font-size: 0.55rem;
    color: rgba(255,255,255,0.7);
    white-space: nowrap;
}

/* Stat-Card mit zwei Werten */
.stat-card-values {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 6px;
}

.stat-line {
    display: flex;
    align-items: baseline;
    gap: 3px;
}

.stat-number {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
}

.stat-desc {
    font-size: 0.55rem;
    opacity: 0.85;
    white-space: nowrap;
}

/* ============================================================================
   STAT CARD FARBEN - EINHEITLICH DUNKELGRAU
   Professionell, ruhig, Fokus auf die Zahlen
   ============================================================================ */

/* Alle Cards - Dunkelgrau wie Uhrzeit */
.stat-card.time,
.stat-card.ek,
.stat-card.einsaetze,
.stat-card.anforderungen,
.stat-card.patients,
.stat-card.transporte {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    color: white;
}

.stat-card.time .stat-card-label,
.stat-card.time .stat-card-sub,
.stat-card.ek .stat-card-label,
.stat-card.ek .stat-card-sub,
.stat-card.einsaetze .stat-card-label,
.stat-card.einsaetze .stat-card-sub,
.stat-card.anforderungen .stat-card-label,
.stat-card.anforderungen .stat-card-sub,
.stat-card.patients .stat-card-label,
.stat-card.patients .stat-card-sub,
.stat-card.transporte .stat-card-label,
.stat-card.transporte .stat-card-sub {
    color: rgba(255,255,255,0.7);
}

.stat-card.time .stat-card-value,
.stat-card.ek .stat-card-value,
.stat-card.einsaetze .stat-card-value,
.stat-card.anforderungen .stat-card-value,
.stat-card.patients .stat-card-value,
.stat-card.transporte .stat-card-value {
    color: white;
}

/* Clickable Cards */
.stat-card.clickable {
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card.clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

/* Uhrzeit behält Monospace-Font */
.stat-card.time .stat-card-value {
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: 1.1rem;
}

/* ============================================================================
   ZWEI-SPALTEN LAYOUT (MC-Belegung + Timer)
   ============================================================================ */

.dashboard-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}

.dashboard-widget {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    overflow: hidden;
}

.widget-header {
    padding: 10px 14px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.widget-content {
    padding: 12px 14px;
}

/* ============================================================================
   MC-BELEGUNG WIDGET
   ============================================================================ */

.mc-belegung-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mc-belegung-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mc-belegung-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mc-belegung-name {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-primary);
}

.mc-belegung-stats {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.mc-belegung-bar {
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
}

.mc-belegung-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.mc-belegung-gesamt {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 2px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 0.85rem;
}

/* ============================================================================
   TIMER WIDGET
   ============================================================================ */

.timer-display {
    text-align: center;
    padding: 10px 0;
}

.timer-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.timer-value {
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 6px;
}

.timer-value.warning {
    color: #ff9800;
    animation: pulse 1s infinite;
}

.timer-value.critical {
    color: #dc3545;
    animation: pulse 0.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.timer-status {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.timer-buttons {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
}

.timer-btn {
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.timer-btn.preset {
    background: #E60005;
    color: white;
}

.timer-btn.preset:hover {
    background: #b30004;
    transform: scale(1.05);
}

.timer-btn.pause {
    background: #ff9800;
    color: white;
}

.timer-btn.reset {
    background: var(--gray-200);
    color: var(--text-primary);
}

.timer-btn.reset:hover {
    background: var(--gray-300);
}

.timer-btn.start {
    background: #28a745;
    color: white;
}

.timer-btn.start:hover {
    background: #218838;
}

.timer-custom {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--gray-200);
}

.timer-input {
    width: 60px;
    padding: 6px 8px;
    border: 2px solid var(--gray-300);
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
}

.timer-input:focus {
    outline: none;
    border-color: #E60005;
}

.timer-input::placeholder {
    color: var(--gray-400);
    font-weight: 400;
}

/* ============================================================================
   EK-VERTEILUNG WIDGET
   ============================================================================ */

.ek-verteilung-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 8px;
}

.ek-item {
    background: var(--gray-50);
    border-radius: 6px;
    padding: 8px;
    text-align: center;
}

.ek-item-label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.ek-item-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #E60005;
}

/* Gesamt-Item hervorgehoben - DRK Rot */
.ek-item-total {
    background: linear-gradient(135deg, #E60005 0%, #b30004 100%);
}

.ek-item-total .ek-item-label {
    color: rgba(255,255,255,0.9);
    font-weight: 600;
}

.ek-item-total .ek-item-value {
    color: white;
    font-size: 1.5rem;
    font-weight: 800;
}

/* ============================================================================
   DARK MODE
   ============================================================================ */

[data-theme="dark"] .ek-item-total {
    box-shadow: 0 2px 8px rgba(230, 0, 5, 0.4);
}

[data-theme="dark"] .stat-card {
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

[data-theme="dark"] .stat-card.time {
    background: linear-gradient(135deg, #1a202c 0%, #0d1117 100%);
}

[data-theme="dark"] .dashboard-widget {
    background: var(--gray-800);
}

[data-theme="dark"] .widget-header {
    background: var(--gray-900);
    border-color: var(--gray-700);
}

[data-theme="dark"] .mc-belegung-bar {
    background: var(--gray-700);
}

[data-theme="dark"] .ek-item {
    background: var(--gray-700);
}

[data-theme="dark"] .timer-btn.reset {
    background: var(--gray-700);
    color: var(--text-primary);
}

[data-theme="dark"] .timer-custom {
    border-color: var(--gray-700);
}

[data-theme="dark"] .timer-input {
    background: var(--gray-700);
    border-color: var(--gray-600);
    color: white;
}

/* ============================================================================
   RESPONSIVE - iPad Landscape (1024px und kleiner)
   ============================================================================ */

@media (max-width: 1100px) {
    .dashboard-stats {
        gap: 6px;
    }
    
    .stat-card {
        padding: 6px 8px;
        gap: 5px;
        min-height: 40px;
    }
    
    .stat-card-icon {
        font-size: 1rem;
    }
    
    .stat-card-label {
        font-size: 0.55rem;
    }
    
    .stat-card-value {
        font-size: 1rem;
    }
    
    .stat-number {
        font-size: 0.9rem;
    }
    
    .stat-desc {
        font-size: 0.5rem;
    }
}

/* ============================================================================
   RESPONSIVE - iPad Portrait (768px und kleiner)
   ============================================================================ */

@media (max-width: 900px) {
    .dashboard-weather {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .weather-details {
        border-left: none;
        padding-left: 0;
        flex-direction: row;
        gap: 12px;
    }
    
    .dashboard-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
        padding: 10px 6px;
        min-height: auto;
    }
    
    .stat-card-body {
        flex-direction: column;
        gap: 2px;
    }
    
    .stat-card-values {
        flex-direction: column;
        gap: 4px;
    }
    
    .stat-card-value {
        font-size: 1.2rem;
    }
    
    .stat-number {
        font-size: 1rem;
    }
    
    .stat-desc {
        font-size: 0.6rem;
    }
    
    .stat-card-label {
        font-size: 0.55rem;
    }
}

/* ============================================================================
   RESPONSIVE - Smartphone (500px und kleiner)
   ============================================================================ */

@media (max-width: 500px) {
    .dashboard-container {
        padding: 8px;
    }
    
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-lage-info {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .timer-value {
        font-size: 2rem;
    }
    
    .ek-verteilung-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================================================
   v3.13.0: DASHBOARD WIDGET GRUPPE (Timer + Klinik nebeneinander)
   ============================================================================ */

.dashboard-widget-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dashboard-widget-compact {
    flex: 1;
}

.dashboard-widget-compact .widget-content {
    padding: 12px;
}

.dashboard-widget-compact .timer-display {
    text-align: center;
}

.dashboard-widget-compact .timer-value {
    font-size: 2rem;
    margin-bottom: 4px;
}

.dashboard-widget-compact .timer-buttons {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 8px;
}

.dashboard-widget-compact .timer-btn {
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* Klinik Dashboard Widget */
.klinik-dashboard-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.klinik-dashboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: var(--gray-50);
    border-radius: 6px;
    font-size: 0.9rem;
}

.klinik-dashboard-item .klinik-name {
    font-weight: 500;
    color: var(--text-primary);
}

.klinik-dashboard-item .klinik-capacity {
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
}

.klinik-dashboard-item .klinik-capacity.good {
    background: #dcfce7;
    color: #166534;
}

.klinik-dashboard-item .klinik-capacity.warning {
    background: #fef3c7;
    color: #92400e;
}

.klinik-dashboard-item .klinik-capacity.critical {
    background: #fee2e2;
    color: #991b1b;
}

/* Dark Mode für Klinik Widget */
[data-theme="dark"] .klinik-dashboard-item {
    background: var(--gray-100);
}

[data-theme="dark"] .klinik-dashboard-item .klinik-capacity.good {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

[data-theme="dark"] .klinik-dashboard-item .klinik-capacity.warning {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

[data-theme="dark"] .klinik-dashboard-item .klinik-capacity.critical {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

@media (min-width: 900px) {
    .dashboard-widget-group {
        flex-direction: row;
    }
}
