/* Modern Admin Panel Styles */

:root {
    --primary: #2c3e50;
    --secondary: #e74c3c;
    --accent: #3498db;
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
    --light: #ecf0f1;
    --dark: #1a252f;
}

/* ── Sidebar ────────────────────────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 48px 0 0;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
}

.sidebar-sticky {
    position: relative;
    top: 0;
    height: calc(100vh - 48px);
    padding-top: .5rem;
    overflow-x: hidden;
    overflow-y: auto;
}

.sidebar .nav-link {
    font-weight: 500;
    color: #333;
    padding: 10px 20px;
    border-left: 3px solid transparent;
    transition: color .15s, background .15s, border-color .15s;
}

.sidebar .nav-link:hover {
    color: var(--accent);
    background: rgba(52, 152, 219, 0.08);
}

.sidebar .nav-link.active {
    color: var(--accent);
    background: rgba(52, 152, 219, 0.12);
    border-left: 3px solid var(--accent);
}

.sidebar .nav-link i {
    margin-right: 8px;
    width: 16px;
    text-align: center;
}

/* ── Dark mode sidebar ──────────────────────────────────────────────────────── */
/* bg-light в Bootstrap 5.3 НЕ адаптируется к data-bs-theme="dark" — явный override */
[data-bs-theme="dark"] #sidebarMenu {
    background-color: #1e2530 !important;
    box-shadow: inset -1px 0 0 rgba(255,255,255,.06);
}
[data-bs-theme="dark"] .sidebar-heading {
    color: #6c757d !important;
}
[data-bs-theme="dark"] .sidebar .nav-link {
    color: #adb5bd;
}
[data-bs-theme="dark"] .sidebar .nav-link:hover {
    color: #74b9e8;
    background: rgba(52, 152, 219, 0.12);
}
[data-bs-theme="dark"] .sidebar .nav-link.active {
    color: #74b9e8;
    background: rgba(52, 152, 219, 0.18);
    border-left-color: #74b9e8;
}

/* ── Operation row highlights ─────────────────────────────────────────────── */
.op-row-done     { background: #f0fdf4; }
.op-row-claimed  { background: #fffbeb; }
.op-row-reserved { background: #f8f9fa; }

[data-bs-theme="dark"] .op-row-done     { background: rgba(39, 174, 96, .12); }
[data-bs-theme="dark"] .op-row-claimed  { background: rgba(243, 156, 18, .10); }
[data-bs-theme="dark"] .op-row-reserved { background: transparent; }

/* ── Direction section title ────────────────────────────────────────────────── */
.dir-section-title {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .02em;
    padding: .5rem .75rem;
    background: #f1f5f9;
    border-radius: 6px;
    margin-bottom: .5rem;
    transition: background .2s;
}
[data-bs-theme="dark"] .dir-section-title {
    background: rgba(255,255,255,.07);
}

/* ── Cards ─────────────────────────────────────────────────────────────────── */
.card.border-left-primary  { border-left: 4px solid var(--accent); }
.card.border-left-warning  { border-left: 4px solid var(--warning); }
.card.border-left-info     { border-left: 4px solid #17a2b8; }
.card.border-left-success  { border-left: 4px solid var(--success); }

/* ── Photo Gallery ──────────────────────────────────────────────────────────── */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}
.photo-grid img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform .3s;
}
.photo-grid img:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
}

/* ── Table ──────────────────────────────────────────────────────────────────── */
.table thead th {
    border-top: none;
    background: #f8f9fa;
    font-weight: 600;
    color: var(--primary);
}
.table tbody tr:hover { background: rgba(0,0,0,.025); }

[data-bs-theme="dark"] .table thead th {
    background: rgba(255,255,255,.04);
    color: #e9ecef;
}
[data-bs-theme="dark"] .table tbody tr:hover {
    background: rgba(255,255,255,.04);
}

/* ── Badges ─────────────────────────────────────────────────────────────────── */
.badge {
    padding: 5px 10px;
    font-weight: 500;
}

/* ── Filters card ───────────────────────────────────────────────────────────── */
.filters-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}
[data-bs-theme="dark"] .filters-card {
    background: rgba(255,255,255,.04);
}

/* ── Smooth theme transition ────────────────────────────────────────────────── */
body, .card, .sidebar, .table, .modal-content, .navbar {
    transition: background-color .2s, color .2s, border-color .2s;
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar { position: static; padding: 0; }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
    .sidebar .nav-link {
        padding: 9px 14px;
        font-size: 0.94rem;
    }

    .sidebar .nav-link i {
        margin-right: 6px;
    }
}
