@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');

:root {
    --sidebar-width-expanded: 260px;
    --sidebar-width-collapsed: 72px;
    --sidebar-bg: #0f172a;
    --sidebar-hover: rgba(255,255,255,0.06);
    --sidebar-active: rgba(99, 102, 241, 0.15);
    --sidebar-active-border: #6366f1;
    --primary-color: #6366f1;
    --transition-speed: 0.25s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
}

/* Основной wrapper приложения */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Левая боковая панель */
.sidebar {
    width: var(--sidebar-width-expanded);
    background: var(--sidebar-bg);
    color: rgba(255,255,255,0.7);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: width var(--transition-speed) ease, transform var(--transition-speed) ease;
    overflow: hidden;
    border-right: 1px solid rgba(255,255,255,0.06);
}

.sidebar.collapsed {
    width: var(--sidebar-width-collapsed);
}

.sidebar-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 64px;
    position: relative;
}

.sidebar.collapsed .sidebar-header {
    padding: 1rem 0.5rem;
}

.sidebar-header .logo {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-header .logo .logo-full {
    max-height: 70px;
    width: auto;
    max-width: 100%;
    display: block;
    transition: opacity var(--transition-speed) ease;
}

.sidebar-header .logo .logo-icon {
    max-height: 30px;
    width: auto;
    display: none;
    transition: opacity var(--transition-speed) ease;
}

.sidebar.collapsed .sidebar-header .logo .logo-full {
    display: none;
}

.sidebar.collapsed .sidebar-header .logo .logo-icon {
    display: block;
}


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

.sidebar-nav::-webkit-scrollbar {
    width: 3px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin: 1px 0;
}

.sidebar-nav > ul > li {
    margin: 0 0.5rem;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: none;
    border-radius: 8px;
    white-space: nowrap;
    position: relative;
    font-size: 0.875rem;
    font-weight: 500;
}

.sidebar.collapsed .sidebar-nav a {
    justify-content: center;
    padding: 0.75rem 0;
    gap: 0;
}

.sidebar-nav a:hover {
    background: var(--sidebar-hover);
    color: rgba(255,255,255,0.95);
    border-left-color: transparent;
}

.sidebar-nav a.active {
    background: var(--sidebar-active);
    color: #fff;
    border-left-color: transparent;
}

.sidebar-nav a.active .nav-icon svg {
    color: var(--sidebar-active-border);
}

.sidebar-nav .nav-icon {
    font-size: 1.25rem;
    width: 24px;
    height: 24px;
    text-align: center;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-nav .nav-icon svg {
    color: rgba(255,255,255,0.45);
    transition: color 0.2s ease;
}

.sidebar-nav a:hover .nav-icon svg {
    color: rgba(255,255,255,0.85);
}

.sidebar-nav .nav-text {
    font-weight: 500;
    opacity: 1;
    transition: opacity 0.15s ease;
}

.sidebar.collapsed .sidebar-nav .nav-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

/* Tooltip для collapsed режима */
.sidebar.collapsed .sidebar-nav a::after {
    content: attr(title);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: var(--sidebar-bg);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    margin-left: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    z-index: 1001;
}

.sidebar.collapsed .sidebar-nav a:hover::after {
    opacity: 1;
}

.sidebar-footer {
    padding: 1rem 1rem;
    border-top: 1px solid rgba(255,255,255,0.06);
    transition: padding var(--transition-speed) ease;
}

.sidebar.collapsed .sidebar-footer {
    padding: 0.75rem 0.5rem;
}

.user-info {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    overflow: hidden;
}

.sidebar.collapsed .user-info {
    flex-direction: column;
    gap: 0.5rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    text-transform: uppercase;
    flex-shrink: 0;
}

.user-details {
    flex: 1;
    min-width: 0;
    opacity: 1;
    transition: opacity 0.2s ease;
}

.sidebar.collapsed .user-details {
    opacity: 0;
    width: 0;
    height: 0;
    overflow: hidden;
}

.user-name {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.8rem;
    color: #aaa;
    margin-top: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #fff;
    text-decoration: none;
    padding: 0.75rem;
    background: rgba(255,255,255,0.1);
    border-radius: 5px;
    transition: all var(--transition-speed) ease;
    font-weight: 500;
}

.sidebar.collapsed .logout-btn {
    padding: 0.75rem 0.5rem;
}

.logout-btn:hover {
    background: rgba(255,255,255,0.2);
}

.logout-icon {
    flex-shrink: 0;
}

.logout-text {
    opacity: 1;
    transition: opacity 0.2s ease;
}

.sidebar.collapsed .logout-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

/* Основной контент */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width-expanded);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left var(--transition-speed) ease;
    overflow-x: hidden;
}

.sidebar.collapsed ~ .main-content {
    margin-left: var(--sidebar-width-collapsed);
}

/* Мобильный header (скрыт на десктопе) */
.mobile-header {
    display: none;
    background: #1a1a2e;
    color: #fff;
    padding: 1rem;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.menu-toggle {
    background: none;
    border: none;
    width: 30px;
    height: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    padding: 0;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.mobile-logo img {
    height: 40px;
}

.mobile-user-icon {
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-avatar-mobile {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), #764ba2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    text-transform: uppercase;
}

main {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    width: 100%;
}

/* Адаптивность для планшетов и мобильных */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .mobile-header {
        display: flex;
    }
    
    main {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    main {
        padding: 1rem;
    }
    
    .sidebar {
        width: 280px;
    }
    
    /* Всегда показываем полный логотип на мобильных */
    .sidebar.collapsed .sidebar-header .logo .logo-full {
        display: block;
    }
    
    .sidebar.collapsed .sidebar-header .logo .logo-icon {
        display: none;
    }
    
    /* Всегда показываем текст на мобильных */
    .sidebar.collapsed .nav-text,
    .sidebar.collapsed .user-details,
    .sidebar.collapsed .logout-text {
        opacity: 1;
        width: auto;
        height: auto;
        overflow: visible;
    }
    
    /* Отключаем collapsed ширину на мобильных */
    .sidebar.collapsed {
        width: 280px;
    }
    
    .sidebar.collapsed .sidebar-header .logo {
        opacity: 1;
        width: auto;
        height: auto;
        overflow: visible;
    }
}

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.login-box {
    background: #020025;
    padding: 3rem;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 420px;
}

.logo-container {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-container img {
    height: 60px;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 700;
}

/* Login page form styles (dark background) */
.login-box .form-group {
    margin-bottom: 1.5rem;
}

.login-box .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #ffffff;
}

.login-box .form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    font-size: 1rem;
    background: rgba(255,255,255,0.1);
    color: #ffffff;
    transition: all 0.2s ease;
}

.login-box .form-group input::placeholder {
    color: rgba(255,255,255,0.5);
}

.login-box .form-group input:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(255,255,255,0.15);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

/* General form group styles (for CRM forms) */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

button {
    width: 100%;
    padding: 0.75rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 600;
}

button:hover {
    background: #764ba2;
}

.dashboard h1 {
    margin-bottom: 2rem;
}

.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

@media (max-width: 576px) {
    .quick-stats {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.stat-card h3 {
    color: #666;
    margin-bottom: 1rem;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: #667eea;
}

.stat-card small {
    color: #999;
    font-size: 0.875rem;
}

.financial-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.finance-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.finance-card.revenue {
    border-left: 5px solid #10b981;
}

.finance-card.expense {
    border-left: 5px solid #ef4444;
}

.finance-card.profit {
    border-left: 5px solid #667eea;
}

.finance-card.profit.negative {
    border-left-color: #ef4444;
}

.finance-value {
    font-size: 1.2rem;
    font-weight: bold;
    margin-top: 0.5rem;
}

.revenue .finance-value {
    color: #10b981;
}

.expense .finance-value {
    color: #ef4444;
}

.profit .finance-value {
    color: #667eea;
}

.profit.negative .finance-value {
    color: #ef4444;
}

.finance-card.deposits {
    border-left: 5px solid #f59e0b;
}

.deposits .finance-value {
    color: #f59e0b;
}

.finance-card small {
    display: block;
    margin-top: 0.5rem;
    color: #6b7280;
    font-size: 0.875rem;
}

.alerts-section {
    margin-top: 2rem;
}

.alert {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-left: 5px solid;
}

.alert h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
}

.alert p {
    margin: 0;
    color: #374151;
}

.alert a {
    color: #667eea;
    font-weight: 600;
    text-decoration: none;
}

.alert a:hover {
    text-decoration: underline;
}

.alert-warning {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

.alert-danger {
    border-left-color: #ef4444;
    background: #fef2f2;
}

.quick-actions {
    margin-top: 3rem;
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.action-btn {
    display: block;
    text-align: center;
    padding: 1rem;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: #764ba2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102,126,234,0.4);
}

.messages {
    margin-bottom: 2rem;
}

.message {
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.message.error {
    background: #fee;
    color: #c00;
    border: 1px solid #fcc;
}

.message.success {
    background: #efe;
    color: #080;
    border: 1px solid #cfc;
}

.change-password-container {
    background: white;
    padding: 3rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    max-width: 500px;
    margin: 0 auto;
}

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

.page-header h1 {
    font-size: 2rem;
    color: #333;
    margin: 0;
}

.form-container {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    max-width: 900px;
}

.form-container h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #667eea;
    color: #667eea;
}

.form-container h3:first-of-type {
    margin-top: 0;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.form-container .form-group {
    margin-bottom: 1.5rem;
}

.form-container .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-container .form-group input,
.form-container .form-group select,
.form-container .form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.form-container .form-group input:focus,
.form-container .form-group select:focus,
.form-container .form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

.form-container .error {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.form-actions {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
    display: flex;
    gap: 1rem;
    justify-content: flex-start;
}

.btn {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #764ba2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102,126,234,0.4);
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

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

.btn-outline {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
}

.calendar-header .btn-outline {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
    width: 100px;
}

.calendar-header .btn-outline:hover {
    background: #667eea;
    color: white;
}

.kanban-board {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
    overflow-x: auto;
    padding-bottom: 1rem;
}

.kanban-column {
    background: #f9fafb;
    border-radius: 10px;
    min-width: 250px;
    display: flex;
    flex-direction: column;
}

.column-header {
    padding: 1rem;
    border-radius: 10px 10px 0 0;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.column-header.new {
    background: #6366f1;
}

.column-header.contacted {
    background: #8b5cf6;
}

.column-header.confirmed {
    background: #3b82f6;
}

.column-header.paid {
    background: #10b981;
}

.column-header.completed {
    background: #059669;
}

.column-header.rejected {
    background: #ef4444;
}

.column-header h3 {
    font-size: 1rem;
    margin: 0;
    font-weight: 600;
}

.column-header .count {
    background: rgba(255,255,255,0.3);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.kanban-cards {
    padding: 1rem;
    flex: 1;
    min-height: 200px;
}

.kanban-cards.drag-over {
    background: #e5e7eb;
}

.kanban-card {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    cursor: move;
    transition: all 0.2s ease;
}

.kanban-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.kanban-card.dragging {
    opacity: 0.5;
}

.kanban-card .card-header {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kanban-card .card-header strong {
    color: #111827;
    font-size: 1rem;
}

.kanban-edit-btn {
    opacity: 0.6;
    transition: opacity 0.2s;
    text-decoration: none;
    font-size: 14px;
    pointer-events: auto;
    cursor: pointer;
}

.kanban-edit-btn:hover {
    opacity: 1;
}

.kanban-card .card-body p {
    margin: 0.5rem 0;
    font-size: 0.875rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.kanban-card .icon {
    font-size: 1rem;
}

.kanban-card .source {
    color: #9ca3af;
    font-size: 0.75rem;
    margin-top: 0.75rem;
}

.kanban-card .card-footer {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f3f4f6;
    display: flex;
    justify-content: space-between;
}

.kanban-card .card-footer small {
    font-size: 0.75rem;
    color: #9ca3af;
}

.empty-message {
    text-align: center;
    color: #9ca3af;
    font-size: 0.875rem;
    margin-top: 2rem;
}

/* Page header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
}

.page-header h1 {
    font-size: 2rem;
    color: #111827;
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 1rem;
}

/* ===========================================
   FILTERS BAR - CLEAN MINIMAL DESIGN
   =========================================== */
.filters-bar {
    background: #fff;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid #eef2f7;
}

.filters-form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: nowrap;
}

/* All filter inputs unified */
.search-input,
.filter-select,
.filters-form input[type="date"] {
    height: 38px;
    padding: 0 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-family: inherit;
    background: #fff;
    color: #374151;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}

.search-input {
    flex: 1;
    min-width: 160px;
}

.filter-select {
    min-width: 120px;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M2.5 4.5L6 8l3.5-3.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    padding-right: 1.75rem;
}

.filters-form input[type="date"] {
    min-width: 130px;
}

.search-input:focus,
.filter-select:focus,
.filters-form input[type="date"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.15);
}

.search-input::placeholder {
    color: #9ca3af;
    font-size: 0.8125rem;
}

/* Button Group */
.filter-buttons {
    display: flex;
    gap: 0.375rem;
    flex-shrink: 0;
    margin-left: 0.25rem;
}

/* Filter Buttons */
.filters-form .btn {
    height: 38px;
    padding: 0 0.875rem;
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    box-sizing: border-box;
    transition: all 0.15s;
    cursor: pointer;
}

.filters-form .btn-secondary {
    background: #667eea;
    color: #fff;
    border: none;
}

.filters-form .btn-secondary:hover {
    background: #5b71e4;
}

.filters-form .btn-outline {
    background: #fff;
    color: #6b7280;
    border: 1px solid #e5e7eb;
}

.filters-form .btn-outline:hover {
    background: #f9fafb;
    color: #374151;
    border-color: #d1d5db;
}

/* ===========================================
   FILTERS BAR - RESPONSIVE
   =========================================== */
@media (max-width: 1200px) {
    .filters-form {
        flex-wrap: wrap;
    }
    
    .search-input {
        flex: 1 1 100%;
        order: 1;
        margin-bottom: 0.25rem;
    }
    
    .filter-select,
    .filters-form input[type="date"] {
        flex: 1;
        min-width: 100px;
        order: 2;
    }
    
    .filter-buttons {
        order: 10;
        margin-left: auto;
    }
}

@media (max-width: 768px) {
    .filters-bar {
        padding: 0.625rem;
    }
    
    .filters-form {
        gap: 0.375rem;
    }
    
    .search-input,
    .filter-select,
    .filters-form input[type="date"] {
        height: 36px;
        font-size: 0.8rem;
    }
    
    .filter-select,
    .filters-form input[type="date"] {
        flex: 1 1 calc(50% - 0.1875rem);
        min-width: unset;
    }
    
    .filter-buttons {
        width: 100%;
        margin-left: 0;
        margin-top: 0.25rem;
    }
    
    .filters-form .btn {
        flex: 1;
        height: 36px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .filter-select,
    .filters-form input[type="date"] {
        flex: 1 1 100%;
    }
}

/* ===========================================
   TABLES - GLOBAL STYLING
   =========================================== */
.table-container {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    width: 100%;
    overflow-x: auto;
    border: 1px solid #eef2f7;
}

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

.data-table thead {
    background: #f8fafc;
}

.data-table th {
    padding: 1rem 1rem;
    text-align: left;
    font-weight: 600;
    color: #64748b;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid #e2e8f0;
}

.data-table td {
    padding: 1rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    color: #1f2937;
    font-size: 0.875rem;
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background-color 0.1s;
}

.data-table tbody tr:hover {
    background-color: #f8fafc;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table .empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #9ca3af;
}

.table-footer {
    padding: 1rem 1.25rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    border-radius: 0 0 12px 12px;
    font-size: 0.875rem;
    color: #64748b;
}

/* Mobile table adjustments */
@media (max-width: 768px) {
    .data-table th,
    .data-table td {
        padding: 0.75rem 0.625rem;
        font-size: 0.8rem;
    }
    
    .data-table th:first-child,
    .data-table td:first-child {
        padding-left: 1rem;
    }
    
    .data-table th:last-child,
    .data-table td:last-child {
        padding-right: 1rem;
    }
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-stage-new {
    background: #dbeafe;
    color: #1e40af;
}

.badge-stage-contacted {
    background: #e9d5ff;
    color: #6b21a8;
}

.badge-stage-confirmed {
    background: #bfdbfe;
    color: #1e3a8a;
}

.badge-stage-paid {
    background: #fb923c;
    color: #ffffff;
    font-weight: 600;
}

.badge-stage-completed {
    background: #a7f3d0;
    color: #064e3b;
}

.badge-stage-rejected {
    background: #fee2e2;
    color: #991b1b;
}

.badge-website {
    background: #dbeafe;
    color: #1e40af;
}

.badge-telegram {
    background: #bfdbfe;
    color: #1e3a8a;
}

.badge-phone {
    background: #d1fae5;
    color: #065f46;
}

.badge-referral {
    background: #fef3c7;
    color: #92400e;
}

.badge-other {
    background: #e5e7eb;
    color: #374151;
}

/* Action buttons */
.actions-cell {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    font-size: 1.25rem;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s;
}

.btn-icon:hover {
    transform: scale(1.2);
}

.link {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.link:hover {
    text-decoration: underline;
}

/* Detail pages */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* New booking row layout - 3 columns */
.booking-row {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 1.5rem !important;
    margin-bottom: 1.5rem !important;
}

.booking-row > .detail-card {
    flex: 0 0 calc(33.333% - 1rem) !important;
    max-width: calc(33.333% - 1rem) !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

.booking-row > .detail-card.full-width {
    flex: 0 0 100% !important;
    max-width: 100% !important;
}

.detail-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
}

.detail-card.full-width {
    flex: 0 0 100%;
    max-width: 100%;
}

.detail-card h2 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #111827;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e5e7eb;
}

.detail-row {
    display: flex;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row .label {
    font-weight: 600;
    color: #6b7280;
    width: 140px;
    flex-shrink: 0;
    font-size: 0.9rem;
}

.detail-row .value {
    color: #111827;
    flex: 1;
    font-size: 0.9rem;
}

.detail-row .value a {
    color: #667eea;
    text-decoration: none;
}

.detail-row .value a:hover {
    text-decoration: underline;
}

/* Photo gallery mini for inline display */
.photo-gallery-mini {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.photo-item-mini {
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.photo-item-mini:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 1;
}

.photo-item-mini img,
.photo-item-mini video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Photo gallery for return section */
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.photo-item {
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 1;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.photo-item:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

.photo-item img,
.photo-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Lightbox styles */
.lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.lightbox-overlay.active {
    display: flex;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
}

.lightbox-content img,
.lightbox-content video {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 32px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    transition: background 0.2s;
}

.lightbox-close:hover {
    background: rgba(255,255,255,0.2);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 48px;
    cursor: pointer;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    transition: background 0.2s;
}

.lightbox-nav:hover {
    background: rgba(255,255,255,0.2);
}

.lightbox-prev {
    left: -80px;
}

.lightbox-next {
    right: -80px;
}

.lightbox-counter {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 14px;
}

/* Return info grid for completed status */
.return-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.return-info-col {
    min-width: 0;
}

/* Small button variant */
.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Responsive: tablet and below */
@media (max-width: 1024px) {
    .booking-row > .detail-card {
        flex: 0 0 calc(50% - 0.75rem) !important;
        max-width: calc(50% - 0.75rem) !important;
    }
    
    .booking-row > .detail-card:nth-child(3n) {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
    
    .return-info-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .photo-gallery {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Responsive: mobile */
@media (max-width: 768px) {
    .booking-row {
        gap: 1rem !important;
        flex-direction: column !important;
    }
    
    .booking-row > .detail-card {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
    
    .booking-row > .detail-card:nth-child(3n) {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
    
    .detail-row {
        flex-direction: column;
    }
    
    .detail-row .label {
        width: 100%;
        margin-bottom: 0.25rem;
    }
    
    .photo-gallery-mini {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .photo-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .lightbox-nav {
        display: none;
    }
}

/* Danger zone */
.action-panel {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.action-panel h2 {
    margin-bottom: 1.5rem;
    color: #333;
    font-size: 1.5rem;
}

.action-buttons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.btn-success, button.btn-success {
    background: #10b981;
    color: white;
    border: none;
    cursor: pointer;
}

.btn-success:hover, button.btn-success:hover {
    background: #059669;
}

.btn-primary, button.btn-primary {
    background: #3b82f6;
    color: white;
    border: none;
    cursor: pointer;
}

.btn-primary:hover, button.btn-primary:hover {
    background: #2563eb;
}

.btn-warning, button.btn-warning {
    background: #f59e0b;
    color: white;
    border: none;
    cursor: pointer;
}

.btn-warning:hover, button.btn-warning:hover {
    background: #d97706;
}

.danger-zone {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.danger-zone h3 {
    color: #991b1b;
    margin-bottom: 1rem;
}

/* Photo gallery */
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.photo-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.photo-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.photo-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.photo-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #667eea;
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.photo-delete-form {
    position: absolute;
    top: 10px;
    right: 10px;
}

.btn-delete-photo {
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-delete-photo:hover {
    background: #dc2626;
    transform: scale(1.1);
}

/* Confirm delete */
.confirm-delete {
    max-width: 600px;
    margin: 0 auto;
}

.warning-box {
    background: #fef3c7;
    border: 2px solid #fbbf24;
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    margin-bottom: 2rem;
}

.warning-box h2 {
    color: #92400e;
    margin-bottom: 1rem;
}

.warning-box p {
    color: #78350f;
    margin: 0.5rem 0;
}

.small-text {
    font-size: 0.875rem;
    font-style: italic;
}

.detail-summary {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.detail-summary h3 {
    margin-bottom: 1rem;
    color: #111827;
}

.detail-summary ul {
    list-style: none;
    padding: 0;
}

.detail-summary li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.detail-summary li:last-child {
    border-bottom: none;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}

@media (max-width: 992px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 1rem;
    border-left: 4px solid #667eea;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.stat-card.stat-primary {
    border-left-color: #10b981;
}

.stat-card.stat-danger {
    border-left-color: #ef4444;
}

.stat-card.stat-success {
    border-left-color: #10b981;
}

.stat-card.stat-warning {
    border-left-color: #f59e0b;
}

.stat-card.stat-info {
    border-left-color: #3b82f6;
}

.stat-card.stat-secondary {
    border-left-color: #6b7280;
}

.stat-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
    line-height: 1;
    width: 2.5rem;
    text-align: center;
}

.stat-content {
    flex: 1 1 calc(100% - 4rem);
    min-width: 120px;
}

.stat-content h3 {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
    margin-top: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.4;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    width: 100%;
}

.stat-value small {
    display: block;
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 400;
    margin-top: 0.5rem;
    line-height: 1.4;
}

@media (max-width: 576px) {
    .stat-card {
        padding: 1.25rem;
    }
    
    .stat-icon {
        font-size: 2rem;
        width: 2rem;
    }
    
    .stat-content {
        flex: 1 1 100%;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.chart-card.full-width {
    grid-column: 1 / -1;
}

.chart-card h2 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: #111827;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e5e7eb;
}

.chart-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chart-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
}

.chart-label {
    min-width: 150px;
    font-weight: 500;
}

.chart-value {
    min-width: 60px;
    text-align: right;
    font-weight: 600;
    color: #111827;
}

.chart-bar {
    height: 30px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 5px;
    transition: width 0.3s ease;
}

.export-section {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    text-align: center;
}

.export-section h2 {
    margin-bottom: 1rem;
    color: #111827;
}

/* Settings */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.settings-card {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.settings-card h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: #111827;
}

.settings-card p {
    color: #6b7280;
    margin-bottom: 1rem;
}

.info-block {
    background: #f9fafb;
    padding: 1rem;
    border-radius: 5px;
    margin: 1rem 0;
}

.info-block p {
    margin: 0.5rem 0;
}

.info-block ul {
    margin: 0;
    padding-left: 1.5rem;
}

.info-block li {
    margin: 0.5rem 0;
    color: #374151;
}

/* Vehicle thumbnails */
.vehicle-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
}

.vehicle-thumb-placeholder {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    font-size: 24px;
}

/* Responsive */
@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .filters-form {
        flex-direction: column;
    }
    
    .search-input,
    .filter-select {
        width: 100%;
    }
    
    /* Улучшенный скролл таблиц на мобильных */
    .table-container {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
    }
    
    .data-table {
        font-size: 0.875rem;
        min-width: 680px;
    }
    
    .data-table th {
        white-space: nowrap;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .detail-row {
        flex-direction: column;
    }
    
    .detail-row .label {
        width: 100%;
        margin-bottom: 0.25rem;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
}
.stat-subtitle { font-size: 0.875rem; color: #6b7280; margin-top: 4px; }

/* Submenu styles */
.has-submenu > a {
    position: relative;
}

.submenu-arrow {
    margin-left: auto;
    transition: transform var(--transition-speed) ease;
    display: flex;
    align-items: center;
}

.submenu-arrow svg {
    color: rgba(255,255,255,0.3);
}

.sidebar.collapsed .submenu-arrow {
    display: none;
}

.submenu {
    list-style: none;
    padding-left: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-speed) ease;
}

.submenu.show {
    max-height: 200px;
}

.submenu li {
    margin: 0;
}

.submenu a {
    padding: 0.5rem 1rem 0.5rem 2.75rem !important;
    font-size: 0.8125rem;
    border-left: none !important;
    border-radius: 6px !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
}

.submenu-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.submenu-icon svg {
    color: rgba(255,255,255,0.35);
    transition: color 0.2s ease;
}

.submenu a:hover .submenu-icon svg {
    color: rgba(255,255,255,0.8);
}

.submenu a.active .submenu-icon svg {
    color: var(--sidebar-active-border);
}

.submenu a:hover {
    background: var(--sidebar-hover);
}

.submenu a.active {
    background: var(--sidebar-active);
    border-left-color: transparent !important;
    color: #fff;
}

.sidebar.collapsed .submenu {
    display: none;
}

/* Checkbox Group for License Categories */
.checkbox-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 10px;
}

/* Specific styling for Django MultipleChoiceField checkboxes */
.checkbox-group ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.checkbox-group ul li {
    margin: 0;
    position: relative;
}

/* Hide the default checkbox */
.checkbox-group ul li input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 0;
    height: 0;
}

/* Create custom checkbox button */
.checkbox-group ul li label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    padding: 12px 20px;
    border: 2px solid #d1d5db;
    border-radius: 10px;
    background: #ffffff;
    transition: all 0.25s ease;
    font-weight: 600;
    font-size: 15px;
    min-width: 70px;
    position: relative;
    user-select: none;
    color: #6b7280;
}

/* Hover state for unchecked */
.checkbox-group ul li label:hover {
    border-color: #667eea;
    background: #f3f4f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.15);
}

/* Checked state - blue button with white checkmark */
.checkbox-group ul li input[type="checkbox"]:checked ~ label {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
}

/* Add checkmark icon before text when checked */
.checkbox-group ul li input[type="checkbox"]:checked ~ label::before {
    content: "✓";
    font-size: 16px;
    font-weight: bold;
    margin-right: 4px;
    animation: checkmarkPop 0.3s ease;
}

/* Checkmark animation */
@keyframes checkmarkPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Active/clicking state */
.checkbox-group ul li label:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

/* Focus state for accessibility */
.checkbox-group ul li input[type="checkbox"]:focus ~ label {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* ============================================
   PHOTO UPLOAD WITH DRAG & DROP PREVIEW
   ============================================ */

/* Drop Zone Styles */
.drop-zone {
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f9fafb;
    margin-bottom: 20px;
}

.drop-zone:hover {
    border-color: #667eea;
    background: #f3f4f6;
}

.drop-zone-active {
    border-color: #667eea;
    background: #eef2ff;
    transform: scale(1.02);
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.drop-zone-content svg {
    color: #667eea;
    margin-bottom: 8px;
}

.drop-zone-text {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin: 0;
}

.drop-zone-hint {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
}

.file-input-hidden {
    display: none !important;
}

/* File Counter Badge */
.file-counter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #eef2ff;
    border: 1px solid #667eea;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 16px;
}

.counter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    background: #667eea;
    color: white;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
}

/* Preview Container */
.photo-preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.preview-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    border: 2px solid #e5e7eb;
    transition: all 0.3s ease;
}

.preview-item:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.preview-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 60px;
    background: rgba(0, 0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.preview-item:hover .preview-overlay {
    background: rgba(0, 0, 0, 0.5);
    opacity: 1;
}

.preview-remove-btn {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.preview-remove-btn:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.preview-remove-btn:active {
    transform: scale(0.95);
}

.preview-info {
    padding: 12px;
    background: #f9fafb;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.preview-name {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-size {
    font-size: 11px;
    color: #6b7280;
}

/* Current Photo Section */
.current-photo-section {
    margin-top: 24px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}

.current-photo-label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 12px 0;
}

.current-photo-img {
    max-width: 200px;
    height: auto;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .photo-preview-container {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }
    
    .preview-item img {
        height: 140px;
    }
    
    .drop-zone {
        padding: 30px 20px;
    }
}

@media (max-width: 480px) {
    .photo-preview-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Дополнительные доходы на дашборде */
.additional-income-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    margin: 30px 0;
    color: #333333;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.additional-income-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e5e7eb;
}

.additional-income-section .section-header h2 {
    color: #1f2937;
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.total-additional-income {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f3f4f6;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.total-additional-income .label {
    color: #6b7280;
}

.income-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.income-category-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.income-category-card:hover {
    background: #f3f4f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.income-category-card .category-name {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.income-category-card .category-amount {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
}

.additional-income-section .section-footer {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.additional-income-section .section-footer small {
    color: #6b7280;
    font-size: 13px;
}

@media (max-width: 768px) {
    .additional-income-section .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .income-categories {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   ADDITIONAL INCOME STATS
   ============================================ */
.stat-additional-income {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.chart-bar-income {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

/* Badge variants for additional income */
.badge-info {
    background: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

/* ============================================
   ANALYTICS DASHBOARD - CHART.JS STYLES
   ============================================ */

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    margin-top: 30px;
}

.chart-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.chart-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.chart-card-full {
    grid-column: 1 / -1;
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.chart-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f3f4f6;
}

.chart-icon {
    font-size: 24px;
}

.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
}

.chart-container-small {
    position: relative;
    height: 300px;
    width: 100%;
}

.empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #9ca3af;
    font-size: 16px;
    font-style: italic;
}

/* Responsive для графиков */
@media (max-width: 1200px) {
    .analytics-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-card-full {
        grid-column: 1;
    }
}

@media (max-width: 768px) {
    .chart-container {
        height: 300px;
    }
    
    .chart-container-small {
        height: 250px;
    }
    
    .chart-title {
        font-size: 16px;
    }
}

/* ==========================================
   СТРАНИЦА СТАТИСТИКИ - ПОЛНЫЕ СТИЛИ
   ========================================== */

/* Контейнер страницы */
.stats-page {
    padding: 0;
}

.stats-page .page-header {
    margin-bottom: 24px;
}

.stats-page .page-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Фильтры */
.stats-filters {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
}

.stats-filters form {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.stats-filters label {
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.stats-filters input[type="date"] {
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    color: #374151;
    background: #f9fafb;
    transition: all 0.2s;
    font-family: inherit;
}

.stats-filters input[type="date"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
    background: #ffffff;
}

/* Финансовые метрики */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

@media (max-width: 1400px) {
    .metrics-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }
}

.metric-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.metric-card.revenue::before { background: linear-gradient(90deg, #10b981, #059669); }
.metric-card.expenses::before { background: linear-gradient(90deg, #ef4444, #dc2626); }
.metric-card.profit::before { background: linear-gradient(90deg, #3b82f6, #2563eb); }
.metric-card.deposits::before { background: linear-gradient(90deg, #8b5cf6, #7c3aed); }
.metric-card.additional::before { background: linear-gradient(90deg, #f59e0b, #d97706); }

.metric-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
}

.metric-card.revenue .metric-icon { background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%); }
.metric-card.expenses .metric-icon { background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%); }
.metric-card.profit .metric-icon { background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%); }
.metric-card.deposits .metric-icon { background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%); }
.metric-card.additional .metric-icon { background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%); }

.metric-content {
    flex: 1;
    min-width: 0;
}

.metric-label {
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.2;
    margin-bottom: 4px;
}

.metric-card.profit .metric-value.positive { color: #059669; }
.metric-card.profit .metric-value.negative { color: #dc2626; }

.metric-currency {
    font-size: 13px;
    color: #9ca3af;
    font-weight: 500;
}

/* Операционные метрики */
.metrics-grid-secondary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

@media (max-width: 1200px) {
    .metrics-grid-secondary {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .metrics-grid-secondary {
        grid-template-columns: 1fr;
    }
}

.metric-card-sm {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.2s;
}

.metric-card-sm:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.metric-card-sm .metric-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    font-size: 22px;
}

.metric-card-sm.vehicles .metric-icon { background: linear-gradient(135deg, #cffafe 0%, #a5f3fc 100%); }
.metric-card-sm.clients .metric-icon { background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%); }
.metric-card-sm.leads .metric-icon { background: linear-gradient(135deg, #ccfbf1 0%, #99f6e4 100%); }
.metric-card-sm.bookings .metric-icon { background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%); }

.metric-card-sm .metric-value {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1;
}

.metric-card-sm .metric-label {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
    text-transform: none;
    letter-spacing: normal;
}

.metric-card-sm .metric-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Секция графиков */
.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
}

.section-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.section-header .section-icon {
    font-size: 24px;
}

/* Сетка графиков */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

@media (max-width: 1200px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

.chart-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
}

.chart-card.full-width {
    grid-column: 1 / -1;
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f3f4f6;
}

.chart-header .chart-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.chart-header .chart-title .chart-icon {
    font-size: 20px;
}

.chart-container {
    position: relative;
    height: 320px;
}

.chart-container-lg {
    position: relative;
    height: 380px;
}

/* Таблица данных */
.data-table-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.data-table-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.data-table-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.data-table-wrapper {
    overflow-x: auto;
}

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

.stats-page .data-table th {
    padding: 14px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

.stats-page .data-table td {
    padding: 16px 20px;
    color: #374151;
    font-size: 14px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.stats-page .data-table tbody tr {
    transition: background 0.2s;
}

.stats-page .data-table tbody tr:hover {
    background: #f9fafb;
}

.stats-page .data-table tbody tr:last-child td {
    border-bottom: none;
}

.stats-page .data-table a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.stats-page .data-table a:hover {
    color: #4f46e5;
    text-decoration: underline;
}

.stats-page .data-table .amount {
    font-weight: 700;
    color: #059669;
}

/* Бейджи для статистики */
.stats-page .badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.stats-page .badge-info {
    background: #dbeafe;
    color: #1d4ed8;
}

.stats-page .badge-secondary {
    background: #f3f4f6;
    color: #6b7280;
}

/* Пустое состояние */
.stats-page .empty-state {
    text-align: center;
    padding: 48px 24px;
    color: #9ca3af;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: auto;
}

.stats-page .empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.stats-page .empty-state-text {
    font-size: 15px;
    margin: 0;
    font-style: normal;
}

/* Анимации */
@keyframes statsFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.stats-page .metric-card,
.stats-page .metric-card-sm,
.stats-page .chart-card,
.stats-page .data-table-card {
    animation: statsFadeIn 0.4s ease-out backwards;
}

.stats-page .metric-card:nth-child(1) { animation-delay: 0.05s; }
.stats-page .metric-card:nth-child(2) { animation-delay: 0.1s; }
.stats-page .metric-card:nth-child(3) { animation-delay: 0.15s; }
.stats-page .metric-card:nth-child(4) { animation-delay: 0.2s; }
.stats-page .metric-card:nth-child(5) { animation-delay: 0.25s; }

.stats-page .metric-card-sm:nth-child(1) { animation-delay: 0.3s; }
.stats-page .metric-card-sm:nth-child(2) { animation-delay: 0.35s; }
.stats-page .metric-card-sm:nth-child(3) { animation-delay: 0.4s; }
.stats-page .metric-card-sm:nth-child(4) { animation-delay: 0.45s; }
