/* ===== AllDomains theme (в стиле DM-панели) ===== */
:root {
    --teal: #1abc9c;
    --teal-dark: #15a589;
    --mint: #e6f9f3;
    --navy: #1e2a3a;
    --bg: #eef2f6;
    --ink: #2b3a4a;
    --muted: #8a99a8;
    --line: #edf1f5;
    --orange: #f8a15f;
}

body {
    background: var(--bg);
    font-family: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
    color: var(--ink);
    font-size: .9rem;
}

/* ---------- Каркас ---------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 250px;
    background: #fff;
    position: fixed;
    inset: 0 auto 0 0;
    overflow-y: auto;
    z-index: 1030;
    box-shadow: 0 0 18px rgba(35, 46, 60, .06);
}
.sidebar .brand {
    display: block;
    padding: 1.3rem 1.5rem 1.1rem;
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -.5px;
    color: #111;
    text-decoration: none;
}
.sidebar .brand .at { color: var(--teal); }
.side-nav { padding: .5rem 0 2rem; }
.side-nav .nav-label {
    padding: 1rem 1.5rem .35rem;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
}
.side-link {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .68rem 1.5rem;
    color: var(--ink);
    font-weight: 500;
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: color .15s, background .15s;
}
.side-link i { font-size: 1.05rem; color: var(--muted); transition: color .15s; }
.side-link:hover { color: var(--teal); }
.side-link:hover i { color: var(--teal); }
.side-link.active {
    background: var(--mint);
    border-left-color: var(--teal);
    color: var(--teal);
    font-weight: 600;
}
.side-link.active i { color: var(--teal); }

.main { margin-left: 250px; flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
    background: #fff;
    padding: .8rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 1px 0 var(--line);
    position: sticky;
    top: 0;
    z-index: 1020;
}
.topbar .search-form { display: flex; max-width: 420px; flex: 1; }
.topbar .search-form input {
    border: 1px solid #e3e9ef;
    border-radius: 8px 0 0 8px;
    border-right: 0;
    padding: .55rem .9rem;
    width: 100%;
    outline: none;
    font-family: inherit;
    font-size: .88rem;
}
.topbar .search-form input:focus { border-color: var(--teal); }
.topbar .search-form button {
    background: var(--teal);
    color: #fff;
    border: 0;
    border-radius: 0 8px 8px 0;
    padding: 0 1.1rem;
}
.topbar .search-form button:hover { background: var(--teal-dark); }
.topbar .spacer { flex: 1; }
.balance-chip {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-weight: 600;
    color: var(--ink);
    white-space: nowrap;
}
.balance-chip .amount { color: var(--teal); font-weight: 700; }

.content { padding: 2rem; flex: 1; }

.footer {
    background: #fff;
    color: var(--muted);
    padding: 1.1rem 2rem;
    font-size: .82rem;
    border-top: 1px solid var(--line);
}

.page-title { font-weight: 700; font-size: 1.35rem; margin-bottom: 1.25rem; }

/* ---------- Карточки ---------- */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(35, 46, 60, .05);
}
.card-header {
    background: #fff !important;
    border-bottom: 1px solid var(--line);
    border-radius: 12px 12px 0 0 !important;
    font-weight: 600;
    padding: .9rem 1.25rem;
}

/* Статкарточки как в референсе */
.stat-card { display: flex; align-items: center; gap: 1rem; padding: 1.25rem; }
.stat-chip {
    width: 48px; height: 48px;
    border-radius: 12px;
    background: var(--mint);
    color: var(--teal);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}
.stat-chip.chip-orange { background: #fdeedd; color: var(--orange); }
.stat-chip.chip-blue { background: #e3f2fd; color: #1e88e5; }
.stat-chip.chip-red { background: #fde8e8; color: #e02424; }
.stat-label {
    font-size: .68rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .06em;
    color: var(--muted); margin-bottom: .15rem;
}
.stat-value { font-size: 1.45rem; font-weight: 800; line-height: 1.1; }

/* Оранжевая пилюля группы (как Platinum) */
.group-pill {
    display: inline-flex; align-items: center; gap: .4rem;
    background: var(--orange); color: #fff;
    border-radius: 30px;
    padding: .35rem 1rem;
    font-size: .8rem; font-weight: 700;
    vertical-align: middle;
}

/* Тёмный промо-блок */
.promo-band {
    background: var(--navy);
    color: #fff;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
}

/* ---------- Кнопки ---------- */
.btn { border-radius: 24px; font-weight: 600; font-family: inherit; }
.btn-sm { border-radius: 18px; }
.btn-primary, .btn-success {
    background: var(--teal);
    border-color: var(--teal);
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active,
.btn-success:hover, .btn-success:focus, .btn-success:active {
    background: var(--teal-dark) !important;
    border-color: var(--teal-dark) !important;
}
.btn-outline-primary, .btn-outline-success {
    color: var(--teal);
    border-color: var(--teal);
}
.btn-outline-primary:hover, .btn-outline-success:hover {
    background: var(--teal);
    border-color: var(--teal);
    color: #fff;
}
.btn-warning { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn-warning:hover { background: #f2903f; border-color: #f2903f; color: #fff; }

/* ---------- Таблицы ---------- */
.table { color: var(--ink); }
.table thead th {
    background: #fff !important;
    color: var(--ink);
    font-size: .8rem;
    font-weight: 700;
    border-bottom: 1px solid var(--line);
    padding-top: .8rem;
    padding-bottom: .8rem;
    white-space: nowrap;
}
.table tbody td { border-color: var(--line); padding-top: .7rem; padding-bottom: .7rem; vertical-align: middle; }
.table tbody tr:nth-of-type(odd) td { background: #f8fafc; }
.table-hover tbody tr:hover td { background: var(--mint); }

/* ---------- Бейджи: пастельные пилюли ---------- */
.badge { border-radius: 30px; font-weight: 600; padding: .42em .85em; }
.badge.bg-success { background: #d9f7ee !important; color: #0f9d7a !important; }
.badge.bg-danger { background: #fde8e8 !important; color: #e02424 !important; }
.badge.bg-warning { background: #fdeedd !important; color: #d97706 !important; }
.badge.bg-info { background: #e3f2fd !important; color: #1e88e5 !important; }
.badge.bg-primary { background: #e0ecff !important; color: #2563eb !important; }
.badge.bg-secondary { background: #eef1f4 !important; color: #64748b !important; }
.badge.bg-dark { background: #e2e8f0 !important; color: #334155 !important; }
.badge.bg-light { background: #eef1f4 !important; color: #64748b !important; }

/* ---------- Формы ---------- */
.form-control, .form-select {
    border-color: #e3e9ef;
    border-radius: 8px;
    font-family: inherit;
}
.form-control:focus, .form-select:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 .2rem rgba(26, 188, 156, .12);
}
.form-label { font-weight: 600; font-size: .84rem; }

/* ---------- Пагинация ---------- */
.pagination { gap: .35rem; }
.pagination .page-link {
    border: 1px solid #e3e9ef;
    border-radius: 50rem !important;
    color: var(--ink);
    min-width: 2.1rem;
    text-align: center;
    font-weight: 600;
    font-size: .85rem;
}
.pagination .page-item.active .page-link {
    background: var(--teal);
    border-color: var(--teal);
    color: #fff;
}
.pagination .page-link:focus { box-shadow: none; }

/* ---------- Алерты ---------- */
.alert { border: none; border-radius: 12px; font-weight: 500; }
.alert-success { background: #d9f7ee; color: #0f766e; }
.alert-danger { background: #fde8e8; color: #b91c1c; }
.alert-warning { background: #fdeedd; color: #b45309; }

/* ---------- Гостевые страницы (логин/регистрация) ---------- */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    position: relative;
}
.auth-lang {
    position: absolute;
    top: 1rem;
    right: 1rem;
}
.auth-lang .btn {
    background: #fff;
    color: var(--ink);
    border-color: #ced4da;
}
/* Фон и на hover перекрыт нашим правилом — задаём контрастное состояние явно */
.auth-lang .btn:hover,
.auth-lang .btn:focus,
.auth-lang .btn:active,
.auth-lang .btn.show {
    background: var(--teal);
    border-color: var(--teal);
    color: #fff;
}
.auth-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(35, 46, 60, .08);
    padding: 2.5rem 2.25rem;
    width: 100%;
    max-width: 420px;
}
.auth-logo {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: var(--mint);
    color: var(--teal);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.7rem;
    margin: 0 auto 1.1rem;
}
.auth-card h1 { font-size: 1.45rem; font-weight: 700; text-align: center; }
.auth-card .sub { color: var(--muted); text-align: center; margin-bottom: 1.5rem; }

/* ---------- Мобильная версия ---------- */
.sidebar-toggle { display: none; background: none; border: 0; font-size: 1.4rem; color: var(--ink); }
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s; }
    .sidebar.show { transform: none; }
    .main { margin-left: 0; }
    .sidebar-toggle { display: inline-block; }
    .content { padding: 1.25rem; }
    .topbar { padding: .8rem 1.25rem; }
}
