/**
 * Support Cases Analytics - Dashboard Styles
 */

:root {
    /* Waschsalon Trier Farben */
    --ws-blue: #2B9FD9;
    --ws-blue-dark: #1A7AB3;
    --ws-blue-light: #5BB8E5;
    --ws-orange: #F5A623;
    --ws-orange-dark: #E09000;
    --ws-yellow: #FFD93D;

    --bg-primary: #0D3B54;
    --bg-secondary: #134B68;
    --bg-tertiary: #1A5F82;
    --text-primary: #ffffff;
    --text-secondary: #B8D4E8;
    --text-muted: #7AAFC9;
    --accent: #F5A623;
    --accent-hover: #E09000;
    --success: #10b981;
    --warning: #F5A623;
    --danger: #ef4444;
    --border: #1A5F82;
    --sidebar-width: 260px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

/* ===== LOGIN PAGE ===== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg-primary), var(--bg-secondary));
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 1rem;
}

.login-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.5rem;
}

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

.login-header svg {
    color: var(--accent);
    margin-bottom: 1rem;
}

.login-header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

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

.login-form label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.login-form input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-form input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* ===== ALERTS ===== */
.alert {
    padding: 0.875rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

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

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--accent-hover);
}

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

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

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* ===== APP LAYOUT ===== */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.sidebar-header .logo {
    width: 120px;
    max-width: 100%;
    height: auto;
    margin-bottom: 0.5rem;
}

.sidebar-header h2 {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.nav-menu {
    list-style: none;
    padding: 1rem 0;
    flex: 1;
}

.nav-item {
    margin: 0.25rem 0.75rem;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
}

.nav-item a:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-item.active a {
    background: rgba(245, 166, 35, 0.15);
    color: var(--accent);
}

.nav-item .icon {
    font-size: 1.125rem;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-footer span {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.profile-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.profile-link:hover {
    color: var(--accent);
}

.logout-btn {
    color: var(--danger);
    text-decoration: none;
    font-size: 0.875rem;
}

.logout-btn:hover {
    text-decoration: underline;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem;
    max-width: calc(100% - var(--sidebar-width));
}

.content-header {
    margin-bottom: 2rem;
}

.content-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

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

/* ===== STATS GRID ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    font-size: 2rem;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.stat-up .stat-value {
    color: var(--success);
}

.stat-down .stat-value {
    color: var(--danger);
}

/* ===== CHARTS GRID ===== */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
}

.chart-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.chart-card canvas {
    max-height: 300px;
}

/* ===== TABLES GRID ===== */
.tables-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.table-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
}

.table-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

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

.data-table th,
.data-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table td {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

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

.data-table .truncate {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table-link {
    display: block;
    text-align: center;
    margin-top: 1rem;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.875rem;
}

.table-link:hover {
    text-decoration: underline;
}

/* ===== BADGES & STATUS ===== */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-payment { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.badge-technical { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.badge-machine { background: rgba(139, 92, 246, 0.2); color: #a78bfa; }
.badge-account { background: rgba(236, 72, 153, 0.2); color: #f472b6; }
.badge-refund { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.badge-information { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.badge-other { background: rgba(100, 116, 139, 0.2); color: #94a3b8; }

.status {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-open::before { background: var(--success); }
.status-in_progress::before { background: var(--warning); }
.status-closed::before { background: var(--text-muted); }

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

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

select.form-control {
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

/* ===== CARD ===== */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

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

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
}

/* ===== COMPARE PAGE ===== */
.compare-controls {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.compare-form {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.compare-form .form-group {
    margin-bottom: 0;
    flex: 1;
    min-width: 150px;
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination a,
.pagination span {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.875rem;
}

.pagination a {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.pagination a:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.pagination .active {
    background: var(--accent);
    color: white;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .charts-grid,
    .tables-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 1000;
    }

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

    .main-content {
        margin-left: 0;
        max-width: 100%;
        padding: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

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