/* =====================================================================
   «Асар» — панель управления
   ===================================================================== */
:root {
    --bg: #f4f6f8;
    --ink: #1f2937;
    --muted: #6b7280;
    --line: #e8ebef;
    --amber: #f59e0b;
    --amber-600: #ea7a0c;
    --amber-50: #fff7e8;
    --emerald: #10b981;
    --side: #12161f;
    --side-2: #1a2030;
    --side-ink: #a5adbd;
    --grad: linear-gradient(135deg, #fbbf24 0%, #f59e0b 45%, #ea7a0c 100%);
    --radius: 1rem;
    --shadow: 0 10px 30px -14px rgba(17, 24, 39, .18);
    --ease: cubic-bezier(.22, 1, .36, 1);
    --sidebar-w: 264px;
    --bs-body-font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
body { font-family: var(--bs-body-font-family); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--amber-600); }
.min-w-0 { min-width: 0; }
.bg-accent { background: var(--amber) !important; color: #fff; }

.btn-accent {
    --bs-btn-color: #fff; --bs-btn-hover-color: #fff; --bs-btn-active-color: #fff; --bs-btn-disabled-color: #fff;
    background: var(--grad); background-size: 160% 160%; border: 0; font-weight: 700;
    transition: transform .2s var(--ease), box-shadow .2s var(--ease), background-position .4s;
}
.btn-accent:hover { background-position: 100% 100%; transform: translateY(-1px); box-shadow: 0 10px 20px -10px rgba(234, 122, 12, .7); }
.btn-icon { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 10px; border: 0; background: transparent; color: inherit; font-size: 1.2rem; }
.btn-icon:hover { background: rgba(127, 127, 127, .14); }

.brand-mark {
    width: 40px; height: 40px; border-radius: 12px; display: inline-grid; place-items: center;
    background: var(--grad); color: #fff; font-size: 1.15rem; flex-shrink: 0;
    box-shadow: 0 8px 18px -8px rgba(234, 122, 12, .8);
}
.brand-mark--lg { width: 64px; height: 64px; font-size: 1.8rem; border-radius: 18px; }

.form-control, .form-select { border-radius: .7rem; border-color: #e2e5e9; }
.form-control:focus, .form-select:focus { border-color: var(--amber); box-shadow: 0 0 0 .25rem rgba(245, 158, 11, .18); }
.form-label { font-weight: 600; font-size: .9rem; }
.modal-content { border: 0; border-radius: 1.2rem; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .35); }

/* ---------- Логин ---------- */
.login-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 15% 20%, rgba(251, 191, 36, .25), transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(16, 185, 129, .2), transparent 40%),
        #f8f9fa;
}
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.login-card {
    width: 100%; max-width: 420px; background: rgba(255, 255, 255, .85); backdrop-filter: blur(16px);
    padding: 2.5rem; border-radius: 1.6rem; border: 1px solid rgba(255, 255, 255, .8);
    box-shadow: 0 30px 70px -30px rgba(17, 24, 39, .35);
    animation: rise .6s var(--ease) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(20px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- Сайдбар ---------- */
.sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 1040;
    background: linear-gradient(180deg, var(--side) 0%, #0e1118 100%); color: var(--side-ink);
    display: flex; flex-direction: column; padding: 1.25rem 1rem;
    transition: transform .3s var(--ease);
}
.sidebar-brand { display: flex; align-items: center; gap: .75rem; padding: .25rem .5rem 1.5rem; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.sidebar-brand strong { display: block; color: #fff; font-size: 1.2rem; font-weight: 800; line-height: 1.1; }
.sidebar-brand small { font-size: .75rem; }
.sidebar-nav { flex: 1; padding-top: 1.25rem; display: flex; flex-direction: column; gap: .2rem; overflow-y: auto; }
.sidebar-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: #5d6577; padding: 0 .75rem .4rem; }
.sidebar-link {
    display: flex; align-items: center; gap: .75rem; padding: .7rem .85rem; border-radius: .75rem;
    color: var(--side-ink); text-decoration: none; font-weight: 600; font-size: .95rem; position: relative;
    transition: background .2s, color .2s;
}
.sidebar-link i { font-size: 1.1rem; width: 20px; text-align: center; }
.sidebar-link:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.sidebar-link.active { background: linear-gradient(90deg, rgba(245, 158, 11, .2), rgba(245, 158, 11, .04)); color: #fff; }
.sidebar-link.active::before { content: ''; position: absolute; left: -1rem; top: 20%; bottom: 20%; width: 4px; border-radius: 0 4px 4px 0; background: var(--amber); }
.sidebar-link.active i { color: var(--amber); }
.sidebar-user {
    display: flex; align-items: center; gap: .7rem; padding: .8rem; border-radius: .9rem;
    background: var(--side-2); color: #fff;
}
.sidebar-user small { color: var(--side-ink); font-size: .75rem; }
.sidebar-user .btn-icon { color: var(--side-ink); }
.sidebar-user .btn-icon:hover { color: #fff; }
.avatar {
    width: 40px; height: 40px; border-radius: 12px; display: inline-grid; place-items: center; flex-shrink: 0;
    background: linear-gradient(135deg, #34d399, #059669); color: #fff; font-weight: 800;
}
.avatar--xl { width: 88px; height: 88px; border-radius: 26px; font-size: 2.2rem; display: grid; }
.sidebar-backdrop { display: none; }

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: none; box-shadow: 0 0 60px rgba(0, 0, 0, .4); }
    .sidebar-backdrop.show { display: block; position: fixed; inset: 0; background: rgba(15, 18, 25, .45); z-index: 1035; }
}

/* ---------- Основная область ---------- */
.main { margin-left: var(--sidebar-w); min-height: 100vh; }
@media (max-width: 991.98px) { .main { margin-left: 0; } }
.topbar {
    position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: 1rem;
    padding: 1.1rem 2rem; background: rgba(244, 246, 248, .85); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
}
.page-title { font-size: 1.5rem; font-weight: 800; margin: 0; letter-spacing: -.02em; }
.page-sub { color: var(--muted); font-size: .9rem; }
.content { padding: 1.75rem 2rem 3rem; }
@media (max-width: 575.98px) { .content, .topbar { padding-left: 1rem; padding-right: 1rem; } }

.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; box-shadow: 0 1px 2px rgba(0, 0, 0, .03); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.1rem; }
.panel-head h2 { font-size: 1.05rem; font-weight: 800; margin: 0; }

/* ---------- KPI ---------- */
.kpi {
    display: flex; align-items: center; gap: 1rem; padding: 1.25rem; border-radius: var(--radius);
    background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink);
    transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow); color: var(--ink); }
.kpi-icon { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; font-size: 1.35rem; background: var(--tint); color: var(--c); flex-shrink: 0; }
.kpi-value { font-size: 1.8rem; font-weight: 800; line-height: 1; }
.kpi-label { color: var(--muted); font-weight: 600; font-size: .88rem; margin-top: .2rem; }
.kpi--new { --c: #3b82f6; --tint: #eaf2ff; }
.kpi--in_progress { --c: #d97706; --tint: #fff4e0; }
.kpi--done { --c: #059669; --tint: #e6f8f0; }
.kpi--mine { --c: #7c3aed; --tint: #f1eaff; }

.mini-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .85rem; }
.mini-list li { display: flex; align-items: center; gap: .8rem; }
.mini-list small { color: var(--muted); }
.mini-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: var(--cat); background: color-mix(in srgb, var(--cat) 14%, #fff); flex-shrink: 0; }
.empty-mini { text-align: center; color: var(--muted); padding: 1.5rem; }
.empty-mini i { display: block; font-size: 2rem; color: #cfd4dc; margin-bottom: .4rem; }

/* ---------- Фильтры и таблицы ---------- */
.filter-pills { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1.2rem; }
.pill {
    border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 999px;
    padding: .45rem .95rem; font-weight: 600; font-size: .88rem; display: inline-flex; align-items: center; gap: .4rem;
    transition: all .2s var(--ease);
}
.pill i.bi-circle-fill { font-size: .5rem; }
.pill span { background: #f1f3f5; border-radius: 999px; padding: .05rem .5rem; font-size: .78rem; }
.pill:hover { border-color: var(--amber); }
.pill.active { background: var(--side); color: #fff; border-color: var(--side); }
.pill.active span { background: rgba(255, 255, 255, .15); }

table.dataTable { font-size: .92rem; }
table.dataTable thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; border-bottom-width: 1px !important; }
table.dataTable tbody tr { cursor: pointer; }
table.dataTable tbody tr.row-new td:first-child { box-shadow: inset 3px 0 0 #3b82f6; }
table.dataTable tbody tr.row-mine td:first-child { box-shadow: inset 3px 0 0 #7c3aed; }
div.dt-container .dt-search input { border-radius: .7rem; padding: .4rem .8rem; }
div.dt-container .dt-paging .page-link { border-radius: .55rem !important; margin: 0 2px; border: 0; color: var(--ink); }
div.dt-container .dt-paging .page-item.active .page-link { background: var(--amber); color: #fff; }
.status-badge { display: inline-flex; align-items: center; gap: .35rem; font-weight: 700; font-size: .78rem; padding: .35rem .7rem; border-radius: 999px; white-space: nowrap; }
.status-badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-new { color: #2563eb; background: #eaf2ff; }
.st-in_progress { color: #b45309; background: #fff4e0; }
.st-done { color: #047857; background: #e6f8f0; }
.st-canceled { color: #4b5563; background: #f1f3f5; }
.cell-sub { display: block; color: var(--muted); font-size: .8rem; }
.vol-chip { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; }
.vol-chip .dot { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: .75rem; color: #fff; background: linear-gradient(135deg, #34d399, #059669); }
.vol-chip.me .dot { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.btn-take { white-space: nowrap; }

/* ---------- Модалка заявки ---------- */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.2rem; }
.detail-item small { display: block; color: var(--muted); font-weight: 600; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; margin-bottom: .15rem; }
.detail-item strong, .detail-item a { font-weight: 700; }
.detail-block { background: #f8f9fa; border-radius: .9rem; padding: 1rem 1.1rem; margin-bottom: 1rem; white-space: pre-wrap; word-break: break-word; }
.detail-photo { border-radius: .9rem; max-height: 360px; width: 100%; object-fit: cover; cursor: zoom-in; }
.report-box { border: 1px solid #c6f0de; background: #f2fcf8; border-radius: .9rem; padding: 1rem 1.1rem; }
.result-switch { display: flex; gap: .5rem; }
.result-switch .btn { flex: 1; font-weight: 700; border-radius: .7rem; }
.confirm-icon { width: 60px; height: 60px; border-radius: 50%; margin: 0 auto 1rem; display: grid; place-items: center; font-size: 1.8rem; background: #fff1f1; color: #dc3545; }

.toast { border: 0; border-radius: .9rem; box-shadow: var(--shadow); }
