/* assets/css/dashboard.css */

/* --- General Layout & Mobile Fixes --- */
.main-content {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    padding: 1.5rem;
}

/* Headings Responsive */
.page-title {
    font-size: 2.5rem;
    color: var(--accent-1);
    margin: 0;
}

h2 {
    font-size: 1.4rem;
    color: var(--text-main);
}

@media (max-width: 768px) {
    .page-title { font-size: 1.8rem; }
    h2 { font-size: 1.2rem; }
    .top-bar { flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem; }
    .top-bar-left { width: 100%; justify-content: space-between; }
    .actions { width: 100%; justify-content: flex-end; }
    .hide-mobile-text { display: none; }
    .btn-responsive-text { padding: 12px; }
}

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

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* --- Stats Grid --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: var(--glass-border);
    padding: 1.5rem;
    border-radius: 24px;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: default;
}

/* Clickable Stats */
.stat-card.clickable-stat {
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.stat-card.clickable-stat:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border-color: var(--accent-1);
}

.stat-card.clickable-stat:active {
    transform: scale(0.98);
}

.stat-card h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chart-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 700;
    font-family: var(--font-heading);
    margin-bottom: 0.8rem;
    position: relative;
    background: conic-gradient(var(--border-color) 0%, var(--border-color) 0%);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.chart-circle::before {
    content: '';
    position: absolute;
    width: 76px; height: 76px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.6);
    backdrop-filter: blur(5px);
}

.chart-value { position: relative; z-index: 1; color: var(--text-main); }

.stat-label {
    margin-top: 0.2rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex; align-items: center; gap: 4px;
    opacity: 0.7;
}

/* --- Birthday Section --- */
.birthday-section { margin-bottom: 2.5rem; width: 100%; }
.section-title-row { margin-bottom: 1rem; }
.section-title-row small { color: var(--text-muted); font-size: 0.9rem; font-weight: 400; }

.birthday-scroll-container {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-1) transparent;
    -webkit-overflow-scrolling: touch;
    margin: 0 -0.5rem; /* Negativer Margin für Full-Width Swipe */
}

.birthday-card {
    min-width: 200px;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--accent-1), #9c4b82);
    color: white;
    padding: 1.2rem;
    border-radius: 20px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 8px 15px rgba(121, 47, 97, 0.2);
    position: relative;
    overflow: hidden;
}

.birthday-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 12px 25px rgba(121, 47, 97, 0.4);
}

.birthday-card::after {
    content: '🎉'; position: absolute; bottom: -5px; right: 5px;
    font-size: 4rem; opacity: 0.15; pointer-events: none;
}

.birthday-card .name {
    font-family: var(--font-heading); font-weight: 700; font-size: 1.2rem;
    display: block; margin-bottom: 0.2rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.birthday-card .date { font-size: 0.9rem; opacity: 0.9; display: block; margin-bottom: 0.8rem; }
.birthday-card .age {
    background: rgba(255,255,255,0.25); padding: 4px 10px; border-radius: 10px;
    font-size: 0.8rem; font-weight: 600; display: inline-block; backdrop-filter: blur(4px);
}

/* --- List Controls (Search & Filter) --- */
.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.list-controls {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    padding: 0.6rem 1rem;
    border-radius: 16px;
    flex-wrap: wrap;
    flex: 1;
}

.search-wrap {
    flex: 2;
    min-width: 200px;
    position: relative;
    display: flex;
    align-items: center;
}
.search-wrap i { position: absolute; left: 10px; color: var(--text-muted); }
.search-wrap input {
    width: 100%; padding: 8px 10px 8px 35px; border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.1); background: rgba(255,255,255,0.5);
    font-family: var(--font-body);
}

.filter-wrap {
    display: flex; gap: 0.5rem; flex: 1;
}
.filter-wrap select {
    padding: 8px 12px; border-radius: 10px; border: 1px solid rgba(0,0,0,0.1);
    background: rgba(255,255,255,0.5); cursor: pointer; flex: 1;
}

.btn-icon-small {
    background: rgba(0,0,0,0.05); border: none; width: 36px; height: 36px;
    border-radius: 10px; cursor: pointer; color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
}
.btn-icon-small:hover { background: var(--accent-1); color: white; }

/* Responsive List Controls */
@media (max-width: 768px) {
    .section-header-row { flex-direction: column; align-items: stretch; }
    .list-controls { flex-direction: column; align-items: stretch; }
    .search-wrap { width: 100%; }
    .filter-wrap { width: 100%; }
}

/* --- Customer Table --- */
.table-container {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: var(--glass-border);
    border-radius: 24px;
    padding: 1.5rem;
    box-shadow: var(--shadow-soft);
}

.customer-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.customer-table th {
    text-align: left; padding: 0.8rem; color: var(--text-muted);
    font-weight: 600; font-size: 0.85rem; text-transform: uppercase;
    border-bottom: 2px solid rgba(0,0,0,0.05); white-space: nowrap;
}

.customer-table td {
    padding: 1rem 0.8rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    vertical-align: middle;
    font-size: 0.95rem;
    transition: background 0.2s;
}

/* Starker Hover Effekt auf Desktop */
.customer-table tr:hover td {
    background-color: rgba(121, 47, 97, 0.1); /* Deutliches Lila */
    color: var(--text-main);
    cursor: pointer;
}
.customer-table tr:hover td:first-child {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}
.customer-table tr:hover td:last-child {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

/* --- MOBILE TABLE CARD VIEW (Das "Liste ist kacke" Fix) --- */
@media (max-width: 768px) {
    .table-container { background: transparent; padding: 0; box-shadow: none; border: none; }
    
    .customer-table, .customer-table tbody, .customer-table tr, .customer-table td {
        display: block; width: 100%;
    }
    
    .customer-table thead { display: none; } /* Header weg */

    .customer-table tr {
        background: var(--bg-card);
        backdrop-filter: blur(12px);
        border: var(--glass-border);
        border-radius: 16px;
        margin-bottom: 1rem;
        padding: 1rem;
        box-shadow: var(--shadow-soft);
        position: relative;
    }
    
    /* Hover auf Mobile ist eher Touch, daher Active State */
    .customer-table tr:active {
        transform: scale(0.98);
        background: rgba(121, 47, 97, 0.05);
    }

    .customer-table td {
        padding: 0.5rem 0;
        border-bottom: 1px solid rgba(0,0,0,0.05);
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
    }
    
    .customer-table td:last-child { border-bottom: none; }

    /* Labels für Mobile */
    .customer-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        text-transform: uppercase;
        font-size: 0.75rem;
        margin-right: 1rem;
    }
    
    /* Name hervorheben */
    .customer-table td:first-child {
        font-size: 1.1rem;
        font-weight: 700;
        color: var(--accent-1);
    }
    .customer-table td:first-child::before { display: none; }
}

/* Status Badges */
.badge {
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}
.badge-paid { background-color: rgba(76, 175, 80, 0.15); color: #2e7d32; border: 1px solid rgba(76, 175, 80, 0.2); }
.badge-unpaid { background-color: rgba(244, 67, 54, 0.15); color: #c62828; border: 1px solid rgba(244, 67, 54, 0.2); }
.badge-soon { background-color: rgba(255, 152, 0, 0.15); color: #ef6c00; border: 1px solid rgba(255, 152, 0, 0.2); }