* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: #f1f5f9;
    overflow-x: hidden;
}

/* ========== ОСНОВНЫЕ КОНТЕЙНЕРЫ ========== */
.app-container {
    position: relative;
    width: 100%;
    min-height: 100vh;
}

.main-content {
    background-color: #f8fafc;
    min-height: 100vh;
    transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    position: relative;
    z-index: 10;
}

.app-container.menu-open .main-content {
    transform: translateX(280px);
}

/* ========== САЙДБАР МЕНЮ ========== */
.side-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100%;
    background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
    color: #e2e8f0;
    z-index: 20;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    display: flex;
    flex-direction: column;
}

.app-container.menu-open .side-menu {
    transform: translateX(0);
}

.menu-header {
    padding: 28px 20px 20px;
    border-bottom: 1px solid #334155;
}

.menu-header h3 {
    font-size: 1.6rem;
    background: linear-gradient(135deg, #c084fc, #60a5fa);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.menu-header p {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 6px;
}

.menu-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 16px;
}

.menu-item {
    background: transparent;
    border: none;
    text-align: left;
    padding: 14px 18px;
    font-size: 1.1rem;
    font-weight: 500;
    color: #cbd5e1;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
}

.menu-item:active {
    background: #334155;
}

.password-change-btn {
    margin-top: auto;
    margin-bottom: 20px;
    background: rgba(96, 165, 250, 0.1);
    border: 1px solid #334155;
}

/* ========== БУРГЕР-КНОПКА ========== */
.burger-btn {
    position: fixed;
    top: 6px;
    left: 6px;
    width: 44px;
    height: 44px;
    background: white;
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 25;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 1px solid #e2e8f0;
    backdrop-filter: blur(4px);
}

.burger-icon {
    width: 24px;
    height: 2px;
    background: #1e293b;
    position: relative;
    border-radius: 2px;
}

.burger-icon::before,
.burger-icon::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background: #1e293b;
    border-radius: 2px;
    left: 0;
}

.burger-icon::before { top: -8px; }
.burger-icon::after { top: 8px; }

/* ========== УПРАВЛЕНИЕ СТРАНИЦАМИ ========== */
.page {
    display: none !important;
    padding: 16px 16px 24px;
}

.page.active-page {
    display: block !important;
}

#adminPage {
    display: none !important;
}

#adminPage.active-page {
    display: block !important;
}

body:has(#adminPage.active-page) #assemblyPage,
body:has(#adminPage.active-page) #remainsPage,
body:has(#adminPage.active-page) #receivingPage,
body:has(#adminPage.active-page) #logoutPage {
    display: none !important;
}

#assemblyPage:not(.active-page),
#remainsPage:not(.active-page),
#receivingPage:not(.active-page),
#adminPage:not(.active-page),
#logoutPage:not(.active-page) {
    display: none !important;
}

/* ========== ОБЩИЕ КОМПОНЕНТЫ ========== */
.date-selector-container {
    position: relative;
    margin-top: 4px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    background: white;
    padding: 12px 16px;
    border-radius: 28px;
    justify-content: flex-end;
    overflow: visible;
}

.assembly-date-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.filter-icon-btn {
    order: 2;
    flex: 0 0 92px;
    min-width: 92px;
    min-height: 55px;
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 10px;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s, border-color .15s, box-shadow .15s;
}

.filter-icon-btn:hover,
.filter-icon-btn:focus-visible {
    background: #f8fafc;
    border-color: #94a3b8;
    outline: none;
    box-shadow: 0 0 0 3px rgba(148, 163, 184, .2);
}

.filter-icon-btn--calendar { color: #334155; }
.filter-icon-btn--type { color: #dc2626; }
.filter-icon-btn--status { color: #2563eb; }

.filter-letter {
    font-size: 1.75rem;
    line-height: 1;
    font-weight: 800;
}

.filter-letter--red { color: #dc2626; }
.filter-letter--blue { color: #2563eb; }

.filter-btn-label {
    color: #475569;
    font-size: .85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.filter-popup {
    position: absolute;
    z-index: 50;
    top: 76px;
    right: 16px;
    left: auto;
    min-width: 220px;
    max-width: calc(100% - 32px);
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .16);
}

#ordersListView { position: relative; }

#adminSkladFilterContainer {
    order: 1;
    margin-right: auto;
}

.inline-date-picker {
    display: block;
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    padding: 9px;
    font: inherit;
    margin-bottom: 8px;
}

.filter-popup--date { min-width: 210px; }

.filter-popup-inner { padding: 8px; }

.filter-popup-item {
    padding: 10px 12px;
    border-radius: 9px;
    color: #334155;
    font-size: .9rem;
    cursor: pointer;
}

.filter-popup-item:hover { background: #f1f5f9; }

.filter-popup-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.filter-popup-btn {
    flex: 1;
    border: 0;
    border-radius: 8px;
    padding: 8px;
    background: #1e293b;
    color: #fff;
    cursor: pointer;
}

.filter-popup-btn--secondary {
    background: #e2e8f0;
    color: #334155;
}

.date-input {
    border: 1px solid #e2e8f0;
    background: #fff;
    padding: 8px 14px;
    border-radius: 30px;
    font-family: inherit;
    min-width: 0;
    box-sizing: border-box;
}

.date-input--compact {
    flex: 1 1 0;
    width: 0;
    padding: 6px 8px;
    font-size: 0.85rem;
}

/* Кнопки */
.btn-primary {
    width: 100%;
    background: linear-gradient(105deg, #1e293b, #2d3e5a);
    border: none;
    padding: 16px 20px;
    border-radius: 60px;
    font-weight: 700;
    color: white;
    cursor: pointer;
}

.btn-secondary {
    background: #475569;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 40px;
    cursor: pointer;
}

.btn-danger {
    background: #dc2626;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
}

.btn-icon {
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    transition: background 0.2s;
}

.btn-icon:hover {
    background: #f1f5f9;
}

/* ========== СТРАНИЦА СБОРОК ========== */
.orders-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

.order-card {
    background: white;
    border-radius: 20px;
    padding: 16px 20px;
    border: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

/* Статусные фоны карточек сборок */
.order-card.status-in-progress { background: #93C2E5; border-color: #facc15; }
.order-card.status-completed   { background: #bbf7d0; border-color: #4ade80; }
.order-card.status-partial     { background: #fecdd3; border-color: #fb7185; }

/* Случайные пастельные фоны для строк товаров */
.item-row.color-blue   { background: #bae6fd; }
.item-row.color-yellow { background: #fde68a; }
.item-row.color-gray   { background: #cbd5e1; }
.item-row.color-brick  { background: #fed7aa; }
.item-row.color-maroon { background: #fbcfe8; }
.item-row.color-green  { background: #bbf7d0; }

/* Если завершён — зелёный фон перекрывает цветной */
.item-row.completed {
    background-color: #e6f7e6 !important;
    border-left: 4px solid #2e7d32;
}

.order-info h4 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e293b;
}

.order-card-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.order-card-date {
    font-size: 0.85rem;
    color: #64748b;
    white-space: normal;
    max-width: 90vw;
    word-wrap: break-word;
    font-weight: 500;
}

.order-card-customer {
    font-size: 0.8rem;
    color: #475569;
    margin-top: 5px;
    font-weight: 700;
}




.order-status-icon {
    font-size: 1.5rem;
}

/* Статус "Собрана не полностью" */
.order-status-icon.partial {
    position: relative;
    width: 24px;
    height: 24px;
}

.order-status-icon.partial svg {
    width: 24px;
    height: 24px;
    transform: rotate(-90deg);
}

.back-button {
    margin-top: 52px;
    margin-bottom: 16px;
    background: #f1f5f9;
    border: none;
    padding: 10px 18px;
    border-radius: 40px;
    cursor: pointer;
}

.back-button-round {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    background: #fef9c3;
    color: #1e293b;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(234, 179, 8, 0.3);
    z-index: 10;
    transition: background 0.2s;
}

.back-button-round:hover {
    background: #fef08a;
}

.assembly-header {
    background: white;
    border-radius: 16px;
    padding: 6px 8px 4px;
    margin-bottom: 6px;
}

.assembly-top-line {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 44px;
}

.assembly-info-line {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 1px;
}

.assembly-date {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
}

.assembly-sklad {
    font-size: 0.8rem;
    color: #64748b;
}

.assembly-counterparty {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b;
}


.order-number {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0f172a;
}

.order-badge {
    font-size: 0.7rem;
    background: #eef2ff;
    color: #2563eb;
    padding: 4px 12px;
    border-radius: 30px;
    display: inline-block;
    margin-top: 8px;
}

.items-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
}

.list-item {
    background: white;
    border-radius: 20px;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #edf2f7;
    cursor: pointer;
}

.item-row {
    border-radius: 20px;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #edf2f7;
    cursor: pointer;
}

.item-wrapper {
    display: flex;
    flex-direction: column;
}

.item-spoiler {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease, padding 0.25s ease;
    padding: 0 18px;
    background: #f8fafc;
    border-radius: 0 0 20px 20px;
    margin-top: -10px;
}

.item-spoiler.open {
    max-height: 140px;
    padding: 12px 18px;
}

.spoiler-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.spoiler-input {
    flex: 1;
    max-width: 80px;
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    background: white;
    color: #1e293b;
    font-family: inherit;
    -moz-appearance: textfield;
}

.spoiler-input::-webkit-outer-spin-button,
.spoiler-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.spoiler-input:focus {
    outline: none;
    border-color: #3b82f6;
}

.spoiler-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.spoiler-minus {
    background: #fee2e2;
    color: #dc2626;
}

.spoiler-plus {
    background: #dbeafe;
    color: #2563eb;
}

.spoiler-confirm {
    background: #dcfce7;
    color: #166534;
    font-size: 1.1rem;
}

.spoiler-sku-btn {
    background: #f1f5f9;
    color: #1e293b;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.spoiler-sku-btn.sku-updated {
    color: #16a34a;
    font-weight: 900;
    border: 2px solid #16a34a;
}

.sku-input-row {
    display: flex;
    margin-top: 8px;
}

.sku-input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    background: white;
    color: #1e293b;
    font-family: inherit;
}

.sku-input:focus {
    outline: none;
    border-color: #3b82f6;
}

.list-item.completed {
    background-color: #e6f7e6;
    border-left: 4px solid #2e7d32;
}

.item-info {
    flex: 1;
}

.item-name {
    font-weight: 800;
    font-size: 1.15rem;
    color: #1e293b;
}

.item-sku {
    font-size: 0.65rem;
    color: #5b6e8c;
}

.item-location {
    font-size: 1.05rem;
    color: #475569;
    margin-top: 2px;
}

.item-counts {
    font-weight: 800;
    font-size: 1.05rem;
    background: #f8fafc;
    padding: 5px 14px;
    border-radius: 40px;
    text-align: right;
    white-space: nowrap;
    margin-left: 12px;
}

.action-footer {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
    margin-bottom: 30px;
}

.empty-orders {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 28px;
    color: #64748b;
}

/* ========== СТАТУС СКАНИРОВАНИЯ СБОРКИ (ВСПЛЫВАЮЩЕЕ УВЕДОМЛЕНИЕ) ========== */
.order-scan-status {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    text-align: center;
    font-size: 1.275rem;
    padding: 8px 16px;
    border-radius: 40px;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: none;
    white-space: normal;
    word-wrap: break-word;
    max-width: 90vw;
}

.order-scan-status.show {
    display: block;
    animation: fadeInOut 2s ease-in-out;
}

.order-scan-status.loading {
    background: #eef2ff;
    color: #2563eb;
}

.order-scan-status.success {
    background: #dcfce7;
    color: #166534;
}

.order-scan-status.error {
    background: #fee2e2;
    color: #dc2626;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
    15% { opacity: 1; transform: translateX(-50%) translateY(0); }
    85% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}

/* ========== СТРАНИЦА ОСТАТКОВ ========== */
.stock-table {
    background: white;
    border-radius: 20px;
    overflow-x: auto;
}

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

.stock-table th, .stock-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.low-stock {
    background-color: #fee2e2;
}

/* ========== СТРАНИЦА ЛОГИНА ========== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 32px;
    padding: 40px 32px;
    width: 100%;
    max-width: 360px;
    text-align: center;
}

.login-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 60px;
    margin-bottom: 12px;
    font-size: 1rem;
}

.login-error {
    color: #dc2626;
    margin-top: 12px;
}

/* Переключатель режимов */
.auth-mode-switch {
    display: flex;
    gap: 8px;
    background: #f1f5f9;
    border-radius: 60px;
    padding: 4px;
    margin-bottom: 24px;
}

.mode-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 12px 16px;
    border-radius: 60px;
    font-weight: 600;
    cursor: pointer;
    color: #64748b;
}

.mode-btn.active {
    background: white;
    color: #1e293b;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.auth-mode-panel {
    display: none;
}

.auth-mode-panel.active {
    display: block;
}

.qr-message {
    text-align: center;
    padding: 20px;
}

.qr-icon {
    font-size: 64px;
    margin-bottom: 16px;
    animation: pulse 1.5s infinite;
}

.qr-icon img {
    width: 120px;
    height: 80px;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.05); }
}

.qr-status {
    font-size: 0.85rem;
    padding: 12px;
    background: #eef2ff;
    border-radius: 20px;
    margin-top: 12px;
}

.qr-status.error {
    background: #fee2e2;
    color: #dc2626;
}

.qr-status.success {
    background: #dcfce7;
    color: #166534;
}

/* ========== АДМИН ПАНЕЛЬ ========== */
.admin-container {
    padding: 20px;
}

.admin-section {
    background: white;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 24px;
    border: 1px solid #e2e8f0;
}

.admin-section h3 {
    margin-bottom: 16px;
    color: #1e293b;
}

.admin-section .date-selector-container {
    margin-top: 0;
    background: transparent;
    padding: 0;
    display: flex;
    gap: 12px;
    align-items: center;
}

.table-container {
    overflow-x: auto;
    margin-top: 16px;
}

.users-table, .api-keys-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.users-table th, .users-table td,
.api-keys-table th, .api-keys-table td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.users-table th, .api-keys-table th {
    background: #f8fafc;
    font-weight: 600;
}

.permission-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.sklad-input {
    width: 110px;
    padding: 4px 6px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: white;
    font-size: 0.85rem;
    cursor: pointer;
}

.change-password-btn, .qr-generate-btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 0.75rem;
}

.delete-user-btn {
    background: #dc2626;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 0.75rem;
    margin-left: 8px;
}

/* Секция сборок в админке */
#adminAssembliesSection {
    margin-top: 20px;
}

#adminAssembliesTableBody tr {
    cursor: pointer;
}

#adminAssembliesTableBody tr:hover {
    background-color: #f8fafc;
}

/* ========== ОБЩИЕ СТИЛИ ========== */
.placeholder-page {
    text-align: center;
    padding: 40px 20px;
}

.placeholder-card {
    background: white;
    border-radius: 36px;
    padding: 32px;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 28px;
    padding: 32px;
    width: 90%;
    max-width: 400px;
}

/* ========== АНИМАЦИИ ========== */
@keyframes scanFlash {
    0%, 100% { background-color: white; }
    50% { background-color: #e0f2fe; }
}

.scan-flash {
    animation: scanFlash 0.3s ease-in-out;
}

/* ========== АДАПТИВНОСТЬ ========== */
@media (max-width: 480px) {
    .order-number { font-size: 1.3rem; }
    .burger-btn { top: 6px; left: 6px; width: 40px; height: 40px; }
    .admin-container { padding: 16px; }
    .date-selector-container {
        padding: 8px 10px;
        gap: 6px;
        border-radius: 16px;
    }
    .date-selector-container .date-input {
        padding: 6px 8px;
        font-size: 0.8rem;
    }
}

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

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

.modal-box {
    background: var(--bg-card, #1e1e2e);
    border-radius: 16px;
    padding: 28px 24px;
    max-width: 400px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.modal-icon {
    font-size: 2.5rem;
    text-align: center;
}

.modal-icon--error  { color: #ef4444; }
.modal-icon--warning { color: #f59e0b; }

.modal-title {
    font-size: 1.2rem;
    font-weight: 700;
    text-align: center;
    margin: 0;
}

.modal-message {
    text-align: center;
    color: var(--text-secondary, #888);
    margin: 0;
    font-size: 0.9rem;
}

.modal-textarea {
    width: 100%;
    background: var(--bg-input, #2a2a3e);
    border: 1px solid var(--border, #333);
    border-radius: 10px;
    padding: 10px 12px;
    color: var(--text-primary, #fff);
    font-size: 0.95rem;
    resize: vertical;
    min-height: 80px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.modal-textarea:focus {
    outline: none;
    border-color: var(--accent, #6c63ff);
}

.modal-textarea.input-error {
    border-color: #ef4444;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn-warning {
    background: #f59e0b;
    color: #000;
    font-weight: 600;
}

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

/* Базовый класс кнопки для модальных окон */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 40px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.15s;
}

.btn:active { opacity: 0.8; }

.btn.btn-primary {
    background: linear-gradient(105deg, #1e293b, #2d3e5a);
    color: white;
    width: auto;
    padding: 10px 20px;
}

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

.btn.btn-warning {
    background: #f59e0b;
    color: #000;
}

/* Переопределяем modal-box под светлую тему */
.modal-box {
    background: #ffffff;
    color: #1e293b;
    border-radius: 20px;
    padding: 28px 24px;
    max-width: 420px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}

.modal-message strong {
    color: #1e293b;
}

/* ========== НАСТРОЙКИ ========== */
.settings-gear-btn {
    position: absolute;
    top: 0;
    right: 0;
    width: 48px;
    height: 48px;
    border: none;
    background: transparent;
    font-size: 1.4rem;
    cursor: pointer;
    border-radius: 0 32px 0 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.3s;
    z-index: 5;
    text-align: center;
    line-height: 1;
}

.settings-gear-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: rotate(60deg);
}

.settings-container {
    display: flex;
    justify-content: center;
    padding: 40px 16px;
}

.settings-card {
    background: white;
    border-radius: 28px;
    padding: 32px 28px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.settings-card h2 {
    font-size: 1.5rem;
    color: #1e293b;
    margin-bottom: 4px;
}

.settings-subtitle {
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.settings-field {
    margin-bottom: 20px;
}

.settings-field label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.settings-field input[type="url"],
.settings-field input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.settings-field input:focus {
    outline: none;
    border-color: #3b82f6;
}

.settings-hint {
    display: block;
    margin-top: 6px;
    font-size: 0.8rem;
    color: #94a3b8;
}

.settings-checkbox-row label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    cursor: pointer;
}

.settings-checkbox-row input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.settings-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.settings-actions button {
    flex: 1;
    padding: 12px;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: opacity 0.15s;
}

.settings-actions button:active {
    opacity: 0.8;
}

.settings-status {
    margin-top: 16px;
    text-align: center;
    font-size: 0.9rem;
    min-height: 24px;
    color: #64748b;
}

.settings-status.success { color: #16a34a; }
.settings-status.error   { color: #dc2626; }
