* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 14px;
    color: #2F2F2F;
    background: #F5F7F7;
}

/* ===== Шапка ===== */
.header {
    background: #1E6F5C;
    color: white;
}
.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 28px;
    max-width: 1400px;
    margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo {
    max-height: 46px;
    max-width: 120px;
    background: white;
    padding: 4px 8px;
    border-radius: 4px;
}
.brand-name { font-size: 20px; font-weight: 700; }
.brand-sub { font-size: 12px; color: #B8E8E5; margin-top: 2px; }
.header-right { text-align: right; }
.company { font-weight: 700; font-size: 13px; }
.version { font-size: 11px; color: #8FCFCA; margin-top: 2px; }

.accent-bar { height: 3px; background: #28A8A8; }

/* ===== Навигация ===== */
.nav {
    display: flex;
    gap: 4px;
    padding: 12px 28px 0;
    max-width: 1400px;
    margin: 0 auto;
}
.nav-item {
    padding: 10px 20px;
    border-radius: 6px 6px 0 0;
    color: #5F6B6A;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.15s;
    position: relative;
}
.nav-item:hover { background: #DEF2F2; color: #1E6F5C; }
.nav-item.active { background: #1E6F5C; color: white; }
.badge {
    display: inline-block;
    background: #FF5E5E;
    color: white;
    border-radius: 10px;
    padding: 1px 7px;
    font-size: 11px;
    margin-left: 6px;
}

/* ===== Контейнер ===== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 28px 40px;
}

/* ===== Заголовки ===== */
.page-title { font-size: 22px; color: #1E6F5C; margin: 0 0 16px; }
.subtitle { color: #94A0A0; margin: -8px 0 20px; }

/* ===== Кнопки ===== */
.btn {
    display: inline-block;
    padding: 9px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
    font-family: inherit;
    white-space: nowrap;
}
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-primary { background: #1E6F5C; color: white; }
.btn-primary:hover { background: #155347; }
.btn-secondary {
    background: white;
    color: #1E6F5C;
    border: 1px solid #1E6F5C;
}
.btn-secondary:hover { background: #EDF7F6; }
.btn-accent { background: #28A8A8; color: white; }
.btn-accent:hover { background: #1F8A8A; }
.btn-danger {
    background: white;
    color: #FF5E5E;
    border: 1px solid #FFD1D1;
}
.btn-danger:hover { background: #FFE5E5; border-color: #FF5E5E; }
.btn-ghost { background: transparent; color: #5F6B6A; padding: 5px 10px; }
.btn[type="button"] { cursor: pointer; }

/* ===== Тулбар ===== */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.toolbar > div {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.search-form { display: flex; gap: 6px; align-items: center; }

/* ===== Поля ввода ===== */
input[type="text"],
input[type="number"],
input[type="file"],
textarea,
select {
    padding: 8px 12px;
    border: 1px solid #E5E9E8;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: white;
    color: #2F2F2F;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #28A8A8;
    box-shadow: 0 0 0 3px rgba(40, 168, 168, 0.15);
}
.input-search { width: 320px; }
.input-qty { width: 75px; text-align: right; }

/* ===== Таблица ===== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.data-table thead {
    background: #1E6F5C;
    color: white;
}
.data-table th {
    padding: 11px 10px;
    text-align: center;
    font-weight: 700;
    font-size: 13px;
}
.data-table td {
    padding: 9px 10px;
    border-top: 1px solid #EEF2F1;
}
.data-table tbody tr:nth-child(even) { background: #FAFBFB; }
.data-table tbody tr:hover { background: #F0F7F6; }
.data-table .center { text-align: center; }
.data-table .right { text-align: right; }
.data-table .actions { text-align: right; white-space: nowrap; }

.inline-form { display: inline-block; }

/* ===== Флеш-уведомления ===== */
.flash {
    padding: 10px 16px;
    border-radius: 6px;
    margin-bottom: 14px;
    font-size: 14px;
}
.flash-success { background: #DEF2F2; color: #1E6F5C; border-left: 4px solid #28A8A8; }
.flash-error { background: #FFE5E5; color: #CC3D3D; border-left: 4px solid #FF5E5E; }

/* ===== Пустое состояние ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #94A0A0;
    background: white;
    border-radius: 8px;
}
.empty-state a { color: #1E6F5C; }
.empty-state .btn { margin: 4px; }

.hint { color: #94A0A0; font-size: 12px; margin-top: 10px; }
.hint a { color: #28A8A8; }

/* ===== Итоги ===== */
.totals {
    margin-top: 20px;
    padding: 16px 24px;
    background: white;
    border-radius: 8px;
    text-align: right;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.totals div { margin: 4px 0; }
.totals strong { color: #1E6F5C; font-size: 16px; }
.total-grand {
    font-size: 18px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #EEF2F1;
}

/* ===== Форма ===== */
.form {
    background: white;
    padding: 24px 28px;
    border-radius: 8px;
    max-width: 640px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.form-row { margin-bottom: 14px; }
.form-row label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    color: #5F6B6A;
    font-size: 13px;
}
.form-row input[type="text"],
.form-row input[type="number"],
.form-row textarea { width: 100%; }
.form-row.checkbox label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    color: #2F2F2F;
    cursor: pointer;
}
.form-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }

/* ===== Inline-форма ===== */
.form-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}
.form-inline label {
    font-weight: 600;
    color: #5F6B6A;
    font-size: 13px;
}

/* ===== Логотип ===== */
.logo-preview {
    margin: 8px 0;
    padding: 10px;
    background: #FAFBFB;
    border-radius: 6px;
    display: inline-block;
}

/* ===== Карточка ===== */
.card {
    background: white;
    padding: 24px 28px;
    border-radius: 8px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.card h2 { color: #1E6F5C; margin-top: 0; }
.card h3 { color: #28A8A8; margin-bottom: 8px; }
.card p, .card li { line-height: 1.6; }
.card ul, .card ol { padding-left: 22px; }
.card ol li { margin-bottom: 6px; }
.card a { color: #28A8A8; }
.contacts { background: #DEF2F2; }

/* ===== Код в тексте ===== */
code {
    background: #F0F5F2;
    padding: 2px 6px;
    border-radius: 3px;
    color: #1E6F5C;
    font-family: 'Consolas', monospace;
    font-size: 13px;
}

/* ===== Футер ===== */
.footer {
    text-align: center;
    padding: 20px;
    color: #94A0A0;
    font-size: 12px;
}
/* Бейдж "Черновик" */
.badge-draft {
    background: #F59E0B;
    color: white;
    border-radius: 10px;
    padding: 1px 8px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
    vertical-align: middle;
}