/* ==========================================================================
   Web-Uhr & Timer - Modernes Responsive Stylesheet & Kollaboration
   ========================================================================== */

:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --card-bg: rgba(30, 41, 59, 0.7);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #38bdf8;
    --accent-glow: rgba(56, 189, 248, 0.35);
    --accent-hover: #0ea5e9;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --radius-full: 9999px;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.2);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.3);
    --shadow-lg: 0 16px 40px rgba(0,0,0,0.4);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    --bg-primary: #f1f5f9;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e2e8f0;
    --card-bg: rgba(255, 255, 255, 0.85);
    --card-border: rgba(0, 0, 0, 0.08);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --accent: #0284c7;
    --accent-glow: rgba(2, 132, 199, 0.2);
    --accent-hover: #0369a1;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 8px 20px rgba(0,0,0,0.08);
    --shadow-lg: 0 16px 36px rgba(0,0,0,0.12);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.5;
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
    padding-bottom: env(safe-area-inset-bottom, 0);
}

/* Tabellen-Zahlen für zitterfreie Zeitanzeigen */
.tabular-numbers, 
.display-clock, 
.display-timer, 
.display-stopwatch, 
.lap-time {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

/* ==========================================================================
   Glassmorphism Panel
   ========================================================================== */
.glass-panel {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.25rem;
    padding-top: max(0.85rem, env(safe-area-inset-top, 0.85rem));
    background: var(--card-bg);
    border-bottom: 1px solid var(--card-border);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.brand-wrapper {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
}

.brand-icon {
    font-size: 1.5rem;
    animation: float 3s ease-in-out infinite;
}

.brand-title {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.action-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 0.45rem 0.75rem;
    min-height: 40px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.88rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: var(--transition);
    text-decoration: none;
    user-select: none;
}

.action-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent);
}

/* ==========================================================================
   Sync Status & Audio Status Badges
   ========================================================================== */
.call-status-badge {
    padding: 0.45rem 0.95rem;
    min-height: 40px;
    border-radius: var(--radius-full);
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    border: 2px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    transition: var(--transition);
    user-select: none;
}

.call-status-badge.status-idle {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.4);
}

.call-status-badge.status-idle:hover {
    background: rgba(16, 185, 129, 0.25);
}

.call-status-badge.status-busy {
    background: rgba(239, 68, 68, 0.25);
    color: #fca5a5;
    border-color: var(--danger);
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.4);
    animation: pulse 1.5s infinite;
}

.call-status-badge.status-busy:hover {
    background: rgba(239, 68, 68, 0.35);
}

/* Call Status Banner */
.call-status-banner {
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.9) 0%, rgba(185, 28, 28, 0.95) 100%);
    color: #ffffff;
    padding: 0.65rem 1rem;
    text-align: center;
    font-size: 0.95rem;
    letter-spacing: 0.03em;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.35);
    animation: fadeIn 0.3s ease;
}

.call-status-banner.hidden {
    display: none;
}

.call-status-banner .banner-content {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

/* Dynamische Farbcodierung für den gesamten Body bei "Im Gespräch" */
body.body-call-busy {
    background: radial-gradient(circle at 50% 10%, #3f1118 0%, #0f172a 100%);
}

body.body-call-busy .app-header {
    border-bottom: 2px solid rgba(239, 68, 68, 0.6);
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.25);
}

body.body-call-busy .clock-ambient-glow {
    background: radial-gradient(circle, rgba(239, 68, 68, 0.4) 0%, transparent 70%);
}

.sync-status-badge {
    padding: 0.45rem 0.85rem;
    min-height: 40px;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    transition: var(--transition);
    user-select: none;
    background: var(--bg-secondary);
}

.sync-status-badge.mode-synced {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.35);
}

.sync-status-badge.mode-local {
    background: rgba(100, 116, 139, 0.2);
    color: var(--text-muted);
    border-color: var(--card-border);
}

.sync-status-badge.mode-connecting {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
    border-color: rgba(245, 158, 11, 0.3);
    animation: pulse 2s infinite;
}

.audio-status-badge {
    padding: 0.45rem 0.85rem;
    min-height: 40px;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: var(--transition);
    user-select: none;
}

.audio-status-badge.active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.3);
}

.audio-status-badge.inactive {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
    border-color: rgba(245, 158, 11, 0.3);
    animation: pulse 2s infinite;
}

/* Toast Benachrichtigung */
.app-toast {
    position: fixed;
    top: 75px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: var(--bg-secondary);
    border: 1px solid var(--accent);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    color: var(--text-primary);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 90vw;
    text-align: center;
}

.app-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   Tab Navigation Bar
   ========================================================================== */
.tab-nav-container {
    max-width: 900px;
    margin: 1.25rem auto 0.5rem;
    padding: 0 1rem;
    width: 100%;
}

.tab-nav {
    display: flex;
    background: var(--bg-secondary);
    border: 1px solid var(--card-border);
    padding: 0.35rem;
    border-radius: var(--radius-full);
    gap: 0.25rem;
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
    scrollbar-width: none;
}

.tab-nav::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    flex: 1;
    min-width: 75px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.65rem 0.9rem;
    min-height: 44px;
    border-radius: var(--radius-full);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    transition: var(--transition);
    white-space: nowrap;
}

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

.tab-btn.active {
    background: var(--accent);
    color: #ffffff;
    box-shadow: 0 4px 12px var(--accent-glow);
}

/* ==========================================================================
   Main Content & Tab Panes
   ========================================================================== */
.main-container {
    max-width: 900px;
    margin: 0.75rem auto 2.5rem;
    padding: 0 1rem;
    width: 100%;
    flex: 1;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

/* ==========================================================================
   1. Uhrzeit (Clock) Section
   ========================================================================== */
.clock-card {
    padding: 3.5rem 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.clock-ambient-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(400px, 85vw);
    height: min(400px, 85vw);
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.clock-content {
    position: relative;
    z-index: 1;
}

.display-clock {
    font-size: clamp(2.8rem, 12.5vw, 7.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.05;
    color: var(--text-primary);
    text-shadow: 0 0 40px var(--accent-glow);
    margin-bottom: 0.75rem;
    word-break: keep-all;
    white-space: nowrap;
}

.clock-seconds {
    font-size: 0.45em;
    opacity: 0.75;
    font-weight: 400;
    margin-left: 0.05em;
}

.display-date {
    font-size: clamp(1rem, 3.2vw, 1.6rem);
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 2rem;
}

.clock-controls {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ==========================================================================
   2. Timer Section
   ========================================================================== */
.timer-card {
    padding: 2.5rem 1.25rem;
    text-align: center;
}

.timer-visual-container {
    position: relative;
    width: 100%;
    max-width: 280px;
    aspect-ratio: 1 / 1;
    margin: 0 auto 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timer-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.timer-track {
    fill: none;
    stroke: var(--bg-tertiary);
    stroke-width: 8;
}

.timer-progress {
    fill: none;
    stroke: var(--accent);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.4s ease, stroke 0.3s ease;
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

.timer-inner-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.display-timer {
    font-size: clamp(2.2rem, 7.8vw, 3.8rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.timer-state-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 0.25rem;
}

/* Timer Time Picker Inputs */
.timer-inputs {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 1.5rem;
}

.time-input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.time-input-group label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.time-input-field {
    width: min(72px, 25vw);
    height: 56px;
    background: var(--bg-secondary);
    border: 2px solid var(--card-border);
    color: var(--text-primary);
    font-size: 1.7rem;
    font-weight: 700;
    text-align: center;
    border-radius: var(--radius-md);
    outline: none;
    transition: var(--transition);
}

.time-input-field:focus {
    border-color: var(--accent);
    box-shadow: 0 0 16px var(--accent-glow);
}

.time-separator {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-top: 1rem;
}

/* Quick Add Presets */
.preset-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 1.75rem;
}

.preset-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    padding: 0.45rem 0.85rem;
    min-height: 38px;
    border-radius: var(--radius-full);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.preset-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--accent);
}

/* Announcements Box */
.announcements-box {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    text-align: left;
}

.announcements-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
    flex-wrap: wrap;
}

.announcements-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
}

.announcement-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.announcement-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--accent);
    cursor: pointer;
}

/* ==========================================================================
   3. Stoppuhr (Stopwatch) Section
   ========================================================================== */
.stopwatch-card {
    padding: 2.5rem 1.25rem;
    text-align: center;
}

.display-stopwatch {
    font-size: clamp(2.6rem, 9.5vw, 5.2rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 2rem;
    text-shadow: 0 0 30px var(--accent-glow);
    white-space: nowrap;
}

.stopwatch-ms {
    font-size: 0.55em;
    opacity: 0.75;
}

.laps-container {
    margin-top: 2rem;
    border-top: 1px solid var(--card-border);
    padding-top: 1.5rem;
    max-height: 320px;
    overflow-y: auto;
}

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

.laps-table th {
    color: var(--text-muted);
    font-weight: 600;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--card-border);
}

.laps-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.lap-fastest {
    color: var(--success);
    font-weight: 700;
}

.lap-slowest {
    color: var(--danger);
    font-weight: 700;
}

/* ==========================================================================
   4. Wecker (Alarm Clock) Section
   ========================================================================== */
.alarm-card {
    padding: 2rem 1.25rem;
}

.alarm-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.alarm-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
    background: var(--bg-secondary);
    padding: 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--card-border);
    margin-bottom: 1.5rem;
}

.alarm-form .form-group {
    flex: 1;
    min-width: 140px;
}

.alarm-form label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
    font-weight: 600;
}

.alarms-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.alarm-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-secondary);
    padding: 0.9rem 1.15rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--card-border);
    transition: var(--transition);
}

.alarm-item.disabled {
    opacity: 0.5;
}

.alarm-time-display {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--text-primary);
}

.alarm-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.alarm-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

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

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-tertiary);
    transition: .3s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

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

input:checked + .slider:before {
    transform: translateX(20px);
}

/* ==========================================================================
   Buttons & Controls
   ========================================================================== */
.controls-row {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.7rem 1.4rem;
    min-height: 44px;
    border-radius: var(--radius-full);
    font-size: 0.98rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition);
    user-select: none;
}

.btn-primary {
    background: var(--accent);
    color: #ffffff;
    box-shadow: 0 4px 14px var(--accent-glow);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--danger);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

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

.btn-secondary:hover {
    background: var(--bg-tertiary);
}

.btn-icon-only {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    min-height: 36px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 0.85rem 1.8rem;
    font-size: 1.05rem;
}

/* Inputs */
.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    min-height: 44px;
    background: var(--bg-primary);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

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

/* ==========================================================================
   Alarm Ringing Overlay Modal
   ========================================================================== */
.alarm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    animation: fadeIn 0.3s ease;
}

.alarm-overlay.hidden {
    display: none;
}

.alarm-modal {
    max-width: 480px;
    width: 100%;
    padding: 2.25rem 1.5rem;
    text-align: center;
    border: 2px solid var(--danger);
    box-shadow: 0 0 50px rgba(239, 68, 68, 0.5);
    animation: alarmPulse 1.2s infinite alternate;
}

.alarm-modal-icon {
    font-size: 3.5rem;
    animation: shake 0.6s infinite;
}

.alarm-modal-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--danger);
    margin: 0.5rem 0;
}

.alarm-modal-desc {
    font-size: 1.15rem;
    color: var(--text-primary);
    margin-bottom: 2rem;
}

.alarm-modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ==========================================================================
   Login Page Styling
   ========================================================================== */
.login-body {
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 20%, #1e293b 0%, #0f172a 100%);
    padding: 1rem;
}

.login-wrapper {
    width: 100%;
    max-width: 420px;
    margin: auto;
}

.login-card {
    padding: 2.25rem 1.75rem;
}

.login-header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.login-icon {
    font-size: 2.75rem;
    margin-bottom: 0.5rem;
}

.login-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 0.88rem;
    margin-top: 0.25rem;
}

.password-input-group {
    position: relative;
    display: flex;
}

.btn-toggle-pw {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 6px;
}

.login-form .form-group {
    margin-bottom: 1.25rem;
}

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

.alert {
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fcd34d;
}

.login-footer {
    margin-top: 1.75rem;
    text-align: center;
    color: var(--text-muted);
}

.login-footer code {
    background: var(--bg-secondary);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    color: var(--accent);
}

/* ==========================================================================
   Fullscreen Mode Styles
   ========================================================================== */
body:fullscreen,
body:-webkit-full-screen {
    background-color: #000000;
}

body:fullscreen .app-header,
body:-webkit-full-screen .app-header {
    background: rgba(0, 0, 0, 0.85);
}

body:fullscreen .display-clock,
body:-webkit-full-screen .display-clock {
    font-size: clamp(4.5rem, 19vw, 13rem);
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

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

@keyframes alarmPulse {
    from { box-shadow: 0 0 30px rgba(239, 68, 68, 0.4); }
    to { box-shadow: 0 0 80px rgba(239, 68, 68, 0.9); }
}

@keyframes shake {
    0%, 100% { transform: rotate(0deg); }
    20% { transform: rotate(-12deg); }
    40% { transform: rotate(12deg); }
    60% { transform: rotate(-8deg); }
    80% { transform: rotate(8deg); }
}

/* ==========================================================================
   Responsive Breakpoints: Mobile, Tablet, Smart Display & Landscape
   ========================================================================== */

/* Tablet & Mobile Screens */
@media (max-width: 768px) {
    .app-header {
        padding: 0.65rem 0.85rem;
    }

    .brand-title {
        font-size: 1.05rem;
    }

    .header-actions {
        gap: 0.35rem;
    }

    .action-btn, .sync-status-badge, .audio-status-badge {
        padding: 0.35rem 0.6rem;
        font-size: 0.8rem;
        min-height: 38px;
    }

    .tab-btn {
        padding: 0.5rem 0.65rem;
        font-size: 0.85rem;
    }

    .clock-card {
        padding: 2.5rem 1rem;
    }

    .timer-card, .stopwatch-card, .alarm-card {
        padding: 1.75rem 1rem;
    }

    .controls-row .btn {
        flex: 1 1 calc(50% - 0.75rem);
        min-width: 130px;
    }

    .alarm-form {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Kleine Smartphones (z. B. iPhone SE, 320px - 380px) */
@media (max-width: 420px) {
    .brand-title {
        display: none; /* Icon bleibt sichtbar */
    }

    .tab-btn .tab-text {
        font-size: 0.8rem;
    }

    .time-input-field {
        width: 58px;
        height: 50px;
        font-size: 1.4rem;
    }

    .controls-row .btn {
        flex: 1 1 100%;
    }
}

/* Querformat auf Mobilgeräten (z. B. Handy quer auf Ladestation / Nachttisch) */
@media (max-height: 520px) and (orientation: landscape) {
    .app-header {
        padding: 0.4rem 1rem;
    }

    .tab-nav-container {
        margin: 0.5rem auto;
    }

    .clock-card {
        padding: 1.25rem 1rem;
    }

    .display-clock {
        font-size: clamp(2.5rem, 12vh, 4.5rem);
        margin-bottom: 0.25rem;
    }

    .display-date {
        margin-bottom: 0.75rem;
    }

    .timer-visual-container {
        max-width: 170px;
        margin-bottom: 1rem;
    }

    .timer-card, .stopwatch-card {
        padding: 1rem;
    }
}

/* ==========================================================================
   CALLCENTER & GESPRÄCHSVERLAUF STYLES
   ========================================================================== */
.calls-card {
    padding: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.calls-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--card-border);
}

.calls-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: monospace;
}

.stat-value-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.stat-subtext {
    font-family: monospace;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.badge-status-lg {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.badge-status-lg.status-idle {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.badge-status-lg.status-busy {
    background: rgba(239, 68, 68, 0.25);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.5);
    animation: pulse-red-badge 2s infinite ease-in-out;
}

.history-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
}

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

.history-table th {
    background: var(--bg-tertiary);
    padding: 0.85rem 1.25rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--card-border);
}

.history-table td {
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

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

.history-table .empty-row td {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
}

@media (max-width: 600px) {
    .calls-card {
        padding: 1rem;
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    .stat-number {
        font-size: 1.4rem;
    }
}

