:root {
    --bg-color: #0b0e14;
    --card-bg: #12151c;
    --card-border: rgba(255, 255, 255, 0.06);
    --text: #f3f4f6;
    --text-muted: #9ca3af;
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --success: #10b981;
    --warning: #f59e0b;
}
//коментарий
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* Фон с подсветкой */
.glow-bg {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 300px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(11, 14, 20, 0) 70%);
    z-index: 0;
    pointer-events: none;
}

.app-container {
    width: 100%;
    max-width: 1300px;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Шапка */
.header {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.header-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.badge-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    width: fit-content;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.header h1 {
    font-size: 22px;
    font-weight: 700;
}

.subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Кнопки */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
}

.btn.primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn.primary:hover {
    background: var(--accent-hover);
}

.btn.full {
    width: 100%;
    justify-content: center;
}

.btn-auth {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text);
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-auth:hover {
    background: rgba(255, 255, 255, 0.1);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    padding: 6px 12px;
    border-radius: 10px;
}

.user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.btn-logout {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    padding: 4px;
    transition: color 0.15s;
}

.btn-logout:hover {
    color: #ef4444;
}

/* Сетка дашборда */
.dashboard-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 20px;
}

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.column-left, .column-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Карточки */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.card.full-height {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card-title, .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.card-title {
    gap: 10px;
    margin-bottom: 0;
}

.card-title i {
    color: var(--accent);
    font-size: 16px;
}

.card-title h3, .card-header h3 {
    font-size: 15px;
    font-weight: 600;
}

/* Скриншот галерея */
.screenshot-gallery {
    width: 100%;
    height: 180px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    border: 1px dashed var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

.overlay-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 12px;
    transition: color 0.2s;
}

.screenshot-gallery:hover .overlay-text {
    color: var(--text);
}

/* Инфо список */
.info-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: 13px;
}

.info-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
}

.info-list li b {
    color: var(--text);
}

.coord {
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
    color: var(--accent);
}

.status-active {
    color: var(--success) !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-active i {
    font-size: 8px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 6px;
    font-size: 12px;
}

.global-progress {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
}

/* Фильтры и элементы управления таблицей */
.filter-buttons {
    display: flex;
    gap: 6px;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid var(--card-border);
}

.filter-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.filter-btn:hover {
    color: var(--text);
}

.filter-btn.active {
    background: var(--card-bg);
    color: var(--text);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.table-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 200px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    font-size: 13px;
}

.search-box input {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    padding: 9px 12px 9px 36px;
    border-radius: 10px;
    color: var(--text);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.search-box input:focus {
    border-color: var(--accent);
}

/* Кастомный выпадающий список сортировки */
.custom-select {
    position: relative;
    width: 260px;
    user-select: none;
}

.select-trigger {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    padding: 9px 12px;
    border-radius: 10px;
    font-size: 13px;
    color: var(--text);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: border-color 0.2s;
}

.select-trigger:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.trigger-content {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.trigger-content i {
    color: var(--accent);
    font-size: 12px;
}

.select-trigger .arrow {
    font-size: 11px;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.custom-select.open .select-trigger .arrow {
    transform: rotate(180deg);
}

.select-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    background: #161922;
    border: 1px solid var(--card-border);
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    z-index: 50;
    display: none;
}

.custom-select.open .select-dropdown {
    display: block;
}

.select-option {
    padding: 10px 14px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s;
}

.select-option:hover {
    background: rgba(255, 255, 255, 0.05);
}

.select-option.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent);
    font-weight: 600;
}

.table-counter {
    font-size: 12px;
    color: var(--text-muted);
}

/* Таблица ресурсов */
.table-container {
    width: 100%;
    overflow: visible !important;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 13px;
}

th {
    position: sticky;
    top: 0;
    background: var(--card-bg);
    z-index: 2;
    padding: 10px 12px;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--card-border);
    cursor: pointer;
    user-select: none;
}

th:hover {
    color: var(--text);
}

th i {
    font-size: 11px;
    margin-left: 4px;
}

td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--card-border);
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: none;
}

/* ИСПРАВЛЕНО: картинка и текст выстроились в ряд слева */
.item-cell {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

/* Стили для иконок майнкрафта */
.minecraft-icon {
    width: 26px;
    height: 26px;
    min-width: 26px;
    min-height: 26px;
    object-fit: contain;
    image-rendering: pixelated;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 4px;
    padding: 2px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.editor-tag {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.edit-input {
    width: 90px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    padding: 6px 8px;
    border-radius: 6px;
    color: var(--text);
    font-size: 13px;
    outline: none;
}

.edit-input:focus {
    border-color: var(--accent);
}

.edit-input:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.01);
}

.highlight-rem {
    font-weight: 600;
    color: var(--text);
}

.mini-prog {
    width: 100px;
    height: 5px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
}

.mini-prog .bar {
    height: 100%;
    background: var(--warning);
    border-radius: 3px;
}

.mini-prog .bar.complete {
    background: var(--success);
}

/* Кастомное выпадающее меню статусов в строке (фиксированная ширина и отсутствие переносов) */
.status-dropdown-wrapper {
    position: relative;
    display: inline-block;
    user-select: none;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-width: 120px;
}

.status-badge i {
    font-size: 10px;
    transition: transform 0.2s ease;
}

.status-dropdown-wrapper.open .status-badge i {
    transform: rotate(180deg);
}

.status-badge.not-started {
    background: rgba(156, 163, 175, 0.15);
    color: #9ca3af;
    border-color: rgba(156, 163, 175, 0.3);
}

.status-badge.in-progress {
    background: rgba(217, 119, 6, 0.15);
    color: #fbbf24;
    border-color: rgba(217, 119, 6, 0.3);
}

.status-badge.closed {
    background: rgba(5, 150, 105, 0.15);
    color: #34d399;
    border-color: rgba(5, 150, 105, 0.3);
}

.status-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    background: #161922;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    z-index: 100;
    min-width: 140px;
    display: none;
}

.status-dropdown-wrapper.open .status-menu {
    display: block;
}

.status-option {
    padding: 9px 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease;
    white-space: nowrap;
}

.status-option:hover {
    background: rgba(255, 255, 255, 0.05);
}

.status-option.not-started { color: #9ca3af; }
.status-option.in-progress { color: #fbbf24; }
.status-option.closed { color: #34d399; }

/* Стили для столбца истории смен */
.history-cell {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

.history-text {
    display: inline-block;
}

/* Модальное окно */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    width: 100%;
    max-width: 380px;
    padding: 24px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 16px;
    transform: translateY(10px);
    transition: transform 0.2s ease;
}

.modal-overlay.open .modal-card {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.close-modal {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    transition: color 0.15s;
}

.close-modal:hover {
    color: var(--text);
}

.modal-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: -8px;
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-body input {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    padding: 10px 14px;
    border-radius: 10px;
    color: var(--text);
    font-size: 13px;
    outline: none;
}

.modal-body input:focus {
    border-color: var(--accent);
}

/* Кнопка добавления категории */
.btn-add-category {
    background-color: #2ecc71;
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    margin-left: 10px;
    transition: background 0.2s;
}
.btn-add-category:hover {
    background-color: #27ae60;
}

/* Выпадающий список категории в строке таблицы */
.material-cat-select {
    background: #222;
    color: #fff;
    border: 1px solid #444;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
}
.material-cat-select:focus {
    outline: none;
    border-color: #2ecc71;
}

/* Контейнер для динамических фильтров категорий */
.category-filters-container {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 15px;
    align-items: center;
}