/* ==========================================
   ОСНОВНЫЕ СТИЛИ ДЛЯ САЙТА zip-teh.ru
   ========================================== */

* {
    box-sizing: border-box;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

body {
    background: #f1f4f8;
    margin: 0;
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    background: white;
    border-radius: 28px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.05);
    overflow: hidden;
    padding: 24px 28px 40px;
}

/* ==========================================
   АДМИН-ПАНЕЛЬ
   ========================================== */
.admin-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.admin-btn {
    background: #e2e8f0;
    border: none;
    padding: 6px 16px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.8rem;
    color: #1e2a3a;
    transition: background 0.2s;
}

.admin-btn.primary {
    background: #1e466e;
    color: white;
}

.admin-btn.primary:hover {
    background: #0f2e4a;
}

.admin-btn:hover {
    background: #cbd5e1;
}

.admin-badge {
    background: #2c5f2d;
    color: white;
    font-size: 0.7rem;
    padding: 4px 12px;
    border-radius: 30px;
}

/* ==========================================
   ЗАГОЛОВКИ
   ========================================== */
h1 {
    font-size: 1.9rem;
    font-weight: 600;
    margin: 0;
    color: #1e2a3a;
}

.sub {
    color: #2c5f2d;
    border-left: 4px solid #2c5f2d;
    padding-left: 14px;
    margin: 16px 0 24px 0;
    font-weight: 500;
}

/* ==========================================
   ОБЛАСТЬ ЗАГРУЗКИ
   ========================================== */
.upload-area {
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 20px;
    padding: 18px 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.upload-area.admin-mode {
    background: #e6f7e6;
    border-color: #2c5f2d;
}

.file-label {
    background: #2c5f2d;
    color: white;
    padding: 10px 22px;
    border-radius: 40px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    display: inline-block;
    font-size: 0.9rem;
    border: none;
}

.file-label:hover {
    background: #1e4a2a;
}

input[type="file"] {
    display: none;
}

/* ==========================================
   ПОИСК
   ========================================== */
.search-box {
    flex: 2;
    min-width: 200px;
}

.search-box input {
    width: 100%;
    padding: 10px 16px;
    border-radius: 40px;
    border: 1px solid #cbd5e1;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box input:focus {
    border-color: #1e466e;
    box-shadow: 0 0 0 2px rgba(30,70,110,0.2);
}

/* ==========================================
   СЧЁТЧИК ЗАПИСЕЙ
   ========================================== */
.info-text {
    font-size: 0.85rem;
    color: #334155;
    background: #eef2ff;
    padding: 8px 16px;
    border-radius: 30px;
    white-space: nowrap;
}

/* ==========================================
   ТАБЛИЦА
   ========================================== */
.table-wrapper {
    overflow-x: auto;
    border-radius: 18px;
    border: 1px solid #e2e8f0;
    background: white;
    margin-top: 12px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    min-width: 500px;
}

th {
    background: #f1f5f9;
    padding: 14px 12px;
    text-align: left;
    font-weight: 600;
    color: #0f172a;
    border-bottom: 1px solid #e2e8f0;
}

td {
    padding: 12px;
    border-bottom: 1px solid #f0f2f5;
    color: #1e293b;
}

tr:hover td {
    background-color: #fef9e3;
}

.badge-stock {
    background: #dff9e6;
    color: #1e6f3f;
    padding: 4px 10px;
    border-radius: 30px;
    font-weight: 500;
    font-size: 0.75rem;
    display: inline-block;
}

.price {
    font-weight: 700;
    color: #0f3b2c;
}

.empty-row td {
    text-align: center;
    padding: 40px;
    color: #64748b;
    font-style: italic;
}

/* ==========================================
   ПОДВАЛ
   ========================================== */
footer {
    margin-top: 32px;
    text-align: center;
    font-size: 0.75rem;
    color: #94a3b8;
}

/* ==========================================
   МОДАЛЬНОЕ ОКНО
   ========================================== */
.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.hidden {
    display: none;
}

.modal-card {
    background: white;
    border-radius: 28px;
    padding: 32px;
    max-width: 380px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 35px rgba(0,0,0,0.2);
}

.modal-card h3 {
    margin-bottom: 8px;
    color: #1e2a3a;
}

.modal-card input {
    width: 100%;
    padding: 12px 16px;
    margin: 16px 0;
    border: 1px solid #cbd5e1;
    border-radius: 60px;
    font-size: 1rem;
    outline: none;
}

.modal-card input:focus {
    border-color: #1e466e;
    box-shadow: 0 0 0 2px rgba(30,70,110,0.2);
}

.modal-card button {
    background: #1e466e;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 60px;
    cursor: pointer;
    width: 100%;
    font-weight: 600;
    font-size: 1rem;
    transition: background 0.2s;
}

.modal-card button:hover {
    background: #0f2e4a;
}

.modal-card .btn-cancel {
    background: #e2e8f0;
    color: #333;
    margin-top: 12px;
}

.modal-card .btn-cancel:hover {
    background: #cbd5e1;
}

.error-msg {
    color: #d32f2f;
    font-size: 0.8rem;
    margin-top: 8px;
}

/* ==========================================
   СКРЫТЫЕ ЭЛЕМЕНТЫ
   ========================================== */
.hidden {
    display: none !important;
}

/* ==========================================
   АДАПТИВНОСТЬ
   ========================================== */
@media (max-width: 680px) {
    .container {
        padding: 18px;
    }
    
    th, td {
        padding: 8px;
    }
    
    .upload-area {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .file-label {
        text-align: center;
    }
    
    .search-box {
        min-width: unset;
    }
    
    .admin-bar {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* ==========================================
   КНОПКА ОТМЕНЫ В МОДАЛЬНОМ ОКНЕ
   ========================================== */
.btn-cancel {
    margin-top: 12px;
    background: #e2e8f0;
    color: #333;
    border: none;
    padding: 10px 20px;
    border-radius: 60px;
    cursor: pointer;
    width: 100%;
    font-weight: 600;
    font-size: 1rem;
    transition: background 0.2s;
}

.btn-cancel:hover {
    background: #cbd5e1;
}
