/* ============================================
   LAYOUT.CSS — РАЗМЕРЫ, ОТСТУПЫ, ТИПОГРАФИКА
   Premium edition • единый стиль с login/register
   ============================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
    background: var(--bg-body);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 12.5px;
    line-height: 1.5;
    padding-top: var(--header-height);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background var(--transition-speed), color var(--transition-speed);
}

a {
    color: var(--brand-orange);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-speed);
}
a:hover { color: var(--brand-orange-dark); }

::selection { background: rgba(239, 125, 0, .18); color: var(--text-primary); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(36, 39, 43, .15);
    border-radius: var(--radius-pill);
    border: 2px solid transparent;
    background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
    background-color: rgba(36, 39, 43, .28);
    background-clip: content-box;
}
body.dark-theme ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .12);
    background-clip: content-box;
}
body.dark-theme ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, .22);
    background-clip: content-box;
}
body.dark-theme ::selection {
    background: rgba(239, 125, 0, .32);
    color: #fff;
}

/* ---------- Хедер ---------- */
.top-header {
    position: fixed; top: 0; left: 0; right: 0;
    height: var(--header-height);
    background: var(--bg-header);
    z-index: var(--z-header);
    box-shadow: 0 1px 0 rgba(255,255,255,.04) inset,
                0 4px 12px rgba(0, 0, 0, .10);
}
.header-container {
    display: flex; align-items: center; justify-content: space-between;
    height: 100%; padding: 0 14px;
}
.header-left { display: flex; align-items: center; gap: 10px; }

.menu-button {
    width: 34px; height: 34px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .06);
    color: var(--brand-orange-light);
    border-radius: var(--radius-sm);
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 18px;
    transition: all var(--transition-speed) var(--ease-out);
}
.menu-button:hover {
    background: var(--brand-orange);
    color: var(--white);
    border-color: var(--brand-orange);
    box-shadow: 0 4px 12px rgba(239, 125, 0, .30);
}

.brand-link {
    display: flex; align-items: center; gap: 8px;
    text-decoration: none; color: var(--white);
    font-weight: 700; font-size: 14px; letter-spacing: -.2px;
}
.brand-link img { height: 26px; width: auto; }

.header-right { display: flex; align-items: center; gap: 8px; }

.clock-widget {
    background: rgba(0, 0, 0, .28);
    padding: 5px 12px;
    border-radius: var(--radius-pill);
    font-family: var(--font-family);
    font-size: 11.5px;
    letter-spacing: .3px;
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, .06);
}

.theme-switcher {
    width: 34px; height: 34px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .06);
    color: var(--brand-orange-light);
    border-radius: var(--radius-sm);
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 15px;
    transition: all var(--transition-speed) var(--ease-out);
}
.theme-switcher:hover {
    background: var(--brand-orange);
    color: var(--white);
    border-color: var(--brand-orange);
}

.logout-button {
    background: rgba(239, 125, 0, .12);
    border: 1px solid rgba(239, 125, 0, .45);
    color: var(--brand-orange-light);
    padding: 5px 11px;
    border-radius: var(--radius-sm);
    font-size: 11.5px;
    font-weight: 600;
    display: inline-flex; align-items: center; gap: 6px;
    cursor: pointer;
    transition: all var(--transition-speed) var(--ease-out);
}
.logout-button:hover {
    background: var(--brand-orange);
    border-color: var(--brand-orange);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(239, 125, 0, .25);
}

/* ---------- Сайдбар ---------- */
.side-menu {
    position: fixed;
    top: var(--header-height);
    left: calc(-1 * var(--sidebar-width));
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background: var(--bg-sidebar);
    transition: left .22s var(--ease-out);
    z-index: var(--z-sidebar);
    overflow-y: auto;
    display: flex; flex-direction: column;
    box-shadow: 1px 0 0 rgba(255, 255, 255, .02),
                4px 0 20px rgba(0, 0, 0, .18);
}
.side-menu.open { left: 0; }
.menu-content { flex: 1; display: flex; flex-direction: column; padding: 10px 0; }
.main-nav { list-style: none; flex: 1; }
.nav-item { margin-bottom: 1px; }

.nav-link {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 16px;
    color: var(--text-sidebar);
    text-decoration: none;
    border-left: 2px solid transparent;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all var(--transition-speed) var(--ease-out);
}
.nav-link:hover {
    background: var(--hover-bg);
    color: var(--text-sidebar-hover);
    border-left-color: var(--brand-orange);
    padding-left: 18px;
}
.nav-link.active {
    background: var(--hover-bg);
    color: var(--text-sidebar-hover);
    border-left-color: var(--brand-orange);
}

.dropdown-arrow {
    margin-left: auto;
    transition: transform .22s var(--ease-out);
    font-size: 10px;
    opacity: .7;
}
.nav-link.expanded .dropdown-arrow { transform: rotate(90deg); }

.dropdown-menu {
    overflow: hidden;
    height: 0;
    transition: height .25s var(--ease-out);
    margin-left: 28px;
    border-left: 1px solid var(--border-sidebar);
}
.dropdown-menu .nav-link { padding: 6px 14px; font-size: 11.5px; }

.menu-footer {
    padding: 10px 16px;
    margin-top: 10px;
    border-top: 1px solid var(--border-sidebar);
    text-align: center;
    font-size: 11px;
    color: var(--text-sidebar);
}

.menu-overlay {
    position: fixed;
    top: var(--header-height);
    left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, .38);
    backdrop-filter: blur(2px);
    z-index: var(--z-overlay);
    opacity: 0; visibility: hidden;
    transition: opacity .22s var(--ease-out);
}
.side-menu.open ~ .menu-overlay { opacity: 1; visibility: visible; }

/* ---------- Контент ---------- */
.page-wrapper { min-height: calc(100vh - var(--header-height)); display: flex; flex-direction: column; }
.page-content { flex: 1; padding: 14px; }
.page-footer {
    background: var(--bg-header);
    color: var(--brand-orange-light);
    text-align: center;
    padding: 8px;
    font-size: 10.5px;
    letter-spacing: .3px;
    border-top: 1px solid rgba(239, 125, 0, .25);
}
.hidden { display: none !important; }

/* ---------- Таблицы ---------- */
.table-container {
    overflow-x: auto;
    margin: 12px 0;
    border-radius: var(--radius-lg);
    border: var(--hairline);
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
}
table { width: 100%; border-collapse: collapse; font-size: 12px; line-height: 1.5; }
thead { background: var(--bg-soft); border-bottom: var(--hairline); }
th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 700;
    font-size: 10.5px;
    color: var(--brand-orange);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: .6px;
}
tbody { background: var(--bg-card); }
td {
    padding: 9px 12px;
    border-bottom: var(--hairline-soft);
    color: var(--text-primary);
    vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background var(--transition-speed) var(--ease-out); }
tbody tr:hover { background: var(--hover-bg); }

td.id-cell code,
td code {
    font-family: var(--font-family);
    font-size: 10.5px;
    background: var(--bg-soft);
    padding: 2px 6px;
    border-radius: 5px;
    color: var(--text-muted);
}
td.user-cell a,
td a.table-link,
td.name-cell a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-speed);
}
td.user-cell a:hover,
td a.table-link:hover,
td.name-cell a:hover { color: var(--brand-orange); }

td.date-cell { font-size: 11.5px; color: var(--text-secondary); }

/* ---------- Карточки ---------- */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 14px;
    overflow: hidden;
    border: var(--hairline);
    transition: box-shadow var(--transition-speed) var(--ease-out);
}
.card:hover { box-shadow: var(--shadow-md); }

.card-header {
    padding: 10px 14px;
    background: var(--bg-card);
    border-bottom: var(--hairline);
    font-weight: 700;
    font-size: 12px;
    color: var(--text-primary);
    display: flex; align-items: center; gap: 8px;
}
.card-header::before {
    content: "";
    width: 3px; height: 14px;
    background: linear-gradient(180deg, var(--brand-orange), var(--brand-orange-light));
    border-radius: 3px;
    flex-shrink: 0;
}
body.dark-theme .card-header { color: var(--brand-orange-light); }
.card-header .text-muted { margin-left: auto; font-weight: 500; font-size: 11px; color: var(--text-muted); }
.card-body { padding: 14px; }

/* ---------- Формы ---------- */
.form-container { max-width: 720px; margin: 0 auto; }
.form-container-narrow { max-width: 420px; margin: 40px auto; }

.entity-form { display: flex; flex-direction: column; gap: 16px; }
.form-section { border-bottom: var(--hairline-soft); padding-bottom: 14px; }
.form-section:last-child { border-bottom: none; padding-bottom: 0; }
.form-section-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--brand-orange);
    margin-bottom: 10px;
    display: flex; align-items: center; gap: 6px;
    letter-spacing: .2px;
}
.form-field { margin-bottom: 12px; }
.form-hint { font-size: 14px; color: var(--text-secondary); margin-bottom: 16px; }

.field-label {
    display: flex; align-items: center; gap: 6px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.field-label.required::after { content: "*"; color: var(--danger); margin-left: 2px; }

.field-input, .form-select {
    width: 100%;
    padding: 8px 12px;
    font-size: 12.5px;
   font-family: var(--font-family);
    border: var(--hairline);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    transition: border-color var(--transition-speed) var(--ease-out),
                box-shadow var(--transition-speed) var(--ease-out),
                background var(--transition-speed) var(--ease-out),
                transform var(--transition-speed) var(--ease-out);
}
.field-input:hover, .form-select:hover {
    background: var(--bg-card);
    border-color: rgba(239, 125, 0, .18);
}
.field-input:focus, .form-select:focus {
    outline: none;
    background: var(--bg-card);
    border-color: rgba(239, 125, 0, .55);
    box-shadow: var(--focus-ring), 0 8px 22px rgba(239, 125, 0, .06);
    transform: translateY(-1px);
}
.field-input-pin {
    text-align: center;
    font-size: 24px;
    letter-spacing: 8px;
    font-family: var(--font-family);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-field-half { flex: 1; }

/* ---------- Чекбоксы ---------- */
.checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.45;
}
.checkbox-wrapper input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-top: 2px;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: var(--brand-orange);
}
.checkbox-wrapper .feather-icon {
    width: 16px;
    height: 16px;
    margin-top: 2px;
    flex-shrink: 0;
    color: var(--text-secondary);
}
.checkbox-wrapper .checkbox-text { flex: 1; }

/* ============================================
   КНОПКИ — единый премиум-стиль с login/register
   ============================================ */
button, .btn {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-family);
    line-height: 1.35;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    background: var(--grad-brand);
    color: var(--white);
    box-shadow: 0 13px 26px rgba(239, 125, 0, .18),
                0 2px 0 rgba(255, 255, 255, .18) inset;
    transition: transform .22s var(--ease-out),
                box-shadow .22s var(--ease-out),
                filter .22s var(--ease-out),
                background var(--transition-speed) var(--ease-out);
}

button:hover, .btn:hover {
    transform: translateY(-2px);
    filter: saturate(1.05);
    box-shadow: 0 18px 34px rgba(239, 125, 0, .22),
                0 2px 0 rgba(255, 255, 255, .2) inset;
}
button:active, .btn:active {
    transform: translateY(0) scale(.99);
    box-shadow: 0 6px 14px rgba(239, 125, 0, .18);
}
button:disabled, .btn:disabled {
    opacity: .55; cursor: not-allowed;
    transform: none; box-shadow: none;
}

/* Текст и иконки — над бликом */
button > *:not(.button-shine),
.btn > *:not(.button-shine) {
    position: relative;
    z-index: 2;
}

/* ---------- Стеклянный блик ---------- */
.button-shine,
button::before,
.btn::before {
    content: "";
    position: absolute;
    z-index: 1;
    top: -80%;
    left: -40%;
    width: 25%;
    height: 260%;
    opacity: .28;
    pointer-events: none;
    transform: rotate(20deg);
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, .9),
        transparent
    );
    animation: buttonShine 3.8s ease-in-out infinite;
}

/* Если в разметке уже есть <span class="button-shine"> — не дублируем */
button:has(.button-shine)::before,
.btn:has(.button-shine)::before {
    display: none;
}

@keyframes buttonShine {
    0%, 45% { left: -45%; }
    65%, 100% { left: 135%; }
}

@media (prefers-reduced-motion: reduce) {
    .button-shine,
    button::before,
    .btn::before {
        animation: none;
        opacity: 0;
    }
}

/* ---------- Варианты кнопок ---------- */
.btn-primary { background: var(--grad-brand); color: var(--white); }

.btn-secondary {
    background: var(--bg-soft);
    color: var(--text-primary);
    border: var(--hairline-strong);
    box-shadow: none;
}
.btn-secondary:hover {
    background: var(--hover-bg);
    box-shadow: none;
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
    box-shadow: 0 13px 26px rgba(217, 45, 58, .22),
                0 2px 0 rgba(255, 255, 255, .14) inset;
}
.btn-danger:hover {
    box-shadow: 0 18px 34px rgba(217, 45, 58, .28),
                0 2px 0 rgba(255, 255, 255, .16) inset;
}

.btn-success {
    background: var(--success);
    color: var(--white);
    box-shadow: 0 13px 26px rgba(46, 158, 91, .22),
                0 2px 0 rgba(255, 255, 255, .14) inset;
}
.btn-success:hover {
    box-shadow: 0 18px 34px rgba(46, 158, 91, .28),
                0 2px 0 rgba(255, 255, 255, .16) inset;
}

.btn-warning {
    background: var(--warning);
    color: #212529;
    box-shadow: 0 13px 26px rgba(232, 163, 23, .22),
                0 2px 0 rgba(255, 255, 255, .18) inset;
}
.btn-warning:hover {
    box-shadow: 0 18px 34px rgba(232, 163, 23, .28),
                0 2px 0 rgba(255, 255, 255, .2) inset;
}

button.small, .btn-sm { padding: 4px 9px; font-size: 11px; gap: 4px; }
button.small::before, .btn-sm::before {
    width: 18%;
    animation-duration: 4.5s;
}

/* ---------- Ссылки-кнопки ---------- */
a.btn,
a.btn:hover,
a.btn:focus,
a.btn:active,
a.btn:visited {
    color: var(--white);
    text-decoration: none;
}

a.btn.disabled,
a.btn[aria-disabled="true"] {
    opacity: .55;
    pointer-events: none;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ---------- Иконки внутри кнопок ---------- */
.btn .feather-icon,
button .feather-icon {
    color: currentColor;
    flex-shrink: 0;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}



/* ---------- Тёмная тема для кнопок ---------- */
body.dark-theme button,
body.dark-theme .btn,
body.dark-theme .btn-primary {
    background: var(--grad-brand-dark);
    box-shadow: 0 13px 26px rgba(0, 0, 0, .35),
                0 2px 0 rgba(255, 255, 255, .08) inset;
}
body.dark-theme button:hover,
body.dark-theme .btn:hover,
body.dark-theme .btn-primary:hover {
    box-shadow: 0 18px 34px rgba(0, 0, 0, .42),
                0 2px 0 rgba(255, 255, 255, .10) inset;
}
body.dark-theme .btn-secondary {
    background: rgba(255, 255, 255, .06);
    color: var(--text-primary);
    box-shadow: none;
}
body.dark-theme .button-shine,
body.dark-theme button::before,
body.dark-theme .btn::before {
    opacity: .16;
}

/* ---------- Детальный просмотр ---------- */
.detail-container { max-width: 900px; margin: 0 auto; }
.detail-grid { display: flex; gap: 20px; margin-bottom: 20px; }
.detail-avatar { text-align: center; min-width: 80px; }
.user-avatar {
    width: 64px; height: 64px;
    background: var(--grad-brand);
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 24px; font-weight: 700; color: var(--white);
    margin-bottom: 6px;
    box-shadow: 0 12px 30px rgba(239, 125, 0, .25);
}
.detail-info { flex: 1; }
.info-row {
    display: flex;
    padding: 8px 0;
    border-bottom: var(--hairline-soft);
    font-size: 12.5px;
    align-items: flex-start;
}
.info-row:last-child { border-bottom: none; }
.info-label {
    width: 130px; flex-shrink: 0;
    color: var(--text-secondary);
    display: flex; align-items: center; gap: 6px;
    font-weight: 600;
}
.info-value { flex: 1; color: var(--text-primary); word-break: break-word; }
.info-value code {
    background: var(--bg-soft);
    padding: 2px 6px;
    border-radius: 5px;
    font-size: 10.5px;
    font-family: var(--font-family);
    color: var(--text-muted);
}
.list-group { display: flex; flex-direction: column; }
.list-group-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px;
    border-bottom: var(--hairline-soft);
    transition: background var(--transition-speed) var(--ease-out);
}
.list-group-item:hover { background: var(--hover-bg); }
.list-group-item:last-child { border-bottom: none; }

/* ---------- Пустые состояния ---------- */
.empty-state { text-align: center; padding: 36px 20px; }
.empty-state p { color: var(--text-secondary); margin-bottom: 14px; font-size: 12.5px; }

/* Пустое состояние JS-таблиц */
.empty-block {
    padding: 24px 20px;
    text-align: center;
    color: var(--text-secondary);
}
.empty-block .empty-icon {
    display: block;
    width: 48px;
    height: 48px;
    margin: 0 auto 10px;
    opacity: .35;
}
.empty-block .empty-hint {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ---------- Сообщения ---------- */
.alert-message {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 12px;
    border-radius: 13px;
    margin-bottom: 14px;
    font-size: 12px;
    animation: fadeIn .45s var(--ease-out);
}
.alert-message.error {
    background: var(--danger-bg);
    border: 1px solid rgba(220, 53, 69, .20);
    color: var(--danger-text);
    box-shadow: 0 8px 24px rgba(220, 53, 69, .06);
}
.alert-message.success {
    background: var(--success-bg);
    border: 1px solid rgba(53, 185, 111, .20);
    color: var(--success-text);
}
.alert-message.info {
    background: var(--bg-soft);
    border: 1px solid var(--hairline);
    color: var(--text-secondary);
}
.alert-close {
    background: none; border: none;
    font-size: 18px; cursor: pointer;
    margin-left: auto; color: inherit; opacity: .65;
    transition: opacity var(--transition-speed);
}
.alert-close:hover { opacity: 1; }
.error-container { max-width: 400px; margin: 40px auto; text-align: center; }

.info-message {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    background: var(--bg-soft);
    border-left: 3px solid var(--brand-orange);
    margin: 14px 0;
    font-size: 12.5px;
}

/* ---------- Пагинация ---------- */
.pagination-wrapper {
    padding: 12px;
    border-top: var(--hairline-soft);
    display: flex;
    justify-content: center;
    background: var(--bg-card);
}
.pagination {
    display: flex;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
    align-items: center;
}
.page-item .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    background: var(--bg-card);
    border: var(--hairline);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 11.5px;
    font-weight: 600;
    transition: all var(--transition-speed) var(--ease-out);
    gap: 4px;
}
.page-item .page-link:hover {
    background: var(--brand-orange);
    border-color: var(--brand-orange);
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(239, 125, 0, .25);
}
.page-item.active .page-link {
    background: var(--grad-brand);
    border-color: transparent;
    color: var(--white);
    pointer-events: none;
    box-shadow: 0 6px 16px rgba(239, 125, 0, .25);
}
.page-item.disabled .page-link,
.page-item .page-link.disabled {
    opacity: .45;
    pointer-events: none;
    cursor: not-allowed;
}

/* ---------- Вкладки (nav-tab) ---------- */
.nav-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 14px;
    border: var(--hairline);
    overflow: hidden;
}
.nav-header {
    padding: 10px 14px;
    background: var(--bg-card);
    border-bottom: var(--hairline);
    font-weight: 700;
    font-size: 12px;
    color: var(--text-primary);
    display: flex; align-items: center; gap: 8px;
}
.nav-header::before {
    content: "";
    width: 3px; height: 14px;
    background: linear-gradient(180deg, var(--brand-orange), var(--brand-orange-light));
    border-radius: 3px;
}
body.dark-theme .nav-header { color: var(--brand-orange-light); }
.nav-header .badge-status { margin-left: 8px; }
.nav-body { padding: 12px 14px; }
.nav-body-split {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.nav-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.nav-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.nav-tabs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nav-tab {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 13px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    background: transparent;
    border: 1px solid transparent;
    transition: all var(--transition-speed) var(--ease-out);
}
.nav-tab:hover {
    background: var(--hover-bg);
    color: var(--brand-orange);
    border-color: rgba(239, 125, 0, .20);
}
.nav-tab.active {
    background: var(--grad-brand);
    color: var(--white);
    border-color: transparent;
    box-shadow: 0 6px 16px rgba(239, 125, 0, .25);
}

/* ---------- Страницы авторизации ---------- */
.auth-page { background: var(--bg-body); padding-top: 0; min-height: 100vh; }

/* ---------- Детальный просмотр (оборудование) ---------- */
.detail-layout {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--header-height));
    background: var(--bg-body);
}
.detail-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 18px;
    background: var(--bg-card);
    border-bottom: var(--hairline);
    flex-wrap: wrap; gap: 10px;
}
.detail-title {
    font-size: 16px; font-weight: 700; margin: 0;
    color: var(--text-primary); letter-spacing: -.2px;
}
.detail-tabs {
    display: flex; gap: 4px; padding: 0 18px;
    background: var(--bg-card);
    border-bottom: var(--hairline);
}
.tab-btn {
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 600;
    background: none; border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    transition: all var(--transition-speed) var(--ease-out);
}
.tab-btn:hover { color: var(--brand-orange); background: var(--hover-bg); }
.tab-btn.active { color: var(--brand-orange); border-bottom: 2px solid var(--brand-orange); }
.tab-pane { display: none; padding: 18px; }
.tab-pane.active { display: block; }
.info-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 18px; }
.info-item { display: flex; flex-direction: column; gap: 3px; }
.info-item.full-width { grid-column: span 4; }

/* ---------- Детальный просмотр с сеткой ---------- */
.detail-container-grid { display: grid; grid-template-columns: 1fr 320px; gap: 20px; }
@media (max-width: 992px) { .detail-container-grid { grid-template-columns: 1fr; } }

/* ---------- Карта ---------- */
.map-control {
    position: absolute;
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    z-index: var(--z-map);
    cursor: pointer;
    border: var(--hairline);
}
#custom-layer-switcher { top: 10px; right: 10px; min-width: 100px; }
.layer-current {
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    user-select: none;
}
.layer-dropdown {
    position: absolute; top: 100%; right: 0; margin-top: 4px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    overflow: hidden;
    min-width: 100px;
    box-shadow: var(--shadow-md);
    border: var(--hairline);
}
.layer-option {
    display: block; width: 100%;
    padding: 7px 12px;
    border: none; background: transparent;
    text-align: left; font-size: 12px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background var(--transition-speed) var(--ease-out);
}
.layer-option:hover { background: var(--hover-bg); }
.layer-option.active {
    background: var(--brand-orange-soft);
    color: var(--brand-orange);
    font-weight: 600;
}
#custom-fullscreen-btn {
    bottom: 20px; right: 10px;
    padding: 8px 12px;
    font-size: 16px; font-weight: 700;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-speed) var(--ease-out);
    border: var(--hairline);
}
#custom-fullscreen-btn:hover { background: var(--hover-bg); transform: scale(1.05); }
#custom-map-legend {
    position: absolute; bottom: 8px; left: 8px;
    background: var(--bg-card-soft);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 11px;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: var(--z-map);
    border: var(--hairline);
}
.legend-title { font-weight: 700; margin-bottom: 6px; font-size: 11px; color: var(--text-primary); }
.legend-items { display: flex; flex-direction: column; gap: 4px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--text-secondary); }
.legend-color { width: 10px; height: 10px; border-radius: 50%; }

/* ============================================
   СТАТУСЫ И БЕЙДЖИ
   ============================================ */
.status-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1.35;
    white-space: nowrap;
    letter-spacing: .15px;
    transition: all var(--transition-speed) var(--ease-out);
}
.status-new        { background: var(--status-new-bg);        color: var(--status-new-text); }
.status-accepted   { background: var(--status-accepted-bg);   color: var(--status-accepted-text); }
.status-rejected   { background: var(--status-rejected-bg);   color: var(--status-rejected-text); }
.status-suspended  { background: var(--status-suspended-bg);  color: var(--status-suspended-text); }
.status-completed  { background: var(--status-completed-bg);  color: var(--status-completed-text); }
.status-closed     { background: var(--status-closed-bg);     color: var(--status-closed-text); }
.status-rework     { background: var(--status-rework-bg);     color: var(--status-rework-text); }

.status-badges { display: flex; gap: 6px; flex-wrap: wrap; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .2px;
    white-space: nowrap;
}
.badge-success   { background: var(--success-bg); color: var(--success-text); }
.badge-danger    { background: var(--danger-bg);  color: var(--danger-text); }
.badge-warning   { background: var(--warning-bg); color: var(--warning-text); }
.badge-secondary {
    background: var(--bg-soft);
    color: var(--text-secondary);
    border: var(--hairline);
}
.badge-info {
    background: rgba(30, 136, 199, .10);
    color: var(--info);
}
.badge-full {
    display: block;
    margin-top: 4px;
}
body.dark-theme .badge-secondary {
    background: rgba(255, 255, 255, .06);
    color: var(--text-secondary);
}

.badge-prefix {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 10.5px;
    font-weight: 800;
    background: var(--grad-brand);
    color: var(--white);
    letter-spacing: .6px;
    box-shadow: 0 4px 10px rgba(239, 125, 0, .22);
}
body.dark-theme .badge-prefix { background: var(--grad-brand-dark); }
.badge-prefix-rec { color: var(--danger); }
td .badge-prefix { font-size: 10px; padding: 2px 8px; }

.badge-status {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 20px; height: 20px;
    padding: 0 8px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 700;
    background: rgba(255, 255, 255, .18);
    color: #fff;
    margin-left: 8px;
}
.badge-status.total { background: rgba(255, 255, 255, .28); }

/* ---------- Модальные окна ---------- */
.modal {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, .45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: var(--z-modal);
    align-items: center; justify-content: center;
    padding: 20px;
}
.modal.show { display: flex; }
.modal-dialog { max-width: 500px; width: 100%; margin: auto; }
.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    border: var(--hairline);
}
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 22px;
    border-bottom: var(--hairline);
    background: var(--bg-soft);
}
.modal-title {
    font-size: 14px; font-weight: 700; color: var(--text-primary);
    display: flex; align-items: center; gap: 8px;
}
.modal-close {
    background: none; border: none;
    font-size: 24px; color: var(--text-secondary);
    cursor: pointer; padding: 0 4px; line-height: 1;
    transition: color var(--transition-speed) var(--ease-out);
}
.modal-close:hover { color: var(--danger); }
.modal-body { padding: 22px; }
.modal-footer {
    display: flex; gap: 10px;
    padding: 16px 22px;
    border-top: var(--hairline);
    background: var(--bg-soft);
}

/* ---------- Photo widget ---------- */
.photo-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.photo-preview img {
    height: 54px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    border: var(--hairline);
    transition: transform var(--transition-speed) var(--ease-out);
}
.photo-preview img:hover { transform: scale(1.04); }

/* ============================================
   ТАБЛИЦЫ ОБОРУДОВАНИЯ / СИ (JS-генерируемые)
   ============================================ */
.equipment-wrapper {
    background: var(--bg-card);
    border: var(--hairline);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin: 12px 0;
}
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.equipment-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    line-height: 1.5;
}
.equipment-table thead { background: var(--bg-soft); border-bottom: var(--hairline); }
.equipment-table th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 700;
    font-size: 10.5px;
    color: var(--brand-orange);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: .6px;
}
.equipment-table td {
    padding: 9px 12px;
    border-bottom: var(--hairline-soft);
    color: var(--text-primary);
    vertical-align: middle;
}
.equipment-table tbody tr { transition: background var(--transition-speed) var(--ease-out); }
.equipment-table tbody tr:hover { background: var(--hover-bg); }
.equipment-table tbody tr:last-child td { border-bottom: none; }

.equipment-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-speed);
}
.equipment-link:hover { color: var(--brand-orange); }

.cell-note {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ---------- Блок действий в таблице ---------- */
.action-buttons {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}
.action-buttons form { display: inline-flex; margin: 0; }

/* ---------- Текстовые утилиты ---------- */
.text-muted   { color: var(--text-muted); font-weight: 500; font-size: 11px; }
.text-danger  { color: var(--danger); }
.text-success { color: var(--success); }
.text-center  { text-align: center; }

/* ---------- Утилиты ---------- */
.p-0  { padding: 0 !important; }
.m-0  { margin: 0 !important; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.w-100 { width: 100%; }
.fw-bold { font-weight: 700; }
.fs-6 { font-size: 12px; }

/* ---------- Анимации ---------- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Адаптивность ---------- */
@media (max-width: 768px) {
    .detail-grid { flex-direction: column; align-items: center; }
    .info-row { flex-direction: column; padding: 8px 0; }
    .info-label { width: 100%; margin-bottom: 4px; }
    .form-row { grid-template-columns: 1fr; gap: 10px; }
    .form-actions { flex-direction: column; gap: 10px; }
    .nav-tabs { flex-direction: column; align-items: stretch; }
    .clock-widget { display: none; }
    .info-grid { grid-template-columns: repeat(2, 1fr); }
    .info-item.full-width { grid-column: span 2; }
}
@media (max-width: 576px) {
    .brand-name { display: none; }
    th, td { padding: 7px 9px; font-size: 11px; }
    .logout-button span { display: none; }
    .info-grid { grid-template-columns: 1fr; }
    .info-item.full-width { grid-column: span 1; }
}

/* ---------- Мелкие утилиты под конец ---------- */
.conf-code { color: var(--brand-orange); font-weight: 700; margin-left: 8px; }
.icon-orange { color: var(--brand-orange); }