/* ============================================================
   RWS — Веб-сервис проверки поставщиков
   Стили: главная, чат, админ-панель
   ============================================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --orange: #FF6B35;
    --orange-light: #FF8C5A;
    --orange-dark: #E55A25;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    --white: #FFFFFF;
    --red: #EF4444;
    --green: #22C55E;
    --yellow: #F59E0B;
    --blue: #3B82F6;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.12);
    --radius: 8px;
    --radius-lg: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--orange); text-decoration: none; }
a:hover { color: var(--orange-dark); }

/* ============================================================
   ГЛАВНАЯ СТРАНИЦА
   ============================================================ */

.page-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    position: relative;
    overflow: hidden;
}

/* Геометрические декорации */
.geo-decoration {
    position: fixed;
    pointer-events: none;
    opacity: 0.06;
}

.geo-top-right {
    width: 400px; height: 400px;
    border: 3px solid var(--orange);
    border-radius: 50%;
    top: -150px; right: -100px;
}

.geo-bottom-left {
    width: 300px; height: 300px;
    border: 3px solid var(--orange);
    border-radius: 50%;
    bottom: -100px; left: -80px;
}

.geo-line-1 {
    width: 200px; height: 2px;
    background: var(--orange);
    top: 30%; left: -60px;
    transform: rotate(-30deg);
}

.geo-line-2 {
    width: 150px; height: 2px;
    background: var(--orange);
    bottom: 25%; right: -40px;
    transform: rotate(45deg);
}

/* Логотип */
.logo-section {
    text-align: center;
    margin-bottom: 40px;
    z-index: 1;
}

.logo-icon svg {
    margin-bottom: 12px;
}

.logo-title {
    font-size: 36px;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: 2px;
}

.logo-subtitle {
    font-size: 16px;
    color: var(--gray-500);
    margin-top: 4px;
}

/* Форма */
.access-form-section {
    z-index: 1;
    margin-bottom: 48px;
}

.form-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 36px 40px;
    box-shadow: var(--shadow-md);
    max-width: 480px;
    width: 100%;
}

.form-card h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.form-description {
    font-size: 14px;
    color: var(--gray-500);
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-600);
    margin-bottom: 6px;
}

.form-group input,
.form-group select {
    max-width: 100%;
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 15px;
    color: var(--gray-800);
    background: var(--white);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.12);
}

.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 20px;
}

.form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--orange);
}

.form-checkbox label {
    font-size: 13px;
    color: var(--gray-600);
    line-height: 1.5;
}

.link-text {
    color: var(--orange);
    text-decoration: underline;
}

/* Кнопки */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 24px;
    background: var(--orange);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn-primary:hover { background: var(--orange-dark); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-secondary:hover { background: var(--gray-200); }

/* Сообщения формы */
.form-message {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 14px;
}

.message-success {
    background: #F0FDF4;
    color: #166534;
    border: 1px solid #BBF7D0;
}

.message-error {
    background: #FEF2F2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

/* Инфо-карточки */
.info-section {
    z-index: 1;
    max-width: 800px;
    width: 100%;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.info-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: box-shadow 0.2s;
}

.info-card:hover { box-shadow: var(--shadow-md); }

.info-icon {
    margin-bottom: 12px;
}

.info-card h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 6px;
}

.info-card p {
    font-size: 13px;
    color: var(--gray-500);
}

/* Футер */
.footer {
    margin-top: 48px;
    font-size: 13px;
    color: var(--gray-400);
    z-index: 1;
}

/* Кнопка входа */
.login-link-section {
    text-align: center;
    margin-top: 20px;
}

.btn-login-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: var(--white);
    color: var(--orange);
    border: 1.5px solid var(--orange);
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.btn-login-link:hover {
    background: rgba(255, 107, 53, 0.06);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

/* Спиннер */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.spinner-large {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3.5px solid var(--gray-200);
    border-top-color: var(--orange);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   СТРАНИЦА ЧАТА
   ============================================================ */

.chat-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Шапка */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
}

.logo-mini {
    display: flex;
    align-items: center;
}

.user-badge {
    font-size: 13px;
    color: var(--gray-500);
    background: var(--gray-100);
    padding: 4px 12px;
    border-radius: 20px;
}

.btn-admin {
    font-size: 13px;
    color: var(--orange);
    padding: 6px 14px;
    border: 1px solid var(--orange);
    border-radius: var(--radius);
    font-weight: 500;
    transition: background 0.2s;
}

.btn-admin:hover { background: rgba(255, 107, 53, 0.08); }

.btn-back {
    font-size: 13px;
    color: var(--gray-600);
    padding: 6px 14px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    transition: background 0.2s;
}

.btn-back:hover { background: var(--gray-100); }

.btn-logout {
    font-size: 13px;
    color: var(--gray-500);
    background: none;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 6px 14px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.btn-logout:hover { color: var(--red); border-color: var(--red); }

/* Основная область */
.chat-main {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
}

/* Приветствие */
.chat-welcome {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
}

.welcome-icon svg {
    margin-bottom: 20px;
    opacity: 0.4;
}

.chat-welcome h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 8px;
}

.chat-welcome p {
    font-size: 15px;
    color: var(--gray-500);
    margin-bottom: 32px;
    max-width: 400px;
}

.quick-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.quick-btn {
    padding: 10px 20px;
    background: var(--white);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.quick-btn:hover {
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

/* Сообщения */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 16px;
}

.message {
    max-width: 80%;
    padding: 12px 18px;
    border-radius: var(--radius-lg);
    font-size: 14px;
    line-height: 1.5;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.message-user {
    align-self: flex-end;
    background: var(--orange);
    color: var(--white);
    border-bottom-right-radius: 4px;
}

.message-system {
    align-self: flex-start;
    background: var(--white);
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
    border-bottom-left-radius: 4px;
}

.message-error {
    align-self: flex-start;
    background: #FEF2F2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

.message-result {
    align-self: flex-start;
    background: var(--white);
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
    border-bottom-left-radius: 4px;
    max-width: 90%;
}

.message-result table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
    font-size: 13px;
}

.message-result th,
.message-result td {
    padding: 6px 10px;
    border: 1px solid var(--gray-200);
    text-align: left;
}

.message-result th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-600);
}

.message-result .result-link {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 14px;
    background: var(--orange);
    color: var(--white);
    border-radius: var(--radius);
    font-size: 13px;
}

.message-result .result-link:hover {
    background: var(--orange-dark);
}

/* ===== Структурированные результаты реестров ===== */
.message-result .result-container {
    width: 100%;
}

.message-result .result-container h3,
.message-result .result-container h4 {
    margin: 0 0 6px;
}

.message-result .result-container .result-company {
    font-size: 15px;
    color: var(--gray-900);
    text-transform: none;
    letter-spacing: 0;
}

.message-result .result-container .result-inn {
    margin: 0 0 10px;
    font-size: 13px;
}

.message-result .result-container .result-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.message-result .result-container .badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid transparent;
}

.message-result .result-container .badge-ok {
    background: #F0FDF4;
    color: #166534;
    border-color: #BBF7D0;
}

.message-result .result-container .badge-err {
    background: #FFFBEB;
    color: #92400E;
    border-color: #FDE68A;
}

.message-result .result-container .badge-none {
    background: var(--gray-50);
    color: var(--gray-500);
    border-color: var(--gray-200);
}

.message-result .result-source {
    margin-top: 14px;
}

.message-result .result-source-title {
    font-size: 13px;
    color: var(--gray-600);
    margin-bottom: 6px;
}

.message-result .result-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.message-result .result-table th {
    background: var(--gray-50);
    padding: 8px;
    text-align: left;
    border: 1px solid var(--gray-200);
    font-weight: 600;
    color: var(--gray-600);
    white-space: nowrap;
}

.message-result .result-table td {
    padding: 8px;
    border: 1px solid var(--gray-200);
    vertical-align: top;
}

.message-result .result-table tr:nth-child(even) td {
    background: #FAFAFA;
}

.message-result .result-table .td-product {
    max-width: 340px;
}

.message-result .result-table .rec-link {
    color: var(--orange);
    font-size: 12px;
    text-decoration: none;
    white-space: nowrap;
    margin-left: 4px;
}

.message-result .result-table .rec-link:hover {
    color: var(--orange-dark);
    text-decoration: underline;
}

.message-result .result-note {
    margin: 6px 0 0;
    font-size: 12px;
    color: var(--gray-500);
}

.message-result .result-empty {
    margin-top: 12px;
    padding: 16px;
    text-align: center;
    color: var(--gray-500);
    background: var(--gray-50);
    border: 1px dashed var(--gray-200);
    border-radius: var(--radius);
    font-size: 14px;
}

.message-result .result-summary {
    margin: 0 0 10px;
    font-size: 13px;
    color: var(--gray-600);
}

.message-result .llm-block {
    margin-top: 12px;
    padding: 10px 14px;
    background: #F0FDF4;
    color: #166534;
    border: 1px solid #BBF7D0;
    border-radius: var(--radius);
    font-size: 13px;
}

.message-llm {
    align-self: flex-start;
    background: #F0FDF4;
    color: #166534;
    border: 1px solid #BBF7D0;
    border-bottom-left-radius: 4px;
    max-width: 85%;
}

/* Загрузка */
.message-loading {
    align-self: flex-start;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 10px 18px;
    font-size: 14px;
    color: var(--gray-500);
}

/* Область загрузки файла */
.upload-section {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    flex-shrink: 0;
}

.file-upload-area {
    border: 2px dashed var(--gray-200);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.file-upload-area:hover {
    border-color: var(--orange);
    background: rgba(255, 107, 53, 0.02);
}

.upload-icon {
    margin-bottom: 8px;
}

.upload-text {
    font-size: 14px;
    color: var(--gray-500);
}

.upload-link {
    color: var(--orange);
    font-weight: 500;
    cursor: pointer;
}

.upload-hint {
    font-size: 12px;
    color: var(--gray-400);
    margin-top: 4px;
}

.file-info {
    margin-top: 8px;
    padding: 8px 14px;
    background: #F0FDF4;
    color: #166534;
    border: 1px solid #BBF7D0;
    border-radius: var(--radius);
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.file-info .remove-file {
    cursor: pointer;
    color: var(--red);
    font-weight: 600;
}

/* Панель ввода */
.chat-input-area {
    padding: 16px 24px;
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    flex-shrink: 0;
}

.input-wrapper {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    gap: 12px;
    align-items: center;
}

#chatInput {
    flex: 1;
    padding: 12px 18px;
    border: 1.5px solid var(--gray-200);
    border-radius: 24px;
    font-size: 15px;
    color: var(--gray-800);
    transition: border-color 0.2s, box-shadow 0.2s;
}

#chatInput:focus {
    outline: none;
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.12);
}

.btn-send {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--orange);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.1s;
    flex-shrink: 0;
}

.btn-send:hover { background: var(--orange-dark); }
.btn-send:active { transform: scale(0.95); }
.btn-send:disabled { opacity: 0.5; cursor: not-allowed; }

/* Модалка результатов */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

.modal-sm {
    max-width: 420px;
}

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

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--gray-400);
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover { color: var(--gray-700); }

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 40px;
    color: var(--gray-500);
    font-size: 14px;
}

/* ============================================================
   АДМИН-ПАНЕЛЬ
   ============================================================ */

.admin-page {
    background: var(--gray-50);
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
}

.admin-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

/* Дашборд */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    font-size: 32px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
}

.stat-label {
    font-size: 13px;
    color: var(--gray-500);
}

/* Табы */
.admin-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 24px;
}

.tab {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-500);
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.tab:hover { color: var(--gray-700); }

.tab.active {
    color: var(--orange);
    border-bottom-color: var(--orange);
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.tab-toolbar h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-800);
}

/* Таблица */
.table-wrapper {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.admin-table th {
    padding: 12px 16px;
    background: var(--gray-50);
    color: var(--gray-600);
    font-weight: 600;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
    white-space: nowrap;
}

.admin-table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
}

.admin-table tr:hover td {
    background: var(--gray-50);
}

.table-loading {
    text-align: center;
    color: var(--gray-400);
    padding: 40px !important;
}

/* Статусы */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-pending {
    background: #FEF3C7;
    color: #92400E;
}

.badge-approved {
    background: #D1FAE5;
    color: #065F46;
}

.badge-rejected {
    background: #FEE2E2;
    color: #991B1B;
}

.badge-user {
    background: var(--gray-100);
    color: var(--gray-600);
}

.badge-admin {
    background: rgba(255, 107, 53, 0.12);
    color: var(--orange-dark);
}

.badge-active {
    background: #D1FAE5;
    color: #065F46;
}

.badge-inactive {
    background: var(--gray-100);
    color: var(--gray-400);
}

/* Кнопки действий */
.action-btn {
    padding: 4px 10px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    margin-right: 4px;
    transition: opacity 0.2s;
}

.action-btn:hover { opacity: 0.8; }

.action-btn-approve {
    background: #D1FAE5;
    color: #065F46;
}

.action-btn-reject {
    background: #FEE2E2;
    color: #991B1B;
}

.action-btn-edit {
    background: var(--gray-100);
    color: var(--gray-600);
}

.action-btn-delete {
    background: #FEE2E2;
    color: #991B1B;
}

/* Форма конфигурации */
.config-form {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    max-width: 500px;
}

.config-form .form-group {
    margin-bottom: 20px;
}

/* ============================================================
   СТРАНИЦА ВХОДА
   ============================================================ */

.login-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 20px;
    position: relative;
    overflow: hidden;
}

.login-container {
    width: 100%;
    max-width: 420px;
    z-index: 1;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header .logo-icon svg {
    margin-bottom: 12px;
}

.login-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: 2px;
}

.login-subtitle {
    font-size: 14px;
    color: var(--gray-500);
    margin-top: 4px;
}

.login-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 32px 36px;
    box-shadow: var(--shadow-lg);
    max-width: 480px;
    margin: 0 auto 24px;
}

.login-card h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.login-description {
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 24px;
}

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    width: 100%;
    padding-right: 44px;
}

.toggle-password {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.toggle-password:hover {
    color: var(--gray-600);
}

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

.remember-me {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--gray-600);
    cursor: pointer;
}

.remember-me input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--orange);
    cursor: pointer;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
}

.back-link {
    font-size: 13px;
    color: var(--gray-500);
}

.back-link:hover {
    color: var(--orange);
}

/* ============================================================
   АДАПТИВНОСТЬ
   ============================================================ */

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

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .form-card {
        padding: 24px;
    }

    .chat-header {
        padding: 10px 16px;
    }

    .header-title {
        display: none;
    }

    .message {
        max-width: 90%;
    }

    .admin-main {
        padding: 16px;
    }

    .admin-table {
        font-size: 12px;
    }

    .admin-table th,
    .admin-table td {
        padding: 8px 10px;
    }
}
