/* ==========================================================================
   COVENANT GROUP — ПАРТНЁРСКИЙ ПОРТАЛ И ЛИЧНЫЙ КАБИНЕТ
   Фирменный стиль: ИТХ УрО РАН / Индустриальный дилер
   Цвета: #0B2545, #13315C, #C9A227, #B91C1C, #F5F7FA, #FFFFFF
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
    --navy-950: #050E1C;
    --navy-900: #0B2545;
    --navy-800: #13315C;
    --navy-700: #1D4E89;
    --gold-500: #C9A227;
    --gold-400: #E2BA36;
    --gold-300: #F3D263;
    --red-700: #991B1B;
    --red-600: #B91C1C;
    --red-500: #DC2626;
    --bg-page: #F5F7FA;
    --surface-card: #FFFFFF;
    --surface-subtle: #F8FAFC;
    --text-primary: #1B1F24;
    --text-secondary: #4B5563;
    --text-muted: #6B7280;
    --border-light: #E2E8F0;
    --border-focus: #13315C;
    
    --status-protected: #15803D;
    --status-protected-bg: #ECFDF5;
    --status-protected-border: #A7F3D0;
    
    --status-warning: #B45309;
    --status-warning-bg: #FFFBEB;
    --status-warning-border: #FDE68A;
    
    --status-pending: #1D4ED8;
    --status-pending-bg: #EFF6FF;
    --status-pending-border: #BFDBFE;
    
    --status-expired: #475569;
    --status-expired-bg: #F1F5F9;
    --status-expired-border: #CBD5E1;
    
    --status-danger: #B91C1C;
    --status-danger-bg: #FEF2F2;
    --status-danger-border: #FECACA;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 22px;

    --shadow-sm: 0 1px 3px rgba(11, 37, 69, 0.06);
    --shadow-md: 0 4px 12px rgba(11, 37, 69, 0.08);
    --shadow-lg: 0 10px 25px -5px rgba(11, 37, 69, 0.12), 0 8px 10px -6px rgba(11, 37, 69, 0.04);
    --shadow-gold: 0 4px 18px rgba(201, 162, 39, 0.28);
    --shadow-navy: 0 8px 24px rgba(11, 37, 69, 0.35);

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
    font-family: var(--font-body);
    font-size: 14.5px;
    line-height: 1.55;
    color: var(--text-primary);
    background-color: var(--bg-page);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ==================== ТИПОГРАФИКА ==================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--navy-900);
    letter-spacing: -0.02em;
    font-weight: 700;
}

a {
    color: var(--navy-800);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--gold-500);
}

/* ==================== SVG ИКОНКИ ==================== */
.svg-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
    vertical-align: middle;
}
.svg-icon.sm { width: 14px; height: 14px; }
.svg-icon.md { width: 20px; height: 20px; }
.svg-icon.lg { width: 24px; height: 24px; }
.svg-icon.xl { width: 32px; height: 32px; }

/* ==================== АПП ЛЕЙАУТ ==================== */
.app-container {
    display: flex;
    min-height: 100vh;
    background-color: var(--bg-page);
}

/* БОКОВАЯ ПАНЕЛЬ НАВИГАЦИИ */
.sidebar {
    width: 280px;
    background: linear-gradient(180deg, var(--navy-950) 0%, var(--navy-900) 65%, var(--navy-800) 100%);
    color: #FFFFFF;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 100;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-header {
    padding: 24px 20px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-badge {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo-icon {
    width: 44px;
    height: 44px;
    background: var(--navy-950);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}

.brand-logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.brand-info h2 {
    font-size: 17px;
    font-weight: 800;
    color: #FFFFFF;
    letter-spacing: 0.03em;
    line-height: 1.15;
}

.brand-info span {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--gold-400);
    font-weight: 700;
    display: block;
    margin-top: 3px;
}

.brand-subtext {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.55);
    margin-top: 10px;
    line-height: 1.35;
    padding-left: 2px;
}

/* НАВИГАЦИОННОЕ МЕНЮ */
.nav-menu {
    flex: 1;
    padding: 20px 14px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.nav-section-title {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 700;
    padding: 12px 12px 6px;
    margin-top: 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10.5px 14px;
    border-radius: var(--radius-md);
    color: rgba(255, 255, 255, 0.78);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid transparent;
}

.nav-item:hover {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(3px);
}

.nav-item.active {
    color: #FFFFFF;
    background: linear-gradient(90deg, rgba(201, 162, 39, 0.2) 0%, rgba(201, 162, 39, 0.05) 100%);
    border-color: rgba(201, 162, 39, 0.45);
    font-weight: 600;
}

.nav-item.active .svg-icon {
    color: var(--gold-400);
}

.nav-item .badge {
    margin-left: auto;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    background: var(--red-600);
    color: #FFFFFF;
}

/* ПРОФИЛЬ В САЙДБАРЕ */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.18);
}

.user-snippet {
    display: flex;
    align-items: center;
    gap: 11px;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--navy-700), var(--gold-500));
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.user-meta {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 13.5px;
    font-weight: 600;
    color: #FFFFFF;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role-pill {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(201, 162, 39, 0.25);
    color: var(--gold-300);
    font-weight: 600;
    display: inline-block;
    margin-top: 2px;
}

/* ==================== ГЛАВНЫЙ КОНТЕНТ ==================== */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* ВЕРХНИЙ ХЕДЕР */
.topbar {
    height: 68px;
    background: #FFFFFF;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: 0 2px 10px rgba(11, 37, 69, 0.03);
}

.topbar-search {
    position: relative;
    width: 380px;
}

.topbar-search input {
    width: 100%;
    height: 42px;
    padding: 0 16px 0 42px;
    background: var(--surface-subtle);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 13.5px;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.topbar-search input:focus {
    outline: none;
    border-color: var(--navy-800);
    background: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(19, 49, 92, 0.1);
}

.topbar-search .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.demo-role-switcher {
    display: flex;
    align-items: center;
    background: var(--surface-subtle);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 3px;
    gap: 3px;
}

.demo-role-btn {
    border: none;
    background: transparent;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.demo-role-btn.active {
    background: var(--navy-900);
    color: #FFFFFF;
    box-shadow: var(--shadow-sm);
}

.btn-icon-top {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    background: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--navy-900);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon-top:hover {
    background: var(--surface-subtle);
    border-color: var(--navy-700);
}

.badge-counter {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--red-600);
    color: #FFFFFF;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid #FFFFFF;
}

/* ==================== ОСНОВНОЙ КОНТЕНТ ==================== */
.content-area {
    padding: 32px;
    flex: 1;
}

/* ЗАГОЛОВОК СТРАНИЦЫ */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-title-group h1 {
    font-size: 26px;
    font-weight: 800;
    color: var(--navy-900);
    line-height: 1.2;
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ==================== БАННЕР С ФОНОМ ОБЪЕКТА ==================== */
.hero-industrial-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 30px;
    min-height: 180px;
    display: flex;
    align-items: center;
    padding: 30px 40px;
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, rgba(11, 37, 69, 0.94) 0%, rgba(19, 49, 92, 0.88) 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.hero-industrial-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../img/hero-dam.jpg');
    background-size: cover;
    background-position: center 35%;
    opacity: 0.35;
    mix-blend-mode: luminosity;
    z-index: 1;
    transform: scale(1.02);
    transition: transform 0.8s ease;
}

.hero-industrial-card:hover .hero-industrial-bg {
    transform: scale(1.05);
}

.hero-content {
    position: relative;
    z-index: 2;
    color: #FFFFFF;
    max-width: 960px;
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 12px;
    background: rgba(201, 162, 39, 0.22);
    border: 1px solid rgba(201, 162, 39, 0.45);
    border-radius: 30px;
    color: var(--gold-300);
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
}

.hero-content h2 {
    color: #FFFFFF;
    font-size: clamp(18px, 2.1vw, 24px);
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 8px;
    white-space: nowrap;
}

@media (max-width: 860px) {
    .hero-content h2 {
        white-space: normal;
        font-size: 18px;
    }
}

.hero-content p {
    color: rgba(255, 255, 255, 0.82);
    font-size: 13.5px;
    line-height: 1.5;
    max-width: 760px;
}

/* ==================== КАРТОЧКИ СТАТИСТИКИ (KPI) ==================== */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 30px;
    align-items: stretch;
}

.kpi-card {
    background: #FFFFFF !important;
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 140px;
    min-height: 140px;
    margin: 0 !important;
    transform: none !important;
    opacity: 1 !important;
    filter: none !important;
    box-sizing: border-box;
}

.kpi-card:hover {
    transform: none !important;
    box-shadow: var(--shadow-md);
    border-color: rgba(19, 49, 92, 0.25);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--navy-800);
    transition: width 0.2s ease;
}

.kpi-card:hover::before {
    width: 6px;
}

.kpi-card.protected::before { background: var(--status-protected); }
.kpi-card.pending::before { background: var(--status-pending); }
.kpi-card.expiring::before { background: var(--status-warning); }
.kpi-card.expired::before { background: var(--status-expired); }

.kpi-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    height: 36px;
    min-height: 36px;
    margin-bottom: 10px;
}

.kpi-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.25;
}

.kpi-icon-wrap {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-subtle);
    color: var(--navy-800);
}

.kpi-card.dimmed {
    opacity: 1 !important;
    filter: none !important;
}

.kpi-card.protected .kpi-icon-wrap { background: #E8F5E9; color: #2E7D32; }
.kpi-card.pending .kpi-icon-wrap { background: #FEF3C7; color: #D97706; }
.kpi-card.expiring .kpi-icon-wrap { background: #FFF7ED; color: #EA580C; }
.kpi-card.expired .kpi-icon-wrap { background: #FEE2E2; color: #DC2626; }

.kpi-card.protected .kpi-value { color: #1E3A8A; }
.kpi-card.pending .kpi-value { color: #D97706; }
.kpi-card.expiring .kpi-value { color: #EA580C; }
.kpi-card.expired .kpi-value { color: #DC2626; }

.kpi-value {
    font-family: var(--font-heading);
    font-size: 30px;
    font-weight: 800;
    color: var(--navy-900);
    line-height: 1;
    margin-top: auto;
    margin-bottom: 6px;
}

.kpi-desc {
    font-size: 11.5px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==================== КНОПКИ ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 20px;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-800) 100%);
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(11, 37, 69, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--navy-800) 0%, var(--navy-700) 100%);
    color: #FFFFFF;
    box-shadow: 0 6px 16px rgba(11, 37, 69, 0.3);
}

.btn-gold {
    background: linear-gradient(135deg, var(--gold-500) 0%, var(--gold-400) 100%);
    color: var(--navy-950);
    font-weight: 700;
    box-shadow: var(--shadow-gold);
}

.btn-gold:hover {
    background: linear-gradient(135deg, var(--gold-400) 0%, var(--gold-300) 100%);
    color: var(--navy-950);
}

.btn-outline {
    background: #FFFFFF;
    border-color: var(--border-light);
    color: var(--navy-900);
}

.btn-outline:hover {
    background: var(--surface-subtle);
    border-color: var(--navy-800);
}

.btn-danger {
    background: var(--red-600);
    color: #FFFFFF;
}

.btn-danger:hover {
    background: var(--red-700);
}

.btn-sm {
    height: 36px;
    padding: 0 14px;
    font-size: 13px;
    border-radius: var(--radius-sm);
}

/* ==================== ПАНЕЛЬ ФИЛЬТРОВ ==================== */
.filter-bar {
    background: var(--surface-card);
    border-radius: var(--radius-lg);
    padding: 18px 24px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-input-wrap {
    flex: 1;
    min-width: 220px;
    position: relative;
}

.filter-input-wrap input {
    width: 100%;
    height: 42px;
    padding: 0 14px 0 40px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    background: var(--surface-subtle);
    font-size: 13.5px;
    color: var(--text-primary);
}

.filter-input-wrap input:focus {
    outline: none;
    border-color: var(--navy-800);
    background: #FFFFFF;
}

.filter-input-wrap .svg-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.filter-select {
    height: 42px;
    padding: 0 36px 0 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    background: var(--surface-subtle);
    font-size: 13.5px;
    color: var(--text-primary);
    cursor: pointer;
    min-width: 170px;
}

.filter-select:focus {
    outline: none;
    border-color: var(--navy-800);
    background: #FFFFFF;
}

/* ==================== ТАБЛИЦА ==================== */
.table-card {
    background: var(--surface-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 30px;
}

.table-responsive {
    overflow-x: auto;
    width: 100%;
}

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

.data-table th {
    background: var(--surface-subtle);
    padding: 14px 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-light);
    white-space: nowrap;
}

.data-table td {
    padding: 16px 20px;
    font-size: 14px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background-color 0.15s ease;
    cursor: pointer;
}

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

.inn-badge {
    font-family: monospace;
    font-size: 12.5px;
    font-weight: 600;
    background: var(--surface-subtle);
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid var(--border-light);
    color: var(--navy-900);
}

/* СТАТУС БЕЙДЖИ */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.status-pill.protected {
    background: var(--status-protected-bg);
    color: var(--status-protected);
    border: 1px solid var(--status-protected-border);
}

.status-pill.expiring_soon {
    background: var(--status-warning-bg);
    color: var(--status-warning);
    border: 1px solid var(--status-warning-border);
}

.status-pill.pending_review {
    background: var(--status-pending-bg);
    color: var(--status-pending);
    border: 1px solid var(--status-pending-border);
}

.status-pill.expired {
    background: var(--status-expired-bg);
    color: var(--status-expired);
    border: 1px solid var(--status-expired-border);
}

.status-pill.rejected {
    background: var(--status-danger-bg);
    color: var(--status-danger);
    border: 1px solid var(--status-danger-border);
}

.pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
}

/* ИНТЕРАКТИВНЫЙ ВЫБОР СТАТУСА И СТАДИИ ПРЯМО В ТАБЛИЦЕ ДАШБОРДА */
.status-select-wrap, .stage-select-wrap {
    display: inline-block;
    position: relative;
}

.status-badge-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    display: inline-flex;
    align-items: center;
    padding: 4px 24px 4px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 7px center;
}

.status-badge-select.protected {
    background-color: var(--status-protected-bg);
    color: var(--status-protected);
    border-color: var(--status-protected-border);
}

.status-badge-select.expiring_soon {
    background-color: var(--status-warning-bg);
    color: var(--status-warning);
    border-color: var(--status-warning-border);
}

.status-badge-select.pending_review {
    background-color: var(--status-pending-bg);
    color: var(--status-pending);
    border-color: var(--status-pending-border);
}

.status-badge-select.expired {
    background-color: var(--status-expired-bg);
    color: var(--status-expired);
    border-color: var(--status-expired-border);
}

.status-badge-select.rejected {
    background-color: var(--status-danger-bg);
    color: var(--status-danger);
    border-color: var(--status-danger-border);
}

.status-badge-select:hover {
    filter: brightness(0.95);
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.stage-badge-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding: 4px 22px 4px 8px;
    border-radius: 4px;
    background-color: var(--surface-subtle);
    border: 1px solid var(--border-light);
    color: var(--navy-900);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%230B2545' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
}

.stage-badge-select:hover {
    border-color: var(--navy-800);
    background-color: #FFFFFF;
}

.pulse-dot.pulsing {
    animation: pulse-animation 2s infinite ease-in-out;
}

@keyframes pulse-animation {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.4); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.8; }
}

/* ==================== МОДАЛЬНЫЕ ОКНА ==================== */
.modal-overlay {
    display: none !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(11, 37, 69, 0.65);
    backdrop-filter: blur(6px);
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.active {
    display: flex !important;
    animation: modal-fade-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-container {
    background: #FFFFFF;
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(11, 37, 69, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transform: translateY(20px) scale(0.97);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-container {
    transform: translateY(0) scale(1);
}

.modal-header {
    padding: 24px 28px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--navy-900);
}

.modal-close {
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-muted);
    padding: 6px;
    border-radius: 50%;
    transition: all 0.15s ease;
}

.modal-close:hover {
    background: var(--surface-subtle);
    color: var(--navy-900);
}

.modal-body {
    padding: 28px;
}

.modal-footer {
    padding: 20px 28px;
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    background: var(--surface-subtle);
}

/* ==================== ФОРМЫ ==================== */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.form-grid.single {
    grid-template-columns: 1fr;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group.col-full {
    grid-column: 1 / -1;
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--navy-900);
}

.form-label .req {
    color: var(--red-600);
}

.form-control {
    height: 44px;
    padding: 0 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    background: var(--surface-subtle);
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--navy-800);
    background: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(19, 49, 92, 0.1);
}

textarea.form-control {
    height: auto;
    min-height: 90px;
    padding: 12px 14px;
    resize: vertical;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    margin-top: 4px;
}

/* ==================== КАРТОЧКА СОПОСТАВЛЕНИЯ ДУБЛЕЙ (ТЗ 10.11) ==================== */
.duplicate-pair-card {
    background: var(--surface-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 24px;
}

.duplicate-match-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    background: var(--status-warning-bg);
    border: 1px solid var(--status-warning-border);
    color: var(--status-warning);
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 20px;
}

.comparison-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.comp-col {
    background: var(--surface-subtle);
    border-radius: var(--radius-md);
    padding: 18px;
    border: 1px solid var(--border-light);
}

.comp-col-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--navy-900);
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.comp-field {
    margin-bottom: 10px;
    font-size: 13px;
}

.comp-field-label {
    color: var(--text-muted);
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
}

.comp-field-val {
    color: var(--text-primary);
    font-weight: 600;
    margin-top: 2px;
}

.comp-field.highlighted {
    background: #FEF3C7;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--status-warning);
}

/* ==================== ТОСТ-УВЕДОМЛЕНИЯ ==================== */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: #FFFFFF;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(11, 37, 69, 0.2);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 420px;
    border-left: 4px solid var(--navy-800);
    animation: toast-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.success { border-left-color: var(--status-protected); }
.toast.warning { border-left-color: var(--status-warning); }
.toast.error { border-left-color: var(--status-danger); }

.toast-content {
    flex: 1;
    font-size: 13.5px;
}

.toast-title {
    font-weight: 700;
    color: var(--navy-900);
    margin-bottom: 2px;
}

@keyframes toast-in {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ==================== АДАПТИВНОСТЬ (МОБИЛЬНЫЕ УСТРОЙСТВА И ПЛАНШЕТЫ) ==================== */
.mobile-brand-bar {
    display: none;
}

.mobile-bottom-nav {
    display: none;
}

@media (max-width: 992px) {
    .sidebar {
        width: 76px;
    }
    .brand-info, .brand-subtext, .nav-section-title, .nav-item span:not(.badge), .user-meta {
        display: none;
    }
    .brand-badge {
        justify-content: center;
    }
    .nav-item {
        justify-content: center;
        padding: 12px;
    }
    .topbar {
        padding: 0 16px;
    }
    .content-area {
        padding: 20px 16px;
    }
}

@media (max-width: 768px) {
    /* Скрываем десктопный сайдбар и переключаем на мобильный интерфейс */
    .sidebar {
        display: none !important;
    }
    .main-wrapper {
        margin-left: 0 !important;
        width: 100% !important;
        padding-bottom: 76px; /* Запас под нижнюю панель навигации */
    }

    /* Мобильный топбар */
    .topbar {
        height: 60px;
        padding: 0 14px;
        position: sticky;
        top: 0;
        z-index: 99;
        background: #FFFFFF;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    }
    .mobile-brand-bar {
        display: flex;
        align-items: center;
    }
    .topbar-search {
        display: none;
    }
    .topbar-actions {
        gap: 8px;
    }
    .topbar-add-btn span {
        display: none;
    }
    .topbar-add-btn {
        padding: 0 12px;
        height: 38px;
    }
    .mobile-user-btn {
        display: inline-flex !important;
    }

    /* Контентная область */
    .content-area {
        padding: 14px 12px 24px;
    }

    /* Промышленный баннер */
    .hero-industrial-card {
        padding: 20px 18px;
        margin-bottom: 18px;
        min-height: auto;
    }
    .hero-content h2 {
        font-size: 18px;
        margin-bottom: 6px;
    }
    .hero-content p {
        font-size: 12.5px;
        line-height: 1.45;
    }
    .hero-tag {
        font-size: 10px;
        padding: 3px 8px;
        margin-bottom: 8px;
    }

    /* Карточки KPI - 2 в ряд на смартфонах */
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 18px;
    }
    .kpi-card {
        padding: 14px;
        border-radius: var(--radius-md);
    }
    .kpi-title {
        font-size: 11px;
    }
    .kpi-value {
        font-size: 24px;
        margin-bottom: 3px;
    }
    .kpi-desc {
        font-size: 10.5px;
        line-height: 1.3;
    }
    .kpi-icon-wrap {
        width: 30px;
        height: 30px;
    }
    .kpi-icon-wrap svg {
        width: 16px;
        height: 16px;
    }

    /* Заголовки страниц и фильтры */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 14px;
    }
    .page-header h1, .page-header h2 {
        font-size: 18px !important;
    }
    .page-subtitle {
        font-size: 12px;
    }
    .page-header div[style*="display: flex"] {
        width: 100%;
        flex-direction: column;
        gap: 8px;
    }
    .page-header .btn {
        width: 100%;
        height: 42px;
        font-size: 13.5px;
    }

    /* Панель фильтров */
    .filter-bar {
        padding: 12px;
        margin-bottom: 14px;
    }
    .filter-grid {
        grid-template-columns: 1fr !important;
        gap: 10px;
    }
    .filter-actions {
        justify-content: stretch;
    }
    .filter-actions .btn {
        flex: 1;
    }

    /* Адаптивные таблицы: плавный горизонтальный скролл со стилями карточек */
    .table-card {
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-sm);
    }
    .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .data-table th, .data-table td {
        padding: 10px 12px;
        font-size: 12.5px;
        white-space: nowrap;
    }

    /* Модальные окна для смартфонов: полноэкранные / прижатые снизу */
    .modal-overlay {
        padding: 0 !important;
        align-items: flex-end !important;
    }
    .modal-container {
        max-width: 100% !important;
        width: 100% !important;
        max-height: 92vh !important;
        border-radius: 20px 20px 0 0 !important;
        display: flex;
        flex-direction: column;
        margin: 0 !important;
    }
    .modal-header {
        padding: 16px 18px;
    }
    .modal-header h3 {
        font-size: 16px;
    }
    .modal-body {
        padding: 16px 18px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .modal-footer {
        padding: 14px 18px;
        flex-direction: column-reverse;
        gap: 8px;
    }
    .modal-footer .btn {
        width: 100%;
        height: 44px;
    }

    /* Сетки внутри модальных окон */
    .form-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    .comparison-cols {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }

    /* Всплывающее окно уведомлений */
    #notifications-popup {
        width: calc(100vw - 20px) !important;
        right: -50px !important;
        top: 48px !important;
    }

    /* Фиксированная нижняя навигация */
    .mobile-bottom-nav {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #0B2545;
        height: 64px;
        z-index: 1000;
        border-top: 1px solid rgba(255, 255, 255, 0.12);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25);
        align-items: center;
        justify-content: space-around;
        padding: 0 4px;
    }
    .mobile-nav-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: rgba(255, 255, 255, 0.65);
        font-size: 10.5px;
        font-weight: 600;
        gap: 4px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 6px 8px;
        min-width: 52px;
        transition: color 0.15s ease;
    }
    .mobile-nav-btn svg {
        width: 20px;
        height: 20px;
    }
    .mobile-nav-btn.active {
        color: #C9A227 !important;
    }
    .mobile-nav-btn-add {
        position: relative;
        top: -12px;
    }
    .mobile-nav-plus-circle {
        width: 44px;
        height: 44px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--gold-400), var(--gold-500));
        color: var(--navy-950);
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 14px rgba(201, 162, 39, 0.5);
        border: 3px solid #0B2545;
        transition: transform 0.2s ease;
    }
    .mobile-nav-btn-add:active .mobile-nav-plus-circle {
        transform: scale(0.92);
    }
    .mobile-nav-btn-add svg {
        width: 22px;
        height: 22px;
        stroke-width: 2.5;
    }
}

