/* ADDEV layout & components — tokens live in survivor-theme.css */

::selection {
    background-color: rgba(115, 181, 18, 0.35);
    color: var(--site-text);
}

body {
    font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
    line-height: 1.6;
    color: var(--site-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

code, pre, .font-mono {
    font-family: "JetBrains Mono", ui-monospace, monospace;
}

.site-main {
    flex: 1;
    width: 100%;
    max-width: 80rem;
    margin-left: auto;
    margin-right: auto;
    padding: 2rem 1.5rem;
}

.site-main--wide {
    max-width: 90rem;
}

.site-main--embed {
    padding-top: 1rem;
    padding-bottom: 1.5rem;
    min-height: 100vh;
}

.site-main--fluid {
    max-width: none;
    width: 100%;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}
/* Навигация */
.navbar,
#mainNavbar {
    z-index: 1030;
    position: sticky;
    top: 0;
}

.site-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
    border-radius: 0.25rem;
    overflow: hidden;
}

.site-brand-mark__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.site-brand-mark--footer {
    width: 1.5rem;
    height: 1.5rem;
}

.site-brand-text {
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.navbar-nav .nav-link:hover {
    transform: none;
}

.navbar-nav .nav-link.active {
    background-color: transparent;
    border-radius: 0;
}

/* Dropdown меню должны быть выше подменю */
.navbar .dropdown-menu {
    z-index: 1040;
}

/* Подменю навигации */
.subnavbar {
    position: sticky;
    top: 4rem;
    z-index: 1010;
    background-color: var(--site-surface) !important;
    border-bottom: 1px solid var(--site-border);
    box-shadow: none;
}

.subnavbar .nav {
    gap: 0.25rem;
}

.subnavbar .nav-link {
    color: var(--site-text);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-size: 0.9rem;
}

.subnavbar .nav-link:hover {
    background-color: var(--survivor-brand-hover, rgba(115, 181, 18, 0.1));
    color: var(--site-text);
}

[data-bs-theme="light"] .subnavbar .nav-link:hover {
    background-color: rgba(0, 0, 0, 0.06);
    color: var(--site-text);
}

.subnavbar .nav-link i {
    margin-right: 0.25rem;
}

/* Скрытие элементов подменю по умолчанию */
.submodule-nav {
    display: none;
}

.submodule-nav.active-module {
    display: block;
}

/* Глобальный селектор активной категории в подменю квестового модуля */
.subnav-category-selector {
    min-width: 200px;
}

.subnav-category-selector.active-module {
    display: flex;
}

.subnav-category-selector select {
    background-color: var(--site-surface);
    color: var(--site-text);
    border-color: var(--site-border);
}

/* Скроллбар для подменю */
.subnavbar .nav {
    scrollbar-width: thin;
    scrollbar-color: var(--site-muted) transparent;
}

.subnavbar .nav::-webkit-scrollbar {
    height: 6px;
}

.subnavbar .nav::-webkit-scrollbar-track {
    background: transparent;
}

.subnavbar .nav::-webkit-scrollbar-thumb {
    background-color: color-mix(in srgb, var(--site-muted) 50%, transparent);
    border-radius: 3px;
}

.subnavbar .nav::-webkit-scrollbar-thumb:hover {
    background-color: color-mix(in srgb, var(--site-muted) 75%, transparent);
}


/* @deprecated compat — Bootstrap .card; templates use surface-card / catalog-card */
.card {
    border: 1px solid var(--site-border);
    box-shadow: none;
    transition: border-color 0.2s ease;
}

.card:hover {
    box-shadow: none;
    transform: none;
}

.card-header {
    background-color: var(--bs-tertiary-bg);
    border-bottom: 1px solid var(--site-border);
    font-weight: 600;
    color: var(--site-text);
}

.card-header h1,
.card-header h2,
.card-header h3,
.card-header h4,
.card-header h5,
.card-header h6,
.card-header .h1,
.card-header .h2,
.card-header .h3,
.card-header .h4,
.card-header .h5,
.card-header .h6 {
    color: inherit;
}

.card-header.bg-light {
    background-color: var(--bs-tertiary-bg) !important;
    color: var(--site-text) !important;
}

/* Read-only text / JSON on detail pages */
.detail-field {
    background-color: var(--bs-tertiary-bg);
    border: 1px solid var(--site-border);
    color: var(--site-text);
}

.detail-field pre,
.json-viewer {
    background-color: var(--bs-tertiary-bg);
    color: var(--site-text);
}

.json-viewer pre,
.json-viewer code {
    color: var(--site-text);
    background-color: transparent;
}

.catalog-empty-icon {
    font-size: 3rem;
}

/* Кнопки */
.btn {
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: none;
}

/* Таблицы */
.table {
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: none;
    border: 1px solid var(--site-border);
}

.table thead th {
    background-color: var(--bs-tertiary-bg);
    border-bottom: 2px solid var(--primary-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
}

.table tbody tr {
    transition: all 0.3s ease;
}

.table tbody tr:hover {
    background-color: var(--bs-tertiary-bg);
}

/* Формы */
.form-control {
    border-radius: 0.5rem;
    border: 1px solid var(--site-border);
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--survivor-brand, var(--primary-color));
    box-shadow: 0 0 0 0.2rem var(--survivor-brand-ring, rgba(115, 181, 18, 0.25));
}

.form-label {
    font-weight: 600;
    color: var(--site-text);
}

/* Алерты */
.alert {
    border: 1px solid var(--site-border);
    border-radius: 0.5rem;
    box-shadow: none;
}

.alert-success {
    background-color: rgba(25, 135, 84, 0.1);
    color: var(--success-color);
    border-left: 4px solid var(--success-color);
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
    border-left: 4px solid var(--danger-color);
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.1);
    color: var(--warning-text);
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background-color: rgba(13, 202, 240, 0.1);
    color: var(--info-color);
    border-left: 4px solid var(--info-color);
}

/* Модальные окна */
.modal-content {
    border: 1px solid var(--site-border);
    border-radius: 1rem;
    box-shadow: none;
}

.modal-header {
    border-bottom: 1px solid var(--site-border);
    border-radius: 1rem 1rem 0 0;
}

.modal-footer {
    border-top: 1px solid var(--site-border);
    border-radius: 0 0 1rem 1rem;
}

/* Пагинация */
.pagination {
    justify-content: center;
}

.page-link {
    border: 1px solid var(--site-border);
    color: var(--survivor-brand, var(--primary-color));
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.page-link:hover {
    background-color: var(--survivor-brand-hover, rgba(115, 181, 18, 0.1));
    color: var(--survivor-brand, var(--primary-color));
    transform: none;
}

.page-item.active .page-link {
    background-color: var(--survivor-brand, var(--primary-color));
    border-color: var(--survivor-brand, var(--primary-color));
    color: var(--survivor-brand-fg, #070b0e);
}

/* Футер */
.site-footer {
    margin-top: 6rem;
    padding: 3rem 0;
    background-color: transparent;
    border-top: 1px solid var(--site-border);
    color: var(--site-text);
}

.site-footer-inner {
    max-width: 80rem;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: center;
    justify-content: space-between;
}

@media (min-width: 768px) {
    .site-footer-inner {
        flex-direction: row;
    }
}

.site-footer-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    color: var(--site-text);
}

.site-brand-wordmark {
    font-weight: 800;
    letter-spacing: -0.02em;
}

.site-footer-brand .brand-name-base {
    color: var(--site-text);
}

.site-footer-brand .brand-accent {
    color: var(--survivor-brand, #73b512);
}

.site-footer-title {
    color: var(--site-text);
    font-weight: 700;
}

.site-footer-muted {
    color: var(--site-muted) !important;
}

.site-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.site-footer-links a {
    color: var(--site-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.site-footer-links a:hover {
    color: var(--survivor-brand, #73b512);
}

footer {
    margin-top: auto;
}

/* Адаптивность */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    /* Адаптивность подменю */
    .subnavbar .nav-link {
        font-size: 0.85rem;
        padding: 0.4rem 0.75rem;
    }
    
    .subnavbar .nav-link i {
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .navbar-brand {
        font-size: 1.1rem;
    }

    #mainNavbar .navbar-tool-btn {
        max-width: 8.5rem;
        padding: 0.35rem 0.6rem;
    }
    
    .navbar-nav .nav-link {
        font-size: 0.9rem;
        padding: 0.5rem 0.75rem;
    }
    
    .subnavbar .nav-link {
        font-size: 0.8rem;
        padding: 0.35rem 0.6rem;
    }
}

.shop-action-bar {
    align-items: stretch;
}

.shop-action-bar .btn,
.shop-action-bar form .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    line-height: 1.25;
    white-space: nowrap;
    font-size: 1rem;
    padding: 0.4rem 0.8rem;
}

.shop-action-bar form {
    display: inline-flex;
    margin: 0;
}

footer h5 {
    color: var(--site-text);
    font-weight: 700;
}

/* Page headers */
.page-header {
    margin-bottom: 2rem;
}

.page-header__row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}

.page-title {
    font-size: 1.875rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0;
    color: var(--site-text);
}

.page-subtitle {
    font-size: 0.875rem;
    color: var(--site-muted);
    margin: 0.25rem 0 0;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.page-header__main {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    min-width: 0;
}

.page-header--admin {
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--site-border);
}

.page-header--admin .page-header__row {
    align-items: center;
}

.page-header--admin .page-header__eyebrow {
    margin: 0 0 0.625rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--survivor-brand, #73b512);
}

.page-header--admin .page-header-icon {
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.page-header--admin .page-header-icon i {
    font-size: 1.25rem;
    color: var(--survivor-brand, #73b512);
}

.page-header--admin .page-title {
    font-size: 1.625rem;
}

.section-title {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--site-text);
}

.section-subtitle {
    color: var(--site-muted);
    margin-bottom: 0;
}

.module-page-header {
    margin-bottom: 0;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
}

.module-page-header h3,
.module-page-header h5 {
    font-size: 1.875rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0;
}

.module-page-header i,
.module-page-header .module-color {
    color: var(--survivor-brand, #73b512) !important;
}

.admin-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 0;
    align-items: start;
}

.admin-sidebar {
    background: var(--site-surface);
    border: 1px solid var(--site-border);
    border-radius: 0.5rem;
    position: sticky;
    top: 1rem;
    align-self: start;
    max-height: calc(100vh - 8rem);
    overflow-y: auto;
    z-index: 1020;
}

.admin-sidebar-brand {
    padding: 1rem 1.25rem;
    font-weight: 600;
    border-bottom: 1px solid var(--site-border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-sidebar-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--site-border);
}

.admin-sidebar-nav {
    padding: 0.5rem 0;
}

.admin-sidebar-nav .nav-section {
    padding: 0.75rem 1.25rem 0.25rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--site-muted);
    list-style: none;
}

.admin-sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 1.25rem;
    color: var(--site-text);
    border-radius: 0;
    transition: background-color 0.15s, color 0.15s;
}

.admin-sidebar-nav .nav-link:hover {
    background: var(--bs-secondary-bg);
}

.admin-sidebar-nav .nav-link i {
    width: 1.25rem;
    text-align: center;
}

.admin-content {
    padding: 0.25rem 0 0 1rem;
    min-width: 0;
}

.admin-content-header {
    margin-bottom: 1rem;
}

.admin-sidebar-backdrop {
    display: none;
}

@media (max-width: 991.98px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: fixed;
        top: 56px;
        left: 0;
        width: 260px;
        height: calc(100vh - 56px);
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        border-right: 1px solid var(--site-border);
    }

    .admin-sidebar.show {
        transform: translateX(0);
    }

    .admin-sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 56px 0 0 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 1019;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.25s, visibility 0.25s;
    }

    .admin-sidebar-backdrop.show {
        opacity: 1;
        visibility: visible;
    }

    body.admin-sidebar-open {
        overflow: hidden;
    }
}

/* Quest list / modal table utilities */
.filter-control--220 {
    max-width: 220px;
}

.filter-control--200 {
    max-width: 200px;
}

.filter-control--180 {
    max-width: 180px;
}

.filter-control--150 {
    max-width: 150px;
}

.quest-col-id {
    width: 80px;
}

.quest-col-title {
    width: 300px;
    max-width: 300px;
}

.quest-cell-ellipsis {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.quest-sort-icon-idle {
    opacity: 0.3;
}

.empty-state-icon {
    font-size: 3rem;
}

.scroll-panel-sm {
    max-height: 200px;
    overflow-y: auto;
}

.scroll-panel-md {
    max-height: 400px;
    overflow-y: auto;
}

.translation-col-key {
    width: 30%;
    min-width: 200px;
}

.translation-col-text {
    width: 45%;
}

.translation-col-date {
    width: 15%;
    min-width: 120px;
}

.translation-col-actions {
    width: 10%;
    min-width: 100px;
}

.translation-cell-key {
    max-width: 250px;
}

.translation-cell-text {
    max-width: 300px;
}

.table-col-40 {
    width: 40%;
}

.table-col-60 {
    width: 60%;
}

.text-nowrap-cell {
    white-space: nowrap;
}

.scroll-panel-md-bordered {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--site-border);
    border-radius: 0.375rem;
}

.quest-form-col-28 {
    flex: 0 0 28%;
    max-width: 28%;
}

.quest-form-col-24 {
    flex: 0 0 24%;
    max-width: 24%;
}

.quest-form-col-10 {
    flex: 0 0 10%;
    max-width: 10%;
}

@media (min-width: 992px) {
    .quest-objective-col-main {
        flex: 0 0 auto;
        width: 75%;
    }

    .quest-objective-col-help {
        flex: 0 0 auto;
        width: 25%;
    }
}

.form-switch-lg {
    transform: scale(1.5);
    width: 2.5rem;
    height: 1.3rem;
}

.form-switch-row {
    height: 38px;
}

/* Editor Terje — layout utilities (replaces inline style=) */
.editor-raw-view {
    min-height: 240px;
}

.editor-cfg-bool-switch {
    width: 3em;
    height: 1.5em;
    float: none;
}

.editor-cfg-value-input {
    width: 70px;
    text-align: center;
}

.editor-cfg-value-col {
    width: 120px;
    text-align: center;
}

.editor-cfg-table-scroll {
    max-height: 60vh;
    overflow-y: auto;
}

.editor-cfg-save-bar {
    position: sticky;
    bottom: 0;
    z-index: 10;
}

.editor-set-select-name {
    cursor: pointer;
}

.editor-set-actions {
    flex-shrink: 0;
}
