:root {
    --bg-body: #0E0E0E;
    --bg-surface: #181818;
    --bg-input: #1F1F1F;
    --text-main: #F5F0EB;
    --text-muted: #9A9A9A;
    --accent: #C22A42;
    --accent-hover: #A12235;
    --accent-rgb: 194, 42, 66;
    --accent-hover-rgb: 161, 34, 53;
    --border: #2A2A2A;

    /* ─── Расширенные (устранение хардкода) ─── */
    --yellow: #F57C00;
    --success: #81c784;
    --info: #64b5f6;
    --danger: #ff6b81;
    --white-on-accent: #ffffff;
    --header-bg: rgba(24, 24, 24, 0.95);
    --overlay-backdrop: rgba(0, 0, 0, 0.75);
    --overlay-modal: rgba(0, 0, 0, 0.85);
    --modal-backdrop: rgba(10, 10, 10, 0.95);
    --shadow-soft: rgba(0, 0, 0, 0.25);
    --shadow-color: rgba(0, 0, 0, 0.4);
    --shadow-strong: rgba(0, 0, 0, 0.6);
    --skeleton-base: rgba(255, 255, 255, 0.03);
    --skeleton-highlight: rgba(255, 255, 255, 0.08);

    --font-heading: 'DM Sans', sans-serif;
    --font-body: 'DM Sans', sans-serif;
    --fw-regular: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-pill: 100px;
    --transition: 0.3s ease;
}

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

html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
    font-family: var(--font-body);
    background: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: clip;
    touch-action: manipulation;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 16px;
}

@supports not (overflow: clip) {
    html, body { overflow-x: hidden; }
}

h1, h2, h3 { font-family: var(--font-heading); font-weight: 400; line-height: 1.2; }
button { cursor: pointer; font-family: inherit; border: none; transition: var(--transition); -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img, svg, video, canvas, audio, iframe, embed, object { max-width: 100%; height: auto; }

.tab-title { font-size: 28px; margin-bottom: 20px; }
.w-100 { width: 100%; }

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

/* ═══════════════ LOGO ═══════════════ */
.logo {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    flex-shrink: 0;
    text-decoration: none;
    transition: var(--transition);
    min-width: 0;
}
.logo-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.logo-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    display: none;
}
.logo-img.is-visible { display: block; }
.logo--compact .logo-img { width: 32px; height: 32px; }
.logo-main {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 600;
    color: var(--text-main);
    letter-spacing: 0.01em;
    line-height: 1.1;
    transition: color 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.logo-slogan {
    font-family: var(--font-body);
    font-size: 10px;
    font-weight: 500;
    color: var(--accent);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-top: 2px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.3s ease;
}
.logo-slogan:empty { display: none; }

/* ═══════════════ BUTTONS ═══════════════ */
.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 42px;
    padding: 0 20px;
    border-radius: var(--radius-pill);
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.btn-primary svg,
.btn-secondary svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    stroke-width: 2;
}
.btn-primary {
    background: var(--accent);
    color: var(--white-on-accent);
    border: 1px solid transparent;
}
.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(var(--accent-rgb), 0.3);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    border-color: var(--text-main);
    background: var(--skeleton-base);
}

.btn-save {
    background: var(--accent);
    color: var(--white-on-accent);
    padding: 14px 36px;
    border-radius: var(--radius-pill);
    font-size: 16px;
    font-weight: 500;
    min-height: 50px;
}
.btn-save:hover { background: var(--accent-hover); }

.btn-cancel {
    background: transparent;
    color: var(--text-main);
    padding: 14px 36px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    font-size: 16px;
    min-height: 50px;
}
.btn-cancel:hover { border-color: var(--text-main); }

.btn-danger {
    background: var(--accent);
    color: var(--white-on-accent);
    padding: 14px 36px;
    border-radius: var(--radius-pill);
    border: none;
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 500;
    min-height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: var(--transition);
}
.btn-danger:hover { background: var(--accent-hover); }

.btn-action {
    padding: 11px;
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    white-space: nowrap;
    min-width: 0;
    cursor: pointer;
    transition: var(--transition);
}
.btn-edit,
.btn-toggle {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--border);
}
.btn-edit:hover,
.btn-toggle:hover { background: rgba(255, 255, 255, 0.1); }
.btn-delete {
    background: rgba(var(--accent-rgb), 0.1);
    color: var(--accent);
    border: 1px solid rgba(var(--accent-rgb), 0.3);
}
.btn-delete:hover {
    background: rgba(var(--accent-rgb), 0.2);
    color: var(--accent-hover);
}

/* ═══════════════ FORMS ═══════════════ */
.form-group { margin-bottom: 24px; min-width: 0; width: 100%; }
.form-group label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 500;
}
.form-control {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 16px;
    outline: none;
    transition: var(--transition);
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}
.form-control:focus { border-color: var(--accent); }
textarea.form-control { resize: vertical; min-height: 100px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; width: 100%; }
.form-hint { font-size: 14px; color: var(--text-muted); margin-top: 6px; }
.form-checks {
    display: flex;
    gap: 20px 32px;
    flex-wrap: wrap;
    padding: 16px 0;
    margin-top: 10px;
    margin-bottom: 24px;
}

.checkboxes-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 24px;
    margin-bottom: 12px;
    width: 100%;
    min-width: 0;
}
.checkboxes-wrapper .form-check { margin-bottom: 0; gap: 12px; }

.form-check {
    display: inline-flex !important;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 15px;
    line-height: 1.45;
    user-select: none;
    color: var(--text-main);
    width: fit-content;
    max-width: 100%;
    min-width: 0;
}
.form-check input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    box-sizing: border-box;
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    padding: 0;
    margin: 0;
    margin-top: 2px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: var(--bg-input);
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    outline: none;
}
.form-check input[type="checkbox"]:checked {
    background: var(--accent);
    border-color: var(--accent);
}
.form-check input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 45%;
    left: 50%;
    width: 5px;
    height: 10px;
    border: solid var(--white-on-accent);
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -50%) rotate(45deg);
}
.form-check input[type="checkbox"]:checked + span { color: var(--text-main); }

/* ═══════════════ ОБЩИЙ ЦВЕТ ДЛЯ ВСЕХ КНОПОК ═══════════════ */
.btn-primary,
.btn-save,
.btn-cancel,
.btn-danger,
.btn-action,
.btn-edit,
.btn-toggle,
.btn-delete,
.btn-upload,
.btn-icon-add,
.btn-tool,
.btn-back,
.mobile-filter-apply {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: var(--white-on-accent) !important;
    box-shadow: 0 4px 14px rgba(var(--accent-rgb), 0.25) !important;
}

.btn-primary:hover,
.btn-save:hover,
.btn-cancel:hover,
.btn-danger:hover,
.btn-action:hover,
.btn-edit:hover,
.btn-toggle:hover,
.btn-delete:hover,
.btn-upload:hover,
.btn-icon-add:hover,
.btn-tool:hover,
.btn-back:hover,
.mobile-filter-apply:hover {
    background: var(--accent-hover) !important;
    border-color: var(--accent-hover) !important;
    color: var(--white-on-accent) !important;
    box-shadow: 0 6px 20px rgba(var(--accent-rgb), 0.4) !important;
}

/* ═══════════════ MEDIA ═══════════════ */
@media (max-width: 768px) {
    .tab-title { font-size: 24px; margin-bottom: 16px; }
    .form-row { grid-template-columns: 1fr; gap: 0; }
    .checkboxes-wrapper { flex-direction: column; gap: 12px; }
    .logo-main { font-size: 20px; }
    .logo-img { width: 32px; height: 32px; }
}