/* ============================================
   LAYOUT.CSS - РАЗМЕРЫ, ОТСТУПЫ, ТИПОГРАФИКА
   ============================================ */

/* Reset & Base */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background: var(--bg-body);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 12px;
    line-height: 1.4;
    padding-top: var(--header-height);
    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); text-decoration: underline; }

/* Хедер */
.top-header { position: fixed; top: 0; left: 0; right: 0; height: var(--header-height); background: var(--bg-header); z-index: 1030; box-shadow: var(--shadow-sm); }
.header-container { display: flex; align-items: center; justify-content: space-between; height: 100%; padding: 0 12px; }
.header-left { display: flex; align-items: center; gap: 10px; }
.menu-button { width: 32px; height: 32px; background: rgba(255,255,255,0.1); border: none; color: var(--brand-orange-light); border-radius: var(--border-radius); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all var(--transition-speed); font-size: 18px; }
.menu-button:hover { background: var(--brand-orange); color: var(--white); }
.brand-link { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--white); font-weight: 600; font-size: 14px; }
.brand-link img { height: 28px; width: auto; }
.header-right { display: flex; align-items: center; gap: 10px; }
.clock-widget { background: rgba(0,0,0,0.3); padding: 4px 10px; border-radius: 20px; font-family: 'Courier New', monospace; font-size: 12px; color: var(--white); }
.theme-switcher { width: 32px; height: 32px; background: rgba(255,255,255,0.1); border: none; color: var(--brand-orange-light); border-radius: var(--border-radius); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: all var(--transition-speed); font-size: 16px; }
.theme-switcher:hover { background: var(--brand-orange); color: var(--white); }
.logout-button { background: rgba(239, 125, 0, 0.15); border: 1px solid var(--brand-orange); color: var(--brand-orange-light); padding: 4px 10px; border-radius: var(--border-radius); font-size: 11px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; transition: all var(--transition-speed); }
.logout-button:hover { background: var(--brand-orange); color: var(--white); }

/* Сайдбар */
.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 0.25s ease; z-index: 1020; overflow-y: auto; display: flex; flex-direction: column; box-shadow: var(--shadow-md); }
.side-menu.open { left: 0; }
.menu-content { flex: 1; display: flex; flex-direction: column; padding: 8px 0; }
.main-nav { list-style: none; flex: 1; }
.nav-item { margin-bottom: 1px; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 8px 14px; color: var(--text-sidebar); text-decoration: none; border-left: 3px solid transparent; cursor: pointer; transition: all var(--transition-speed); font-size: 12px; }
.nav-link:hover { background: var(--hover-bg); color: var(--text-sidebar-hover); border-left-color: var(--brand-orange); padding-left: 18px; }
.nav-link i { width: 16px; font-size: 14px; }
.dropdown-arrow { margin-left: auto; transition: transform 0.25s; font-size: 10px; }
.nav-link.expanded .dropdown-arrow { transform: rotate(90deg); }
.dropdown-menu { overflow: hidden; height: 0; transition: height 0.25s ease; margin-left: 28px; border-left: 1px solid var(--border-sidebar); }
.dropdown-menu .nav-link { padding: 6px 14px; font-size: 11px; }
.menu-footer { padding: 8px 14px; 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,0.5); backdrop-filter: blur(3px); z-index: 1015; opacity: 0; visibility: hidden; transition: opacity 0.25s; }
.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: 12px; }
.page-footer { background: var(--bg-header); color: var(--brand-orange-light); text-align: center; padding: 6px; font-size: 10px; border-top: 1px solid var(--brand-orange); }
.hidden { display: none !important; }

/* Таблицы */
.table-container { overflow-x: auto; margin: 10px 0; border-radius: var(--border-radius); border: 1px solid var(--border-color); background: var(--bg-card); }
table { width: 100%; border-collapse: collapse; font-size: 12px; line-height: 1.4; }
thead { background: var(--hover-bg); border-bottom: 2px solid var(--brand-orange); }
th { padding: 8px 10px; text-align: left; font-weight: 600; font-size: 11px; color: var(--brand-orange); white-space: nowrap; text-transform: uppercase; }
tbody { background: var(--bg-card); }
td { padding: 6px 10px; border-bottom: 1px solid var(--border-color); color: var(--text-primary); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--hover-bg); }
td.id-cell code { font-family: 'Courier New', monospace; font-size: 10px; background: transparent; color: var(--text-secondary); }
td.user-cell a, td a.table-link { color: var(--text-primary); text-decoration: none; font-weight: 500; }
td.user-cell a:hover, td a.table-link:hover { color: var(--brand-orange); text-decoration: underline; }

/* Карточки и Формы */
.card { background: var(--bg-card); border-radius: var(--border-radius); box-shadow: var(--shadow-sm); margin-bottom: 12px; overflow: hidden; border: 1px solid var(--border-color); }
.card-header { padding: 8px 12px; background: linear-gradient(135deg, var(--brand-orange-light), var(--bg-card)); border-bottom: 1px solid var(--brand-orange); font-weight: 600; font-size: 12px; color: var(--text-primary); display: flex; align-items: center; gap: 6px; }
body.dark-theme .card-header { background: linear-gradient(135deg, var(--brand-orange-dark), var(--bg-card)); color: var(--brand-orange-light); }
.card-header .text-muted { margin-left: auto; font-weight: normal; font-size: 11px; }
.card-body { padding: 12px; }
.form-container { max-width: 700px; margin: 0 auto; }
.entity-form { display: flex; flex-direction: column; gap: 15px; }
.form-section { border-bottom: 1px solid var(--border-color); padding-bottom: 12px; }
.form-section:last-child { border-bottom: none; padding-bottom: 0; }
.form-section-title { font-size: 12px; font-weight: 600; color: var(--brand-orange); margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.form-field { margin-bottom: 10px; }
.field-label { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 500; color: var(--text-primary); margin-bottom: 4px; }
.field-label.required::after { content: "*"; color: #dc3545; margin-left: 2px; }
.field-input, .form-select { width: 100%; padding: 5px 8px; font-size: 12px; border: 1px solid var(--border-color); border-radius: var(--border-radius); background: var(--bg-card); color: var(--text-primary); transition: all var(--transition-speed); }
.field-input:focus, .form-select:focus { outline: none; border-color: var(--brand-orange); box-shadow: 0 0 0 2px rgba(239, 125, 0, 0.1); }
.form-row { display: flex; gap: 12px; }
.form-field-half { flex: 1; }

/* Кнопки */
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 5px 10px; font-size: 12px; font-weight: 500; line-height: 1.4; text-align: center; text-decoration: none; white-space: nowrap; border-radius: var(--border-radius); border: none; cursor: pointer; transition: all var(--transition-speed); background: var(--brand-orange); color: var(--white); }
button:hover, .btn:hover { background: var(--brand-orange-dark); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
button:active, .btn:active { transform: translateY(0); }
button:disabled, .btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
button .feather-icon, .btn .feather-icon { width: 14px; height: 14px; filter: brightness(0) invert(1); }
.btn-primary { background: var(--brand-orange); color: var(--white); }
.btn-secondary { background: var(--gray-500); color: var(--white); }
.btn-danger { background: #dc3545; color: var(--white); }
.btn-success { background: #28a745; color: var(--white); }
.btn-warning { background: #ffc107; color: #212529; }
button.small, .btn-sm { padding: 3px 6px; font-size: 11px; gap: 4px; }

/* Чекбоксы */
.checkbox-wrapper { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.checkbox-wrapper input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--brand-orange); }

/* Детальный просмотр и Списки */
.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: linear-gradient(135deg, var(--brand-orange), var(--brand-orange-dark)); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 600; color: var(--white); margin-bottom: 6px; }
.detail-info { flex: 1; }
.info-row { display: flex; padding: 6px 0; border-bottom: 1px solid var(--border-color); font-size: 12px; align-items: flex-start; }
.info-row:last-child { border-bottom: none; }
.info-label { width: 120px; flex-shrink: 0; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; font-weight: 500; }
.info-label .feather-icon { width: 14px; height: 14px; }
.info-value { flex: 1; color: var(--text-primary); word-break: break-word; }
.info-value code { background: var(--hover-bg); padding: 1px 4px; border-radius: 4px; font-size: 10px; font-family: monospace; }
.list-group { display: flex; flex-direction: column; }
.list-group-item { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid var(--border-color); }
.list-group-item:last-child { border-bottom: none; }

/* Пустые состояния и Ошибки */
.empty-state { text-align: center; padding: 32px 20px; }
.empty-state .feather-icon { width: 36px; height: 36px; opacity: 0.5; margin-bottom: 12px; }
.empty-state p { color: var(--text-secondary); margin-bottom: 12px; }
.alert-message { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--border-radius); margin-bottom: 15px; font-size: 12px; }
.alert-message.error { background: rgba(220, 53, 69, 0.1); border: 1px solid #dc3545; color: #dc3545; }
.alert-close { background: none; border: none; font-size: 18px; cursor: pointer; margin-left: auto; color: inherit; opacity: 0.7; }
.error-container { max-width: 400px; margin: 40px auto; text-align: center; }

/* Пагинация */
.pagination-wrapper { padding: 10px; border-top: 1px solid var(--border-color); display: flex; justify-content: center; background: var(--bg-card); }
.pagination { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.page-item .page-link { display: flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; padding: 0 6px; background: var(--bg-card); border: 1px solid var(--border-color); color: var(--text-primary); text-decoration: none; border-radius: var(--border-radius); font-size: 11px; transition: all var(--transition-speed); }
.page-item .page-link:hover { background: var(--brand-orange); border-color: var(--brand-orange); color: var(--white); }
.page-item.active .page-link { background: var(--brand-orange); border-color: var(--brand-orange); color: var(--white); pointer-events: none; }

/* Навигационные вкладки (Tabs) */
.nav-card { background: var(--bg-card); border-radius: var(--border-radius); box-shadow: var(--shadow-sm); margin-bottom: 12px; border: 1px solid var(--border-color); overflow: hidden; }
.nav-header { padding: 8px 12px; background: linear-gradient(135deg, var(--brand-orange-light), var(--bg-card)); border-bottom: 1px solid var(--brand-orange); font-weight: 600; font-size: 12px; color: var(--text-primary); display: flex; align-items: center; gap: 6px; }
body.dark-theme .nav-header { background: linear-gradient(135deg, var(--brand-orange-dark), var(--bg-card)); color: var(--brand-orange-light); }
.nav-body { padding: 10px 12px; }
.nav-tabs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav-tab { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; color: var(--text-secondary); text-decoration: none; font-size: 12px; font-weight: 500; border-radius: var(--border-radius); transition: all var(--transition-speed); background: transparent; border: 1px solid transparent; }
.nav-tab:hover { background: var(--hover-bg); color: var(--brand-orange); }
.nav-tab.active { background: var(--brand-orange); color: var(--white); border-color: var(--brand-orange); }

/* Страницы авторизации */
.auth-page { background: var(--bg-body); padding-top: 0; display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.auth-wrapper { width: 100%; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-container { max-width: 400px; width: 100%; margin: 0 auto; }
.auth-card { background: var(--bg-card); border-radius: var(--border-radius); box-shadow: var(--shadow-md); overflow: hidden; padding: 24px; border: 1px solid var(--border-color); }
.auth-header { text-align: center; margin-bottom: 20px; }
.auth-logo { margin-bottom: 16px; }
.auth-logo img { height: 48px; width: auto; }
.auth-title { font-size: 20px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.auth-subtitle { font-size: 12px; color: var(--brand-orange); font-weight: 500; margin-bottom: 4px; }
.auth-description { font-size: 12px; color: var(--text-secondary); }
.auth-info { background: var(--hover-bg); border: 1px solid var(--brand-orange); border-radius: var(--border-radius); padding: 10px 12px; margin-bottom: 18px; display: flex; gap: 10px; }
.auth-info .feather-icon { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; }
.auth-info ul { margin-top: 6px; padding-left: 18px; }
.auth-info li { font-size: 11px; color: var(--text-secondary); margin-bottom: 2px; }
.auth-form { margin-bottom: 18px; }
.auth-button { width: 100%; padding: 8px 14px; background: var(--brand-orange); color: var(--white); border: none; border-radius: var(--border-radius); font-size: 13px; font-weight: 600; cursor: pointer; transition: all var(--transition-speed); display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 8px; }
.auth-button:hover { background: var(--brand-orange-dark); transform: translateY(-1px); }
.auth-footer { text-align: center; padding-top: 16px; border-top: 1px solid var(--border-color); }
.auth-footer p { font-size: 12px; color: var(--text-secondary); }
.auth-link { color: var(--brand-orange); text-decoration: none; font-weight: 600; }

/* Детальный просмотр оборудования и объектов */
.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: 12px 16px; background: var(--bg-card); border-bottom: 1px solid var(--border-color); flex-wrap: wrap; gap: 10px; }
.detail-title { font-size: 16px; font-weight: 600; margin: 0; color: var(--text-primary); }
.status-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { padding: 2px 8px; border-radius: 16px; font-size: 10px; font-weight: 500; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fed7aa; color: #9a3412; }
.detail-tabs { display: flex; gap: 4px; padding: 0 16px; background: var(--bg-card); border-bottom: 1px solid var(--border-color); }
.tab-btn { padding: 8px 12px; font-size: 12px; font-weight: 500; background: none; border: none; color: var(--text-secondary); cursor: pointer; border-radius: 6px 6px 0 0; transition: all 0.2s; }
.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: 16px; }
.tab-pane.active { display: block; }
.info-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 16px; }
.info-item { display: flex; flex-direction: column; gap: 2px; }
.info-item.full-width { grid-column: span 4; }

/* Карта */
.map-control { position: absolute; background: white; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.15); z-index: 1000; cursor: pointer; }
#custom-layer-switcher { top: 10px; right: 10px; min-width: 100px; }
.layer-current { padding: 6px 10px; font-size: 12px; font-weight: 500; background: white; border-radius: 8px; user-select: none; }
.layer-dropdown { position: absolute; top: 100%; right: 0; margin-top: 4px; background: white; border-radius: 8px; overflow: hidden; min-width: 100px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.layer-option { display: block; width: 100%; padding: 6px 10px; border: none; background: white; text-align: left; font-size: 12px; cursor: pointer; transition: background 0.2s; }
.layer-option:hover { background: #f0f0f0; }
.layer-option.active { background: #e6f2ff; color: #0066cc; }
#custom-fullscreen-btn { bottom: 20px; right: 10px; padding: 6px 10px; font-size: 16px; font-weight: bold; background: white; border-radius: 8px; cursor: pointer; transition: all 0.2s; }
#custom-fullscreen-btn:hover { background: #f0f0f0; transform: scale(1.05); }
#custom-map-legend { position: absolute; bottom: 5px; left: 5px; background: rgba(255,255,255,0.95); border-radius: 8px; padding: 8px 12px; font-size: 11px; box-shadow: 0 2px 8px rgba(0,0,0,0.15); backdrop-filter: blur(4px); z-index: 1000; }
.legend-title { font-weight: 600; margin-bottom: 6px; font-size: 11px; color: #333; }
.legend-items { display: flex; flex-direction: column; gap: 4px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 10px; color: #555; }
.legend-color { width: 10px; height: 10px; border-radius: 50%; }

/* ============================================
   ИКОНКИ FEATHER
   ============================================ */

.feather-icon {
    display: inline-block;
    width: 1.1em;
    height: 1.1em;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
    filter: brightness(0) invert(1);
}

.icon-sm { width: 0.9em; height: 0.9em; }
.icon-orange { filter: brightness(0) saturate(100%) invert(48%) sepia(98%) saturate(1068%) hue-rotate(346deg) brightness(97%) contrast(101%); }
.icon-white { filter: brightness(0) invert(1); }
.nav-link:hover .feather-icon { filter: brightness(0) saturate(100%) invert(67%) sepia(44%) saturate(1174%) hue-rotate(346deg) brightness(99%) contrast(96%); }

/* ---------- Основные иконки ---------- */
.icon-menu { background-image: url('/static/icons/menu.svg'); }
.icon-chevron-right { background-image: url('/static/icons/chevron-right.svg'); }
.icon-chevron-left { background-image: url('/static/icons/chevron-left.svg'); }
.icon-chevron-down { background-image: url('/static/icons/chevron-down.svg'); }
.icon-clock { background-image: url('/static/icons/clock.svg'); }
.icon-clock-history { background-image: url('/static/icons/clock.svg'); }
.icon-sun { background-image: url('/static/icons/sun.svg'); }
.icon-moon { background-image: url('/static/icons/moon.svg'); }
.icon-shield { background-image: url('/static/icons/shield.svg'); }
.icon-users { background-image: url('/static/icons/users.svg'); }
.icon-user { background-image: url('/static/icons/user.svg'); }
.icon-user-plus { background-image: url('/static/icons/user-plus.svg'); }
.icon-user-x { background-image: url('/static/icons/user-x.svg'); }
.icon-user-minus { background-image: url('/static/icons/user-minus.svg'); }
.icon-layers { background-image: url('/static/icons/layers.svg'); }
.icon-gear { background-image: url('/static/icons/settings.svg'); }
.icon-gear-wide { background-image: url('/static/icons/settings.svg'); }
.icon-settings { background-image: url('/static/icons/settings.svg'); }
.icon-map { background-image: url('/static/icons/map.svg'); }
.icon-tag { background-image: url('/static/icons/tag.svg'); }
.icon-images { background-image: url('/static/icons/image.svg'); }
.icon-image { background-image: url('/static/icons/image.svg'); }
.icon-droplet { background-image: url('/static/icons/droplet.svg'); }
.icon-person-badge { background-image: url('/static/icons/user.svg'); }
.icon-pin-map { background-image: url('/static/icons/map-pin.svg'); }
.icon-map-pin { background-image: url('/static/icons/map-pin.svg'); }
.icon-geo-alt { background-image: url('/static/icons/map-pin.svg'); }
.icon-list { background-image: url('/static/icons/list.svg'); }
.icon-bounding-box { background-image: url('/static/icons/crop.svg'); }
.icon-archive { background-image: url('/static/icons/archive.svg'); }
.icon-tools { background-image: url('/static/icons/tool.svg'); }
.icon-tool { background-image: url('/static/icons/tool.svg'); }
.icon-lightning { background-image: url('/static/icons/zap.svg'); }
.icon-zap { background-image: url('/static/icons/zap.svg'); }
.icon-box-arrow-right { background-image: url('/static/icons/log-out.svg'); }
.icon-log-out { background-image: url('/static/icons/log-out.svg'); }
.icon-person-circle { background-image: url('/static/icons/user.svg'); }
.icon-eye { background-image: url('/static/icons/eye.svg'); }
.icon-eye-off { background-image: url('/static/icons/eye-off.svg'); }
.icon-edit { background-image: url('/static/icons/edit-2.svg'); }
.icon-trash { background-image: url('/static/icons/trash-2.svg'); }
.icon-plus { background-image: url('/static/icons/plus.svg'); }
.icon-search { background-image: url('/static/icons/search.svg'); }
.icon-filter { background-image: url('/static/icons/filter.svg'); }
.icon-check { background-image: url('/static/icons/check.svg'); }
.icon-check-circle { background-image: url('/static/icons/check-circle.svg'); }
.icon-x { background-image: url('/static/icons/x.svg'); }
.icon-x-circle { background-image: url('/static/icons/x-circle.svg'); }
.icon-save { background-image: url('/static/icons/save.svg'); }
.icon-refresh { background-image: url('/static/icons/refresh-cw.svg'); }
.icon-arrow-left { background-image: url('/static/icons/arrow-left.svg'); }
.icon-arrow-right { background-image: url('/static/icons/arrow-right.svg'); }
.icon-info { background-image: url('/static/icons/info.svg'); }
.icon-alert { background-image: url('/static/icons/alert-circle.svg'); }
.icon-alert-triangle { background-image: url('/static/icons/alert-triangle.svg'); }
.icon-mail { background-image: url('/static/icons/mail.svg'); }
.icon-lock { background-image: url('/static/icons/lock.svg'); }
.icon-calendar { background-image: url('/static/icons/calendar.svg'); }
.icon-hash { background-image: url('/static/icons/hash.svg'); }
.icon-database { background-image: url('/static/icons/database.svg'); }
.icon-table { background-image: url('/static/icons/table.svg'); }
.icon-pause { background-image: url('/static/icons/pause-circle.svg'); }
.icon-play { background-image: url('/static/icons/play-circle.svg'); }
.icon-company { background-image: url('/static/icons/factory.svg'); }
.icon-factory { background-image: url('/static/icons/factory.svg'); }
.icon-grid { background-image: url('/static/icons/grid.svg'); }
.icon-server { background-image: url('/static/icons/server.svg'); }
.icon-cpu { background-image: url('/static/icons/cpu.svg'); }
.icon-hard-drive { background-image: url('/static/icons/hard-drive.svg'); }
.icon-activity { background-image: url('/static/icons/activity.svg'); }

/* ---------- Иконки для бокового меню ---------- */
.icon-book { background-image: url('/static/icons/book.svg'); }
.icon-building { background-image: url('/static/icons/factory.svg'); }
.icon-globe { background-image: url('/static/icons/globe.svg'); }
.icon-user-badge { background-image: url('/static/icons/user.svg'); }
.icon-ruler { background-image: url('/static/icons/tag.svg'); }
.icon-stop-circle { background-image: url('/static/icons/stop-circle.svg'); }
.icon-circle { background-image: url('/static/icons/circle.svg'); }
.icon-square { background-image: url('/static/icons/square.svg'); }
.icon-box { background-image: url('/static/icons/box.svg'); }
.icon-bar-chart { background-image: url('/static/icons/bar-chart.svg'); }
.icon-bar-chart-2 { background-image: url('/static/icons/bar-chart-2.svg'); }
.icon-home { background-image: url('/static/icons/home.svg'); }

/* Адаптивность */
@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 { flex-direction: column; 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: 6px 8px; font-size: 11px; }
    .logout-button span { display: none; }
    .info-grid { grid-template-columns: 1fr; }
    .info-item.full-width { grid-column: span 1; }
}



/* ============================================
   ДОПОЛНИТЕЛЬНЫЕ СТИЛИ ДЛЯ СТАТУСОВ И БЕЙДЖЕЙ
   ============================================ */

/* ---------- Статус-бейджи ---------- */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    transition: all var(--transition-speed);
}

/* Новая */
.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);
}

/* ---------- Бейдж для префиксов ---------- */
.badge-prefix {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    background: var(--brand-orange);
    color: var(--white);
    letter-spacing: 0.5px;
}

body.dark-theme .badge-prefix {
    background: var(--brand-orange-dark);
}

/* ---------- Счетчик в навигации ---------- */
.badge-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    margin-left: 8px;
}

.badge-status.total {
    background: rgba(255, 255, 255, 0.3);
}

/* ---------- Цвета иконок ---------- */
.icon-blue {
    filter: brightness(0) saturate(100%) invert(27%) sepia(94%) saturate(1996%) hue-rotate(202deg) brightness(94%) contrast(92%);
}

.icon-orange {
    filter: brightness(0) saturate(100%) invert(48%) sepia(98%) saturate(1068%) hue-rotate(346deg) brightness(97%) contrast(101%);
}

.icon-white {
    filter: brightness(0) invert(1);
}

.icon-success {
    filter: brightness(0) saturate(100%) invert(42%) sepia(72%) saturate(499%) hue-rotate(90deg) brightness(93%) contrast(87%);
}

.icon-danger {
    filter: brightness(0) saturate(100%) invert(27%) sepia(51%) saturate(3072%) hue-rotate(346deg) brightness(94%) contrast(92%);
}

/* ---------- Сетка для формы (две колонки) ---------- */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

/* ---------- Детальный просмотр с сеткой ---------- */
.detail-container-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
}

@media (max-width: 992px) {
    .detail-container-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------- Модальные окна ---------- */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    z-index: 1050;
    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(--border-radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--hover-bg);
}

.modal-title {
    font-size: 14px;
    font-weight: 600;
    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;
    transition: color var(--transition-speed);
}

.modal-close:hover {
    color: var(--danger);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-body);
}

/* ---------- Информационные сообщения ---------- */
.info-message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--border-radius);
    background: var(--hover-bg);
    border-left: 3px solid var(--brand-orange);
    margin: 15px 0;
}

.info-message .feather-icon {
    flex-shrink: 0;
    margin-top: 2px;
}

.info-message-icon {
    width: 18px;
    height: 18px;
}

/* ---------- Photo widget ---------- */
.photo-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.photo-preview img {
    height: 50px;
    border-radius: var(--border-radius);
    object-fit: cover;
    border: 1px solid var(--border-color);
}

/* ---------- Кнопки в модальных окнах ---------- */
.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-success:hover {
    background: #218838;
}

.btn-warning {
    background: var(--warning);
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
}

/* ---------- Заголовки с текстом muted ---------- */
.text-muted {
    color: var(--text-secondary);
    font-weight: normal;
    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(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-message {
    animation: fadeIn 0.3s ease;
}

/* ---------- Стили для префикса в таблице ---------- */
td .badge-prefix {
    font-size: 10px;
    padding: 1px 8px;
}

/* ---------- Стили для ID в таблице ---------- */
td.id-cell code {
    font-family: 'Courier New', monospace;
    font-size: 10px;
    background: var(--hover-bg);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--text-secondary);
}

/* ---------- Стили для дат в таблице ---------- */
td.date-cell {
    font-size: 11px;
    color: var(--text-secondary);
}

/* ---------- Стили для названий в таблице ---------- */
td.name-cell a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
}

td.name-cell a:hover {
    color: var(--brand-orange);
    text-decoration: underline;
}

/* ---------- Nav-header с бейджем ---------- */
.nav-header .badge-status {
    margin-left: 8px;
}

/* ---------- Заголовок карточки с иконкой ---------- */
.card-header .feather-icon {
    width: 16px;
    height: 16px;
}

/* ---------- Кнопка с иконкой в модалке ---------- */
.modal-title .feather-icon {
    width: 18px;
    height: 18px;
}