/* Базовые сбросы и общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, 'Roboto', sans-serif;
    background: #f4f6fa;
    color: #1f2937;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
}

/* Шапка */
.site-header {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, #1e40af, #7c3aed);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    text-decoration: none;
}

.main-nav a {
    text-decoration: none;
    font-weight: 500;
    color: #374151;
    margin-left: 24px;
    transition: 0.2s;
}
.main-nav a:hover { color: #2563eb; }

.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #f8fafc;
    padding: 6px 16px;
    border-radius: 40px;
    border: 1px solid #e2e8f0;
}
.user-greeting { font-weight: 500; font-size: 0.9rem; }
.balance-badge {
    background: #dbeafe;
    color: #1e40af;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}
.user-actions a {
    margin-left: 8px;
    color: #475569;
    font-size: 0.9rem;
}
.user-actions a:hover { color: #2563eb; }

/* Сетка для личного кабинета */
.main-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 32px;
    margin: 32px 0;
}
.sidebar {
    background: #ffffff;
    border-radius: 20px;
    padding: 20px;
    border: 1px solid #eef2ff;
    align-self: start;
    position: sticky;
    top: 90px;
}
.content {
    background: #ffffff;
    border-radius: 20px;
    padding: 24px;
    border: 1px solid #eef2ff;
}

/* Рекламные блоки (заглушки) */
.ad-sidebar, .ad-inline, .ad-footer {
    background: #f8fafc;
    border-radius: 16px;
    padding: 16px;
    text-align: center;
    border: 1px dashed #cbd5e1;
    margin-bottom: 24px;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
    color: #475569;
}

/* Футер */
.site-footer {
    background: #1e293b;
    color: #cbd5e1;
    margin-top: auto;
    padding: 40px 0 24px;
}
.footer-inner {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}
.footer-links a {
    color: #94a3b8;
    text-decoration: none;
    margin-left: 20px;
}
.footer-links a:hover { color: #e2e8f0; }
.copyright { text-align: center; padding-top: 24px; border-top: 1px solid #334155; font-size: 0.75rem; margin-top: 24px; }

/* Таблицы и формы */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px; border-bottom: 1px solid #e2e8f0; text-align: left; }
.btn { padding: 4px 12px; border-radius: 20px; background: #eef2ff; color: #2563eb; text-decoration: none; font-size: 0.85rem; }
.btn-danger { background: #fee2e2; color: #dc2626; }
.overdue { background: #fef3c7; }

/* Адаптивность */
@media (max-width: 900px) {
    .main-grid { grid-template-columns: 1fr; }
    .sidebar { position: static; }
    .header-inner { flex-direction: column; align-items: stretch; }
    .user-info { justify-content: space-between; width: 100%; }
}
@media (max-width: 640px) {
    .container { padding: 0 16px; }
    .content { padding: 20px; }
}