/* ============================================================================
   HANS AGENCY LIVE CRM - FREED CORP INSPIRED DESIGN
   ============================================================================ */

/* БАЗОВЫЕ СТИЛИ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--navy-50, #f8fafc);
    color: var(--navy-900, #0f172a);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ФОН С ЛИНИЯМИ (КАК У FREED CORP) */
.background-lines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.line {
    position: absolute;
    background: linear-gradient(180deg, transparent, var(--blue-100, #dbeafe), transparent);
    opacity: 0.3;
}

.line-1 {
    width: 2px;
    height: 100%;
    left: 20%;
    animation: lineMove 20s ease-in-out infinite;
}

.line-2 {
    width: 2px;
    height: 100%;
    left: 50%;
    animation: lineMove 25s ease-in-out infinite reverse;
}

.line-3 {
    width: 2px;
    height: 100%;
    left: 80%;
    animation: lineMove 30s ease-in-out infinite;
}

@keyframes lineMove {
    0%, 100% { transform: translateY(-10%); }
    50% { transform: translateY(10%); }
}

.floating-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.1;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: var(--blue-400, #60a5fa);
    top: 10%;
    left: 10%;
    animation: float 20s ease-in-out infinite;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: var(--blue-600, #2563eb);
    top: 50%;
    right: 10%;
    animation: float 25s ease-in-out infinite reverse;
}

.shape-3 {
    width: 350px;
    height: 350px;
    background: var(--blue-500, #3b82f6);
    bottom: 10%;
    left: 50%;
    animation: float 30s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(30px, -30px); }
    66% { transform: translate(-30px, 30px); }
}

/* ОСНОВНОЙ КОНТЕЙНЕР */
.admin-container {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* САЙДБАР */
.sidebar {
    width: 280px;
    background: white;
    border-right: 1px solid var(--navy-200, #e2e8f0);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 100;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.05);
}

.sidebar-logo {
    padding: 24px 20px;
    border-bottom: 1px solid var(--navy-200, #e2e8f0);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sidebar-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--navy-900, #0f172a);
    letter-spacing: -0.5px;
}

.sidebar-subtitle {
    font-size: 11px;
    color: var(--navy-500, #64748b);
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* НАВИГАЦИЯ */
.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 4px;
    border-radius: 8px;
    color: var(--navy-600, #475569);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.nav-item:hover {
    background: var(--navy-50, #f8fafc);
    color: var(--navy-900, #0f172a);
}

.nav-item.active {
    background: var(--blue-50, #eff6ff);
    color: var(--blue-600, #2563eb);
    font-weight: 600;
}

.nav-badge {
    margin-left: auto;
    background: var(--blue-600, #2563eb);
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
}

/* ПОЛЬЗОВАТЕЛЬ В САЙДБАРЕ */
.sidebar-user {
    padding: 16px;
    border-top: 1px solid var(--navy-200, #e2e8f0);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue-500, #3b82f6), var(--blue-700, #1d4ed8));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
}

.user-details h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--navy-900, #0f172a);
    margin-bottom: 2px;
}

.user-details p {
    font-size: 12px;
    color: var(--navy-500, #64748b);
}

.logout-btn {
    width: 100%;
    padding: 10px;
    background: var(--navy-50, #f8fafc);
    border: 1px solid var(--navy-200, #e2e8f0);
    border-radius: 8px;
    color: var(--navy-700, #334155);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.logout-btn:hover {
    background: var(--danger-50, #fef2f2);
    border-color: var(--danger-200, #fecaca);
    color: var(--danger-600, #dc2626);
}

/* ОСНОВНОЙ КОНТЕНТ */
.main-content {
    flex: 1;
    margin-left: 280px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ШАПКА */
.header {
    background: white;
    border-bottom: 1px solid var(--navy-200, #e2e8f0);
    padding: 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--navy-900, #0f172a);
    margin-bottom: 4px;
}

.page-subtitle {
    font-size: 14px;
    color: var(--navy-500, #64748b);
}

.header-time {
    font-size: 14px;
    color: var(--navy-600, #475569);
    font-weight: 500;
}

/* КОНТЕНТ */
.content-wrapper {
    flex: 1;
    padding: 32px;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* СТАТИСТИКА */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid var(--navy-200, #e2e8f0);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.2s;
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-label {
    font-size: 13px;
    color: var(--navy-500, #64748b);
    font-weight: 500;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--navy-900, #0f172a);
}

/* ДАШБОРД СЕТКА */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 24px;
}

.dashboard-card {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--navy-200, #e2e8f0);
    overflow: hidden;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--navy-200, #e2e8f0);
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--navy-900, #0f172a);
}

.card-body {
    padding: 24px;
}

/* СЕКЦИЯ ЗАГОЛОВОК */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--navy-900, #0f172a);
    margin-bottom: 4px;
}

.section-header p {
    font-size: 14px;
    color: var(--navy-500, #64748b);
}

/* ФИЛЬТРЫ */
.filters-card {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--navy-200, #e2e8f0);
    padding: 20px;
    margin-bottom: 20px;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.filter-input, .filter-select {
    padding: 10px 14px;
    border: 1px solid var(--navy-200, #e2e8f0);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s;
}

.filter-input:focus, .filter-select:focus {
    outline: none;
    border-color: var(--blue-500, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ТАБЛИЦА */
.table-card {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--navy-200, #e2e8f0);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--navy-50, #f8fafc);
}

.data-table th {
    padding: 14px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--navy-600, #475569);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--navy-200, #e2e8f0);
}

.data-table td {
    padding: 14px 16px;
    font-size: 14px;
    color: var(--navy-700, #334155);
    border-bottom: 1px solid var(--navy-100, #f1f5f9);
}

.data-table tbody tr:hover {
    background: var(--navy-50, #f8fafc);
}

.loading-cell {
    text-align: center;
    padding: 40px !important;
    color: var(--navy-400, #94a3b8);
}

/* КНОПКИ */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}

.btn-primary {
    background: var(--blue-600, #2563eb);
    color: white;
}

.btn-primary:hover {
    background: var(--blue-700, #1d4ed8);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
    background: var(--navy-100, #f1f5f9);
    color: var(--navy-700, #334155);
}

.btn-secondary:hover {
    background: var(--navy-200, #e2e8f0);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* СОФТЫ */
.softs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.soft-card {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--navy-200, #e2e8f0);
    padding: 24px;
    transition: all 0.2s;
    position: relative;
}

.soft-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
}

.soft-card-coming {
    opacity: 0.6;
}

.soft-icon {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--blue-500, #3b82f6), var(--blue-700, #1d4ed8));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin-bottom: 16px;
}

.soft-card h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--navy-900, #0f172a);
    margin-bottom: 8px;
}

.soft-card p {
    font-size: 14px;
    color: var(--navy-500, #64748b);
    margin-bottom: 16px;
}

.soft-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.soft-stat {
    flex: 1;
    padding: 12px;
    background: var(--navy-50, #f8fafc);
    border-radius: 8px;
    text-align: center;
}

.soft-stat-label {
    display: block;
    font-size: 12px;
    color: var(--navy-500, #64748b);
    margin-bottom: 4px;
}

.soft-stat-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--navy-900, #0f172a);
}

.coming-soon-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--warning-100, #fef3c7);
    color: var(--warning-700, #b45309);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

/* ПРОФИЛЬ */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
}

.profile-card {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--navy-200, #e2e8f0);
    padding: 24px;
}

.profile-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--navy-900, #0f172a);
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--navy-200, #e2e8f0);
}

.profile-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue-500, #3b82f6), var(--blue-700, #1d4ed8));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 32px;
    margin: 0 auto 24px;
}

.profile-field {
    margin-bottom: 20px;
}

.profile-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--navy-500, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.profile-value {
    font-size: 14px;
    color: var(--navy-900, #0f172a);
    font-weight: 500;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: var(--success-100, #d1fae5);
    color: var(--success-700, #047857);
}

/* МОБИЛЬНОЕ МЕНЮ */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 101;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: white;
    border: 1px solid var(--navy-200, #e2e8f0);
    color: var(--navy-700, #334155);
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

/* АДАПТИВНОСТЬ */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .sidebar-overlay.active {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .header {
        padding: 16px 20px;
    }

    .content-wrapper {
        padding: 20px;
    }

    .page-title {
        font-size: 20px;
    }

    .softs-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }

    .profile-grid {
        grid-template-columns: 1fr;
    }
}


/* SENDER СТАТИСТИКА */
.sender-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.sender-stat-item {
    text-align: center;
    padding: 16px;
    background: var(--navy-50, #f8fafc);
    border-radius: 8px;
}

.sender-stat-label {
    display: block;
    font-size: 13px;
    color: var(--navy-500, #64748b);
    font-weight: 500;
    margin-bottom: 8px;
}

.sender-stat-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: var(--navy-900, #0f172a);
}

@media (max-width: 640px) {
    .sender-stats-grid {
        grid-template-columns: 1fr;
    }
}


/* ДОПОЛНИТЕЛЬНЫЕ ЭЛЕМЕНТЫ СТАТИСТИКИ */
.stat-change {
    font-size: 12px;
    color: var(--navy-500, #64748b);
    margin-top: 4px;
    font-weight: 500;
}

.stat-change.positive {
    color: var(--success-600, #059669);
}

.stat-change.negative {
    color: var(--danger-600, #dc2626);
}

/* ВЫБОР ПЕРИОДА */
.period-selector {
    display: flex;
    gap: 8px;
    background: var(--navy-50, #f8fafc);
    padding: 4px;
    border-radius: 8px;
}

.period-btn {
    padding: 6px 16px;
    border: none;
    background: transparent;
    color: var(--navy-600, #475569);
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.period-btn:hover {
    background: white;
    color: var(--navy-900, #0f172a);
}

.period-btn.active {
    background: var(--blue-600, #2563eb);
    color: white;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

/* ТОП СПИСОК */
.top-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.top-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--navy-50, #f8fafc);
    border-radius: 8px;
    transition: all 0.2s;
}

.top-item:hover {
    background: var(--navy-100, #f1f5f9);
    transform: translateX(4px);
}

.top-rank {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--blue-100, #dbeafe);
    color: var(--blue-700, #1d4ed8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.top-rank.gold {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #b8860b;
}

.top-rank.silver {
    background: linear-gradient(135deg, #c0c0c0, #e8e8e8);
    color: #696969;
}

.top-rank.bronze {
    background: linear-gradient(135deg, #cd7f32, #e9a76f);
    color: #8b4513;
}

.top-info {
    flex: 1;
}

.top-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--navy-900, #0f172a);
    margin-bottom: 2px;
}

.top-stats {
    font-size: 12px;
    color: var(--navy-500, #64748b);
}

.top-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--success-600, #059669);
    flex-shrink: 0;
}

.loading-text {
    text-align: center;
    padding: 40px 20px;
    color: var(--navy-400, #94a3b8);
    font-size: 14px;
}

@media (max-width: 768px) {
    .period-selector {
        flex-wrap: wrap;
    }

    .period-btn {
        flex: 1;
        min-width: calc(50% - 4px);
    }
}

/* ============================================================================
   APPLICATION MODAL
   ============================================================================ */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--navy-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: var(--navy-900);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--navy-500);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--navy-100);
    color: var(--navy-900);
}

.modal-body {
    padding: 24px;
}

.app-modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.app-modal-section h3 {
    font-size: 16px;
    color: var(--navy-900);
    margin: 0 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary);
}

.app-modal-field {
    margin-bottom: 16px;
}

.app-modal-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--navy-600);
    margin-bottom: 6px;
}

.app-modal-value {
    font-size: 14px;
    color: var(--navy-900);
    padding: 8px 12px;
    background: var(--navy-50);
    border-radius: 8px;
}

.app-modal-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 16px;
    border-top: 1px solid var(--navy-200);
}

.app-modal-actions .btn {
    flex: 1;
    min-width: 140px;
}

@media (max-width: 768px) {
    .app-modal-grid {
        grid-template-columns: 1fr;
    }
    
    .app-modal-actions {
        flex-direction: column;
    }
    
    .app-modal-actions .btn {
        width: 100%;
    }
}

/* Action buttons in table */
.action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.action-btn-view {
    background: var(--primary-50);
    color: var(--primary);
}

.action-btn-view:hover {
    background: var(--primary);
    color: white;
}

.action-btn-edit {
    background: var(--warning-50);
    color: var(--warning);
}

.action-btn-edit:hover {
    background: var(--warning);
    color: white;
}

.action-btn-success {
    background: var(--success-50);
    color: var(--success);
}

.action-btn-success:hover {
    background: var(--success);
    color: white;
}

.action-btn-danger {
    background: var(--danger-50);
    color: var(--danger);
}

.action-btn-danger:hover {
    background: var(--danger);
    color: white;
}

/* ============================================================================
   APPLICATIONS MANAGER - SENIOR+++ LEVEL STYLES
   ============================================================================ */

/* Панель массовых действий */
.bulk-actions-bar {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--blue-600, #2563eb), var(--blue-700, #1d4ed8));
    color: white;
    padding: 16px 32px;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(37, 99, 235, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 24px;
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.bulk-actions-bar.active {
    bottom: 32px;
    animation: slideUpBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUpBounce {
    0% { bottom: -100px; }
    60% { bottom: 40px; }
    100% { bottom: 32px; }
}

.bulk-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 15px;
}

.bulk-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 16px;
}

.bulk-buttons {
    display: flex;
    gap: 12px;
}

.bulk-buttons .btn {
    padding: 8px 16px;
    font-size: 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.2s;
}

.bulk-buttons .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* Пагинация */
.pagination-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    background: white;
    border-radius: 16px;
    margin-top: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    flex-wrap: wrap;
    gap: 16px;
}

.pagination-info {
    color: var(--navy-600, #475569);
    font-size: 14px;
    font-weight: 500;
}

.pagination-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.pagination-btn {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--navy-200, #e2e8f0);
    background: white;
    color: var(--navy-700, #334155);
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--blue-50, #eff6ff);
    border-color: var(--blue-300, #93c5fd);
    color: var(--blue-600, #2563eb);
    transform: translateY(-1px);
}

.pagination-btn.active {
    background: linear-gradient(135deg, var(--blue-600, #2563eb), var(--blue-700, #1d4ed8));
    color: white;
    border-color: var(--blue-600, #2563eb);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-ellipsis {
    padding: 0 8px;
    color: var(--navy-400, #94a3b8);
}

.pagination-limit {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--navy-600, #475569);
}

.pagination-limit select {
    padding: 8px 32px 8px 12px;
    border: 1px solid var(--navy-200, #e2e8f0);
    border-radius: 10px;
    background: white;
    color: var(--navy-700, #334155);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    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='%23334155' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.pagination-limit select:hover {
    border-color: var(--blue-300, #93c5fd);
}

/* Сортируемые заголовки */
.sortable-header {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: all 0.2s;
}

.sortable-header:hover {
    background: var(--blue-50, #eff6ff);
    color: var(--blue-600, #2563eb);
}

.sortable-header i {
    margin-left: 6px;
    opacity: 0.3;
    transition: all 0.2s;
}

.sortable-header:hover i {
    opacity: 0.6;
}

.sortable-header.sort-asc i::before {
    content: "\f0de";
    opacity: 1;
    color: var(--blue-600, #2563eb);
}

.sortable-header.sort-desc i::before {
    content: "\f0dd";
    opacity: 1;
    color: var(--blue-600, #2563eb);
}

/* Чекбоксы для выбора */
.app-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--blue-600, #2563eb);
}

#selectAllApplications {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--blue-600, #2563eb);
}

/* Выбранная строка */
.app-row.selected {
    background: var(--blue-50, #eff6ff) !important;
    border-left: 3px solid var(--blue-600, #2563eb);
}

/* Таблица заявок */
.applications-table {
    width: 100%;
    table-layout: fixed;
}

.applications-table th,
.applications-table td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Имя и телефон в одной ячейке */
.app-name {
    font-weight: 600;
    color: var(--navy-900, #0f172a);
    margin-bottom: 2px;
}

.app-phone-small {
    font-size: 12px;
    color: var(--navy-500, #64748b);
}

/* ID заявки */
.app-id {
    font-weight: 600;
    color: var(--blue-600, #2563eb);
}

/* Дата */
.app-date {
    font-size: 13px;
    color: var(--navy-600, #475569);
}

/* Бейдж типа заявки */
.app-type-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    background: var(--navy-100, #f1f5f9);
    color: var(--navy-700, #334155);
}

/* Кнопки действий */
.action-buttons {
    display: flex;
    gap: 6px;
    justify-content: flex-start;
}

.action-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 14px;
}

.action-btn-view {
    background: var(--blue-100, #dbeafe);
    color: var(--blue-600, #2563eb);
}

.action-btn-view:hover {
    background: var(--blue-600, #2563eb);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.action-btn-edit {
    background: var(--amber-100, #fef3c7);
    color: var(--amber-600, #d97706);
}

.action-btn-edit:hover {
    background: var(--amber-600, #d97706);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
}

.action-btn-success {
    background: var(--green-100, #dcfce7);
    color: var(--green-600, #16a34a);
}

.action-btn-success:hover {
    background: var(--green-600, #16a34a);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

.action-btn-danger {
    background: var(--red-100, #fee2e2);
    color: var(--red-600, #dc2626);
}

.action-btn-danger:hover {
    background: var(--red-600, #dc2626);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--navy-700, #334155);
    margin-bottom: 8px;
}

.empty-state-hint {
    font-size: 14px;
    color: var(--navy-500, #64748b);
}

/* Loading state */
.loading-cell {
    text-align: center;
    padding: 60px 20px;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--navy-200, #e2e8f0);
    border-top-color: var(--blue-600, #2563eb);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error state */
.error-cell {
    text-align: center;
    padding: 60px 20px;
}

.error-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.error-text {
    font-size: 16px;
    color: var(--red-600, #dc2626);
    margin-bottom: 24px;
    font-weight: 500;
}

/* Адаптивность */
@media (max-width: 768px) {
    .bulk-actions-bar {
        flex-direction: column;
        gap: 16px;
        padding: 16px;
        width: calc(100% - 32px);
        max-width: 500px;
    }
    
    .bulk-buttons {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .pagination-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .pagination-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .pagination-limit {
        justify-content: center;
    }
    
    .applications-table {
        font-size: 13px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
}

/* Анимация появления строк */
@keyframes fadeInRow {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.app-row {
    animation: fadeInRow 0.3s ease-out;
}

/* Hover эффект для строк */
.app-row:hover {
    background: var(--navy-50, #f8fafc);
    transform: scale(1.001);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* ============================================================================
   MODAL WINDOW STYLES
   ============================================================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 90%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 24px 32px;
    border-bottom: 1px solid var(--navy-200, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, var(--blue-50, #eff6ff), white);
}

.modal-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--navy-900, #0f172a);
}

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--navy-100, #f1f5f9);
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: var(--navy-600, #475569);
}

.modal-close:hover {
    background: var(--red-100, #fee2e2);
    color: var(--red-600, #dc2626);
    transform: rotate(90deg);
}

.modal-body {
    padding: 32px;
    overflow-y: auto;
    flex: 1;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.detail-item label {
    font-size: 13px;
    font-weight: 600;
    color: var(--navy-600, #475569);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-item span {
    font-size: 15px;
    color: var(--navy-900, #0f172a);
    font-weight: 500;
    padding: 10px 14px;
    background: var(--navy-50, #f8fafc);
    border-radius: 10px;
    border: 1px solid var(--navy-200, #e2e8f0);
}

.modal-footer {
    padding: 20px 32px;
    border-top: 1px solid var(--navy-200, #e2e8f0);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    background: var(--navy-50, #f8fafc);
}

.modal-footer .btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
}

@media (max-width: 768px) {
    .modal-content {
        max-width: 95%;
        max-height: 95vh;
    }
    
    .modal-header {
        padding: 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-footer {
        padding: 16px 20px;
        flex-wrap: wrap;
    }
    
    .modal-footer .btn {
        flex: 1;
        min-width: 120px;
    }
}


/* ============================================================================
   TOGGLE SWITCH
   ============================================================================ */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #10b981;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.toggle-switch input:disabled + .toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Hover effect */
.toggle-slider:hover {
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.toggle-switch input:checked + .toggle-slider:hover {
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}


/* ============================================================================
   GROUP MODE BUTTONS
   ============================================================================ */
.group-mode-btn {
    transition: all 0.2s ease;
}

.group-mode-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.group-mode-btn:active {
    transform: translateY(0);
}

/* ============================================================================
   MOBILE MENU BUTTON
   ============================================================================ */

.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #6366f1, #4338ca);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.5);
}

.mobile-menu-toggle:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}


/* ============================================================================
   ROLE BADGES - Бейджи ролей
   ============================================================================ */

.role-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.role-admin {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.role-manager {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
}

.role-recruiter {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.role-support {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.role-viewer {
    background: linear-gradient(135deg, #64748b, #475569);
    color: white;
}


/* ============================================================================
   TOGGLE SWITCH - Переключатели
   ============================================================================ */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: 0.3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.toggle-switch input:disabled + .toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}
