﻿/* ==================== APP THEME & LAYOUT (GTA5RP) ==================== */
:root, [data-theme="dark"], body.dark-theme {
    --bg-primary:    #141418;
    --bg-secondary:  #1c1c22;
    --bg-sidebar:    #16161c;
    --bg-card:       #1e1e26;
    --bg-card-hover: #26262f;
    --accent:        #f5820d;
    --accent-dark:   #c96a00;
    --accent-light:  #ff9f3a;
    --text-primary:  #e8e8f0;
    --text-muted:    #828299;
    --text-dim:      #555568;
    --border:        #2a2a36;
    --sidebar-w:     210px;
    --topbar-h:      62px;
    --radius:        10px;
    --radius-sm:     6px;
}

[data-theme="light"], body:not(.dark-theme) {
    --bg-primary:    #f2f3f7;
    --bg-secondary:  #ffffff;
    --bg-sidebar:    #ffffff;
    --bg-card:       #ffffff;
    --bg-card-hover: #f7f8fa;
    --text-primary:  #181a20;
    --text-muted:    #686f82;
    --text-dim:      #9aa1b4;
    --border:        #e3e6ed;
}

/* App Layout */
.app-layout { display: flex; height: 100vh; width: 100vw; overflow: hidden; }

/* Sidebar */
.sidebar { width: var(--sidebar-w); background: var(--bg-sidebar); display: flex; flex-direction: column; flex-shrink: 0; border-right: 1px solid var(--border); overflow-y: auto; overflow-x: hidden; user-select: none; }
.sidebar-logo { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--border); text-decoration: none; color: var(--text-primary); }
.sidebar-logo .logo-icon { font-size: 20px; color: var(--accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sidebar-logo .logo-text { font-weight: 800; font-size: 17px; color: var(--text-primary); letter-spacing: 0.5px; }
.nav-section { padding: 8px 0; }
.nav-section + .nav-section { border-top: 1px solid var(--border); }
.sidebar .nav-item, .sidebar a.nav-item, .sidebar .nav-item:link, .sidebar .nav-item:visited { display: flex !important; align-items: center !important; gap: 10px !important; padding: 10px 18px !important; color: var(--text-muted) !important; text-decoration: none !important; font-size: 13.5px !important; font-weight: 500 !important; transition: color .15s, background .15s !important; cursor: pointer !important; position: relative !important; user-select: none !important; background: transparent !important; border: none !important; }
.sidebar .nav-item i, .sidebar a.nav-item i { font-size: 16px !important; width: 20px !important; text-align: center !important; flex-shrink: 0 !important; color: inherit; }
.sidebar .nav-item:hover, .sidebar a.nav-item:hover { color: var(--text-primary) !important; background: rgba(255,255,255,.04) !important; }
.sidebar .nav-item.active, .sidebar a.nav-item.active { color: #ffffff !important; background: rgba(245,130,13,.12) !important; font-weight: 600 !important; }
.sidebar .nav-item.active::before, .sidebar a.nav-item.active::before { content: '' !important; position: absolute !important; left: 0 !important; top: 0 !important; bottom: 0 !important; width: 3px !important; background: var(--accent) !important; border-radius: 0 3px 3px 0 !important; }
.sidebar .nav-item.active i, .sidebar a.nav-item.active i { color: var(--accent) !important; }
.nav-submenu { max-height: 0; overflow: hidden; transition: max-height .25s ease; background: rgba(0,0,0,.15); }
.nav-submenu.open { max-height: 200px; }
.nav-submenu .nav-item { padding-left: 38px !important; font-size: 13px !important; }
.nav-item .nav-arrow { margin-left: auto; font-size: 11px; transition: transform .2s ease; }
.nav-item.open .nav-arrow { transform: rotate(90deg); }

/* Main wrap & Topbar */
.main-wrap { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.topbar { height: var(--topbar-h); background: var(--bg-secondary); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; gap: 16px; flex-shrink: 0; }
.topbar-left { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.topbar-greeting { font-size: 15px; color: var(--text-muted); line-height: 1.25; }
.topbar-greeting strong { color: var(--text-primary); font-weight: 700; }
.topbar-sub { font-size: 11.5px; color: var(--text-dim); margin-top: 2px; display: flex; align-items: center; gap: 6px; }
.topbar-sub .vip-badge { color: #e0a82e; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.balance-chip { display: flex; align-items: center; gap: 6px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 20px; padding: 5px 12px; font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; }
.balance-chip .bc-icon { width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; }
.balance-chip.bc-primary { background: rgba(245,130,13,.12); border-color: rgba(245,130,13,.4); color: #ffaa4d; }
.balance-chip.bc-primary .bc-icon { background: var(--accent); color: #fff; }
.topbar-selector { background: var(--bg-card); border: 1px solid var(--border); border-radius: 20px; color: var(--text-primary); padding: 5px 14px; font-size: 12.5px; font-weight: 500; outline: none; cursor: pointer; transition: border-color .15s; }
.topbar-selector:focus { border-color: var(--accent); }
.topbar-divider { width: 1px; height: 24px; background: var(--border); margin: 0 4px; }
.topbar-icon-btn { width: 36px; height: 36px; border-radius: 50%; background: var(--bg-card); border: 1px solid var(--border); color: var(--text-muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 14px; transition: all .2s ease; padding: 0; }
.topbar-icon-btn:hover { color: var(--accent); border-color: var(--accent); background: rgba(245,130,13,.08); transform: translateY(-1px); }
.theme-icon-light { display: none; color: #ffc107; }
.theme-icon-dark { display: inline-block; color: #828299; }
[data-theme="light"] .theme-icon-light, body:not(.dark-theme) .theme-icon-light { display: inline-block; }
[data-theme="light"] .theme-icon-dark, body:not(.dark-theme) .theme-icon-dark { display: none; }

/* Content area */
.content-area { flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 20px; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.page-title { font-size: 20px; font-weight: 700; color: var(--text-primary); display: flex; align-items: center; gap: 10px; }
.page-title .title-icon { width: 36px; height: 36px; background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%); border-radius: 9px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 17px; }
.page-subtitle { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.quick-actions { background: var(--bg-card) !important; border: 1px solid var(--border) !important; border-radius: var(--radius) !important; padding: 12px 16px !important; }
.section-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-dim); margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.section-label i { color: var(--accent); }
.qa-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.qa-btn { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 20px; color: var(--text-muted); font-size: 12.5px; font-weight: 500; cursor: pointer; transition: all .15s; text-decoration: none; }
.qa-btn:hover { background: rgba(245,130,13,.1); border-color: var(--accent); color: var(--accent); }
.qa-btn.qa-active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* App layout Bootstrap overrides */
.app-layout .card { background: var(--bg-card) !important; border: 1px solid var(--border) !important; border-radius: var(--radius) !important; color: var(--text-primary) !important; overflow: hidden; }
.app-layout .card-header { background: var(--bg-card) !important; border-bottom: 1px solid var(--border) !important; padding: 12px 16px !important; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-header-title { font-weight: 600; font-size: 13.5px; display: flex; align-items: center; gap: 7px; color: var(--text-primary); }
.card-header-title i { color: var(--accent); }
.card-header-badge { background: var(--bg-secondary) !important; border: 1px solid var(--border) !important; border-radius: 12px !important; padding: 2px 8px !important; font-size: 11px !important; color: var(--text-muted) !important; }
.inv-total-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 16px; background: var(--bg-secondary); font-size: 12.5px; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.inv-total-val { font-weight: 700; color: var(--accent); }
.app-layout .form-control, .app-layout .form-select { background-color: var(--bg-secondary) !important; border: 1px solid var(--border) !important; color: var(--text-primary) !important; border-radius: var(--radius-sm) !important; }
.app-layout .form-control:focus, .app-layout .form-select:focus { border-color: var(--accent) !important; box-shadow: 0 0 0 2px rgba(245,130,13,0.2) !important; color: var(--text-primary) !important; }
.app-layout .input-group-text { background-color: var(--bg-primary) !important; border: 1px solid var(--border) !important; color: var(--text-muted) !important; }
.data-table, .active-items-table { width: 100%; border-collapse: collapse; }
.data-table th, .active-items-table th, .app-layout .table th { font-size: 10.5px !important; font-weight: 700 !important; text-transform: uppercase !important; letter-spacing: 0.5px !important; color: var(--text-dim) !important; padding: 8px 10px !important; border-bottom: 1px solid var(--border) !important; background: transparent !important; text-align: left; }
.data-table td, .active-items-table td, .app-layout .table td { padding: 9px 10px !important; border-bottom: 1px solid rgba(42,42,54,0.5) !important; font-size: 13px !important; color: var(--text-primary) !important; vertical-align: middle !important; background: transparent !important; }
.data-table tbody tr:hover, .active-items-table tbody tr:hover, .app-layout .table tbody tr:hover { background: rgba(255,255,255,0.025) !important; }
.col-price, .price-val { font-weight: 700 !important; color: var(--accent) !important; }
.col-date, .date-val { font-size: 12px !important; color: var(--text-muted) !important; }
.progress-wrap, .progress-container .progress { background: var(--bg-secondary) !important; border-radius: 20px !important; height: 22px !important; overflow: hidden; position: relative; min-width: 130px; border: none !important; }
.progress-fill, .progress-bar { height: 100% !important; border-radius: 20px !important; transition: width .3s !important; }
.progress-bar.bg-success, .pf-green { background: linear-gradient(90deg,#1a9e57,#2ac47a) !important; }
.progress-bar.bg-warning, .pf-yellow { background: linear-gradient(90deg,#c96a00,#f5a623) !important; }
.progress-bar.bg-danger, .pf-red { background: linear-gradient(90deg,#a01c1c,#e05555) !important; }
.progress-label, .progress-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 10.5px !important; font-weight: 700 !important; color: #fff !important; text-shadow: 0 1px 3px rgba(0,0,0,.6) !important; pointer-events: none; }
.progress-text * { color: #fff !important; }
.history-section { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.app-layout .bg-light { background-color: var(--bg-secondary) !important; color: var(--text-primary) !important; }
.app-layout .modal-content { background-color: var(--bg-card) !important; border: 1px solid var(--border) !important; color: var(--text-primary) !important; }
.app-layout .modal-header, .app-layout .modal-footer { border-color: var(--border) !important; }
.app-layout .btn-close { filter: invert(1) grayscale(100%) brightness(200%) !important; }
.btn-accent { background: var(--accent) !important; border-color: var(--accent) !important; color: #fff !important; border-radius: var(--radius-sm); font-weight: 600; }
.btn-accent:hover { background: var(--accent-light) !important; border-color: var(--accent-light) !important; color: #fff !important; }
.btn-outline { background: transparent !important; color: var(--text-muted) !important; border: 1px solid var(--border) !important; border-radius: var(--radius-sm); font-weight: 500; }
.btn-outline:hover { color: var(--text-primary) !important; border-color: var(--text-muted) !important; }
.btn-success-outline { background: transparent !important; color: #2ac47a !important; border: 1px solid rgba(42,196,122,.4) !important; border-radius: var(--radius-sm); }
.btn-success-outline:hover { background: rgba(42,196,122,.1) !important; color: #2ac47a !important; }
.btn-danger-outline { background: transparent !important; color: #e05555 !important; border: 1px solid rgba(224,85,85,.4) !important; border-radius: var(--radius-sm); }
.btn-danger-outline:hover { background: rgba(224,85,85,.1) !important; color: #e05555 !important; }
.calc-summary { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-sm); display: grid; grid-template-columns: 1fr 1fr 1fr; overflow: hidden; }
.calc-cell { padding: 8px 0; text-align: center; }
.calc-cell + .calc-cell { border-left: 1px solid var(--border); }
.calc-val { font-size: 15px; font-weight: 700; color: var(--accent); }
.calc-lbl { font-size: 10.5px; color: var(--text-dim); margin-top: 2px; }
.total-box { background: linear-gradient(135deg,rgba(245,130,13,.18) 0%,rgba(245,130,13,.06) 100%); border: 1px solid rgba(245,130,13,.35); border-radius: var(--radius-sm); padding: 10px; text-align: center; }
.total-box .tb-label { font-size: 11px; color: var(--text-muted); }
.total-box .tb-value { font-size: 22px; font-weight: 800; color: var(--accent); }
.item-name { font-weight: 600; color: var(--text-primary); }
.item-category { font-size: 11px; color: var(--text-dim); margin-top: 1px; }
.actions-cell { display: flex; gap: 4px; align-items: center; }
.status-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.status-badge.status-active, .badge-active { background: rgba(42,196,122,.15) !important; color: #2ac47a !important; }
.status-badge.status-sold, .badge-sold { background: rgba(90,130,255,.15) !important; color: #7a9fff !important; }
.active-items-table .btn-success { background: transparent !important; color: #2ac47a !important; border: 1px solid rgba(42,196,122,.4) !important; }
.active-items-table .btn-success:hover { background: rgba(42,196,122,.15) !important; color: #2ac47a !important; }
.active-items-table .btn-danger { background: transparent !important; color: #e05555 !important; border: 1px solid rgba(224,85,85,.4) !important; }
.active-items-table .btn-danger:hover { background: rgba(224,85,85,.15) !important; color: #e05555 !important; }
.app-layout .pagination .page-link { background: var(--bg-secondary) !important; border: 1px solid var(--border) !important; color: var(--text-muted) !important; font-size: 12px; border-radius: 6px; margin: 0 2px; padding: 4px 10px; }
.app-layout .pagination .page-item.active .page-link { background: var(--accent) !important; border-color: var(--accent) !important; color: #fff !important; }
.app-layout .pagination .page-item.disabled .page-link { background: var(--bg-card) !important; color: var(--text-dim) !important; border-color: var(--border) !important; }
.app-layout .per-page-selector { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.app-layout .per-page-selector select { background: var(--bg-secondary) !important; border: 1px solid var(--border) !important; color: var(--text-primary) !important; border-radius: var(--radius-sm); padding: 3px 8px; font-size: 12px; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }
/* ==================== END APP THEME ==================== */
/* Общие стили */
body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body:has(.app-layout) {
    overflow: hidden !important;
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.3rem;
}

/* Карточки */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

/* Кнопки */
.btn {
    border-radius: 8px;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

/* НАВИГАЦИЯ - ОБНОВЛЕННЫЕ СТИЛИ */
.navbar-nav {
    display: flex;
    align-items: center;
}

.navbar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    white-space: nowrap;
    border-radius: 6px;
    transition: all 0.2s ease;
    margin: 0 0.1rem;
}

.navbar-nav .nav-link:hover {
    background-color: rgba(255,255,255,0.1);
    transform: translateY(-1px);
}

.navbar-nav .nav-item {
    margin: 0;
}

.navbar-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    margin: 0 0.5rem;
    white-space: nowrap;
}

/* Специфичные стили для десктопной навигации */
@media (min-width: 992px) {
    .navbar-nav .nav-link {
        flex-direction: row;
        text-align: left;
    }
    
    .navbar-nav .nav-link i {
        margin: 0;
        font-size: 1.1rem;
    }
    
    .navbar-nav.me-auto {
        margin-right: auto !important;
    }
    
    .navbar-nav.ms-auto {
        margin-left: auto !important;
    }
}

/* Мобильная навигация */
@media (max-width: 991.98px) {
    .navbar-nav .nav-link {
        padding: 0.8rem 1rem;
        margin: 0.1rem 0;
        border-radius: 0.375rem;
    }
    
    .navbar-nav .nav-link i {
        min-width: 20px;
        text-align: center;
    }
    
    .navbar-text {
        padding: 0.8rem 1rem;
        margin: 0.5rem 0;
    }
    
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* Предотвращаем перенос текста */
.navbar-brand,
.navbar-nav .nav-link,
.navbar-text {
    white-space: nowrap;
}

/* Стили для иконок в навигации */
.navbar-nav .nav-link i {
    width: 1.2em;
    text-align: center;
}

/* Стили для админской ссылки */
.navbar-nav .nav-link[href="/admin"] {
    background-color: rgba(220, 53, 69, 0.2);
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.navbar-nav .nav-link[href="/admin"]:hover {
    background-color: rgba(220, 53, 69, 0.3);
}

/* Стили для DateTime Picker */
.td-theme-bootstrap {
    --td-btn-bg: #0d6efd;
    --td-btn-color: white;
    --td-border-radius: 8px;
}

.td-theme-bootstrap .picker {
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    border: 1px solid #dee2e6;
}

.td-theme-bootstrap .picker .table {
    margin-bottom: 0;
}

.td-theme-bootstrap .picker .btn {
    border-radius: 6px;
    transition: all 0.2s ease;
}

.td-theme-bootstrap .picker .btn:hover {
    transform: translateY(-1px);
}

.td-theme-bootstrap .picker .btn-active {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    border-color: #0a58ca;
}

/* Кастомные стили для input группы */
#datetimepicker .input-group-text {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #dee2e6;
    border-left: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

#datetimepicker .input-group-text:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    transform: translateY(-1px);
}

#datetimepicker .form-control {
    border-right: none;
}

#datetimepicker .form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Стили для поля даты и времени */
.input-group {
    position: relative;
}

.input-group-text {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    border: 2px solid #6c757d;
    border-left: none;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
    z-index: 3;
}

.input-group-text:hover {
    background: linear-gradient(135deg, #495057 0%, #343a40 100%);
    transform: translateY(-1px);
}

/* Убираем native иконку календаря */
input[type="datetime-local"] {
    border-right: none;
    padding-right: 45px;
    background: white;
}

input[type="datetime-local"]:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Скрываем native иконку календаря в Chrome/Safari */
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    background: none;
    display: none;
}

/* Скрываем native иконку календаря в Firefox */
input[type="datetime-local"]::-moz-calendar-picker-indicator {
    display: none;
}

/* Скрываем native иконку календаря в Edge */
input[type="datetime-local"]::-ms-clear {
    display: none;
}

/* Стили для текста внутри datetime field */
input[type="datetime-local"]::-webkit-datetime-edit {
    padding: 0;
    color: #495057;
}

input[type="datetime-local"]::-webkit-datetime-edit-fields-wrapper {
    padding: 0;
}

input[type="datetime-local"]::-webkit-datetime-edit-text {
    color: #495057;
    padding: 0 2px;
}

input[type="datetime-local"]::-webkit-datetime-edit-month-field,
input[type="datetime-local"]::-webkit-datetime-edit-day-field,
input[type="datetime-local"]::-webkit-datetime-edit-year-field,
input[type="datetime-local"]::-webkit-datetime-edit-hour-field,
input[type="datetime-local"]::-webkit-datetime-edit-minute-field {
    color: #495057;
}

/* Для Firefox */
input[type="datetime-local"]::-moz-focus-inner {
    border: 0;
    padding: 0;
}

/* Адаптивность для мобильных */
@media (max-width: 576px) {
    .input-group-text {
        padding: 0.375rem 0.5rem;
    }
    
    .input-group-text i {
        font-size: 1rem;
    }
    
    input[type="datetime-local"] {
        font-size: 14px;
        padding-right: 40px;
    }
}

/* Анимации */
.pulse {
    animation: pulse 0.3s ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Дополнительные стили для улучшения внешнего вида */
.form-control[type="datetime-local"]:disabled {
    background-color: #e9ecef;
    opacity: 1;
}

/* Стили для placeholder */
input[type="datetime-local"]::placeholder {
    color: #6c757d;
    opacity: 0.7;
}

/* Состояние ошибки */
input[type="datetime-local"].is-invalid {
    border-color: #dc3545;
}

input[type="datetime-local"].is-invalid:focus {
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Состояние успеха */
input[type="datetime-local"].is-valid {
    border-color: #198754;
}

input[type="datetime-local"].is-valid:focus {
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.25);
}

/* Анимация для появления поля пола */
#genderField {
    transition: all 0.3s ease;
    opacity: 0;
    height: 0;
    overflow: hidden;
}

#genderField[style*="display: block"] {
    opacity: 1;
    height: auto;
    margin-bottom: 1rem;
}

/* Стили для таблиц */
.table th, .table td {
    vertical-align: middle;
    text-align: center;
}

.table th:first-child, 
.table td:first-child {
    text-align: left;
}

.table th:last-child, 
.table td:last-child {
    text-align: center;
    min-width: 120px;
}

/* Стили для статуса */
.badge {
    font-size: 0.75em;
    padding: 0.35em 0.65em;
}

/* Стили для кнопок действий */
.d-flex.flex-column.gap-1 {
    gap: 0.25rem !important;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Дополнительные исправления для навигации */
.navbar-collapse {
    flex-grow: 0;
}

.navbar-nav .nav-link {
    line-height: 1.2;
}

/* Фикс для мобильного меню */
@media (max-width: 991.98px) {
    .navbar-nav .nav-link {
        flex-direction: row;
        justify-content: flex-start;
    }
    
    .navbar-nav .nav-link i {
        margin-right: 0.5rem;
        width: 1.2em;
    }
}

/* Гарантируем правильное выравнивание для всех элементов навигации */
.navbar .container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

/* Стили для выпадающего меню пользователя */
.navbar-nav .dropdown-toggle {
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0.5rem 1rem;
    border-radius: 6px;
}

.navbar-nav .dropdown-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.navbar-nav .dropdown-menu {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    margin-top: 0.5rem;
}

.navbar-nav .dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    margin: 0.1rem 0.5rem;
    width: auto;
}

.navbar-nav .dropdown-item:hover {
    background-color: #f8f9fa;
    transform: translateX(2px);
}

.navbar-nav .dropdown-item-text {
    padding: 0.5rem 1rem;
}

.navbar-nav .dropdown-divider {
    margin: 0.3rem 0;
}

/* Стили для админской ссылки в выпадающем меню */
.navbar-nav .dropdown-item[href="/admin"] {
    color: #dc3545;
    font-weight: 500;
}

.navbar-nav .dropdown-item[href="/admin"]:hover {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

/* Анимация появления выпадающего меню */
.dropdown-menu {
    animation: dropdownFadeIn 0.2s ease;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Адаптивность для мобильных устройств */
@media (max-width: 991.98px) {
    .navbar-nav .dropdown-menu {
        position: static;
        float: none;
        width: 100%;
        margin-top: 0;
        box-shadow: none;
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .navbar-nav .dropdown-toggle::after {
        margin-left: auto;
    }
    
    .navbar-nav .dropdown-item {
        margin: 0.1rem 0;
        padding: 0.8rem 1rem;
    }
}

/* Стили для иконок в выпадающем меню */
.dropdown-item i {
    width: 1.2em;
    text-align: center;
    margin-right: 0.5rem;
}

/* Улучшаем внешний вид текста пользователя */
.navbar-nav .dropdown-toggle {
    gap: 0.5rem;
    align-items: center;
}

/* Скрываем имя пользователя на очень маленьких экранах */
@media (max-width: 360px) {
    .navbar-nav .dropdown-toggle span {
        display: none;
    }
    
    .navbar-nav .dropdown-toggle i {
        margin-right: 0;
    }
}

/* Плавная анимация для всех hover-эффектов */
.navbar-nav .nav-link,
.navbar-nav .dropdown-toggle,
.dropdown-item {
    transition: all 0.2s ease-in-out;
}

/* Улучшаем видимость активного состояния */
.navbar-nav .dropdown-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25);
}

/* Стили для статусов */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.6rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-active {
    background-color: #d1e7dd;
    color: #0f5132;
    border: 1px solid #badbcc;
}

.status-sold {
    background-color: #d8e2f7;
    color: #052c65;
    border: 1px solid #b6d4fe;
}

.status-sale {
    background-color: #e0e0e0;
    color: #495057;
    border: 1px solid #dee2e6;
}

.status-badge i {
    font-size: 0.7rem;
}

/* Стили для компактной формы */
.stat-item {
    padding: 0.25rem;
}

.form-control-sm {
    border-radius: 0.375rem;
}

.input-group-sm > .form-control {
    border-radius: 0.375rem;
}

.input-group-sm > .input-group-text {
    border-radius: 0.375rem;
}

/* Анимация для итоговой стоимости */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 0.3s ease-in-out;
}

/* Стили для карточек */
.card {
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 0.5rem;
}

.card-header {
    border-radius: 0.5rem 0.5rem 0 0 !important;
}

/* Стили для поиска */
#searchResults {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
}

#searchResults .list-group-item {
    border: none;
    border-bottom: 1px solid #f8f9fa;
    font-size: 0.875rem;
}

#searchResults .list-group-item:last-child {
    border-bottom: none;
}

#searchResults .list-group-item:hover {
    background-color: #f8f9fa;
}

.list-group-item {
    cursor: pointer;
    border: none;
    border-bottom: 1px solid #dee2e6;
    border-radius: 0;
}
.list-group-item:last-child {
    border-bottom: none;
}
.list-group-item:hover {
    background-color: #f8f9fa;
}

.badge {
    font-size: 0.7em;
    padding: 0.3em 0.5em;
}

/* Стили для строк с истекшим VIP статусом */
tr.vip-expired {
    opacity: 0.7;
    background-color: #fff5f5 !important;
}

tr.vip-expiring {
    background-color: #fff9e6 !important;
}

.invalid-feedback {
    display: none;
}

.invalid-feedback.d-block {
    display: block;
}

.datetimepicker.is-invalid {
    border-color: #dc3545;
}

/* Стили для плоского дизайна календаря */
.flatpickr-calendar {
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.flatpickr-time {
    border-radius: 0 0 8px 8px;
}

.flatpickr-input {
    background-color: white !important;
    cursor: pointer;
}

.datetimepicker {
    cursor: pointer;
}

.card {
    transition: transform 0.2s ease;
    border-radius: 12px;
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.form-select, .form-control {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    transition: border-color 0.2s ease;
}
.form-select:focus, .form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}
.btn {
    border-radius: 8px;
    transition: all 0.2s ease;
    font-weight: 500;
}
.btn:hover {
    transform: translateY(-1px);
}
.input-group-text {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #e9ecef;
    border-left: none;
}
#totalPrice {
    transition: all 0.3s ease;
}
.pulse {
    animation: pulse 0.3s ease-in-out;
}
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}
.stat-item {
    padding: 10px;
    border-radius: 8px;
    background: #f8f9fa;
}
.stat-item h5 {
    margin: 0;
    font-weight: bold;
}
.alert {
    border-radius: 10px;
    border: none;
}
/* Анимация для появления поля пола */
#genderField {
    transition: all 0.3s ease;
    opacity: 0;
    height: 0;
    overflow: hidden;
}

#genderField[style*="display: block"] {
    opacity: 1;
    height: auto;
    margin-bottom: 1rem;
}

/* Notification Styles */
.notification-item {
    transition: background-color 0.2s ease;
    border: none !important;
    padding: 0.75rem 1rem;
}

.notification-item:hover {
    background-color: #f8f9fa !important;
}

.notification-item.unread {
    background-color: #f0f7ff;
}

.dropdown-menu {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

#notificationList {
    scrollbar-width: thin;
    scrollbar-color: #dee2e6 transparent;
}

#notificationList::-webkit-scrollbar {
    width: 4px;
}

#notificationList::-webkit-scrollbar-track {
    background: transparent;
}

#notificationList::-webkit-scrollbar-thumb {
    background-color: #dee2e6;
    border-radius: 2px;
}

/* Адаптивная таблица для всех устройств */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-sm th,
.table-sm td {
    padding: 0.5rem;
    font-size: 0.875rem;
    vertical-align: middle;
}

/* Компактные кнопки действий */
.btn-sm.p-1 {
    padding: 0.25rem !important;
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Улучшенное отображение для мобильных */
@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.8rem;
        border: 1px solid #dee2e6;
        border-radius: 0.375rem;
    }
    
    .table-sm th,
    .table-sm td {
        padding: 0.4rem 0.3rem;
        font-size: 0.8rem;
    }
    
    .btn-sm.p-1 {
        min-width: 28px;
        height: 28px;
        padding: 0.2rem !important;
    }
    
    /* Уменьшаем бейджи на мобильных */
    .badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
    
    /* Более компактные отступы */
    .d-flex.gap-1 {
        gap: 0.1rem !important;
    }
}

/* Для очень маленьких экранов */
@media (max-width: 576px) {
    .table-sm th,
    .table-sm td {
        padding: 0.3rem 0.2rem;
        font-size: 0.75rem;
    }
    
    .btn-sm.p-1 {
        min-width: 26px;
        height: 26px;
        padding: 0.15rem !important;
    }
    
    .badge {
        font-size: 0.65rem;
        padding: 0.15rem 0.3rem;
    }
    
    /* Скрываем менее важные колонки на очень маленьких экранах */
    .table-responsive th:nth-child(7), /* Цена продажи */
    .table-responsive td:nth-child(7),
    .table-responsive th:nth-child(8), /* Комиссия */
    .table-responsive td:nth-child(8) {
        display: none;
    }
}

/* Улучшаем перенос текста */
.text-break {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Гарантируем что таблица не ломает layout */
.card-body.p-0 {
    overflow: hidden;
}

/* АДАПТИВНЫЕ ТАБЛИЦЫ ДЛЯ АДМИНКИ */
.table-responsive-md .table.table-striped.table-hover {
    table-layout: fixed !important;
    width: 100% !important;
}

.table-responsive-md .table.table-striped.table-hover th,
.table-responsive-md .table.table-striped.table-hover td {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    vertical-align: middle !important;
}

/* Ширины колонок для таблицы транзакций */
.table-responsive-md .table.table-striped.table-hover th:nth-child(1),
.table-responsive-md .table.table-striped.table-hover td:nth-child(1) { 
    width: 70px !important; 
    min-width: 60px !important;
    text-align: left !important;
    padding-left: 1rem !important;
}

.table-responsive-md .table.table-striped.table-hover th:nth-child(2),
.table-responsive-md .table.table-striped.table-hover td:nth-child(2) { 
    width: 200px !important; 
    min-width: 150px !important;
}

.table-responsive-md .table.table-striped.table-hover th:nth-child(3),
.table-responsive-md .table.table-striped.table-hover td:nth-child(3) { 
    width: 120px !important; 
    min-width: 100px !important;
}

.table-responsive-md .table.table-striped.table-hover th:nth-child(4),
.table-responsive-md .table.table-striped.table-hover td:nth-child(4) { 
    width: 120px !important; 
    min-width: 100px !important;
}

.table-responsive-md .table.table-striped.table-hover th:nth-child(5),
.table-responsive-md .table.table-striped.table-hover td:nth-child(5) { 
    width: 100px !important; 
    min-width: 80px !important;
}

.table-responsive-md .table.table-striped.table-hover th:nth-child(6),
.table-responsive-md .table.table-striped.table-hover td:nth-child(6) { 
    width: 120px !important; 
    min-width: 100px !important;
    text-align: right !important;
    font-family: 'Courier New', monospace !important;
    font-weight: 600 !important;
    padding-right: 1rem !important;
}

.table-responsive-md .table.table-striped.table-hover th:nth-child(7),
.table-responsive-md .table.table-striped.table-hover td:nth-child(7) { 
    width: 120px !important; 
    min-width: 100px !important;
    text-align: right !important;
    font-family: 'Courier New', monospace !important;
    font-weight: 600 !important;
    padding-right: 1rem !important;
}

.table-responsive-md .table.table-striped.table-hover th:nth-child(8),
.table-responsive-md .table.table-striped.table-hover td:nth-child(8) { 
    width: 100px !important; 
    min-width: 80px !important;
    text-align: center !important;
}

.table-responsive-md .table.table-striped.table-hover th:nth-child(9),
.table-responsive-md .table.table-striped.table-hover td:nth-child(9) { 
    width: 140px !important; 
    min-width: 120px !important;
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    .table-responsive-md .table.table-striped.table-hover th:nth-child(9),
    .table-responsive-md .table.table-striped.table-hover td:nth-child(9) {
        display: none !important;
    }
    
    .table-responsive-md .table.table-striped.table-hover {
        font-size: 0.875rem;
        min-width: 700px;
    }
}

.user-active {
    background-color: #77a672ff !important;
}

.user-inactive {
    background-color: #737373 !important;
}

.pagination .page-item.active .page-link {
    background-color: #0d6efd;
    border-color: #0d6efd;
}
.pagination .page-link {
    color: #0d6efd;
}
.pagination .page-link:hover {
    color: #0a58ca;
}

/* Активная таблица инвентаря */
.active-items-table {
    width: 100%;
    table-layout: auto;
}
.active-items-table th,
.active-items-table td {
    vertical-align: middle;
    word-break: break-word;
}
.active-items-table .col-item {
    min-width: 0;
    width: 40%;
}
.active-items-table .col-date {
    width: 20%;
    white-space: nowrap;
}
.active-items-table .col-price {
    width: 15%;
    white-space: nowrap;
}
.active-items-table .col-actions {
    width: 15%;
}
.item-comment {
    color: #3171b1;
    font-size: 0.78em;
    word-break: break-word;
}
html[data-theme="dark"] .item-comment {
    color: #8aafd4;
}
@media (max-width: 576px) {
    .active-items-table .col-date {
        font-size: 0.75rem;
    }
    .active-items-table .col-price {
        font-size: 0.85rem;
    }
}

/* Заголовок "Активные предметы в продаже" + суммарная стоимость инвентаря */
.inventory-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.375rem 0.75rem;
    margin-bottom: 1rem;
}
.inventory-total {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    line-height: 1.4;
    color: var(--bs-body-color, #212529);
    background-color: var(--bs-tertiary-bg, #f1f3f5);
    border: 1px solid var(--bs-border-color, rgba(33, 37, 41, 0.175));
    border-radius: 0.5rem;
    padding: 0.25rem 0.625rem;
    white-space: nowrap;
}
.inventory-total-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--bs-primary, #0d6efd);
    font-variant-numeric: tabular-nums;
}
/* Тёмная тема: контраст на тёмном фоне карточки */
html[data-theme="dark"] .inventory-total {
    color: #c9d1d9;
    background-color: #0d1117;
    border-color: #30363d;
}
html[data-theme="dark"] .inventory-total-value {
    color: #58a6ff;
}
/* Мобильные: компактный размер, перенос строки обеспечивает flex-wrap */
@media (max-width: 576px) {
    .inventory-heading {
        margin-bottom: 0.75rem;
    }
    .inventory-total {
        font-size: 0.8125rem;
    }
    .inventory-total-value {
        font-size: 0.9375rem;
    }
}

/* Пагинация инвентаря */
.inventory-header-tools {
    min-width: 0;
}
.inventory-header-tools .per-page-selector,
.inventory-header-tools .badge {
    flex: 0 0 auto;
}
.inventory-pagination {
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
}
.inventory-pagination .pagination {
    flex-wrap: nowrap;
    margin-bottom: 0;
}
.inventory-pagination .page-link {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    cursor: pointer;
}
#inventoryTableWrapper {
    position: relative;
}
#inventoryTableWrapper.inventory-updating {
    opacity: 0.5;
}
.inventory-loading {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    align-items: center;
    white-space: nowrap;
}
.inventory-loading.active {
    display: flex;
}
html[data-theme="dark"] .inventory-loading {
    background: rgba(33, 37, 41, 0.9);
}

/* Селектор количества записей на странице */
.per-page-selector {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    white-space: nowrap;
}
.per-page-selector label {
    margin-bottom: 0;
    color: inherit;
    opacity: 0.85;
}
.per-page-selector select {
    width: auto;
    padding: 0.2rem 1.5rem 0.2rem 0.5rem;
    font-size: 0.8125rem;
    line-height: 1.4;
    border-radius: 0.25rem;
    border: 1px solid rgba(255, 255, 255, 0.6);
    background-color: #fff;
    color: #212529;
    cursor: pointer;
}
.per-page-selector select:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}
@media (max-width: 576px) {
    .inventory-header-tools {
        width: 100%;
        justify-content: space-between;
    }
    .inventory-pagination .page-link {
        padding: 0.2rem 0.4rem;
    }
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1040;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* Sidebar Styles */
.admin-sidebar {
    min-height: 100vh;
    position: sticky;
    top: 0;
}

.sidebar-sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

/* Main Content */
.main-content {
    min-height: 100vh;
    padding: 0;
}

.main-content-inner {
    padding: 1rem;
    margin-left: 0;
}

/* Offcanvas Mobile Menu */
.offcanvas {
    max-width: 280px;
}

.offcanvas-body .nav-link {
    border-radius: 0;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.offcanvas-body .nav-link:hover {
    background-color: rgba(255,255,255,0.1);
}

.offcanvas-body .nav-link.active {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

/* Navigation Styles */
.nav-pills .nav-link {
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.nav-pills .nav-link:hover {
    background-color: rgba(255,255,255,0.1);
    transform: translateX(5px);
}

.nav-pills .nav-link.active {
    background-color: #0d6efd;
    border-color: #0d6efd;
    transform: translateX(5px);
}

.nav-pills .nav-link i {
    width: 20px;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 991.98px) {
    .main-content {
        margin-left: 0;
    }
    
    .main-content-inner {
        padding-top: 4rem; /* Space for mobile toggle button */
    }
}

@media (min-width: 992px) {
    .main-content-inner {
        padding: 2rem;
    }
}

/* Scrollbar for sidebar */
.sidebar-sticky::-webkit-scrollbar {
    width: 4px;
}

.sidebar-sticky::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
}

.sidebar-sticky::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
}

.sidebar-sticky::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5);
}

/* Animation for mobile menu */
.offcanvas-start {
    transition: transform 0.3s ease-in-out;
}

/* Improved table responsiveness for mobile */
@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.775rem;
    }
}

/* Card improvements */
.card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border: 1px solid rgba(0, 0, 0, 0.125);
}

.card-header {
    background-color: rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
}

/* Стили для редактирования по клику */
.editable-field {
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: inline-block;
    min-width: 60px;
}

.editable-field:hover {
    background-color: #e9ecef;
    box-shadow: 0 0 0 2px #b8daff;
}

.editing .editable-field {
    display: none;
}

.editing .quantity-edit,
.editing .buy-price-edit,
.editing .sell-price-edit,
.editing .commission-edit {
    display: flex !important;
}

.price-cell input, .commission-cell input {
    max-width: 100px;
}

.quantity-edit {
    max-width: 80px;
    margin: 0 auto;
}

.editing-row {
    background-color: #fff3cd !important;
}

.profit-updated {
    animation: pulse-green 1s;
}

@keyframes pulse-green {
    0% { background-color: #d1edff; }
    50% { background-color: #b8daff; }
    100% { background-color: transparent; }
}

.save-indicator {
    font-size: 0.7rem;
    color: #28a745;
    margin-left: 5px;
}

.autosave-notice {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
    display: none;
}

.pulse {
    animation: pulse 0.3s ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.profit-updated {
    background-color: rgba(25, 135, 84, 0.1) !important;
    transition: background-color 0.5s ease;
}

.quick-notification {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ============================================
   THEME TOGGLE BUTTON
   ============================================ */
.theme-toggle {
    position: relative;
    width: 40px;
    height: 40px;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50% !important;
    transition: background-color 0.3s ease, transform 0.2s ease;
    overflow: hidden;
}

.theme-toggle:hover {
    background-color: rgba(255, 255, 255, 0.15) !important;
    transform: scale(1.1) !important;
}

.theme-toggle:active {
    transform: scale(0.95) !important;
}

/* По умолчанию (светлая тема): показываем луну, скрываем солнце */
.theme-toggle .theme-icon-dark {
    font-size: 1.2rem;
    color: #c4b5fd;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: absolute;
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.theme-toggle .theme-icon-light {
    font-size: 1.2rem;
    color: #fbbf24;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: absolute;
    opacity: 0;
    transform: scale(0) rotate(-180deg);
}

/* Тёмная тема: показываем солнце, скрываем луну */
.theme-toggle.active-dark .theme-icon-dark {
    opacity: 0;
    transform: scale(0) rotate(180deg);
}

.theme-toggle.active-dark .theme-icon-light {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

/* Анимация вращения при нажатии */
.theme-toggle-spin {
    animation: themeToggleSpin 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes themeToggleSpin {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.2); }
    100% { transform: rotate(360deg) scale(1); }
}

/* ============================================
   DARK THEME STYLES
   ============================================ */

/* Плавный переход при смене темы */
html[data-theme="dark"],
html[data-theme="dark"] body,
html[data-theme="dark"] .card,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .input-group-text,
html[data-theme="dark"] .table,
html[data-theme="dark"] .list-group-item,
html[data-theme="dark"] footer {
    transition: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

/* --- Body & Main --- */
html[data-theme="dark"] body {
    background-color: #0f1117;
    color: #e1e4e8;
}

/* --- Navbar --- */
html[data-theme="dark"] .navbar.bg-dark {
    background-color: #161b22 !important;
    border-bottom: 1px solid #21262d;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
}

/* --- Cards --- */
html[data-theme="dark"] .card {
    background-color: #161b22;
    border-color: #21262d !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

html[data-theme="dark"] .card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] .card-header {
    background-color: #1c2129 !important;
    border-bottom-color: #21262d !important;
    color: #e1e4e8;
}

html[data-theme="dark"] .card-body {
    color: #c9d1d9;
}

html[data-theme="dark"] .card-footer {
    background-color: #1c2129;
    border-top-color: #21262d;
}

/* --- Forms --- */
html[data-theme="dark"] .form-control {
    background-color: #0d1117;
    border-color: #30363d;
    color: #e1e4e8;
}

html[data-theme="dark"] .form-control:focus {
    background-color: #0d1117;
    border-color: #58a6ff;
    color: #e1e4e8;
    box-shadow: 0 0 0 0.2rem rgba(88, 166, 255, 0.25);
}

html[data-theme="dark"] .form-control::placeholder {
    color: #6e7681;
}

html[data-theme="dark"] .form-select {
    background-color: #0d1117;
    border-color: #30363d;
    color: #e1e4e8;
}

html[data-theme="dark"] .form-select:focus {
    border-color: #58a6ff;
    box-shadow: 0 0 0 0.2rem rgba(88, 166, 255, 0.25);
}

html[data-theme="dark"] .input-group-text {
    background: linear-gradient(135deg, #21262d 0%, #30363d 100%);
    border-color: #30363d;
    color: #8b949e;
}

html[data-theme="dark"] input[type="datetime-local"] {
    background-color: #0d1117;
    color: #e1e4e8;
    border-color: #30363d;
}

html[data-theme="dark"] input[type="datetime-local"]::-webkit-datetime-edit,
html[data-theme="dark"] input[type="datetime-local"]::-webkit-datetime-edit-text,
html[data-theme="dark"] input[type="datetime-local"]::-webkit-datetime-edit-month-field,
html[data-theme="dark"] input[type="datetime-local"]::-webkit-datetime-edit-day-field,
html[data-theme="dark"] input[type="datetime-local"]::-webkit-datetime-edit-year-field,
html[data-theme="dark"] input[type="datetime-local"]::-webkit-datetime-edit-hour-field,
html[data-theme="dark"] input[type="datetime-local"]::-webkit-datetime-edit-minute-field {
    color: #e1e4e8;
}

/* --- Tables --- */
html[data-theme="dark"] .table {
    color: #c9d1d9;
    --bs-table-bg: transparent;
    --bs-table-striped-bg: rgba(255, 255, 255, 0.03);
    --bs-table-hover-bg: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .table th {
    border-color: #21262d;
    color: #8b949e;
    background-color: #161b22;
}

html[data-theme="dark"] .table td {
    border-color: #21262d;
}

html[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(255, 255, 255, 0.02);
    --bs-table-accent-bg: rgba(255, 255, 255, 0.02);
}

html[data-theme="dark"] .table-hover > tbody > tr:hover > * {
    background-color: rgba(255, 255, 255, 0.05);
    --bs-table-accent-bg: rgba(255, 255, 255, 0.05);
}

/* --- Dropdown --- */
html[data-theme="dark"] .dropdown-menu {
    background-color: #1c2129;
    border-color: #30363d;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] .dropdown-item {
    color: #c9d1d9;
}

html[data-theme="dark"] .dropdown-item:hover,
html[data-theme="dark"] .dropdown-item:focus {
    background-color: #21262d;
    color: #e1e4e8;
}

html[data-theme="dark"] .dropdown-divider {
    border-color: #21262d;
}

html[data-theme="dark"] .dropdown-item-text {
    color: #8b949e;
}

/* --- Modals --- */
html[data-theme="dark"] .modal-content {
    background-color: #161b22;
    border-color: #30363d;
    color: #e1e4e8;
}

html[data-theme="dark"] .modal-header {
    border-bottom-color: #21262d;
}

html[data-theme="dark"] .modal-footer {
    border-top-color: #21262d;
}

html[data-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* --- Buttons --- */
html[data-theme="dark"] .btn-outline-secondary {
    color: #8b949e;
    border-color: #30363d;
}

html[data-theme="dark"] .btn-outline-secondary:hover {
    background-color: #21262d;
    border-color: #8b949e;
    color: #e1e4e8;
}

html[data-theme="dark"] .btn-outline-primary {
    color: #58a6ff;
    border-color: #58a6ff;
}

html[data-theme="dark"] .btn-outline-primary:hover {
    background-color: rgba(88, 166, 255, 0.15);
    color: #79b8ff;
}

html[data-theme="dark"] .btn-outline-danger {
    color: #f85149;
    border-color: #f85149;
}

html[data-theme="dark"] .btn-outline-danger:hover {
    background-color: rgba(248, 81, 73, 0.15);
    color: #ff7b72;
}

html[data-theme="dark"] .btn-light {
    background-color: #21262d;
    border-color: #30363d;
    color: #c9d1d9;
}

html[data-theme="dark"] .btn-light:hover {
    background-color: #30363d;
    border-color: #484f58;
    color: #e1e4e8;
}

/* --- Alerts --- */
html[data-theme="dark"] .alert-success {
    background-color: rgba(46, 160, 67, 0.15);
    border-color: rgba(46, 160, 67, 0.3);
    color: #56d364;
}

html[data-theme="dark"] .alert-danger {
    background-color: rgba(248, 81, 73, 0.15);
    border-color: rgba(248, 81, 73, 0.3);
    color: #ff7b72;
}

html[data-theme="dark"] .alert-warning {
    background-color: rgba(187, 128, 9, 0.15);
    border-color: rgba(187, 128, 9, 0.3);
    color: #e3b341;
}

html[data-theme="dark"] .alert-info {
    background-color: rgba(88, 166, 255, 0.15);
    border-color: rgba(88, 166, 255, 0.3);
    color: #79b8ff;
}

/* --- Badges --- */
html[data-theme="dark"] .badge.bg-secondary {
    background-color: #30363d !important;
    color: #c9d1d9;
}

html[data-theme="dark"] .badge.bg-light {
    background-color: #21262d !important;
    color: #c9d1d9;
}

/* --- List Groups --- */
html[data-theme="dark"] .list-group-item {
    background-color: #161b22;
    border-color: #21262d;
    color: #c9d1d9;
}

html[data-theme="dark"] .list-group-item:hover {
    background-color: #1c2129;
}

html[data-theme="dark"] .list-group-item.active {
    background-color: #1f6feb;
    border-color: #1f6feb;
}

/* --- Notifications --- */
html[data-theme="dark"] .notification-item {
    border-color: #21262d !important;
}

html[data-theme="dark"] .notification-item:hover {
    background-color: #1c2129 !important;
}

html[data-theme="dark"] .notification-item.unread {
    background-color: rgba(56, 139, 253, 0.1);
}

/* --- Footer --- */
html[data-theme="dark"] footer.bg-dark {
    background-color: #0d1117 !important;
    border-top: 1px solid #21262d;
}

/* --- Status badges --- */
html[data-theme="dark"] .status-active {
    background-color: rgba(46, 160, 67, 0.15);
    color: #56d364;
    border-color: rgba(46, 160, 67, 0.3);
}

html[data-theme="dark"] .status-sold {
    background-color: rgba(88, 166, 255, 0.15);
    color: #79b8ff;
    border-color: rgba(88, 166, 255, 0.3);
}

html[data-theme="dark"] .status-sale {
    background-color: rgba(139, 148, 158, 0.15);
    color: #8b949e;
    border-color: rgba(139, 148, 158, 0.3);
}

/* --- Stat items --- */
html[data-theme="dark"] .stat-item {
    background-color: #1c2129;
    color: #c9d1d9;
}

/* --- Text utilities --- */
html[data-theme="dark"] .text-muted {
    color: #6e7681 !important;
}

html[data-theme="dark"] .text-dark {
    color: #e1e4e8 !important;
}

html[data-theme="dark"] .text-body {
    color: #c9d1d9 !important;
}

html[data-theme="dark"] .border {
    border-color: #21262d !important;
}

html[data-theme="dark"] .border-bottom {
    border-bottom-color: #21262d !important;
}

html[data-theme="dark"] .border-top {
    border-top-color: #21262d !important;
}

/* --- Background utilities --- */
html[data-theme="dark"] .bg-light {
    background-color: #161b22 !important;
}

html[data-theme="dark"] .bg-white {
    background-color: #0d1117 !important;
}

html[data-theme="dark"] .bg-body {
    background-color: #0f1117 !important;
}

/* --- Editable fields --- */
html[data-theme="dark"] .editable-field:hover {
    background-color: #21262d;
    box-shadow: 0 0 0 2px #30363d;
}

html[data-theme="dark"] .editing-row {
    background-color: rgba(187, 128, 9, 0.1) !important;
}

/* --- VIP status rows --- */
html[data-theme="dark"] tr.vip-expired {
    background-color: rgba(248, 81, 73, 0.05) !important;
}

html[data-theme="dark"] tr.vip-expiring {
    background-color: rgba(187, 128, 9, 0.05) !important;
}

/* --- Pagination --- */
html[data-theme="dark"] .pagination .page-link {
    background-color: #0d1117;
    border-color: #30363d;
    color: #58a6ff;
}

html[data-theme="dark"] .pagination .page-link:hover {
    background-color: #161b22;
    border-color: #58a6ff;
    color: #79b8ff;
}

html[data-theme="dark"] .pagination .page-item.active .page-link {
    background-color: #1f6feb;
    border-color: #1f6feb;
}

html[data-theme="dark"] .pagination .page-item.disabled .page-link {
    background-color: #0d1117;
    border-color: #21262d;
    color: #484f58;
}

/* --- Sidebar --- */
html[data-theme="dark"] .admin-sidebar {
    background-color: #0d1117 !important;
}

/* --- Flatpickr dark theme override --- */
html[data-theme="dark"] .flatpickr-calendar {
    background: #161b22;
    border-color: #30363d;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] .flatpickr-months,
html[data-theme="dark"] .flatpickr-month {
    background: #1c2129;
    color: #c9d1d9;
}

html[data-theme="dark"] .flatpickr-current-month .flatpickr-monthDropdown-months {
    background: #1c2129;
    color: #c9d1d9;
}

html[data-theme="dark"] .flatpickr-weekdays {
    background: #161b22;
}

html[data-theme="dark"] span.flatpickr-weekday {
    color: #8b949e;
    background: #161b22;
}

html[data-theme="dark"] .flatpickr-day {
    color: #c9d1d9;
}

html[data-theme="dark"] .flatpickr-day:hover {
    background: #21262d;
    border-color: #30363d;
}

html[data-theme="dark"] .flatpickr-day.selected {
    background: #1f6feb;
    border-color: #1f6feb;
}

html[data-theme="dark"] .flatpickr-day.today {
    border-color: #58a6ff;
}

html[data-theme="dark"] .flatpickr-time {
    background: #161b22;
    border-top-color: #21262d;
}

html[data-theme="dark"] .flatpickr-time input,
html[data-theme="dark"] .flatpickr-time .flatpickr-am-pm {
    color: #c9d1d9;
}

html[data-theme="dark"] .flatpickr-time input:hover,
html[data-theme="dark"] .flatpickr-time input:focus,
html[data-theme="dark"] .flatpickr-time .flatpickr-am-pm:hover {
    background: #21262d;
}

/* --- Scrollbars dark theme --- */
html[data-theme="dark"] #notificationList {
    scrollbar-color: #30363d transparent;
}

html[data-theme="dark"] #notificationList::-webkit-scrollbar-thumb {
    background-color: #30363d;
}

/* --- Search results --- */
html[data-theme="dark"] #searchResults {
    border-color: #30363d;
    background-color: #161b22;
}

html[data-theme="dark"] #searchResults .list-group-item {
    border-bottom-color: #21262d;
}

html[data-theme="dark"] #searchResults .list-group-item:hover {
    background-color: #1c2129;
}

/* --- HR --- */
html[data-theme="dark"] hr {
    border-color: #21262d;
    opacity: 0.5;
}

/* --- Breadcrumb --- */
html[data-theme="dark"] .breadcrumb {
    background-color: #161b22;
}

html[data-theme="dark"] .breadcrumb-item a {
    color: #58a6ff;
}

html[data-theme="dark"] .breadcrumb-item.active {
    color: #8b949e;
}

/* --- Headings --- */
html[data-theme="dark"] h1, html[data-theme="dark"] h2,
html[data-theme="dark"] h3, html[data-theme="dark"] h4,
html[data-theme="dark"] h5, html[data-theme="dark"] h6 {
    color: #e1e4e8;
}

/* --- Auto-save notice --- */
html[data-theme="dark"] .autosave-notice {
    background-color: #161b22;
}

/* --- Nav tabs/pills --- */
html[data-theme="dark"] .nav-tabs .nav-link {
    color: #8b949e;
}

html[data-theme="dark"] .nav-tabs .nav-link:hover {
    border-color: #21262d;
    color: #c9d1d9;
}

html[data-theme="dark"] .nav-tabs .nav-link.active {
    background-color: #161b22;
    border-color: #21262d #21262d #161b22;
    color: #e1e4e8;
}

/* --- Offcanvas --- */
html[data-theme="dark"] .offcanvas {
    background-color: #161b22;
    color: #c9d1d9;
}

html[data-theme="dark"] .offcanvas-header {
    border-bottom-color: #21262d;
}

/* --- Extra Text Color Overrides for Better Readability --- */
html[data-theme="dark"] a:not(.btn):not(.nav-link):not(.dropdown-item):not(.page-link) {
    color: #58a6ff;
}

html[data-theme="dark"] a:not(.btn):not(.nav-link):not(.dropdown-item):not(.page-link):hover {
    color: #79b8ff;
}

html[data-theme="dark"] label {
    color: #e1e4e8;
}

html[data-theme="dark"] .form-text {
    color: #8b949e;
}

html[data-theme="dark"] .text-black, 
html[data-theme="dark"] .text-black-50,
html[data-theme="dark"] .text-secondary {
    color: #c9d1d9 !important;
}

html[data-theme="dark"] strong, 
html[data-theme="dark"] b {
    color: #ffffff;
}

html[data-theme="dark"] th,
html[data-theme="dark"] td,
html[data-theme="dark"] caption {
    color: #e1e4e8 !important;
}

html[data-theme="dark"] .small, 
html[data-theme="dark"] small {
    color: #8b949e;
}

html[data-theme="dark"] .input-group-text {
    color: #c9d1d9 !important;
}

/* --- Lab specific styles --- */
html[data-theme="dark"] .results-section {
    background: #161b22;
    border-color: #30363d;
}

html[data-theme="dark"] .result-option,
html[data-theme="dark"] .general-info {
    background: #0d1117;
    border-color: #30363d;
}

html[data-theme="dark"] .result-option.best-option {
    background-color: rgba(46, 160, 67, 0.15);
    border-color: rgba(46, 160, 67, 0.3);
}

/* --- Generic Overrides for Inline White/Light Backgrounds in Templates --- */
html[data-theme="dark"] [style*="background: #ffffff"],
html[data-theme="dark"] [style*="background:#ffffff"],
html[data-theme="dark"] [style*="background: #fff;"],
html[data-theme="dark"] [style*="background:#fff;"],
html[data-theme="dark"] [style*="background: #fff"],
html[data-theme="dark"] [style*="background:#fff"],
html[data-theme="dark"] [style*="background: white"],
html[data-theme="dark"] [style*="background:white"],
html[data-theme="dark"] [style*="background: #f8fafc"],
html[data-theme="dark"] [style*="background:#f8fafc"],
html[data-theme="dark"] [style*="background: #f8f9fa"],
html[data-theme="dark"] [style*="background:#f8f9fa"],
html[data-theme="dark"] [style*="background-color: #ffffff"],
html[data-theme="dark"] [style*="background-color:#ffffff"],
html[data-theme="dark"] [style*="background-color: white"],
html[data-theme="dark"] [style*="background-color:white"] {
    background: #161b22 !important;
    background-color: #161b22 !important;
    border-color: #30363d !important;
}

html[data-theme="dark"] [style*="background: #fff3cd"],
html[data-theme="dark"] [style*="background:#fff3cd"] {
    background: rgba(187, 128, 9, 0.15) !important;
    border-color: rgba(187, 128, 9, 0.3) !important;
}

/* --- Readability Overrides for Inline Dark Text Colors in Dark Mode --- */
html[data-theme="dark"] [style*="color: #1e293b"],
html[data-theme="dark"] [style*="color:#1e293b"],
html[data-theme="dark"] [style*="color: #212529"],
html[data-theme="dark"] [style*="color:#212529"],
html[data-theme="dark"] [style*="color: #333"],
html[data-theme="dark"] [style*="color:#333"],
html[data-theme="dark"] [style*="color: #334155"],
html[data-theme="dark"] [style*="color:#334155"],
html[data-theme="dark"] [style*="color: #495057"],
html[data-theme="dark"] [style*="color:#495057"] {
    color: #f0f6fc !important;
}

html[data-theme="dark"] [style*="color: #64748b"],
html[data-theme="dark"] [style*="color:#64748b"],
html[data-theme="dark"] [style*="color: #6c757d"],
html[data-theme="dark"] [style*="color:#6c757d"] {
    color: #8b949e !important;
}

/* --- Inline Border Color Overrides --- */
html[data-theme="dark"] [style*="border-color: #e2e8f0"],
html[data-theme="dark"] [style*="border-color:#e2e8f0"],
html[data-theme="dark"] [style*="border-color: #cbd5e1"],
html[data-theme="dark"] [style*="border-color:#cbd5e1"],
html[data-theme="dark"] [style*="border-color: #dee2e6"],
html[data-theme="dark"] [style*="border-color:#dee2e6"] {
    border-color: #30363d !important;
}

/* --- Pricing Plans Special Gradients & Elements --- */
html[data-theme="dark"] [style*="background: linear-gradient(45deg, #1e293b"],
html[data-theme="dark"] [style*="background:linear-gradient(45deg, #1e293b"] {
    background: linear-gradient(45deg, #f0f6fc, #2563eb) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

/* --- Form Fields Styling in Dark Mode --- */
html[data-theme="dark"] input.form-control[style*="background: #f8f9fa"],
html[data-theme="dark"] input.form-control[style*="background-color: #f8f9fa"],
html[data-theme="dark"] input.form-control[style*="background: #ffffff"],
html[data-theme="dark"] input.form-control[style*="background-color: #ffffff"] {
    background-color: #0d1117 !important;
    color: #f0f6fc !important;
    border-color: #30363d !important;
}

html[data-theme="dark"] input.form-control {
    background-color: #0d1117 !important;
    color: #f0f6fc !important;
    border-color: #30363d !important;
}

html[data-theme="dark"] .card-body hr,
html[data-theme="dark"] .card hr {
    border-color: #30363d !important;
}

/* --- Battle Pass Progress Calculator Custom Styles --- */
.bp-modal-header {
    background: linear-gradient(135deg, #1f1235 0%, #3b1c6e 100%);
    color: #ffffff;
    border-bottom: 2px solid #5a2e9b;
}

.bp-modal-header .modal-title {
    font-weight: 700;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.bp-server-badge {
    border-radius: 8px;
    padding: 10px 15px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.bp-server-badge-active {
    background-color: #e0f2fe;
    border-color: #bae6fd;
    color: #0369a1;
}

.bp-server-badge-inactive {
    background-color: #f1f5f9;
    border-color: #e2e8f0;
    color: #475569;
}

html[data-theme="dark"] .bp-server-badge-active {
    background-color: rgba(14, 165, 233, 0.15) !important;
    border-color: rgba(14, 165, 233, 0.3) !important;
    color: #7dd3fc !important;
}

html[data-theme="dark"] .bp-server-badge-inactive {
    background-color: rgba(71, 85, 105, 0.15) !important;
    border-color: rgba(71, 85, 105, 0.3) !important;
    color: #94a3b8 !important;
}

.bp-progress-card {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

html[data-theme="dark"] .bp-progress-card {
    background: #161b22;
    border-color: #30363d;
}

.bp-progress-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.bp-progress-bar-container {
    height: 32px;
    background-color: #e9ecef;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

html[data-theme="dark"] .bp-progress-bar-container {
    background-color: #0d1117;
}

.bp-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #7b2cbf 0%, #c77dff 100%);
    border-radius: 16px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 15px;
}

.bp-progress-percent {
    position: absolute;
    width: 100%;
    text-align: center;
    left: 0;
    top: 0;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    color: #1f1235;
    z-index: 10;
    text-shadow: 0px 0px 4px rgba(255, 255, 255, 0.8);
}

html[data-theme="dark"] .bp-progress-percent {
    color: #ffffff;
    text-shadow: 0px 0px 4px rgba(0, 0, 0, 0.9);
}

.bp-input-group {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
}

html[data-theme="dark"] .bp-input-group {
    background: #0d1117;
    border-color: #30363d;
}

.bp-metric-box {
    text-align: center;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    height: 100%;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bp-metric-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

html[data-theme="dark"] .bp-metric-box {
    background: #0d1117;
    border-color: #30363d;
}

.bp-metric-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #7b2cbf;
}

html[data-theme="dark"] .bp-metric-value {
    color: #c77dff;
}

.bp-metric-label {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 4px;
    font-weight: 500;
}

.bp-countdown-timer {
    background: linear-gradient(135deg, #1f1235 0%, #100720 100%);
    border-radius: 10px;
    color: white;
    padding: 15px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.bp-countdown-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
    margin-bottom: 8px;
}

.bp-countdown-digits {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1.15rem;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.bp-pacing-badge {
    padding: 12px 15px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
    margin-top: 15px;
    transition: all 0.3s ease;
}

.bp-pacing-success {
    background-color: #d1e7dd;
    color: #0f5132;
    border: 1px solid #badbcc;
}

.bp-pacing-warning {
    background-color: #fff3cd;
    color: #664d03;
    border: 1px solid #ffecb5;
}

html[data-theme="dark"] .bp-pacing-success {
    background-color: rgba(25, 135, 84, 0.2);
    color: #75b798;
    border-color: rgba(25, 135, 84, 0.35);
}

html[data-theme="dark"] .bp-pacing-warning {
    background-color: rgba(255, 193, 7, 0.15);
    color: #ffda6a;
    border-color: rgba(255, 193, 7, 0.3);
}

.bp-tooltip-box {
    background: rgba(123, 44, 191, 0.05);
    border-left: 4px solid #7b2cbf;
    padding: 12px;
    border-radius: 0 8px 8px 0;
    font-size: 0.82rem;
    color: #495057;
    margin-top: 15px;
}

html[data-theme="dark"] .bp-tooltip-box {
    background: rgba(199, 125, 255, 0.08);
    border-left-color: #c77dff;
    color: #ced4da;
}

/* --- COMPACT TRANSACTION HISTORY TABLE --- */
.finance-cell {
    font-size: 0.825rem;
    padding: 0.25rem 0.5rem !important;
    text-align: left !important;
}

.finance-item {
    display: grid !important;                  /* override Bootstrap d-flex */
    grid-template-columns: 80px 1fr !important; /* label | value */
    column-gap: 4px !important;
    align-items: center !important;
    line-height: 1.25;
    margin: 2px 0;
}

/* Label column — neutralise me-1 margin, grid track controls spacing */
.finance-item > span.text-muted {
    margin-right: 0 !important;
}

.finance-item .price-cell {
    display: block;
}

/* Match the padding of .editable-field so all values indent identically */
.commission-display,
.profit-display {
    padding: 4px 8px;
    display: inline-block;
}

/* Compact dates cell style */
td.text-start div.text-nowrap {
    font-size: 0.8rem;
    line-height: 1.25;
}

/* --- MOBILE CARD VIEW PATTERN (< 768px) --- */
@media (max-width: 767.98px) {
    #purchases .table-responsive {
        border: none !important;
        overflow-x: visible !important;
    }
    
    #purchases table,
    #purchases tbody,
    #purchases tr,
    #purchases td {
        display: block !important;
        width: 100% !important;
    }
    
    #purchases thead {
        display: none !important;
    }
    
    #purchases tr {
        margin-bottom: 20px !important;
        border: 1px solid #dee2e6 !important;
        border-radius: 16px !important;
        padding: 16px !important;
        background: #ffffff !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
        position: relative !important;
        transition: transform 0.2s ease, box-shadow 0.2s ease !important;
    }
    
    html[data-theme="dark"] #purchases tr {
        background: #161b22 !important;
        border-color: #30363d !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
    }

    #purchases tr:hover {
        transform: translateY(-2px) !important;
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08) !important;
    }
    
    /* Header Area: Position delete bin absolutely at top right */
    #purchases td:first-child {
        position: absolute !important;
        top: 16px !important;
        right: 16px !important;
        width: auto !important;
        padding: 0 !important;
        border: none !important;
        background: transparent !important;
        z-index: 10;
    }
    
    #purchases td:first-child button {
        width: 42px !important;
        height: 42px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 50% !important;
        padding: 0 !important;
        font-size: 1.1rem !important;
    }
    
    /* Item name and ID */
    #purchases td:nth-child(2) {
        padding: 0 48px 8px 0 !important;
        border: none !important;
        text-align: left !important;
    }
    
    #purchases td:nth-child(2) .fw-bold {
        font-size: 1.05rem !important;
        color: #1f1235 !important;
        margin-bottom: 6px !important;
    }
    
    html[data-theme="dark"] #purchases td:nth-child(2) .fw-bold {
        color: #f0f6fc !important;
    }
    
    /* Status tag on left */
    #purchases td:nth-child(3) {
        display: inline-flex !important;
        width: auto !important;
        padding: 6px 0 !important;
        border: none !important;
        text-align: left !important;
    }
    
    /* Date and time on right */
    #purchases td:nth-child(4) {
        display: inline-block !important;
        width: auto !important;
        float: right !important;
        padding: 4px 0 !important;
        border: none !important;
        text-align: right !important;
    }

    #purchases td:nth-child(4) div.text-nowrap {
        font-size: 0.825rem !important;
        color: #495057 !important;
    }
    
    html[data-theme="dark"] #purchases td:nth-child(4) div.text-nowrap {
        color: #8b949e !important;
    }
    
    #purchases tr::after {
        content: "" !important;
        display: table !important;
        clear: both !important;
    }
    
    /* Financial Grid Area (2x2 Grid) */
    #purchases td.finance-cell {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
        border-top: 1px solid #e9ecef !important;
        border-bottom: none !important;
        padding: 12px 0 !important;
        margin-top: 10px !important;
    }
    
    html[data-theme="dark"] #purchases td.finance-cell {
        border-top-color: #30363d !important;
    }
    
    #purchases td.finance-cell .finance-item {
        background: #f8f9fa !important;
        border-radius: 8px !important;
        padding: 8px 10px !important;
        margin: 0 !important;
        border: 1px solid #e9ecef !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 2px !important;
    }
    
    html[data-theme="dark"] #purchases td.finance-cell .finance-item {
        background: #0d1117 !important;
        border-color: #30363d !important;
    }
    
    #purchases td.finance-cell .finance-item span.text-muted {
        font-size: 0.75rem !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
    }
    
    /* Comment Area */
    #purchases td:nth-child(6) {
        border-top: 1px dashed #e9ecef !important;
        padding: 10px 0 0 0 !important;
        margin-top: 4px !important;
        text-align: left !important;
        font-size: 0.85rem !important;
        color: #495057 !important;
    }
    
    html[data-theme="dark"] #purchases td:nth-child(6) {
        border-top-color: #30363d !important;
        color: #8b949e !important;
    }
    
    /* Ensure page buttons are large enough on mobile */
    .pagination .page-link {
        padding: 10px 16px !important;
        font-size: 1rem !important;
    }
}
/* ==================== КОМПОНЕНТНЫЕ СТИЛИ (ВЫНЕСЕНЫ ИЗ ШАБЛОНОВ) ==================== */

/* --- Уведомление о Cookies --- */
.cookies-notice {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-top: 1px solid var(--border);
    padding: 15px 20px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
    z-index: 10000;
    font-size: 14px;
}
.cookies-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.cookies-content p {
    margin: 0;
    flex: 1;
    line-height: 1.4;
}
.cookies-content a {
    color: var(--accent);
    text-decoration: underline;
}
.cookies-buttons {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}
.cookies-buttons .btn {
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}
@media (max-width: 768px) {
    .cookies-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    .cookies-buttons {
        width: 100%;
        justify-content: center;
    }
}

/* --- Политика конфиденциальности --- */
.privacy-policy {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}
.policy-content section {
    margin-bottom: 30px;
}
.policy-content h2 {
    color: var(--text-primary);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 5px;
    margin-bottom: 15px;
}
.policy-content ul {
    padding-left: 20px;
}
.policy-content li {
    margin-bottom: 8px;
}
.policy-date {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    text-align: center;
}

/* --- Главная страница (Home) --- */
.hero-section {
    padding: 2.5rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    margin-top: 1.5rem;
    color: white;
    position: relative;
    overflow: hidden;
}
.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    animation: float 20s linear infinite;
    z-index: 1;
}
.hero-section > * {
    position: relative;
    z-index: 2;
}
@keyframes float {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-20px, -20px) rotate(360deg); }
}
.hero-section .display-5 {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.hero-section .text-muted {
    color: rgba(255, 255, 255, 0.8) !important;
}
.feature-card {
    border-radius: 15px;
    background: var(--bg-card);
    box-shadow: 0 5px 25px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid var(--border);
    cursor: pointer;
    height: 100%;
}
.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}
.feature-image-container {
    position: relative;
    height: 180px;
    overflow: hidden;
}
.feature-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.feature-card:hover .feature-image {
    transform: scale(1.05);
}
.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.feature-card:hover .image-overlay {
    opacity: 1;
}
.image-overlay i {
    color: white;
    font-size: 2rem;
    background: rgba(0,0,0,0.5);
    padding: 12px;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.feature-card[onclick*="openYouTubeModal"] .image-overlay i {
    font-size: 2.5rem;
    background: rgba(255, 0, 0, 0.8);
    padding: 15px;
    border-radius: 50%;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.feature-card[onclick*="openYouTubeModal"]:hover {
    border-color: #ff0000;
}
.video-indicator {
    margin-top: 0.5rem;
    color: #ff0000;
    font-size: 0.8rem;
}
.video-indicator i {
    margin-right: 0.25rem;
}
.feature-content {
    padding: 1.5rem;
    text-align: center;
}
.feature-content h5 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}
.feature-content .text-muted {
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--text-muted) !important;
}
.social-section {
    padding: 2.5rem;
    background: var(--bg-secondary);
    border-radius: 15px;
    border: 2px dashed var(--border);
}
.social-btn {
    display: inline-flex;
    align-items: center;
    padding: 12px 24px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}
.social-btn.telegram {
    background: linear-gradient(135deg, #0088cc, #00aced);
    color: white;
}
.social-btn.discord {
    background: linear-gradient(135deg, #5865f2, #7289da);
    color: white;
}
.social-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    color: white;
    text-decoration: none;
}
#imageModal .modal-dialog,
#youtubeModal .modal-dialog {
    max-width: 80%;
    margin: 1rem auto;
}
#imageModal .modal-body {
    padding: 0;
    background: var(--bg-secondary);
}
#imageModal .modal-body img {
    max-height: 80vh;
    object-fit: contain;
}
#youtubeModal .modal-body {
    padding: 0;
    background: #000;
}
#youtubeModal .modal-body .ratio {
    background: #000;
}
#youtubeModal iframe {
    width: 100%;
    height: 100%;
    border: none;
}
#youtubeModal .modal-header {
    background: var(--bg-card);
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
}
#youtubeModal .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}
@media (max-width: 768px) {
    .hero-section { padding: 2rem 1rem; margin-top: 1rem; }
    .display-5 { font-size: 2rem; }
    .feature-image-container { height: 150px; }
    .social-btn { padding: 10px 20px; font-size: 0.9rem; }
    .feature-content { padding: 1rem; }
    #imageModal .modal-dialog, #youtubeModal .modal-dialog { max-width: 95%; margin: 0.5rem auto; }
    #youtubeModal .modal-body .ratio { height: auto; min-height: 300px; }
}
@media (max-width: 576px) {
    .feature-image-container { height: 120px; }
    .social-section { padding: 1.5rem; }
    .feature-card { margin-bottom: 1rem; }
    .video-indicator { font-size: 0.7rem; }
}

/* --- Лаборатория SPANK (Lab) --- */
.results-section {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.result-option {
    background: var(--bg-card);
    border: 2px solid var(--border);
    transition: all 0.3s ease;
    border-radius: var(--radius-sm);
}
.result-option.best-option {
    border-color: #28a745;
    background: rgba(40, 167, 69, 0.08);
}
.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
.result-item:last-child {
    border-bottom: none;
}
.general-info {
    background: var(--bg-card);
    padding: 15px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

/* --- Чеклист Фарма BP (BP Farm) --- */
@media (max-width: 768px) {
    .task-checkbox { transform: scale(1.5) !important; margin-right: 1rem !important; }
    .favorite-task { padding: 1rem 0.75rem; }
    .list-group-item { padding: 0.75rem 0.5rem; }
}
.favorite-task.completed {
    background-color: rgba(255,255,255,0.03);
    opacity: 0.7;
}
.favorite-task.completed .task-name {
    text-decoration: line-through;
    color: var(--text-muted);
}
.favorite-task.completed .task-checkbox {
    opacity: 1 !important;
    cursor: not-allowed;
}
.favorite-task {
    transition: all 0.3s ease;
    animation: fadeIn 0.3s ease;
}
.favorite-task.removing {
    animation: fadeOut 0.3s ease;
    opacity: 0;
}
.stat-update {
    animation: pulse 0.5s ease-in-out;
}
.custom-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    min-width: 300px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* --- Настройки аккаунта (Account Settings) --- */
.dashboard-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}
.account-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 20px;
}
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}
.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-sizing: border-box;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-group input:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 2px rgba(245,130,13,0.2);
}

/* --- Профили (Profiles) --- */
.balance-editable {
    cursor: pointer;
    min-width: 100px;
}
.balance-editable:hover .balance-display {
    background-color: var(--bg-card-hover);
    border-radius: 4px;
    padding: 2px 6px;
}
.balance-input {
    width: 120px !important;
    text-align: center;
    font-weight: bold;
}
.profile-name-editable {
    cursor: pointer;
    min-width: 150px;
}
.profile-name-display {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-weight: 500;
    cursor: pointer;
}
.profile-name-editable:hover .profile-name-display {
    background: rgba(245,130,13,0.1);
    border-radius: 6px;
    padding: 4px 8px;
    border: 1px dashed var(--accent);
}
.balance-edit-form,
.profile-name-edit-form {
    display: none;
    align-items: center;
    gap: 6px;
    background: var(--bg-secondary);
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid var(--border);
    width: fit-content;
    margin: 2px 0;
}
.profile-name-edit-form[style*="flex"] {
    display: flex !important;
}
.profile-name-input {
    width: 200px !important;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 14px;
    background: var(--bg-card);
    color: var(--text-primary);
}
.profile-name-buttons {
    display: flex;
    gap: 4px;
}
.btn-save-name,
.btn-cancel-name {
    padding: 4px 8px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    transition: all 0.2s ease;
    min-width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.btn-save-name { background: #28a745; color: white; }
.btn-save-name:hover { background: #218838; }
.btn-cancel-name { background: #6c757d; color: white; }
.btn-cancel-name:hover { background: #5a6268; }

/* Flatpickr глобальные оверлеи */
.flatpickr-calendar {
    z-index: 99999 !important;
}
.flatpickr-calendar.open {
    z-index: 100000 !important;
}

/* --- Отчёты и статистика (Stats / Reports) --- */
.sortable-header {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
    background-color: var(--bg-secondary);
}
.sortable-header:hover {
    background-color: var(--bg-card-hover);
}
.sortable-header a {
    color: var(--text-primary);
    text-decoration: none;
}
.sortable-header a:hover {
    color: var(--accent);
}
@media (max-width: 768px) {
    .sortable-header span { font-size: 0.875rem; }
    .date-range-buttons { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
    .date-range-buttons button { flex: 1; min-width: 70px; font-size: 0.8rem; padding: 0.25rem 0.5rem; }
}
option[value="all"] { font-weight: bold; }
option[value^="transport"]::before { content: "🚗 "; }
option[value^="realty"]::before { content: "🏠 "; }
option[value^="weapons"]::before { content: "🔫 "; }
option[value^="clothing"]::before { content: "👕 "; }
option[value^="electronics"]::before { content: "📱 "; }
option[value^="other"]::before { content: "📦 "; }

/* --- Подписки: Анимации статусов --- */
@keyframes successPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 12px 40px rgba(22, 163, 74, 0.3); }
    50% { transform: scale(1.05); box-shadow: 0 16px 50px rgba(22, 163, 74, 0.4); }
}
@keyframes failPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 12px 40px rgba(220, 38, 38, 0.3); }
    50% { transform: scale(1.05); box-shadow: 0 16px 50px rgba(220, 38, 38, 0.35); }
}

/* --- Поиск предметов в панели администратора --- */
#searchResults {
    position: absolute;
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    width: 100%;
}

/* ==================== RESPONSIVE NAVIGATION (SIDEBAR / HAMBURGER) ==================== */
.sidebar-head { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.sidebar-logo { border-bottom: 0; flex: 1; min-width: 0; padding-right: 6px; }
.sidebar-close { display: none; align-items: center; justify-content: center; width: 32px; height: 32px; margin-right: 10px; border-radius: var(--radius-sm); background: var(--bg-secondary); border: 1px solid var(--border); color: var(--text-muted); font-size: 13px; line-height: 1; cursor: pointer; transition: color .15s, border-color .15s; }
.sidebar-close:hover { color: var(--accent); border-color: var(--accent); }
.sidebar-toggle { display: none; align-items: center; justify-content: center; width: 38px; height: 38px; flex-shrink: 0; padding: 0; border-radius: 9px; background: var(--bg-card); border: 1px solid var(--border); color: var(--text-primary); font-size: 18px; line-height: 1; cursor: pointer; transition: color .15s, border-color .15s; }
.sidebar-toggle:hover { color: var(--accent); border-color: var(--accent); }
.mobile-topbar { display: none; align-items: center; gap: 10px; height: 52px; padding: 0 12px; background: var(--bg-secondary); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.mobile-topbar .mobile-brand { font-weight: 800; font-size: 15px; letter-spacing: .4px; color: var(--text-primary); text-decoration: none; }
.sidebar-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.55); opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility .25s ease; z-index: 1065; }
.app-layout.sidebar-open .sidebar-backdrop { opacity: 1; visibility: visible; }

/* Планшет: сайдбар только с иконками */
@media (min-width: 768px) and (max-width: 991.98px) {
    :root { --sidebar-w: 64px; }
    .sidebar .nav-label, .sidebar .logo-text, .sidebar .nav-arrow { display: none; }
    .sidebar .nav-item { justify-content: center !important; padding: 12px 0 !important; gap: 0 !important; }
    .sidebar .nav-submenu .nav-item { padding-left: 0 !important; }
    .sidebar .nav-submenu { max-height: 240px; }
    .sidebar-logo { justify-content: center; padding: 16px 0; }
    .nav-section { padding: 6px 0; }
}

/* Мобильные (<768px): сайдбар скрыт, off-canvas */
@media (max-width: 767.98px) {
    .sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: 264px; z-index: 1070; transform: translateX(-100%); transition: transform .25s ease; box-shadow: 4px 0 24px rgba(0,0,0,.35); }
    .app-layout.sidebar-open .sidebar { transform: translateX(0); }
    .sidebar-close { display: inline-flex; }
    .sidebar-toggle { display: inline-flex; }
    .mobile-topbar { display: flex; }
    .content-area { padding: 14px 12px 20px; gap: 14px; }
    .topbar { height: auto; min-height: var(--topbar-h); padding: 8px 12px; gap: 8px; }
    .topbar > .sidebar-toggle { display: inline-flex; }
    .topbar-left { flex: 1; }
    .topbar-greeting { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .topbar-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .topbar-divider { display: none; }
    .topbar-selector { max-width: 45vw; }
    .page-header { flex-wrap: wrap; }
}

/* ==================== DESIGN SYSTEM EXTRAS (по образцу /market/trade) ==================== */
.app-layout .list-group-item { background: var(--bg-card); color: var(--text-primary); border-color: var(--border); }
.app-layout .list-group-item:hover { background: var(--bg-card-hover); }
.app-layout .list-group-item.bg-light { background: var(--bg-secondary) !important; }

/* Сводные карточки статистики */
.stat-card .card-body { padding: 14px 10px; }
.stat-card .stat-title { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: var(--text-muted); }
.stat-card .stat-title i { color: var(--accent); }
.stat-card .stat-value { margin-top: 4px; font-size: 1.3rem; font-weight: 800; letter-spacing: -0.4px; line-height: 1.15; color: var(--text-primary); word-break: break-word; }
.stat-card .stat-note { margin-top: 2px; font-size: 10.5px; color: var(--text-dim); }
.stat-card.is-success .stat-value { color: #2ac47a; }
.stat-card.is-loss .stat-value { color: #e05555; }
.stat-card.is-accent .stat-value { color: var(--accent); }
@media (max-width: 767.98px) {
    .stat-card .stat-value { font-size: 1.12rem; }
}

/* Мuted chips (вместо сплошных цветных счётчиков) */
.badge-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-secondary); color: var(--text-muted); font-size: 11px; font-weight: 600; line-height: 1.2; }
.badge-chip-accent { background: rgba(245,130,13,.12); border-color: rgba(245,130,13,.35); color: var(--accent); }

/* Строка фильтров отчётов: даты -> кнопки -> профиль */
.filter-bar .filter-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; }
.filter-bar .filter-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.filter-bar .filter-field > label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--text-dim); }
.filter-bar .filter-field input { width: 134px; }
.filter-bar .filter-sep { width: 1px; align-self: stretch; background: var(--border); }
.filter-bar .filter-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.filter-bar .filter-profile { margin-left: auto; min-width: 250px; }
.filter-bar .filter-profile select { width: 100%; }
@media (max-width: 767.98px) {
    .filter-bar .filter-field { flex: 1 1 130px; }
    .filter-bar .filter-field input { width: 100%; }
    .filter-bar .filter-sep { display: none; }
    .filter-bar .filter-profile { margin-left: 0; min-width: 100%; }
}

/* Графики: приглушённая палитра (вместо неоновых зелёного/синего) */
:root {
    --chart-spent:  #c2706f;
    --chart-sales:  #4c9a78;
    --chart-rent:   #6b8fd6;
    --chart-profit: #f5820d;
    --chart-grid:   rgba(130,130,153,.16);
    --chart-text:   #828299;
}
[data-theme="light"], body:not(.dark-theme) {
    --chart-grid: rgba(104,111,130,.16);
    --chart-text: #686f82;
}

/* Текстовые метки категорий (замена иконок/эмодзи) */
.cat-text-label { font-size: 11px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }

/* Настройки аккаунта / Профиль */
.dashboard-container { max-width: 1440px; margin: 0; padding: 0; }
.settings-title { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; font-size: 20px; font-weight: 700; color: var(--text-primary); }
.settings-section-title { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; padding-bottom: 10px; border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--text-muted); }
.limit-tile { padding: 12px; text-align: center; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.limit-tile .limit-emoji { font-size: 1.35rem; margin-bottom: 4px; }
.limit-tile .limit-name { font-size: .9rem; font-weight: 600; color: var(--text-primary); }
.limit-tile .limit-value { margin-top: 4px; font-size: 1.1rem; font-weight: 700; color: var(--accent); }

/* Телефон: компактные отступы у контейнеров страниц */
@media (max-width: 767.98px) {
    .container { padding-left: 4px; padding-right: 4px; }
}