/* CleanERP — panel va kabinet uslublari */
:root {
  --brand: #0f766e;
  --brand-dark: #0b5a54;
  --brand-soft: #e6f4f2;
  --ink: #17262b;
  --muted: #62727a;
  --line: #e3e8ea;
  --bg: #f5f7f8;
  --surface: #ffffff;
  --side: #10222a;
  --side-ink: #b9c7cc;
  --radius: 10px;
  --bs-primary: #0f766e;
  --bs-primary-rgb: 15, 118, 110;
  --bs-link-color: #0f766e;
  --bs-link-hover-color: #0b5a54;
  --bs-body-font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--bg);
  --bs-border-color: var(--line);
}

body { font-size: 0.94rem; -webkit-font-smoothing: antialiased; }
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand-dark);
  --bs-btn-hover-border-color: var(--brand-dark); --bs-btn-active-bg: var(--brand-dark);
  --bs-btn-active-border-color: var(--brand-dark); --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand); }
.btn-outline-primary { --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand);
  --bs-btn-hover-border-color: var(--brand); --bs-btn-active-bg: var(--brand); --bs-btn-active-border-color: var(--brand); }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(15, 118, 110, .15); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
a { text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Panel qobig'i ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar { --bs-offcanvas-bg: var(--side); --bs-offcanvas-width: 276px; background: var(--side); color: var(--side-ink);
  width: 260px; flex: 0 0 260px; }
@media (min-width: 992px) {
  .sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background-color: var(--side) !important; }
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 12px; }
.brand { color: #fff; font-weight: 700; font-size: 1.15rem; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; }
.brand:hover { color: #fff; text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--brand); display: grid; place-items: center; color: #fff; }
.sidebar nav { padding: 4px 12px 24px; }
.nav-group { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #6f8791; padding: 16px 10px 6px; }
.sidebar .nav-link { color: var(--side-ink); display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
  font-size: .9rem; }
.sidebar .nav-link i { font-size: 1.05rem; opacity: .85; }
.sidebar .nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.sidebar .nav-link.active { background: var(--brand); color: #fff; }
.sidebar .nav-link:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 10px 24px; background: var(--surface);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.content { padding: 24px; max-width: 1280px; width: 100%; }
@media (max-width: 575.98px) { .content { padding: 16px; } .topbar { padding: 10px 16px; } }

.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid;
  place-items: center; font-weight: 600; font-size: .85rem; object-fit: cover; }

/* ---------- Sahifa sarlavhasi, kartalar ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.page-head h1 { font-size: 1.4rem; font-weight: 650; margin: 0; letter-spacing: -.01em; }
.card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; background: var(--surface); }
.card-header { background: transparent; border-bottom: 1px solid var(--line); font-weight: 600; padding: 12px 16px; }
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .65rem .9rem; }
.table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600;
  background: #fafbfb; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { vertical-align: middle; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.filter-bar .form-control, .filter-bar .form-select { width: auto; min-width: 150px; }
.filter-bar .search { flex: 1 1 220px; max-width: 340px; }

.badge { font-weight: 500; }
.text-bg-primary { background-color: var(--brand) !important; }

/* ---------- KPI ---------- */
.kpi { padding: 16px 18px; height: 100%; }
.kpi .label { color: var(--muted); font-size: .8rem; }
.kpi .value { font-size: 1.55rem; font-weight: 650; letter-spacing: -.01em; margin-top: 2px; }
.kpi .sub { color: var(--muted); font-size: .78rem; }
.kpi.alert-kpi .value { color: #b42318; }
.chart-box { position: relative; height: 280px; }

/* ---------- Detail ---------- */
.dl-grid { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: 0; }
.dl-grid dt, .dl-grid dd { padding: 10px 16px; border-bottom: 1px solid var(--line); margin: 0; }
.dl-grid dt { color: var(--muted); font-weight: 500; }
.dl-grid dt:last-of-type, .dl-grid dd:last-of-type { border-bottom: 0; }
@media (max-width: 575.98px) { .dl-grid { grid-template-columns: 1fr; } .dl-grid dt { border-bottom: 0; padding-bottom: 0; } }

/* ---------- Bo'sh holat ---------- */
.empty { text-align: center; padding: 44px 16px; color: var(--muted); }
.empty h2 { font-size: 1.05rem; color: var(--ink); margin-bottom: 6px; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.auth-card { width: 100%; max-width: 420px; padding: 28px; }
.auth-card h1 { font-size: 1.35rem; font-weight: 650; }

/* ---------- Kabinet (mijoz) ---------- */
.cab-nav { background: var(--surface); border-bottom: 1px solid var(--line); }
.cab-nav .nav-link { color: var(--muted); padding: 14px 14px; border-bottom: 2px solid transparent; font-weight: 500; }
.cab-nav .nav-link.active { color: var(--brand); border-bottom-color: var(--brand); }
.cab-nav .nav-link:hover { color: var(--ink); text-decoration: none; }
.cab-container { max-width: 1040px; margin: 0 auto; padding: 24px 16px 48px; }

.req::after { content: ' *'; color: #b42318; }
.inline-form { display: inline; }
.table-actions { white-space: nowrap; text-align: right; }
@media print { .sidebar, .topbar, .filter-bar, .no-print { display: none !important; } .content { padding: 0; } }
