/* ─── Дизайн-система Медскан (единый стиль с «Мониторингом цен») ─── */
:root {
    --blue: #0071bb;
    --blue-2: #0088d4;
    --teal: #00b5af;
    --navy: #1e2f5e;
    --blue-light: #e8f4fd;
    --teal-light: #e0f7f6;
    --navy-light: #eef0f6;
    --bg: #f4f7fb;
    --white: #ffffff;
    --text: #1a2035;
    --muted: #6b7a99;
    --border: #dde3ef;
    --success: #22c55e;
    --success-bg: #f0fdf4;
    --warning: #f59e0b;
    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --radius: 12px;
    --shadow: 0 2px 16px rgba(30, 47, 94, .08);
    --shadow-md: 0 4px 24px rgba(30, 47, 94, .13);
}

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

body {
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}

.container {
    max-width: 860px;
    margin: 0 auto;
    padding: 28px 20px 60px;
}

/* ─── Шапка ─── */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px 24px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e2f5e 0%, #005f8e 100%);
    padding: 11px 22px;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(30, 47, 94, .2);
}

.logo-img {
    height: 38px;
    width: auto;
    display: block;
}

.subtitle-line {
    font-family: 'Oswald', sans-serif;
    font-size: 26px;
    font-weight: 600;
    color: var(--navy);
    margin: 4px 2px 24px;
    letter-spacing: .3px;
}

/* ─── Карточки-секции ─── */
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 18px;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--blue), var(--teal));
}

.card h3 {
    font-family: 'Oswald', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 6px;
    letter-spacing: .3px;
}

.hint {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 14px;
}

.row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* ─── Кнопки ─── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 20px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Manrope', sans-serif;
    cursor: pointer;
    border: none;
    transition: all .18s;
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--blue), var(--blue-2));
    color: #fff;
}
.btn-primary:hover:not(:disabled) {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 113, 187, .3);
}

.btn-secondary {
    background: var(--teal-light);
    color: #067c78;
}
.btn-secondary:hover:not(:disabled) {
    background: #cdeeec;
}

.btn-danger {
    background: var(--danger-bg);
    border: 1.5px solid #fecaca;
    color: var(--danger);
}
.btn-danger:hover:not(:disabled) {
    background: #fee2e2;
}

.session-id {
    font-family: 'Manrope', monospace;
    font-size: 13px;
    font-weight: 600;
    color: var(--blue);
    background: var(--blue-light);
    padding: 7px 14px;
    border-radius: 20px;
}

/* ─── Загрузка ─── */
.upload-area {
    margin-top: 14px;
}

.upload-area input[type="file"] {
    display: none;
}

.upload-label {
    display: inline-block;
    padding: 10px 20px;
    background: var(--teal-light);
    color: #067c78;
    border-radius: 9px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

.upload-label:hover {
    background: #cdeeec;
}

/* ─── Табы ─── */
.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
    background: var(--navy-light);
    border-radius: 10px;
    padding: 4px;
}

.tab {
    flex: 1;
    padding: 9px 16px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Manrope', sans-serif;
    color: var(--muted);
    transition: all .18s;
}

.tab.active {
    background: var(--white);
    color: var(--navy);
    box-shadow: 0 1px 4px rgba(30, 47, 94, .12);
}

.tab-content {
    padding: 4px 0;
}

/* ─── Зона перетаскивания ─── */
.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
    transition: all .18s;
}

.drop-zone.dragover {
    border-color: var(--blue);
    background: var(--blue-light);
}

.drop-zone input[type="file"] {
    display: none;
}

.drop-label {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
}

.drop-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: var(--blue-light);
    color: var(--blue);
    font-family: 'Oswald', sans-serif;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: .5px;
}

.drop-hint {
    font-size: 12px;
    color: var(--muted);
}

.count-badge {
    margin-top: 10px;
    padding: 5px 14px;
    background: var(--success-bg);
    color: #16a34a;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    display: inline-block;
}

/* ─── Поля ввода ─── */
.input-text {
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: 9px;
    font-size: 14px;
    font-family: 'Manrope', sans-serif;
    color: var(--text);
    background: var(--white);
    min-width: 260px;
    transition: border-color .18s, box-shadow .18s;
}

.input-text:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(0, 113, 187, .12);
}

.status-text {
    margin-top: 10px;
    font-size: 13px;
    color: var(--muted);
}

.status-ok {
    margin-top: 10px;
    color: #16a34a;
    font-size: 13px;
    font-weight: 600;
}

/* ─── Прогресс ─── */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--navy-light);
    border-radius: 4px;
    margin: 16px 0 8px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--blue), var(--teal));
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
}

#progressText {
    font-size: 13px;
    color: var(--muted);
    font-weight: 600;
    font-family: 'Manrope', monospace;
}

/* ─── Результаты ─── */
.result-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.summary {
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 16px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.7;
    white-space: pre-wrap;
    overflow-x: auto;
    font-family: 'Manrope', monospace;
}

.hidden {
    display: none;
}

footer {
    text-align: center;
    color: var(--muted);
    font-size: 12px;
    margin-top: 32px;
}

/* ─── Логин ─── */
.login-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.login-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px;
    width: 380px;
    max-width: 92vw;
    box-shadow: var(--shadow-md);
    text-align: center;
}

.login-card .logo {
    margin: 0 auto 24px;
    padding: 16px 28px;
}

.login-card .logo-img {
    height: 52px;
}

.login-card h3 {
    font-family: 'Oswald', sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 20px;
}

.login-card .input-text {
    width: 100%;
    min-width: 0;
    margin-bottom: 12px;
}

.login-error {
    color: var(--danger);
    font-size: 13px;
    margin-top: 4px;
}

/* ─── Пользователь ─── */
.user-bar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--navy);
}

.btn-logout {
    padding: 7px 15px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Manrope', sans-serif;
    background: transparent;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    color: var(--muted);
    transition: all .18s;
}

.btn-logout:hover {
    background: var(--bg);
    color: var(--navy);
}

.status-live {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .35; }
}

/* ─── Список пользователей ─── */
.user-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.user-badge {
    background: var(--blue-light);
    color: var(--navy);
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.user-date {
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
}

@media (max-width: 560px) {
    .subtitle-line { font-size: 22px; }
    .card { padding: 20px; }
}
