/* ============================================================
   Işgärler sanawy — Modern Dashboard Theme
   ============================================================ */


:root {
    --bg: #F5F9FC;
    --surface: #FFFFFF;
    --border: #DCE8F0;
    --border-soft: #E8F0F6;
    --ink: #1A2B3C;
    --ink-soft: #5A7080;
    --ink-faint: #8AA0B0;

    --accent: #4A9FD4;
    --accent-hover: #2F7FB0;
    --accent-soft: #EAF2F8;
    --sky-deep: #2F7FB0;
    --teal: #3FA89B;
    --green: #2E9E6B;
    --green-soft: #E5F4EC;

    --danger: #E05252;
    --danger-soft: #FBEAEA;
    --amber: #EF9F27;
    --amber-soft: #FDF1DA;

    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --shadow: 0 2px 8px rgba(74,159,212,0.08);
    --shadow-hover: 0 6px 24px rgba(74,159,212,0.10);

    --font-display: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-body: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ---------- Base ---------- */
body {
    background: var(--bg);
    font-family: var(--font-body);
    color: var(--ink);
    margin: 0;
    padding: 0;
}

.page-container {
    max-width: 1200px;
    margin: 32px auto;
    padding: 0 20px;
}

/* ---------- Page head ---------- */
.page-head {
    margin-bottom: 24px;
}

.page-head h1 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.5rem;
    letter-spacing: -0.01em;
    color: var(--ink);
    margin: 0;
}

/* ---------- Buttons ---------- */
.btn-ghost, .btn-new {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
    padding: 9px 16px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    border: 1px solid transparent;
}

.btn-ghost {
    background: var(--surface);
    color: var(--ink-soft);
    border-color: var(--border);
}
.btn-ghost:hover {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: var(--accent-soft);
}
.btn-ghost i.fa-spin,
.btn-ghost.spinning i {
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn-new {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 2px 8px -2px rgba(67, 56, 202, 0.5);
}
.btn-new:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}
.btn-new .icon-dot {
    display: inline-flex;
    width: 18px; height: 18px;
    align-items: center; justify-content: center;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    font-size: 0.65rem;
}

/* ---------- State boxes (loading / empty) ---------- */
.state-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 48px 20px;
    color: var(--ink-faint);
}
.state-box i {
    font-size: 1.6rem;
    color: var(--accent);
    opacity: 0.6;
}
.state-box .msg {
    font-size: 0.9rem;
}

.error-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--danger-soft);
    color: var(--danger);
    border: 1px solid rgba(224, 82, 82, 0.25);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    font-size: 0.9rem;
}

/* ---------- Panel ---------- */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
}

/* Panel bir grid/flex hatarynyň içinde bolsa, aralyk eýýäm ata elementiň
   gap'y bilen berilýär - şonuň üçin panel-iň öz margin-bottom'yny nol
   edýäris (ýogsam aralyk 2 esse bolýardy: margin + gap). */
.main-row-60-40 > .panel,
.right-col-stack > .panel,
.three-col-row > .panel {
    margin-bottom: 0;
}
.main-row-60-40 {
    margin-bottom: 20px;
}

.panel-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1rem;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
}
.panel-title i { color: var(--accent); }

/* ---------- Donut chart ---------- */
.distribution-row {
    display: flex;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
}

.donut-wrap {
    position: relative;
    width: 190px !important;
    height: 190px !important;
    margin: 0 auto;
    flex-shrink: 0;
}

.donut-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.donut-center .num {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 2rem;
    color: var(--ink);
    line-height: 1;
}
.donut-center .lbl {
    font-size: 0.75rem;
    color: var(--ink-faint);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 4px;
}

.legend-list {
    flex: 1;
    min-width: 240px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.legend-row {
    display: grid;
    grid-template-columns: 10px auto 1fr auto;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
}

.legend-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-name {
    color: var(--ink-soft);
    white-space: nowrap;
}

.legend-track {
    height: 6px;
    background: var(--bg);
    border-radius: 999px;
    overflow: hidden;
}
.legend-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    transition: width 0.5s ease;
}

.legend-count {
    text-align: right;
    font-weight: 600;
    color: var(--ink);
    white-space: nowrap;
    font-size: 0.8rem;
}

/* ---------- Search ---------- */
.search-wrap {
    position: relative;
    max-width: 320px;
    margin-bottom: 18px;
}
.search-wrap.mb-0 { margin-bottom: 0; }

.search-wrap i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ink-faint);
    font-size: 0.85rem;
}

.search-wrap input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 14px 10px 38px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    font-family: var(--font-body);
    font-size: 0.88rem;
    color: var(--ink);
    outline: none;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.search-wrap input:focus {
    border-color: var(--accent);
    background: var(--surface);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ---------- Table ---------- */
.modern-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.87rem;
}

.modern-table thead th {
    text-align: left;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ink-faint);
    padding: 0 14px 12px;
    border-bottom: 1px solid var(--border);
}

.modern-table tbody td {
    padding: 14px;
    border-bottom: 1px solid var(--border);
    color: var(--ink);
    vertical-align: middle;
}

.modern-table tbody tr:last-child td { border-bottom: none; }

.modern-table tbody tr {
    transition: background 0.12s ease;
}
.modern-table tbody tr:hover {
    background: var(--bg);
}

.person-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.person-name {
    font-weight: 500;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
}
.status-badge .dot {
    width: 6px; height: 6px;
    border-radius: 50%;
}

.active-check { color: #2E9E6B; font-size: 1rem; }
.active-cross { color: var(--ink-faint); font-size: 1rem; }

.icon-btn {
    width: 32px; height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--ink-soft);
    background: var(--bg);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.8rem;
    transition: all 0.15s ease;
}
.icon-btn:hover {
    background: var(--accent-soft);
    color: var(--accent);
}
.icon-btn.danger:hover {
    background: var(--danger-soft);
    color: var(--danger);
}

/* ---------- Table footer / pagination ---------- */
.table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 10px;
}

.result-count {
    font-size: 0.82rem;
    color: var(--ink-faint);
}

.pagination {
    display: flex;
    list-style: none;
    gap: 4px;
    margin: 0;
    padding: 0;
}

.page-link {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--ink-soft);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.15s ease;
}
.page-link:hover {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: var(--accent-soft);
}
.page-item.active .page-link {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.page-item.disabled .page-link {
    opacity: 0.4;
    cursor: not-allowed;
}
.page-item.disabled .page-link:hover {
    background: var(--surface);
    color: var(--ink-soft);
}

/* ---------- Minimal utility fallbacks (skip if Bootstrap already loaded) ---------- */
.d-flex { display: flex; }
.justify-content-between { justify-content: space-between; }
.align-items-start { align-items: flex-start; }
.align-items-center { align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: 10px; }
.gap-3 { gap: 16px; }
.mb-0 { margin-bottom: 0; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 22px; }
.my-3 { margin: 16px 0; }
.mt-3 { margin-top: 16px; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
    .distribution-row { flex-direction: column; }
    .modern-table thead { display: none; }
    .modern-table, .modern-table tbody, .modern-table tr, .modern-table td {
        display: block;
        width: 100%;
    }
    .modern-table tr {
        border-bottom: 1px solid var(--border);
        padding: 10px 0;
    }
    .modern-table td {
        border-bottom: none;
        padding: 6px 0;
    }
}







/* ============================================================
   Sidebar + Navbar — "Işgärler sanawy" teması ile uyumlu
   (aynı renk/font token'ları employees-modern.css ile birebir)
   ============================================================ */


/* ÖNEMLİ: Bu değişkenler kasıtlı olarak :root'a değil, doğrudan .sidebar ve
   .navbar-modern'e tanımlanıyor. Her sayfanın kendi <style> bloğunda farklı
   :root token'ları olabiliyor (örn. assets sayfasındaki --primary mavi,
   employees sayfasındaki --accent indigo) — bunlar :root'ta çakışınca sayfa
   değiştikçe sidebar'ın rengi de değişiyordu. Scope'u buraya alınca artık
   hangi sayfada olursan ol sidebar/navbar hep aynı renkte kalıyor. */
.sidebar, .navbar-modern {
    --bg: #F5F9FC;
    --surface: #FFFFFF;
    --border: #DCE8F0;
    --ink: #1A2B3C;
    --ink-soft: #5A7080;
    --ink-faint: #8AA0B0;

    --accent: #4A9FD4;
    --accent-hover: #2F7FB0;
    --accent-soft: #EAF2F8;

    --font-display: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-body: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ---------- Layout: mevcut Bootstrap d-flex + flex-grow-1 yapısını kullanıyoruz,
   ayrı bir .app-shell/.main-area sarmalayıcısına gerek yok ---------- */

/* ---------- Sidebar (beyaz) ---------- */
.sidebar {
    width: 260px;
    min-height: 100vh;
    height: 100vh;
    background: var(--surface);
    color: var(--ink);
    border-right: 1px solid var(--border);
    padding-top: 8px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    transition: width 0.25s ease;

    /* Sayfa kayarken sidebar ekranda sabit kalsın; kendi menüsü sığmazsa
       kendi içinde kaysın, taşma bitince sayfa normal akışla devam etsin. */
    position: sticky;
    top: 0;
    align-self: flex-start;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 999px;
}
.sidebar::-webkit-scrollbar-thumb:hover { background: var(--ink-faint); }

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    color: var(--ink);
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--accent), #2F7FB0);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(74,159,212,0.28);
}

.brand-text-wrap {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    min-width: 0;
}
.brand-text {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
    color: var(--ink);
    white-space: nowrap;
}
.brand-caption {
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-faint);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-section-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-faint);
    padding: 18px 24px 8px;
}

.nav-menu {
    list-style: none;
    padding: 0 12px;
    margin: 4px 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    padding: 11px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 10px;
    border-left: 3px solid transparent;
    transition: background 0.15s ease, color 0.15s ease;
}

.nav-item i {
    width: 16px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--ink-faint);
    transition: color 0.15s ease;
}

.nav-count {
    margin-left: auto;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--ink-faint);
    flex-shrink: 0;
}
.nav-item.active .nav-count { color: var(--accent); }

.nav-item:hover {
    background: var(--accent-soft);
    color: var(--accent);
}
.nav-item:hover i { color: var(--accent); }

.nav-item.active {
    background: var(--accent-soft);
    color: var(--accent);
    border-left: 3px solid var(--accent);
    font-weight: 600;
}
.nav-item.active i { color: var(--accent); }

.sidebar-footer {
    margin-top: auto;
    padding: 16px 24px 22px;
    border-top: 1px solid var(--border);
    font-size: 0.76rem;
    color: var(--ink-faint);
}

/* ---------- Sidebar: "Ulgam onlaýn" görkezijisi ---------- */
.sidebar-online {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 24px 4px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--green);
}
.online-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--green);
    flex-shrink: 0;
    box-shadow: 0 0 0 3px var(--green-soft);
}

/* ---------- Sidebar: aşaky ulanyjy profil kartoçkasy ---------- */
.sidebar-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 16px 18px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--ink);
    border: 1px solid var(--border);
    transition: background 0.15s ease;
}
.sidebar-profile:hover { background: var(--bg); }
.sidebar-profile .avatar-circle { flex-shrink: 0; }
.sidebar-profile-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
    min-width: 0;
    flex: 1;
}
.sidebar-profile-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: capitalize;
}
.sidebar-profile-role {
    font-size: 0.72rem;
    color: var(--ink-faint);
}
.sidebar-profile-chevron {
    font-size: 0.72rem;
    color: var(--ink-faint);
    flex-shrink: 0;
}

/* ---------- Sidebar: daraltılmış hal (navbar'daki buton ile toggle edilir) ---------- */
.sidebar.collapsed { width: 76px; }
.sidebar.collapsed .brand-text-wrap,
.sidebar.collapsed .nav-item span.nav-text,
.sidebar.collapsed .nav-count,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .sidebar-footer,
.sidebar.collapsed .sidebar-online span.nav-text,
.sidebar.collapsed .sidebar-profile-meta,
.sidebar.collapsed .sidebar-profile-chevron { display: none; }
.sidebar.collapsed .brand { justify-content: center; padding: 20px 0; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 12px 0; }
.sidebar.collapsed .nav-item i { width: auto; }
.sidebar.collapsed .sidebar-online { justify-content: center; padding: 16px 0 4px; }
.sidebar.collapsed .sidebar-profile { justify-content: center; margin: 14px 8px 18px; }

/* ---------- Navbar ---------- */
.navbar-modern {
    background: var(--surface);
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

/* ---------- Navbar: merkezdäki hassahana ady bloky ---------- */
/* .navbar-modern "position: sticky" eýýäm bar, ony position kontekst
   hökmünde ulanyp, ortadaky bloky sag/çep elementlere garamazdan
   hakyky merkeze ýerleşdirýäris. */
.navbar-text-block-center {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    line-height: 1.3;
    pointer-events: none;
    white-space: nowrap;
}
.navbar-text-block-center .navbar-text-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--ink);
    letter-spacing: -0.005em;
}
.navbar-text-block-center .navbar-text-sub {
    font-size: 0.72rem;
    color: var(--ink-faint);
    margin-top: 1px;
}
@media (max-width: 900px) {
    .navbar-text-block-center { display: none; }
}

.page-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--ink);
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 8px;
}
.page-title .crumb-root { color: var(--ink-soft); font-weight: 500; }
.page-title .crumb-sep { color: var(--ink-faint); font-weight: 400; }

.navbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sidebar-toggle-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-soft);
    background: var(--bg);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}
.sidebar-toggle-btn:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 18px;
}

.avatar-circle {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent), #7C6EF0);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.82rem;
    flex-shrink: 0;
}

/* ---------- Content wrapper (navbar altındaki sayfa alanı) ----------
   Padding'i artık Bootstrap'in p-3/p-md-4'ü veriyor (layout.html), burada
   sadece genişliği ve ortalamayı sınırlıyoruz — çift padding olmasın. */
.page-content {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .sidebar { width: 76px; }
    .brand span.brand-text,
    .nav-item span.nav-text,
    .nav-section-label,
    .sidebar-footer { display: none; }
    .brand { justify-content: center; padding: 20px 0; }
    .nav-item { justify-content: center; padding: 12px 0; }
    .nav-item i { width: auto; }
    .user-box .user-meta { display: none; }
}
/* ---------- Reports: stat cards ---------- */
.stat-cards-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 18px 20px;
}

.stat-card .stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    color: var(--accent);
    margin-bottom: 10px;
    font-size: 15px;
}

.stat-card .stat-num {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.2;
}

.stat-card .stat-lbl {
    color: var(--ink-soft);
    font-size: 0.82rem;
    margin-top: 2px;
}

/* ---------- Reports: tabs ---------- */
.tabs-row {
    display: flex;
    gap: 6px;
    margin-bottom: 18px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
}

.tab-btn {
    background: none;
    border: none;
    padding: 10px 16px;
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--ink-soft);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.tab-btn:hover { color: var(--ink); }

.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ---------- Reports: simple horizontal bar list ---------- */
.bar-list { display: flex; flex-direction: column; gap: 12px; }

.bar-row { display: flex; align-items: center; gap: 12px; }

.bar-row .bar-label {
    width: 160px;
    flex-shrink: 0;
    font-size: 0.85rem;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bar-row .bar-track {
    flex: 1;
    height: 10px;
    background: var(--accent-soft);
    border-radius: 6px;
    overflow: hidden;
}

.bar-row .bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 6px;
}

.bar-row .bar-value {
    width: 60px;
    flex-shrink: 0;
    text-align: right;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink);
}

.chart-panel-tall { height: 320px; position: relative; }
.text-muted { color: var(--ink-soft); font-size: 0.85em; }

.page-sub { color: var(--ink-soft); font-size: 0.85rem; margin-top: 2px; }

.main-row-60-40 {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 1100px) { .main-row-60-40 { grid-template-columns: 1fr; } }

.three-col-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
  align-items: start;
  margin-bottom: 20px;
}
@media (max-width: 1300px) { .three-col-row { grid-template-columns: 1fr 1fr; } }
@media (max-width: 900px) { .three-col-row { grid-template-columns: 1fr; } }

.right-col-stack { display: flex; flex-direction: column; gap: 20px; }

.no-data-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 14px;
  color: var(--ink-faint);
  font-size: 0.85rem;
  text-align: center;
  justify-content: center;
  background: var(--bg-soft, #F7F9FC);
  border-radius: 10px;
}
.no-data-mini i { font-size: 1rem; color: var(--ink-faint); }

/* ---------- Dil çalgyçy (navbar) ---------- */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 2px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 3px;
}

.lang-switcher .lang-opt {
    background: none;
    border: none;
    padding: 5px 10px;
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ink-soft);
    border-radius: 6px;
    cursor: pointer;
    letter-spacing: 0.02em;
}

.lang-switcher .lang-opt:hover { color: var(--ink); }

.lang-switcher .lang-opt.active {
    background: var(--accent);
    color: #fff;
}

/* ============================================================
   Klinika görkezijileri, Dolandyryş, Işgärler, Enjamlar, Dermanlar
   sahypalary üçin ähli goşmaça komponentler
   ============================================================ */

/* ---------- Sahypa kellesi: baglanyşyk statusy ---------- */
.status-connection {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--green);
    font-weight: 500;
}
.status-connection .online-dot { box-shadow: 0 0 0 3px var(--green-soft); }

/* ---------- Döwür saýlaýjy ---------- */
.period-switcher {
    display: flex;
    align-items: center;
    gap: 2px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 3px;
}
.period-switcher .period-opt {
    background: none;
    border: none;
    padding: 5px 11px;
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--ink-soft);
    border-radius: 6px;
    cursor: pointer;
    letter-spacing: 0.02em;
}
.period-switcher .period-opt:hover { color: var(--ink); }
.period-switcher .period-opt.active {
    background: var(--ink);
    color: #fff;
    font-weight: 600;
}

.table-scroll-x { overflow-x: auto; }

.see-all-link {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
.see-all-link:hover { text-decoration: underline; }
.see-all-link i { font-size: 0.65rem; }

.donut-center .sub { font-size: 0.72rem; color: var(--ink-soft); margin-top: 2px; }

/* ---------- KPI kart v2 (Klinika görkezijileri): ikon sagda ýokarda ---------- */
.kpi-cards-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}
@media (max-width: 1300px) { .kpi-cards-row { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) { .kpi-cards-row { grid-template-columns: repeat(2, 1fr); } }

.kpi-card-v2 {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 16px 18px;
}
.kpi-v2-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
}
.kpi-v2-label {
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--ink-soft);
}
.kpi-v2-caption { font-size: 0.72rem; color: var(--ink-faint); margin-top: 3px; }
.kpi-v2-icon {
    width: 34px; height: 34px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; flex-shrink: 0;
}
.kpi-v2-icon.tone-warning { background: var(--amber-soft); color: var(--amber); }
.kpi-v2-icon.tone-info { background: var(--accent-soft); color: var(--accent); }
.kpi-v2-icon.tone-success { background: var(--green-soft); color: var(--green); }
.kpi-v2-icon.tone-neutral { background: var(--bg); color: var(--ink-faint); }
.kpi-v2-icon.tone-danger { background: var(--danger-soft); color: var(--danger); }
.kpi-v2-num {
    font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; color: var(--ink);
    display: flex; align-items: baseline; gap: 4px;
}
.kpi-v2-num .unit { font-size: 0.85rem; font-weight: 500; color: var(--ink-faint); }
.kpi-v2-trend { font-size: 0.75rem; margin-top: 8px; display: flex; align-items: center; gap: 4px; color: var(--ink-faint); }
.kpi-v2-trend.up { color: var(--green); }
.kpi-v2-trend.down { color: var(--danger); }
.kpi-v2-trend span { color: var(--ink-faint); font-weight: 400; margin-left: 2px; }

/* ---------- Pill-bar list (rak görnüşleri) ---------- */
.pill-bar-list { display: flex; flex-direction: column; gap: 11px; }
.pill-bar-row { display: flex; align-items: center; gap: 12px; }
.pill-bar-label {
    width: 96px; flex-shrink: 0;
    font-size: 0.82rem; font-weight: 600; color: var(--ink);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pill-bar-track { flex: 1; height: 26px; background: var(--bg); border-radius: 999px; position: relative; }
.pill-bar-fill {
    height: 100%; border-radius: 999px;
    background: linear-gradient(90deg, #6FB4DD, var(--accent));
    display: flex; align-items: center; justify-content: flex-end;
    padding-right: 10px; min-width: 26px; box-sizing: border-box;
}
.pill-bar-fill .pct-inside { color: #fff; font-size: 0.74rem; font-weight: 700; white-space: nowrap; }
.pill-bar-pct-outside {
    position: absolute; top: 50%; transform: translateY(-50%);
    margin-left: 8px; font-size: 0.74rem; font-weight: 700; color: var(--ink); white-space: nowrap;
}
.pill-bar-count { width: 54px; text-align: right; flex-shrink: 0; font-size: 0.8rem; color: var(--ink-soft); }

/* ---------- Tapgyr stack bar (anyklamada tapgyr) ---------- */
.stage-row { margin-bottom: 16px; }
.stage-row:last-child { margin-bottom: 0; }
.stage-row-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.stage-row-name { font-size: 0.85rem; font-weight: 600; color: var(--ink); }
.stage-row-n { font-size: 0.78rem; color: var(--ink-faint); }
.stage-stack { display: flex; height: 26px; border-radius: 999px; overflow: hidden; }
.stage-seg {
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 0.7rem; font-weight: 700;
    transition: width 0.4s ease;
}
.stage-seg.tone-s1 { background: #2E9E6B; }
.stage-seg.tone-s2 { background: #8FD1B0; }
.stage-seg.tone-s3 { background: #EF9F27; }
.stage-seg.tone-s4 { background: #E05252; }
.stage-row-caption { font-size: 0.74rem; color: var(--green); margin-top: 6px; }

/* ---------- Anatomik ýaýlanyş - "treemap" görüşi ---------- */
.treemap-grid {
    display: grid;
    grid-template-rows: 2.1fr 1.3fr 0.85fr;
    gap: 4px;
    height: 300px;
}
.treemap-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.treemap-cell {
    border-radius: 8px;
    padding: 10px 12px;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
}
.treemap-cell .tm-name { font-size: 0.8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.treemap-cell .tm-val { font-size: 1.25rem; font-weight: 700; font-family: var(--font-display); }
.treemap-cell .tm-pct { font-size: 0.7rem; font-weight: 500; opacity: 0.85; margin-left: 4px; }
.treemap-cell.tier-red { background: #E0605A; }
.treemap-cell.tier-orange { background: #EF9F27; }
.treemap-cell.tier-blue { background: #4A9FD4; }

.treemap-legend {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}
.treemap-legend-group { flex: 1; min-width: 120px; }
.treemap-legend-head { display: flex; align-items: center; gap: 6px; font-size: 0.72rem; font-weight: 700; color: var(--ink-soft); margin-bottom: 6px; }
.treemap-legend-head .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.treemap-legend-row { display: flex; justify-content: space-between; font-size: 0.76rem; color: var(--ink-soft); padding: 2px 0; }
.treemap-legend-row b { color: var(--ink); font-weight: 600; }

/* ---------- Ýaş piramidasy ---------- */
.age-pyramid-list { display: flex; flex-direction: column; gap: 7px; }
.age-pyramid-row { display: grid; grid-template-columns: 40px 1fr; align-items: center; gap: 10px; }
.age-pyramid-label { font-size: 0.72rem; color: var(--ink-faint); text-align: right; }
.age-pyramid-track { height: 14px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.age-pyramid-fill { height: 100%; background: var(--teal); border-radius: 4px; transition: width 0.4s ease; }
.age-pyramid-footer {
    display: flex; justify-content: space-between;
    margin-top: 10px; font-size: 0.74rem; font-weight: 600;
}
.age-pyramid-footer .males { color: var(--accent); }
.age-pyramid-footer .females { color: var(--teal); }

/* ---------- Jyns gauge - halka aşagynda at + san ---------- */
.gender-gauges-row-v2 {
    display: flex;
    justify-content: space-around;
    gap: 12px;
    flex-wrap: wrap;
    padding: 4px 0 4px;
}
.gauge-item-v2 { display: flex; flex-direction: column; align-items: center; }
.gauge-item-v2 .gauge-label { font-size: 0.76rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink); margin-top: 10px; }
.gauge-item-v2 .gauge-count { font-size: 0.76rem; color: var(--ink-faint); margin-top: 2px; }
.gauge-sm { width: 140px !important; height: 140px !important; }

/* ---------- Umumy mini-sanaw (soňky näsaglar, duýduryşlar, satyn alyşlar we ş.m.) ---------- */
.mini-list { display: flex; flex-direction: column; }
.mini-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 2px;
    border-bottom: 1px solid var(--border);
}
.mini-list-item:last-child { border-bottom: none; }
.mini-list-icon {
    width: 34px; height: 34px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    background: var(--accent-soft); color: var(--accent);
    flex-shrink: 0; font-size: 13px;
}
.mini-list-body { flex: 1; min-width: 0; }
.mini-list-title {
    font-size: 0.85rem; font-weight: 600; color: var(--ink);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mini-list-sub { font-size: 0.76rem; color: var(--ink-faint); margin-top: 1px; }
.mini-list-value { text-align: right; flex-shrink: 0; font-size: 0.8rem; color: var(--ink-soft); white-space: nowrap; }

/* ---------- "Sıralama" bar listesi (meds: iň netijeli dermanlar) ---------- */
.ranked-list { display: flex; flex-direction: column; gap: 14px; }
.ranked-row { display: flex; align-items: center; gap: 12px; }
.ranked-badge {
    width: 24px; height: 24px; border-radius: 50%;
    background: var(--bg); color: var(--ink-soft);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; font-weight: 700; flex-shrink: 0;
}
.ranked-badge.top1 { background: #FCEBB0; color: #8A6A00; }
.ranked-body { flex: 1; min-width: 0; }
.ranked-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.ranked-name { font-size: 0.84rem; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ranked-name .ranked-sub { font-weight: 400; color: var(--ink-faint); font-size: 0.74rem; }
.ranked-pct { font-family: var(--font-display); font-weight: 700; font-size: 0.9rem; color: var(--green); flex-shrink: 0; }
.ranked-track { height: 6px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.ranked-fill { height: 100%; background: var(--green); border-radius: 999px; }
.ranked-meta { font-size: 0.7rem; color: var(--ink-faint); margin-top: 3px; }

/* ---------- Bildiriş/duýduryş kartlary (az ammar) ---------- */
.alert-cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.alert-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px; }
.alert-card .ac-name { font-size: 0.82rem; font-weight: 600; color: var(--ink); }
.alert-card .ac-cat { font-size: 0.7rem; color: var(--ink-faint); margin-top: 2px; }
.alert-card .ac-num { font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; color: var(--danger); margin-top: 10px; }
.alert-card .ac-unit { font-size: 0.72rem; color: var(--ink-faint); font-weight: 500; margin-left: 3px; }
.alert-card .ac-days { font-size: 0.7rem; color: var(--ink-faint); margin-top: 4px; }
.alert-card .ac-btn {
    display: block; width: 100%; text-align: center; margin-top: 10px;
    background: var(--danger); color: #fff; border: none; border-radius: var(--radius-sm);
    padding: 7px 0; font-size: 0.76rem; font-weight: 600; cursor: pointer;
}
.alert-card.tone-warning .ac-num { color: var(--amber); }
.alert-card.tone-warning .ac-btn { background: var(--accent); }

/* ---------- Okuw/maslahat kart list (status chip bilen) ---------- */
.event-list { display: flex; flex-direction: column; gap: 0; }
.event-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--border); }
.event-item:last-child { border-bottom: none; }
.event-icon {
    width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--accent-soft); color: var(--accent); font-size: 14px;
}
.event-body { flex: 1; min-width: 0; }
.event-title { font-size: 0.85rem; font-weight: 600; color: var(--ink); }
.event-meta { font-size: 0.74rem; color: var(--ink-faint); margin-top: 2px; }
.event-time { font-size: 0.78rem; font-weight: 600; color: var(--ink); text-align: right; flex-shrink: 0; white-space: nowrap; }
.event-time .ampm { font-size: 0.65rem; color: var(--ink-faint); display: block; font-weight: 500; }

/* ---------- Kontraktçy SLA bar (marker çyzygy bilen) ---------- */
.sla-bar-list { display: flex; flex-direction: column; gap: 16px; }
.sla-bar-row {}
.sla-bar-head { display: flex; justify-content: space-between; margin-bottom: 6px; }
.sla-bar-name { font-size: 0.82rem; font-weight: 600; color: var(--ink); }
.sla-bar-meta { font-size: 0.7rem; color: var(--ink-faint); }
.sla-bar-value { font-size: 0.82rem; font-weight: 700; }
.sla-bar-track { position: relative; height: 8px; background: var(--bg); border-radius: 999px; }
.sla-bar-fill { height: 100%; border-radius: 999px; }
.sla-bar-marker { position: absolute; top: -4px; width: 2px; height: 16px; background: var(--ink-faint); }

/* ---------- KPI kart: sag ýokarda kiçi halka-gauge (Işgärler/Enjamlar/Dermanlar) ---------- */
.kpi-cards-row-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}
@media (max-width: 1100px) { .kpi-cards-row-4 { grid-template-columns: repeat(2, 1fr); } }

.kpi-gauge-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 16px 18px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}
.kpi-gauge-card .kg-left { min-width: 0; }
.kpi-gauge-card .kg-label {
    font-size: 0.66rem; font-weight: 700; letter-spacing: 0.05em;
    text-transform: uppercase; color: var(--ink-soft);
}
.kpi-gauge-card .kg-caption { font-size: 0.72rem; color: var(--ink-faint); margin-top: 2px; }
.kpi-gauge-card .kg-num { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; color: var(--ink); margin-top: 10px; }
.kpi-gauge-card .kg-sub { font-size: 0.76rem; color: var(--ink-faint); margin-top: 6px; display: flex; align-items: center; gap: 5px; }
.kpi-gauge-card .kg-sub .dot { width: 6px; height: 6px; border-radius: 50%; }
.kpi-gauge-donut { width: 54px; height: 54px; position: relative; flex-shrink: 0; }
.kpi-gauge-donut .kg-pct {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-size: 0.72rem; font-weight: 700; color: var(--ink);
}

/* ---------- KPI kart: sparkline bilen (Dolandyryş paneli) ---------- */
.kpi-cards-row-mixed {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}
@media (max-width: 1100px) { .kpi-cards-row-mixed { grid-template-columns: repeat(2, 1fr); } }

.kpi-spark-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
}
.kpi-spark-top { display: flex; justify-content: space-between; align-items: center; }
.kpi-spark-label { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-soft); }
.kpi-spark-icon {
    width: 32px; height: 32px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; flex-shrink: 0;
}
.kpi-spark-icon.tone-neutral { background: var(--ink); color: #fff; }
.kpi-spark-icon.tone-info { background: var(--accent-soft); color: var(--accent); }
.kpi-spark-icon.tone-success { background: var(--green-soft); color: var(--green); }
.kpi-spark-body { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 12px; gap: 8px; }
.kpi-spark-body.gauge-body { align-items: center; height: 100%; margin-top: 4px; }
.kpi-spark-num { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; color: var(--ink); }
.kpi-spark-trend { font-size: 0.75rem; margin-top: 6px; display: flex; align-items: center; gap: 4px; color: var(--ink-faint); }
.kpi-spark-trend.up { color: var(--green); }
.kpi-spark-trend.down { color: var(--danger); }
.kpi-spark-chart { width: 84px; height: 34px; flex-shrink: 0; }

/* ---------- Status chip (trend kartlary) ---------- */
.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 4px 9px;
    border-radius: 999px;
    white-space: nowrap;
}
.status-chip.muted { background: var(--bg); color: var(--ink-faint); }
.status-chip.success { background: var(--green-soft); color: var(--green); }
.status-chip.warning { background: var(--amber-soft); color: var(--amber); }
.status-chip.info { background: var(--accent-soft); color: var(--accent); }

/* ---------- Görkezijiler sahypasy: aşaky trend kartlary ---------- */
.trend-cards-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}
.trend-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 20px;
}
.trend-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 4px;
}
.trend-card-title { color: var(--ink-soft); font-size: 0.82rem; }

/* ---------- Renkli tonlar - statCardsHTML'e { tone: '...' } geçince ---------- */
.stat-icon.tone-success { background: var(--green-soft); color: var(--green); }
.stat-icon.tone-warning { background: var(--amber-soft); color: var(--amber); }
.stat-icon.tone-danger { background: var(--danger-soft); color: var(--danger); }
.stat-icon.tone-teal { background: #E6F5F3; color: var(--teal); }

/* ---------- Çykyş düwmesi (navbar) ---------- */
.logout-btn {
    margin-left: 10px;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-soft);
    background: var(--bg);
    border: 1px solid var(--border);
    text-decoration: none;
    font-size: 14px;
}

.logout-btn:hover {
    color: #E05252;
    border-color: #E05252;
}
