body {
    background: #f5f5f7;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Логин страница */
body.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: radial-gradient(circle at top, #ffffff 0, #f1f1f1 40%, #e3e3e3 100%);
}

.login-wrapper {
    max-width: 400px;
    width: 100%;
    padding: 16px;
}

.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px 24px 32px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.12);
}

.login-logo {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.yt-dot {
    width: 26px;
    height: 18px;
    border-radius: 6px;
    background: #ff0000;
    position: relative;
    margin-right: 10px;
}

.yt-dot::after {
    content: "";
    position: absolute;
    left: 9px;
    top: 4px;
    border-style: solid;
    border-width: 5px 0 5px 8px;
    border-color: transparent transparent transparent #fff;
}

.login-title {
    font-size: 22px;
    font-weight: 700;
}

/* ---------- NAVBAR (YouTube style) ---------- */

.navbar-yt {
    background: #181818 !important;
    border-bottom: 1px solid #303030;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.navbar-yt .navbar-brand {
    display: flex;
    align-items: center;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
}

.yt-brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.yt-brand-icon {
    width: 26px;
    height: 18px;
    border-radius: 6px;
    background: #ff0000;
    position: relative;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.yt-brand-icon::after {
    content: "";
    position: absolute;
    left: 9px;
    top: 4px;
    border-style: solid;
    border-width: 5px 0 5px 8px;
    border-color: transparent transparent transparent #ffffff;
}

.yt-brand-text {
    color: #ffffff;
    font-weight: 700;
    letter-spacing: 0.04em;
    font-size: 18px;
}

.navbar-yt .navbar-toggler {
    border-color: transparent;
    outline: none;
    box-shadow: none;
}

.navbar-yt .navbar-toggler-icon {
    filter: invert(100%);
}

/* ---------- Блок пользователя в navbar ---------- */

.navbar-user-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #f9fafb;
}

.navbar-user-role {
    font-size: 0.78rem;
    color: #d1d5db;
}

.navbar-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: #f97316;
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.3);
}

/* ---------- App shell: sidebar + main ---------- */

/* отступ от фиксированного navbar */
#main {
    padding-top: 64px;
}

.app-shell {
    display: flex;
    align-items: stretch;
    min-height: calc(100vh - 64px - 56px); /* минус хедер и футер */
}

/* Sidebar */

.app-sidebar {
    width: 240px;
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    padding: 20px 14px;
    flex-shrink: 0;
}

.app-sidebar-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
    margin-bottom: 8px;
    padding-left: 10px;
}

.app-sidebar-nav .nav-item {
    margin-bottom: 4px;
}

.app-sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 12px;
    padding: 8px 10px;
    font-size: 0.92rem;
    color: #4b5563;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.08s ease;
}

.app-sidebar-nav .nav-link .app-sidebar-icon {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    font-size: 14px;
}

.app-sidebar-nav .nav-link .app-sidebar-text {
    white-space: nowrap;
}

.app-sidebar-nav .nav-link:hover {
    background-color: #f3f4ff;
    color: #111827;
    transform: translateX(1px);
}

.app-sidebar-nav .nav-link.active {
    background: #e5edff;
    color: #1d4ed8;
}

.app-sidebar-nav .nav-link.active .app-sidebar-icon {
    background: #dbeafe;
}

/* Основная область */

.app-main {
    flex: 1;
    /* фон контентной части — сплошной белый */
    background: #ffffff;
    /* отступы с учётом сайдбара и чтобы контент "дышал" */
    padding: 24px 32px 32px;
}

/* Контейнер внутри — только ширина и внутренний паддинг, без карточки */
.app-main-container {
    max-width: 1200px;
    margin: 0 auto;
    background: transparent;
    border-radius: 0;
    padding: 8px 0 0;
    box-shadow: none;
}

/* Заголовки и списки секций */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.sections-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px 16px;
}

/* ---------- Мобильная адаптация ---------- */

@media (max-width: 767.98px) {
    .app-shell {
        flex-direction: column;
        min-height: auto;
    }

    .app-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
        padding-bottom: 8px;
        margin-bottom: 0;
    }

    .app-main {
        padding: 16px 12px 20px;
    }

    .app-main-container {
        max-width: 100%;
        padding: 4px 0 0;
    }

    .yt-brand-text {
        font-size: 16px;
    }
}


/* ---------- Users page ---------- */

.user-index h1,
.user-form-page h1 {
    font-size: 1.8rem;
    font-weight: 700;
}

.card-table .table {
    margin-bottom: 0;
}

.card-table .table tbody tr:hover {
    background-color: #f9fafb;
}

.user-form-page .card-title {
    font-size: 1rem;
    font-weight: 600;
}

/* ---------- Users table header styling ---------- */

.user-index .card-table .table thead th {
    background: #f9fafb;              /* мягкий светлый фон */
    border-bottom-color: #e5e7eb;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;                   /* серый текст */
}

/* убираем синие подчеркивания у сортируемых заголовков */
.user-index .card-table .table thead th a {
    color: inherit;
    text-decoration: none;
}

.user-index .card-table .table thead th a:hover {
    color: #111827;
}

/* ------ Таблица расходов ------ */

.expense-index .card-table .table thead th {
    background: #f9fafb;
    border-bottom-color: #e5e7eb;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #6b7280;
}

.expense-index .table thead th a {
    color: inherit;
    text-decoration: none;
}

.expense-index .table thead th a:hover {
    color: #111827;
}

/* кнопка Подробнее */
.expense-details-btn {
    font-size: 0.78rem;
    padding: 6px 10px !important;
}

/* --- Кнопки-иконки в таблице расходов --- */

.btn-icon-only {
    padding-inline: 0.45rem;
    padding-block: 0.3rem;
}

.btn-icon {
    display: block;
    width: 14px;
    height: 14px;
}

/* --- Бейдж с итогом за месяц --- */

.expense-total-badge {
    display: inline-flex;
    flex-direction: row;
    align-items: baseline;
    gap: 8px;
    background: #fef2f2;
    color: #b91c1c;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 0.9rem;
    border: 1px solid #fecaca;
    white-space: nowrap;
}

.expense-total-label {
    text-transform: none;
    letter-spacing: 0.02em;
}

.expense-total-value {
    font-weight: 700;
}

/* адаптация под мобильные */
@media (max-width: 767.98px) {
    .expense-total-badge {
        width: 100%;
        justify-content: space-between;
        margin-top: 8px;
    }
}

/* ---------- Фильтры расходов ---------- */

.expense-filters {
    gap: 0.75rem;
}

.expense-filter-group {
    max-width: 220px;
    min-width: 180px;
}

.expense-filter-group .form-select,
.expense-filter-group .form-control {
    border-left: none;
    font-size: 0.875rem;
}

.expense-filter-icon {
    background: #f3f4f6;
    border-right: none;
    color: #6b7280;
    font-size: 0.9rem;
}

.expense-filter-control:focus {
    box-shadow: none;
}

/* Кнопка "Поиск" */

.expense-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    padding-inline: 0.9rem;
}

/* Бейдж с итогом за месяц */

.expense-total-badge {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 6px 14px;
    border-radius: 999px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    font-size: 0.8rem;
    color: #b91c1c;
}

.expense-total-label {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.7rem;
    opacity: 0.8;
}

.expense-total-value {
    font-weight: 700;
    font-size: 0.9rem;
}

/* Мобильная адаптация фильтров */

@media (max-width: 767.98px) {
    .expense-filter-group {
        min-width: 100%;
        max-width: 100%;
    }

    .expense-total-badge {
        margin-top: 8px;
    }
}


