/* === CSS Variables / Theme System === */
:root {
    /* Light Theme Colors */
    --color-primary: #2563eb;
    --color-primary-dark: #1d4ed8;
    --color-primary-light: #3b82f6;
    --color-success: #16a34a;
    --color-danger: #dc2626;
    --color-warning: #d97706;

    /* Person Colors */
    --color-masha: #ec4899;
    --color-masha-light: #f472b6;
    --color-valentin: #3b82f6;
    --color-valentin-light: #60a5fa;

    /* Category Colors */
    --color-essen: #f97316;
    --color-essen-light: rgba(249, 115, 22, 0.2);
    --color-wohnung: #8b5cf6;
    --color-wohnung-light: rgba(139, 92, 246, 0.2);
    --color-fixkosten: #6b7280;
    --color-fixkosten-light: rgba(107, 114, 128, 0.2);

    /* Layout Colors */
    --color-bg: #f1f5f9;
    --color-bg-alt: #e2e8f0;
    --color-card: #ffffff;
    --color-sidebar: #1e293b;
    --color-sidebar-hover: #334155;
    --color-sidebar-active: #3b82f6;
    --color-sidebar-text: #94a3b8;
    --color-sidebar-text-active: #ffffff;

    /* Text Colors */
    --color-text: #1e293b;
    --color-text-muted: #64748b;
    --color-text-light: #94a3b8;
    --color-border: #e2e8f0;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);

    /* Misc */
    --radius: 12px;
    --radius-sm: 8px;
    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
    --transition: 0.2s ease;
}

/* Dark Theme */
[data-theme="dark"] {
    --color-bg: #0f172a;
    --color-bg-alt: #1e293b;
    --color-card: #1e293b;
    --color-sidebar: #0f172a;
    --color-sidebar-hover: #1e293b;
    --color-text: #f1f5f9;
    --color-text-muted: #94a3b8;
    --color-text-light: #64748b;
    --color-border: #334155;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.4);
}

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

html {
    scroll-behavior: smooth;
}

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

/* === App Layout === */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* === Sidebar === */
.sidebar {
    width: var(--sidebar-width);
    background: var(--color-sidebar);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    transition: width var(--transition), transform var(--transition);
    z-index: 1000;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #fff;
    text-decoration: none;
}

.sidebar-logo .logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--color-masha), var(--color-valentin));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.sidebar-logo .logo-text {
    font-size: 1.125rem;
    font-weight: 600;
}

.sidebar-logo .logo-subtitle {
    font-size: 0.75rem;
    color: var(--color-sidebar-text);
    display: block;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.nav-section {
    padding: 0.5rem 1rem;
    margin-bottom: 0.5rem;
}

.nav-section-title {
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-sidebar-text);
    padding: 0.5rem 0.75rem;
    font-weight: 600;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--color-sidebar-text);
    text-decoration: none;
    border-radius: var(--radius-sm);
    margin: 0.125rem 0;
    transition: all var(--transition);
    font-weight: 500;
}

.nav-item:hover {
    background: var(--color-sidebar-hover);
    color: var(--color-sidebar-text-active);
}

.nav-item.active {
    background: var(--color-sidebar-active);
    color: var(--color-sidebar-text-active);
}

.nav-item .icon {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

.nav-item .label {
    flex: 1;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--color-sidebar-hover);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--color-sidebar-text);
    transition: all var(--transition);
    width: 100%;
    border: none;
    font-size: 0.875rem;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-sidebar-text-active);
}

.theme-toggle .icon {
    font-size: 1.25rem;
}

.bot-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    font-size: 0.875rem;
    color: var(--color-sidebar-text);
}

.bot-status .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-text-muted);
}

.bot-status .status-dot.online {
    background: var(--color-success);
    box-shadow: 0 0 8px var(--color-success);
}

.bot-status .status-dot.offline {
    background: var(--color-danger);
}

.user-menu {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
}

.logout-btn {
    color: var(--color-sidebar-text);
    text-decoration: none;
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.logout-btn:hover {
    color: var(--color-danger);
    background: rgba(220, 38, 38, 0.1);
}

/* Mobile Sidebar Toggle */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    width: 44px;
    height: 44px;
    background: var(--color-sidebar);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* === Main Content === */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem;
    min-height: 100vh;
    transition: margin-left var(--transition);
}

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

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 0.25rem;
}

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

/* === Cards === */
.card {
    background: var(--color-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    overflow: hidden;
}

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

.card-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
}

.card-header h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text);
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--color-border);
    background: var(--color-bg);
}

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

.kpi-card {
    background: var(--color-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.kpi-card.debt::before { background: var(--color-danger); }
.kpi-card.expenses::before { background: var(--color-essen); }
.kpi-card.category::before { background: var(--color-wohnung); }
.kpi-card.trend::before { background: var(--color-success); }

.kpi-label {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.kpi-label .icon {
    font-size: 1rem;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.2;
}

.kpi-value.positive { color: var(--color-success); }
.kpi-value.negative { color: var(--color-danger); }

.kpi-change {
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.kpi-change.up { color: var(--color-success); }
.kpi-change.down { color: var(--color-danger); }
.kpi-change.neutral { color: var(--color-text-muted); }

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

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.grid-2-1 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.grid-1-2 {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1.5rem;
}

/* === Chart Container === */
.chart-container {
    position: relative;
    height: 300px;
}

.chart-container.small {
    height: 200px;
}

.chart-container.large {
    height: 400px;
}

/* === Balance Display === */
.balance-display {
    text-align: center;
    padding: 2rem;
}

.balance-amount {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.balance-amount.positive { color: var(--color-success); }
.balance-amount.negative { color: var(--color-danger); }
.balance-amount.neutral { color: var(--color-text-muted); }

.balance-description {
    font-size: 1rem;
    color: var(--color-text-muted);
}

.balance-breakdown {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.breakdown-item {
    padding: 1rem;
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    text-align: center;
}

.breakdown-item.masha {
    border-left: 3px solid var(--color-masha);
}

.breakdown-item.valentin {
    border-left: 3px solid var(--color-valentin);
}

.breakdown-item h4 {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}

.breakdown-item .value {
    font-size: 1.25rem;
    font-weight: 600;
}

/* === Expense List === */
.expense-list {
    max-height: 400px;
    overflow-y: auto;
}

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

.expense-item:hover {
    background: var(--color-bg);
}

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

.expense-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.expense-icon.essen {
    background: var(--color-essen-light);
    color: var(--color-essen);
}

.expense-icon.wohnung {
    background: var(--color-wohnung-light);
    color: var(--color-wohnung);
}

.expense-info {
    flex: 1;
    min-width: 0;
}

.expense-description {
    font-weight: 500;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.expense-meta {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.expense-meta .user-badge {
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.expense-meta .user-badge.masha {
    background: rgba(236, 72, 153, 0.15);
    color: var(--color-masha);
}

.expense-meta .user-badge.valentin {
    background: rgba(59, 130, 246, 0.15);
    color: var(--color-valentin);
}

.expense-amount {
    font-weight: 600;
    font-size: 1rem;
    color: var(--color-text);
}

.expense-actions {
    opacity: 0;
    transition: opacity var(--transition);
}

.expense-item:hover .expense-actions {
    opacity: 1;
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition);
}

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

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

.btn-secondary {
    background: var(--color-bg-alt);
    color: var(--color-text);
}

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

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

.btn-danger:hover {
    background: #b91c1c;
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-muted);
}

.btn-ghost:hover {
    background: var(--color-bg);
    color: var(--color-text);
}

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

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-sm);
}

.btn-icon.sm {
    width: 28px;
    height: 28px;
    font-size: 0.875rem;
}

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

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

.form-input,
.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    color: var(--color-text);
    background: var(--color-card);
    transition: all var(--transition);
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-input::placeholder {
    color: var(--color-text-light);
}

/* === Filter Bar === */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    white-space: nowrap;
}

.filter-group select,
.filter-group input {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-card);
    color: var(--color-text);
    font-size: 0.875rem;
}

/* === Month Selector === */
.month-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.month-selector .current {
    min-width: 150px;
    text-align: center;
    font-weight: 500;
}

/* === Period Filter === */
.period-filter {
    display: flex;
    gap: 0.5rem;
    background: var(--color-bg);
    padding: 0.25rem;
    border-radius: var(--radius-sm);
}

.period-filter button {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition);
}

.period-filter button:hover {
    color: var(--color-text);
}

.period-filter button.active {
    background: var(--color-card);
    color: var(--color-text);
    box-shadow: var(--shadow-sm);
}

/* === Modal === */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--color-card);
    padding: 2rem;
    border-radius: var(--radius);
    width: 100%;
    max-width: 480px;
    position: relative;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

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

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.modal-close:hover {
    background: var(--color-danger);
    color: white;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
}

/* === Tables === */
.table-container {
    overflow-x: auto;
}

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

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

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

.data-table tbody tr:hover {
    background: var(--color-bg);
}

/* === Fixed Costs List === */
.fixed-costs-section {
    margin-bottom: 1.5rem;
}

.fixed-costs-section h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border);
}

.fixed-costs-section h4 .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.fixed-costs-section h4 .dot.masha { background: var(--color-masha); }
.fixed-costs-section h4 .dot.valentin { background: var(--color-valentin); }

.fixed-cost-item {
    display: flex;
    justify-content: space-between;
    padding: 0.625rem 0;
}

.fixed-cost-item .label {
    color: var(--color-text);
}

.fixed-cost-item .amount {
    font-weight: 500;
}

.fixed-costs-total {
    padding: 1rem;
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    margin-top: 1rem;
}

.fixed-costs-total .row {
    display: flex;
    justify-content: space-between;
    padding: 0.375rem 0;
}

.fixed-costs-total .row.total {
    font-weight: 600;
    border-top: 1px solid var(--color-border);
    padding-top: 0.75rem;
    margin-top: 0.5rem;
}

.standing-order-box {
    padding: 1rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(236, 72, 153, 0.1));
    border-radius: var(--radius-sm);
    text-align: center;
    margin-top: 1rem;
    border: 1px solid var(--color-border);
}

.standing-order-box .amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
}

.standing-order-box .description {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-top: 0.25rem;
}

/* === Status Badge === */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.online {
    background: rgba(22, 163, 74, 0.15);
    color: var(--color-success);
}

.status-badge.offline {
    background: rgba(220, 38, 38, 0.15);
    color: var(--color-danger);
}

.status-badge.warning {
    background: rgba(217, 119, 6, 0.15);
    color: var(--color-warning);
}

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

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

.empty-state h3 {
    font-size: 1.125rem;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.875rem;
}

/* === Stat Box === */
.stat-box {
    padding: 1rem;
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    text-align: center;
}

.stat-box .label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.stat-box .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
}

.stat-box .subtext {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: 0.25rem;
}

/* === Quick Stats Row === */
.quick-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.quick-stat {
    flex: 1;
    padding: 1rem;
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.quick-stat .icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.quick-stat .icon.food {
    background: var(--color-essen-light);
    color: var(--color-essen);
}

.quick-stat .icon.housing {
    background: var(--color-wohnung-light);
    color: var(--color-wohnung);
}

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

.quick-stat .content .value {
    font-size: 1.25rem;
    font-weight: 600;
}

/* === Login Page === */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: linear-gradient(135deg, var(--color-sidebar) 0%, #334155 100%);
}

.login-box {
    background: var(--color-card);
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-box .logo {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--color-masha), var(--color-valentin));
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1.5rem;
}

.login-box h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--color-text);
}

.login-box .subtitle {
    color: var(--color-text-muted);
    margin-bottom: 2rem;
}

.login-box .form-group {
    text-align: left;
}

.login-box .btn {
    width: 100%;
    padding: 1rem;
}

.error-message {
    background: rgba(220, 38, 38, 0.1);
    color: var(--color-danger);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

/* === Responsive === */
@media (max-width: 1024px) {
    .grid-2, .grid-3, .grid-2-1, .grid-1-2 {
        grid-template-columns: 1fr;
    }
}

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

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

    .sidebar-toggle {
        display: flex;
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
        padding-top: 4.5rem;
    }

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

    .filter-bar {
        flex-direction: column;
    }

    .modal-content {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
    }

    .balance-breakdown {
        grid-template-columns: 1fr;
    }

    .quick-stats {
        flex-direction: column;
    }
}

/* === Loading States === */
.skeleton {
    background: linear-gradient(90deg, var(--color-bg) 25%, var(--color-bg-alt) 50%, var(--color-bg) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-text.short { width: 40%; }
.skeleton-text.medium { width: 70%; }
.skeleton-text.long { width: 100%; }

/* === Bot Status Banner === */
.bot-status-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    transition: all var(--transition);
}

.bot-status-banner.online {
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.1), rgba(22, 163, 74, 0.05));
    border-color: rgba(22, 163, 74, 0.3);
}

.bot-status-banner.offline {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.1), rgba(220, 38, 38, 0.05));
    border-color: rgba(220, 38, 38, 0.3);
}

.bot-status-banner.unknown {
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.1), rgba(217, 119, 6, 0.05));
    border-color: rgba(217, 119, 6, 0.3);
}

.bot-status-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.bot-status-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.bot-status-indicator .status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-text-muted);
    transition: all var(--transition);
}

.bot-status-indicator .status-dot.online {
    background: var(--color-success);
    box-shadow: 0 0 12px var(--color-success);
    animation: pulse 2s infinite;
}

.bot-status-indicator .status-dot.offline {
    background: var(--color-danger);
}

.bot-status-indicator .status-dot.unknown {
    background: var(--color-warning);
}

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

.bot-status-indicator .status-label {
    font-weight: 600;
    font-size: 1rem;
    color: var(--color-text);
}

.bot-status-details {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

.bot-status-details .bot-version {
    padding: 0.125rem 0.5rem;
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-family: monospace;
}

.bot-uptime {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    padding: 0.375rem 0.75rem;
    background: var(--color-bg);
    border-radius: var(--radius-sm);
}

.bot-status-banner.online .bot-uptime {
    background: rgba(22, 163, 74, 0.15);
    color: var(--color-success);
}

.bot-status-details .bot-pid {
    padding: 0.125rem 0.5rem;
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-family: monospace;
}

.bot-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.bot-buttons {
    display: flex;
    gap: 0.5rem;
}

.bot-buttons .btn {
    white-space: nowrap;
}

/* === Notifications === */
.notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    background: var(--color-card);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 3000;
    animation: slideIn 0.3s ease;
    max-width: 400px;
}

.notification.success {
    border-color: var(--color-success);
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.1), var(--color-card));
}

.notification.error {
    border-color: var(--color-danger);
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.1), var(--color-card));
}

.notification button {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--color-text-muted);
    padding: 0;
    line-height: 1;
}

.notification button:hover {
    color: var(--color-text);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@media (max-width: 768px) {
    .bot-status-banner {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }

    .bot-status-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .bot-controls {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .bot-buttons {
        width: 100%;
    }

    .bot-buttons .btn {
        flex: 1;
    }

    .notification {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
    }
}

/* === Animations === */
.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-up {
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
