/* Design System Variables - Updated to match Official Website (Radiate Theme) */
:root {
    /* Modern Colors */
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-sidebar: #0f172a;
    --sidebar-accent: #1e40af;
    
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-light: #ffffff;
    
    --accent-green: #10b981;
    --accent-blue: #1e73be;
    --accent-blue-hover: #155a96;
    --accent-red: #ef4444;
    
    --border-color: #e5e7eb;
    
    /* Typography */
    --font-heading: 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    /* Modern Radii & Shadows */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-full: 9999px;
    
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --shadow-premium: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    
    /* Transitions */
    --transition: cubic-bezier(0.4, 0, 0.2, 1) 0.3s;
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Hintergrundbild nur hinter der Sidebar */
.sidebar::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('https://dakv-tuttlingen.hopto.org/wp-content/uploads/2026/02/cropped-150x100-Final-grau-copy-scaled-4.jpg');
    background-size: cover;
    background-position: center;
    opacity: 0.05;
    z-index: 0;
    pointer-events: none;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 600;
}

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ===================== SIDEBAR (Modern Dark) ===================== */
.sidebar {
    width: 270px;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 60%, #0f172a 100%);
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    padding: 0;
    position: relative;
    z-index: 100;
    box-shadow: 4px 0 24px rgba(0,0,0,0.3);
    flex-shrink: 0;
    overflow: hidden;
}

/* Decorative top glow line */
.sidebar::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #6366f1, #8b5cf6);
}

.brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1.5rem 1.5rem;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    background: rgba(255,255,255,0.02);
}

.brand img {
    margin-bottom: 1rem !important;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    border: 2px solid rgba(255,255,255,0.1);
    filter: brightness(0.9) contrast(1.1);
}

.brand h1 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #f1f5f9;
    line-height: 1.4;
    letter-spacing: 0.01em;
}

.brand p {
    font-size: 0.72rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 4px;
}

/* Nav menu */
.nav-menu {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 1.25rem 0.875rem;
    overflow-y: auto;
}

/* Custom scrollbar for nav */
.nav-menu::-webkit-scrollbar { width: 3px; }
.nav-menu::-webkit-scrollbar-track { background: transparent; }
.nav-menu::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

.nav-item {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    font-family: var(--font-body);
    font-weight: 500;
    position: relative;
    letter-spacing: 0.01em;
}

.nav-item i {
    font-size: 1.2rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.nav-item span {
    flex: 1;
}

.nav-item:hover {
    background: rgba(255,255,255,0.07);
    color: #f1f5f9;
    transform: translateX(3px);
}

.nav-item:hover i {
    color: #60a5fa;
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(59,130,246,0.25), rgba(99,102,241,0.15));
    color: #93c5fd;
    border: 1px solid rgba(59,130,246,0.3);
    box-shadow: 0 0 20px rgba(59,130,246,0.1), inset 0 1px 0 rgba(255,255,255,0.05);
}

.nav-item.active i {
    color: #60a5fa;
    filter: drop-shadow(0 0 6px rgba(96,165,250,0.6));
}

.nav-item.active span {
    color: #e2e8f0;
    font-weight: 600;
}

/* Active indicator bar */
.nav-item.active::before {
    content: '';
    position: absolute;
    left: -0.875rem;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: linear-gradient(180deg, #3b82f6, #6366f1);
    border-radius: 0 3px 3px 0;
}

/* Sidebar section label */
.nav-section-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #475569;
    padding: 0.75rem 1rem 0.25rem;
    margin-top: 0.5rem;
}

/* Sidebar footer */
.sidebar-footer {
    padding: 1rem 0.875rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.07);
    background: rgba(0,0,0,0.2);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 0.5rem;
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(59,130,246,0.4);
}

.user-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-details .name {
    font-weight: 600;
    font-size: 0.85rem;
    color: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-details .role {
    font-size: 0.72rem;
    color: #64748b;
    white-space: nowrap;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: #f8fafc;
}

.topbar {
    height: 90px;
    padding: 0 2.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar h2 {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--text-main);
}

#current-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    background: #fff;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.pages {
    padding: 1.5rem 3rem 3rem;
    flex: 1;
    background: #f8fafc;
}

.page {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.page.active {
    display: block;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header p {
    color: var(--text-muted);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1.75rem;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--accent-blue);
    color: var(--text-light);
    box-shadow: 0 4px 14px rgba(30, 115, 190, 0.3);
}

.btn-primary:hover {
    background-color: var(--accent-blue-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 115, 190, 0.4);
}

.btn-secondary {
    background-color: white;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background-color: #f9fafb;
    border-color: #d1d5db;
    transform: translateY(-1px);
}

.btn-icon {
    padding: 0.5rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 4px;
    font-size: 1.2rem;
    transition: var(--transition);
}

.btn-icon:hover {
    color: var(--accent-red);
    background-color: rgba(255, 59, 48, 0.1);
}

/* Dashboard Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: var(--bg-card);
    padding: 1.75rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

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

.stat-card.highlight {
    background: linear-gradient(135deg, #1e73be, #155a96);
    color: var(--text-light);
    border: none;
}

.stat-card.highlight .stat-icon {
    background-color: rgba(255, 255, 255, 0.15);
    color: var(--text-light);
}

.stat-card.highlight p {
    color: var(--text-light);
}

.stat-card.highlight h3 {
    color: rgba(255,255,255,0.8);
}

.stat-icon {
    width: 65px;
    height: 65px;
    border-radius: var(--radius-md);
    background-color: rgba(30, 115, 190, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--accent-blue);
}

.stat-info h3 {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.35rem;
    font-weight: 700;
}

.stat-info p {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

/* Dashboard Widgets Grid */
.dashboard-widgets {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 1024px) {
    .dashboard-widgets {
        grid-template-columns: 1fr;
    }
}

/* Widgets */
.widget {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

/* Calendar Styles */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.calendar-grid-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

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

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    border: 1px solid transparent;
}

.calendar-day:hover:not(.empty) {
    background-color: rgba(30, 115, 190, 0.1);
    color: var(--accent-blue);
}

.calendar-day.empty {
    cursor: default;
}

.calendar-day.today {
    font-weight: 600;
    color: var(--accent-red);
}

.calendar-day.selected {
    background-color: var(--accent-blue);
    color: var(--text-light);
    font-weight: 600;
}

.calendar-day.has-note::after {
    content: '';
    position: absolute;
    bottom: 4px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: var(--accent-green);
}

.calendar-day.has-termin {
    background-color: rgba(16, 185, 129, 0.2);
    box-shadow: inset 0 0 0 2px var(--accent-green);
    font-weight: 800;
}


.calendar-day.has-termin::after {
    content: '';
    position: absolute;
    bottom: 2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--accent-green);
    box-shadow: 0 0 8px var(--accent-green);
}

.calendar-day.selected.has-note::after,
.calendar-day.selected.has-termin::after {
    background-color: var(--text-light);
    box-shadow: none;
}

.widget h3 {
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
}

.activity-list {
    list-style: none;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

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

.activity-icon {
    min-width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(52, 199, 89, 0.1);
    color: var(--accent-green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.activity-icon.expense {
    background-color: rgba(255, 59, 48, 0.1);
    color: var(--accent-red);
}

.activity-icon.person {
    background-color: rgba(212, 175, 55, 0.1);
    color: var(--accent-gold);
}

.activity-details {
    flex: 1;
}

.activity-details p {
    font-weight: 500;
}

.activity-details span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.activity-amount {
    font-weight: 600;
}

.activity-amount.positive {
    color: var(--accent-green);
}

.activity-amount.negative {
    color: var(--accent-red);
}

/* Tables */
.table-container {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th {
    background-color: #fafbfc;
    padding: 1.25rem 1.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 1.15rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    font-size: 0.95rem;
    color: var(--text-main);
}

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

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

.badge {
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.025em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
}

.badge-income { background: rgba(16, 185, 129, 0.1); color: #059669; }
.badge-expense { background: rgba(239, 68, 68, 0.1); color: #dc2626; }

.badge-role-Vorstand { background: rgba(245, 158, 11, 0.1); color: #d97706; }
.badge-role-Mitglied { background: #f3f4f6; color: #4b5563; }
.badge-role-Mitarbeiter { background: rgba(30, 115, 190, 0.1); color: var(--accent-blue); }

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background-color: #fcfcfc;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    flex: 1;
    min-width: 150px;
}

.filter-group i {
    position: absolute;
    left: 0.8rem;
    color: var(--text-muted);
}

.filter-group input, .filter-group select {
    width: 100%;
    padding: 0.5rem 0.8rem 0.5rem 2.2rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9rem;
    background: white;
}

.filter-group select {
    padding-left: 0.8rem;
}

/* Sortable Headers */
th.sortable {
    cursor: pointer;
    transition: background 0.2s;
    user-select: none;
    white-space: nowrap;
}

th.sortable:hover {
    background-color: rgba(0,0,0,0.05) !important;
    color: var(--accent-blue) !important;
}

th.sortable i {
    font-size: 0.8rem;
    margin-left: 4px;
    opacity: 0.5;
}

/* Table Row Interactivity */
.data-table tbody tr {
    cursor: pointer;
    transition: background 0.15s;
}

.data-table tbody tr:hover {
    background-color: rgba(30, 115, 190, 0.05) !important;
}

.data-table tbody tr td .btn-icon {
    position: relative;
    z-index: 2; /* Ensure buttons are clickable over the row */
}

/* Empty States */
.empty-state {
    padding: 4rem 2rem;
    text-align: center;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(15, 23, 42, 0.5); /* Modern blue-tinted overlay */
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

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

.modal {
    background: white;
    width: 95%;
    max-width: 600px;
    border-radius: var(--radius-lg);
    padding: 0; /* Let content handle padding */
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(30px);
    transition: var(--transition);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 10;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
}

.modal-footer {
    padding: 1.25rem 2rem;
    background: #f9fafb;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    position: sticky;
    bottom: 0;
}

.modal-wide {
    max-width: 900px;
}

.modal-tabs {
    display: flex;
    gap: 1rem;
    border-bottom: 1px solid var(--border-color);
    margin: 1rem -2rem 0 -2rem;
    padding: 0 2rem;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.modal-header {
    background: #fcfcfc;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.tab-btn {
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.2s;
    font-size: 0.95rem;
}

.tab-btn:hover {
    color: var(--accent-blue);
    background: rgba(30, 115, 190, 0.03);
}

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

.tab-content {
    display: none;
    padding: 1rem 0;
}

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

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 800;
}

.btn-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}

.btn-close:hover {
    color: var(--accent-red);
}

.modal form {
    padding: 1.5rem 0;
}

.form-group {
    margin-bottom: 1.5rem;
    padding: 0 2rem;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input, 
.form-group select, 
.form-group textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-family: var(--font-body);
    transition: var(--transition);
    background: #f9fafb;
    outline: none;
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 4px rgba(30, 115, 190, 0.1);
    background: #fff;
}

.radio-group {
    display: flex;
    gap: 1rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

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

/* --- Responsive Design --- */

.mobile-only {
    display: none !important;
}

.topbar-left {
    display: flex;
    align-items: center;
}

.sidebar-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

/* Tablet & Mobile (Standard: < 1024px) */
@media (max-width: 1024px) {
    .mobile-only {
        display: flex !important;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        box-shadow: 10px 0 30px rgba(0,0,0,0.1);
        z-index: 100;
    }

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

    .sidebar.active ~ .sidebar-overlay {
        opacity: 1;
        pointer-events: all;
    }

    .main-content {
        width: 100%;
    }

    .topbar {
        padding: 0 1.5rem;
    }

    .pages {
        padding: 0 1.5rem 2rem;
    }

    .topbar h2 {
        font-size: 1.5rem;
    }
}

/* =============================================
   MOBILE (< 768px) — Vollständig optimiert
   ============================================= */
@media (max-width: 768px) {

    /* ---- Layout ---- */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .dashboard-widgets {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }

    .topbar {
        height: 64px;
        padding: 0 1rem;
    }

    .topbar h2 {
        font-size: 1.15rem;
    }

    #current-date { display: none; }

    .pages {
        padding: 1rem 1rem 2rem !important;
    }

    /* ---- Page Header — Buttons stapeln ---- */
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        margin-bottom: 1.25rem;
    }

    .page-header p { font-size: 0.85rem; }

    .page-header .btn,
    .page-header div[style*="display:flex"] {
        width: 100%;
        flex-direction: column;
        gap: 0.5rem !important;
    }

    .page-header .btn {
        justify-content: center;
    }

    /* ---- Stat Cards ---- */
    .stat-card {
        padding: 1rem;
        gap: 1rem;
    }

    .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 1.5rem;
    }

    .stat-info p { font-size: 1.4rem; }

    /* ---- Modals ---- */
    .modal-overlay {
        padding: 0.5rem;
        align-items: flex-end;
    }

    .modal {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 20px 20px 0 0 !important;
        max-height: 90vh;
        overflow-y: auto;
    }

    .modal-header, .modal-footer {
        padding: 1rem 1.25rem;
    }

    .modal-body {
        padding: 1rem 1.25rem;
    }

    .modal-footer {
        flex-direction: column;
        gap: 0.5rem;
    }

    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }

    .form-group {
        padding: 0;
        margin-bottom: 1rem;
    }

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

    /* ---- Tabellen als Cards ---- */
    .table-container {
        border-radius: var(--radius-md);
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .data-table { min-width: 500px; }

    .data-table th,
    .data-table td {
        padding: 0.75rem 0.9rem;
        font-size: 0.82rem;
    }

    /* ---- Filter Bar ---- */
    .filter-bar {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
    }

    .filter-group { min-width: 100%; }

    /* ---- School Tabs ---- */
    .school-tabs {
        gap: 0.25rem !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0;
        flex-wrap: nowrap !important;
    }

    .tab-btn {
        white-space: nowrap;
        padding: 0.5rem 0.8rem;
        font-size: 0.82rem;
    }

    /* ---- Aufgaben Kanban ---- */
    #aufgaben-kanban {
        grid-template-columns: 1fr !important;
    }

    /* ---- Dashboard Widgets ---- */
    .widget {
        padding: 1.25rem !important;
    }

    .widget h3 { font-size: 1.1rem; }

    /* ---- Nav Items Mobile ---- */
    .nav-item {
        padding: 0.65rem 0.875rem;
        font-size: 0.85rem;
    }

    /* ---- Hilfe Grid ---- */
    #hilfe > div > div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* ---- Benutzer-Info ---- */
    .user-details .name { font-size: 0.8rem; }

    /* ---- Buchhaltung stats ---- */
    #buchhaltung .stats-grid {
        grid-template-columns: 1fr !important;
    }
}

/* =============================================
   SEHR KLEINES HANDY (< 480px)
   ============================================= */
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr !important;
    }

    .brand h1 { font-size: 0.9rem; }

    .sidebar { width: 280px; }

    .topbar h2 { font-size: 1rem; }

    .stat-info p { font-size: 1.2rem; }

    .pages { padding: 0.75rem 0.75rem 2rem !important; }

    .page-header { gap: 0.5rem; }

    .data-table { min-width: 420px; }
}

/* Upload Progress Bar Styling */
#upload-progress-container {
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

#upload-progress-bar {
    background: linear-gradient(90deg, var(--accent-blue), #4f46e5, var(--accent-blue));
    background-size: 200% 100%;
    animation: progress-animation 2s linear infinite;
}

@keyframes progress-animation {
    0% { background-position: 200% 0; }
    100% { background-position: 0 0; }
}

