/* ======================================================================
   Aelo — dizayn. Login sahifasi: ikki ustunli, rasm + don teksturasi (5-bo'lim).
   Ichki sahifalar: Liquid Glass — body.app (3 va 9-bo'limlar).
   Eski Liquid Glass stillari: design/liquid-glass-legacy.css

   Tuzilma:
     1. Tokenlar (ranglar, o'lchamlar)
     2. Asos (reset, matn)
     3. Layout (sidebar, topbar, kontent, footer, mobil)
     4. Komponentlar (tugma, forma, karta, jadval, ogohlantirish, belgi)
     5. Sahifalar (kirish, xato)
     6. Yordamchi klasslar
     7. Umumiy qo'shimchalar (tablar, filtr paneli, haftalik jadval)
     8. Modullar (bemor, jadval, tashrif, tish formulasi, kassa)
     9. Liquid Glass — ichki sahifalar uchun tokenlar va komponentlar
   Yangi modul stillari shu fayl oxiriga, o'z sarlavhasi bilan qo'shiladi.
   ====================================================================== */

/* 1. Tokenlar ---------------------------------------------------------- */
:root {
    --bg: #ecf1f4;             /* sahifa foni */
    --surface: #f5f5f7;        /* karta, yuqori panel, jadval */
    --surface-2: #eceef1;      /* jadval sarlavhasi, hover */
    --field: #ffffff;          /* kiritish maydonlari */
    --border: #e1e4e8;
    --border-strong: #cbd5e1;
    --text: #0f172a;
    --text-2: #475569;
    --muted: #64748b;

    --primary: #001d51;        /* tugma, havola, yon menyu foni (login bilan bir xil) */
    --primary-hover: #010b13;
    --primary-soft: #e8edf6;
    --on-primary: #ffffff;
    --success: #16a34a;
    --success-soft: #f0fdf4;
    --warning: #d97706;
    --warning-soft: #fffbeb;
    --danger: #dc2626;
    --danger-soft: #fef2f2;

    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 3px rgba(15, 23, 42, .04);
    --focus: 0 0 0 3px rgba(0, 29, 81, .18);

    --sidebar-w: 248px;
    --topbar-h: 64px;
    --font: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

/* 2. Asos -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
}

h1, h2, h3, h4 { margin: 0 0 12px; line-height: 1.25; font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: 26px; }
h2 { font-size: 20px; }
h3 { font-size: 17px; }
p  { margin: 0 0 12px; }

a { color: var(--primary); font-weight: 500; text-decoration: none; }
a:hover { text-decoration: underline; }

img, svg { vertical-align: middle; }

:focus-visible { outline: none; box-shadow: var(--focus); }

.ui-icon {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

/* 3. Layout (body.app) — Liquid Glass ----------------------------------
   Yon menyu va yuqori panel fon ustida "suzib turadigan" shisha panellar.
   Shisha tokenlari va ichki sahifa komponentlari — 9-bo'limda. */
.sidebar {
    position: fixed;
    inset: 12px auto 12px 12px;
    width: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--glass-shadow);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    z-index: 30;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 20px 16px;
}
.sidebar-brand .ui-icon {
    box-sizing: content-box;
    width: 22px;
    height: 22px;
    padding: 9px;
    color: #fff;
    background: linear-gradient(160deg, var(--primary-2), var(--primary));
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(37, 99, 215, .28), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.sidebar-brand-name { font-size: 20px; font-weight: 800; letter-spacing: -0.04em; line-height: 1.1; }
.sidebar-brand-sub  { font-size: 12px; color: var(--muted); }

.sidebar-menu {
    list-style: none;
    margin: 0;
    padding: 4px 12px 12px;
    flex: 1;
    overflow-y: auto;
}
.sidebar-menu li + li { margin-top: 2px; }

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 42px;
    padding: 9px 12px;
    border-radius: 12px;
    color: var(--text-2);
    font-weight: 500;
    transition: background-color .18s ease, color .18s ease, transform .18s ease;
}
.sidebar-link:hover { background: rgba(255, 255, 255, .7); color: var(--text); text-decoration: none; }
.sidebar-link:active { transform: scale(.98); }
.sidebar-link.active {
    background: linear-gradient(160deg, var(--primary-2), var(--primary));
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(37, 99, 215, .22), inset 0 1px 0 rgba(255, 255, 255, .25);
}

.sidebar-divider { height: 1px; margin: 10px 12px; background: var(--border); }

.sidebar-footer { padding: 12px; border-top: 1px solid var(--border); margin: 0; }
.sidebar-footer .sidebar-link {
    width: 100%;
    background: none;
    border: 0;
    font: inherit;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
}
.sidebar-footer .sidebar-link:hover { color: var(--danger); background: var(--danger-soft); }

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .28);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    z-index: 25;
}

.topbar {
    position: sticky;
    top: 12px;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    height: var(--topbar-h);
    margin: 12px 12px 0 calc(var(--sidebar-w) + 24px);
    padding: 0 12px 0 24px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: var(--glass-shadow);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-title { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.menu-toggle {
    display: none;
    padding: 8px;
    background: var(--field);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    cursor: pointer;
}

.user-chip { display: flex; align-items: center; gap: 10px; }
.user-avatar {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(160deg, var(--primary-2), var(--primary));
    color: #fff;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(37, 99, 215, .22), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.user-name { font-weight: 600; line-height: 1.2; }
.user-role { font-size: 12px; color: var(--muted); line-height: 1.2; }

.content {
    margin-left: calc(var(--sidebar-w) + 24px);
    padding: 24px 12px 24px 0;
    min-height: calc(100vh - var(--topbar-h) - 73px);
}

.footer {
    margin-left: calc(var(--sidebar-w) + 24px);
    padding: 0 12px 16px 8px;
    font-size: 12px;
    color: var(--muted);
}

@media (max-width: 900px) {
    .sidebar { inset: 8px auto 8px 8px; transform: translateX(calc(-100% - 16px)); transition: transform .25s ease; background: var(--glass-strong); }
    .sidebar.open { transform: none; }
    .topbar { top: 8px; margin: 8px 8px 0; padding: 0 8px 0 8px; }
    .content { margin-left: 0; padding: 16px 8px; }
    .footer { margin-left: 0; padding: 0 16px 16px; }
    .menu-toggle { display: inline-flex; }
    .user-info, .btn-label { display: none; }
}

/* 4. Komponentlar ------------------------------------------------------ */

/* Tugmalar */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font: inherit;
    font-weight: 600;
    line-height: 1.25;
    transition: background-color .15s, border-color .15s;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn .ui-icon { width: 16px; height: 16px; }

.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--field); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-ghost { background: none; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 13px 20px; font-size: 16px; }
.btn-block { width: 100%; }

/* Formalar */
.form-group { margin-bottom: 16px; }
.form-group label, .form-label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; }

.form-control {
    display: block;
    width: 100%;
    padding: 10px 14px;
    font: inherit;
    color: var(--text);
    background: var(--field);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    transition: border-color .15s, box-shadow .15s;
}
.form-control:hover { border-color: #aebbc5; }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus); }
.form-control:disabled { background: var(--surface-2); color: var(--muted); }
.form-control.is-invalid { border-color: var(--danger); }
textarea.form-control { min-height: 80px; resize: vertical; }
select.form-control { padding-right: 32px; }

.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.form-actions { display: flex; gap: 8px; margin-top: 8px; }
.form-hint { margin-top: 4px; font-size: 12px; color: var(--muted); }
.field-error { margin-top: 4px; font-size: 13px; color: var(--danger); }

.form-control-lg { padding: 13px 16px; font-size: 16px; }

/* Telefon: "+998" doimiy, qolgan 9 raqam yoziladi (helpers.php: phone_input) */
.phone-group {
    display: flex;
    align-items: stretch;
    background: var(--field);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
}
.phone-group:focus-within { border-color: var(--primary); box-shadow: var(--focus); }
.phone-group.is-invalid { border-color: var(--danger); }
.phone-prefix {
    display: flex;
    align-items: center;
    padding: 0 12px;
    color: var(--text-2);
    font-weight: 600;
    background: var(--surface-2);
    border-right: 1px solid var(--border);
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    user-select: none;
}
.phone-group .form-control { border: 0; background: none; box-shadow: none; font-variant-numeric: tabular-nums; }

/* Parol maydoni: o'ng tomonda "Ko'rsatish / Yashirish" tugmasi */
.password-wrapper { position: relative; }
.password-wrapper .form-control { padding-right: 100px; }
.password-toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding: 0 10px;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    background: none;
    border: 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.password-toggle:hover { background: var(--primary-soft); }

/* Til almashtirgich (yuqori panel va login) */
.lang-switch { display: inline-flex; gap: 2px; padding: 3px; background: rgba(15, 23, 42, .06); border-radius: 10px; }
.lang-link {
    padding: 4px 9px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--text-2);
    border-radius: 7px;
    text-decoration: none;
}
.lang-link:hover { color: var(--text); background: rgba(255, 255, 255, .6); text-decoration: none; }
.lang-link.active { color: var(--primary); background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }

/* Karta */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: -24px -24px 20px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
}
.card-header h2, .card-header h3 { margin: 0; }

/* Sahifa sarlavhasi (sarlavha + amallar) */
.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}
.page-head h1 { margin: 0; font-size: 26px; }

/* Jadval */
.table-wrap {
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
.table th {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
    background: var(--surface-2);
    white-space: nowrap;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* Ogohlantirishlar */
.alert {
    padding: 12px 16px;
    margin-bottom: 20px;
    border-left: 4px solid;
    border-radius: var(--radius-sm);
}
.alert-success { background: var(--success-soft); border-color: var(--success); color: #166534; }
.alert-error   { background: var(--danger-soft);  border-color: var(--danger);  color: #991b1b; }
.alert-warning { background: var(--warning-soft); border-color: var(--warning); color: #92400e; }
.alert-info    { background: var(--primary-soft); border-color: var(--primary); color: var(--text); }

/* Belgilar (status) */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: var(--surface-2);
    color: var(--text-2);
    border: 1px solid var(--border);
}
.badge-primary { background: var(--primary-soft); color: var(--primary); border-color: #d5dbec; }
.badge-success { background: var(--success-soft); color: var(--success); border-color: #bbf7d0; }
.badge-warning { background: var(--warning-soft); color: var(--warning); border-color: #fde68a; }
.badge-danger  { background: var(--danger-soft);  color: var(--danger);  border-color: #fecaca; }

/* Bo'sh holat */
.empty-state { padding: 40px 16px; text-align: center; color: var(--muted); }

/* 5. Sahifalar --------------------------------------------------------- */

/* Kirish sahifasi (body.auth-body) ------------------------------------
   Chapda rasm (public/assets/img/login.webp) — ko'k qoplamasiz, ustida "don" (film grain)
   teksturasi. Rasm yuklanguncha Pinterest uslubidagi donador joy egallovchi fon ko'rinadi,
   so'ng rasm xiradan aniqqa o'tib ochiladi. Matn o'qilishi uchun faqat neytral (qora)
   soya — rang o'zgarmaydi. O'ngda forma: umumiy .form-control, .btn, .alert. */
.auth-body { background: var(--bg); }

.auth {
    --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    display: grid;
    grid-template-columns: minmax(0, 11fr) minmax(0, 9fr);
    min-height: 100vh;
    min-height: 100dvh;
}

/* Chap panel. Rasm — panel foni (eski view bilan ham ishlaydi); yangi view'dagi <img>
   ustiga sekin ochiladi. Ko'k qoplama yo'q: faqat yengil neytral soya va mayin don. */
.auth-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 48px;
    margin: 12px 0 12px 12px;
    padding: 40px clamp(28px, 4vw, 56px);
    border-radius: 20px;
    background: #8d8a84 url('../img/login.webp') center / cover no-repeat;
    color: #fff;
    overflow: hidden;
    isolation: isolate;
}
/* Neytral soya — faqat matn joylarida (tepa va past), o'rtasi toza */
.auth-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, rgba(0, 0, 0, .28) 0%, rgba(0, 0, 0, 0) 26%, rgba(0, 0, 0, 0) 58%, rgba(0, 0, 0, .42) 100%);
    pointer-events: none;
}
/* Mayin don (film grain) — Pinterest'dagi ochilmagan rasm kabi, juda yengil */
.auth-panel::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: var(--grain) 0 0 / 200px 200px;
    mix-blend-mode: soft-light;
    opacity: .35;
    pointer-events: none;
}
.auth-photo {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    filter: blur(6px);
    transition: opacity .5s ease, filter .7s ease;
}
.auth-panel.is-loaded .auth-photo { opacity: 1; filter: none; }
.auth-scrim { display: none; }
.auth-panel-top, .auth-panel-bottom { position: relative; text-shadow: 0 1px 2px rgba(0, 0, 0, .18); }

.auth-brand {
    font-size: clamp(26px, 2.6vw, 34px);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.1;
}
.auth-brand span {
    display: block;
    margin-top: 6px;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0;
    opacity: .85;
}
.auth-tagline { max-width: 32ch; margin: 0 0 14px; font-size: 17px; line-height: 1.5; font-weight: 400; }
.auth-points { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0; list-style: none; font-size: 13px; opacity: .9; }
.auth-points li::before { content: '·'; margin-right: 8px; opacity: .7; }
.auth-points li:first-child::before { content: none; }

/* O'ng tomon: forma */
.auth-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px clamp(24px, 5vw, 72px);
    background: var(--bg);
}
.auth-card { width: 100%; max-width: 380px; animation: auth-in .35s ease both; }
@keyframes auth-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Eski view mosligi (yangi view'da ishlatilmaydi) */
.auth-brand-small { display: none; margin-bottom: 24px; font-size: 24px; font-weight: 600; color: var(--primary); }
.auth-card > .lang-switch { margin-bottom: 28px; }

.auth-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 40px; }
.auth-top .lang-switch { margin: 0; }
.auth-logo { display: inline-flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; color: var(--primary); text-decoration: none; }
.auth-logo:hover { text-decoration: none; }
.auth-logo img { width: 32px; height: 32px; padding: 6px; border-radius: 9px; background: var(--primary); object-fit: contain; }
.auth-logo-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: #fff; background: var(--primary); }
.auth-logo-mark .brand-logo { width: 26px; height: 26px; }

.auth-card h1 { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -0.015em; }
.auth-lead { margin: 6px 0 0; color: var(--muted); line-height: 1.5; }
.auth-card .alert { margin: 20px 0 0; }
.auth-card form { margin-top: 24px; }
.auth-card .form-control-lg { background: var(--field); transition: border-color .15s, box-shadow .15s; }
.auth-card .form-control-lg:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(0, 29, 81, .10); outline: none; }
.auth-card .btn-lg { border-radius: 12px; }
.auth-help { margin: 20px 0 0; color: var(--muted); }
.auth-help .btn-link { padding: 0; }
.auth-foot { margin: 32px 0 0; padding-top: 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }

.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.label-row label { margin-bottom: 6px; }
.label-link { font-size: 13px; font-weight: 500; }
.caps-hint { margin-top: 6px; font-size: 12px; font-weight: 500; color: var(--warning); }
.caps-hint::before { content: '⇪ '; }

/* Yuborilayotgan tugma */
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btn-spin .7s linear infinite;
}
.btn-secondary.is-loading::after { border-color: rgba(15, 23, 42, .2); border-top-color: var(--text); }
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* Tor ekranlar: panel yuqorida ixcham banner bo'ladi */
@media (max-width: 860px) {
    .auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .auth-panel { min-height: 150px; margin: 10px 10px 0; padding: 22px; gap: 16px; border-radius: 18px; }
    .auth-brand { font-size: 24px; }
    .auth-brand span { font-size: 13px; }
    .auth-tagline, .auth-points { display: none; }
    .auth-main { align-items: flex-start; padding: 28px 20px 40px; }
    .auth-top { margin-bottom: 28px; }
    .auth-logo span { display: none; }
    .auth-brand-small { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .auth-card, .btn.is-loading::after { animation: none; }
    .auth-photo { transition: none; }
}

/* Xato sahifalari */
.error-page { padding: 64px 16px; text-align: center; }
.error-page h1 { font-size: 56px; margin-bottom: 8px; color: var(--muted); }
.error-page p { color: var(--text-2); margin-bottom: 20px; }

/* 6. Yordamchi klasslar ----------------------------------------------- */
.text-muted { color: var(--muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.narrow { max-width: 480px; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* 7. Umumiy qo'shimchalar (modullar uchun) ---------------------------- */

/* Tablar */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.tab {
    padding: 8px 12px;
    margin-bottom: -1px;
    color: var(--text-2);
    font-weight: 500;
    border-bottom: 2px solid transparent;
}
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--primary); font-weight: 600; border-bottom-color: var(--primary); }

/* Asboblar paneli (filtr, navigatsiya) */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.form-control-sm { padding: 6px 10px; font-size: 13px; width: auto; min-width: 200px; }

form.inline { display: inline; }
.table tr.is-muted td { color: var(--muted); }
.table-plain { border: 0; }
.table-plain th { background: none; }
.table-plain td { padding: 6px 8px; border: 0; }
.small { font-size: 12px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }

.color-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 6px;
    border-radius: 50%;
    background: var(--dot, var(--primary));
}

/* Katta formalar */
.form-card { max-width: 760px; }
.form-card h3 { margin-top: 8px; padding-top: 8px; }
.form-card h3:first-of-type { margin-top: 0; padding-top: 0; }
fieldset.doctor-fields { border: 0; padding: 0; margin: 0; }
.form-color { height: 38px; padding: 4px; width: 80px; }
.align-end { display: flex; align-items: flex-end; }

/* Haftalik jadval (smenalar) */
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.week-day {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 160px;
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.week-day.is-today { border-color: var(--primary); box-shadow: inset 0 2px 0 var(--primary); }
.week-day.is-closed { background: var(--surface-2); }
.week-day-head { display: flex; flex-direction: column; font-weight: 600; line-height: 1.3; }
.week-day-note { font-size: 12px; color: var(--muted); }
.week-day-add {
    margin-top: auto;
    padding: 4px;
    font-size: 12px;
    text-align: center;
    color: var(--muted);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-sm);
}
.week-day-add:hover { color: var(--primary); border-color: var(--primary); text-decoration: none; }

.shift {
    padding: 6px 8px;
    font-size: 13px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-left: 3px solid var(--dot, var(--primary));
    border-radius: var(--radius-sm);
}
.shift-time { font-weight: 600; font-variant-numeric: tabular-nums; }
.shift-doctor { font-weight: 500; }
.shift-chair { font-size: 12px; }
.shift-actions { display: flex; flex-wrap: wrap; gap: 0 2px; margin: 4px -6px -2px; }
.shift-actions .btn { padding: 2px 6px; font-size: 12px; }

@media (max-width: 1100px) {
    .week-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    .week-grid { grid-template-columns: 1fr; }
    .week-day { min-height: 0; }
}

/* 8. Modullar: bemor, jadval, tashrif, tish formulasi, kassa ----------- */

/* Umumiy setkalar va bloklar */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.grid-wide-left { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat {
    display: block;
    padding: 18px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    color: inherit;
}
a.stat:hover { border-color: var(--primary); text-decoration: none; }
.stat-label { font-size: 13px; font-weight: 500; color: var(--muted); }
.stat-value { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-hint { font-size: 12px; color: var(--muted); }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; }
.pre { white-space: pre-line; }
.list-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.list-row.is-muted { color: var(--muted); }
.alert-item { display: inline-block; margin-left: 8px; }
.mt-12 { margin-top: 12px; }
.push-right { margin-left: auto; }
.search-wide { min-width: 320px; }
.input-num { width: 72px; min-width: 0; }
.input-tooth { width: 80px; min-width: 0; }
.input-money { width: 120px; min-width: 0; }
.input-date { width: 150px; min-width: 0; }
.input-big { font-size: 18px; font-weight: 600; }
.table tfoot td { border-top: 1px solid var(--border); border-bottom: 0; }
.table .total-row td { font-weight: 600; font-size: 15px; }
h4 { margin: 12px 0 8px; font-size: 14px; }
.kv { display: inline-block; margin-right: 8px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin: 16px 0; }

/* Bemor tanlash */
.picker { position: relative; }
.picker-list {
    position: absolute;
    z-index: 40;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 280px;
    overflow-y: auto;
    background: var(--field);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 24px rgba(16, 24, 40, .12);
}
.picker-item { display: block; width: 100%; padding: 8px 10px; text-align: left; background: none; border: 0; font: inherit; cursor: pointer; }
.picker-item:hover, .picker-item:focus { background: var(--primary-soft); }
.picker-empty { padding: 8px 10px; color: var(--muted); }

/* Kunlik jadval */
.day-grid { table-layout: fixed; min-width: 640px; }
.day-grid th, .day-grid td { padding: 0; border-bottom: 0; border-right: 1px solid var(--border); height: 22px; vertical-align: top; }
.day-grid th { padding: 8px; text-align: center; }
.day-grid tr.dg-hour td { border-top: 1px solid var(--border); }
.day-grid tbody tr:hover { background: none; }
.dg-time { width: 64px; padding: 2px 8px !important; font-size: 12px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.dg-off { background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 4px, #e2e5e9 4px, #e2e5e9 8px); }
.dg-free { box-shadow: inset 3px 0 0 var(--dot); }
.dg-add { display: block; height: 100%; min-height: 22px; text-align: center; color: transparent; font-weight: 600; }
.dg-add:hover { color: var(--primary); background: var(--primary-soft); text-decoration: none; }
.dg-apt { padding: 2px !important; }
.apt-block {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 40px;
    padding: 4px 6px;
    font-size: 12px;
    line-height: 1.3;
    color: var(--text);
    background: var(--primary-soft);
    border-left: 3px solid var(--dot);
    border-radius: 4px;
    overflow: hidden;
}
.apt-block:hover { text-decoration: none; filter: brightness(.97); }
.apt-block.status-confirmed { background: #d9e2f3; }
.apt-block.status-arrived, .apt-block.status-in_progress { background: var(--warning-soft); }
.apt-block.status-completed { background: var(--success-soft); }
.apt-time { font-weight: 600; font-variant-numeric: tabular-nums; }
.apt-name { font-weight: 500; }
.apt-meta { color: var(--muted); }

/* Tashrif: xizmat qo'shish */
.add-item { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.add-item select { flex: 1 1 260px; }
.plan-items td { padding: 6px; }
.plan-items select { min-width: 220px; }

/* Tish formulasi */
.tooth-chart { overflow-x: auto; }
.tooth-row { display: flex; justify-content: center; gap: 3px; margin-bottom: 6px; }
.tooth-row-upper { padding-bottom: 6px; border-bottom: 1px dashed var(--border-strong); }
.tooth-mid { width: 1px; margin: 0 4px; background: var(--border-strong); }
.tooth {
    display: grid;
    place-items: center;
    width: 30px;
    height: 38px;
    padding: 0;
    font: inherit;
    font-size: 11px;
    font-weight: 600;
    color: var(--text);
    background: var(--tooth, var(--field));
    border: 1px solid var(--border-strong);
    border-radius: 6px 6px 10px 10px;
}
.tooth-row-lower .tooth { border-radius: 10px 10px 6px 6px; }
button.tooth { cursor: pointer; }
button.tooth:hover { border-color: var(--primary); box-shadow: var(--focus); }
.tooth.state-missing span { text-decoration: line-through; color: var(--muted); }
.tooth-primary { margin-top: 8px; }
.tooth-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 10px; font-size: 12px; color: var(--text-2); }
.tooth-swatch { display: inline-block; width: 12px; height: 12px; margin-right: 4px; vertical-align: -2px; background: var(--tooth); border: 1px solid var(--border-strong); border-radius: 3px; }
.tooth-dialog { width: min(420px, calc(100vw - 32px)); padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); }
.tooth-dialog::backdrop { background: rgba(17, 24, 39, .4); }

/* 9. Liquid Glass — ichki sahifalar (body.app) -------------------------
   Login sahifasi (body.auth-body) bu bo'limdan foydalanmaydi va o'zgarmaydi.

   Qoidalar:
   - Shisha faqat "qobiq"da: yon menyu, yuqori panel, kartalar. Matn o'qiladigan
     joylar (maydon, jadval qatori, ro'yxat) deyarli shaffof emas — kontrast saqlanadi.
   - Bitta asosiy rang (to'q ko'k) faqat asosiy amal va faol holat uchun.
   - Harakat qisqa (≤ 200 ms) va faqat javob sifatida; "kam harakat" sozlamasida o'chadi.
   - backdrop-filter yo'q brauzerda yoki "kam shaffoflik" sozlamasida — oddiy oq fon. */
body.app {
    --glass: rgba(255, 255, 255, .58);
    --glass-strong: rgba(255, 255, 255, .86);
    --glass-border: rgba(255, 255, 255, .75);
    --glass-blur: blur(22px) saturate(170%);
    --glass-shadow: 0 10px 30px rgba(15, 23, 42, .08), 0 1px 2px rgba(15, 23, 42, .04), inset 0 1px 0 rgba(255, 255, 255, .85);

    --surface: var(--glass);
    --surface-2: rgba(15, 23, 42, .045);
    --field: rgba(255, 255, 255, .88);
    --border: rgba(15, 23, 42, .08);
    --border-strong: rgba(15, 23, 42, .16);
    --text: #1f2937;
    --text-2: #4b5563;
    --muted: #6b7280;
    --primary: #2563d7;        /* ichki sahifalar urg'u rangi (login: to'q ko'k qoladi) */
    --primary-2: #4c86ee;
    --primary-hover: #1d4fb4;
    --primary-soft: rgba(37, 99, 215, .09);
    --focus: 0 0 0 3px rgba(37, 99, 215, .22);
    --radius: 20px;
    --radius-sm: 12px;
    --shadow: var(--glass-shadow);
    --sidebar-w: 252px;

    background: #e8eef6;
}

/* Fon: yumshoq rangli dog'lar — shisha ortida "chuqurlik" beradi. Qo'zg'almas. */
body.app::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(60% 50% at 10% 6%, rgba(96, 165, 250, .38), transparent 70%),
        radial-gradient(50% 45% at 94% 10%, rgba(167, 139, 250, .28), transparent 70%),
        radial-gradient(55% 50% at 80% 96%, rgba(45, 212, 191, .22), transparent 70%),
        radial-gradient(45% 40% at 6% 94%, rgba(253, 186, 116, .20), transparent 70%);
}

/* Yozuv: Outfit qalin ko'rinadi, shuning uchun ichki sahifalarda yengilroq vazn */
.app { color: var(--text); }
.app h1, .app h2, .app h3, .app h4 { font-weight: 600; letter-spacing: -0.01em; }
.app .page-head h1 { font-size: 24px; }
.app strong, .app b { font-weight: 600; }
.app a { font-weight: 400; }
.app .sidebar-brand-name { font-weight: 700; letter-spacing: -0.02em; }
.app .sidebar-link { font-weight: 400; }
.app .sidebar-link.active { font-weight: 500; }
.app .topbar-title { font-weight: 600; letter-spacing: -0.01em; }
.app .user-name { font-weight: 500; }
.app .user-avatar { font-weight: 600; }
.app .btn { font-weight: 500; }
.app .form-group label, .app .form-label { font-weight: 500; color: var(--text-2); }
.app .table th { font-weight: 500; }
.app .badge { font-weight: 500; }
.app .tab, .app .tab.active { font-weight: 500; }
.app .stat-label { font-weight: 400; }
.app .stat-value { font-weight: 600; letter-spacing: -0.01em; }
.app .table .total-row td { font-weight: 600; }
.app .apt-time, .app .shift-time, .app .week-day-head { font-weight: 500; }
.app .apt-name, .app .shift-doctor { font-weight: 500; }
.app .phone-prefix { font-weight: 500; }
.app .tooth { font-weight: 500; }

/* Shisha yuzalar */
.app .card,
.app .table-wrap,
.app .stat,
.app .week-day {
    border-color: var(--glass-border);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
}
.app .card-header { border-bottom-color: var(--border); }
.app .table-wrap { overflow: auto; }
.app .table th { background: none; }
.app .table tbody tr { transition: background-color .15s ease; }
.app .table tbody tr:hover { background: rgba(255, 255, 255, .55); }

/* Ustiga chiqadigan oynalar: o'qilishi uchun zichroq shisha */
.app .picker-list,
.app .tooth-dialog {
    background: var(--glass-strong);
    border-color: var(--glass-border);
    box-shadow: 0 20px 50px rgba(15, 23, 42, .18), inset 0 1px 0 rgba(255, 255, 255, .9);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
}
.app .tooth-dialog { border-radius: 24px; padding: 24px; }
.app .tooth-dialog::backdrop { background: rgba(15, 23, 42, .28); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.app .picker-item { border-radius: 8px; }
.app .picker-list { padding: 4px; }

/* Tugmalar: asosiy amal — yagona to'q, hajmli tugma */
.app .btn { min-height: 40px; transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .12s ease; }
.app .btn:active:not(:disabled) { transform: scale(.97); }
.app .btn-sm { min-height: 32px; border-radius: 10px; }
.app .btn-primary {
    background: linear-gradient(160deg, var(--primary-2), var(--primary));
    box-shadow: 0 4px 12px rgba(37, 99, 215, .20), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.app .btn-primary:hover { background: linear-gradient(160deg, var(--primary), var(--primary-hover)); box-shadow: 0 8px 20px rgba(37, 99, 215, .32), inset 0 1px 0 rgba(255, 255, 255, .22); }
.app .btn-secondary { box-shadow: 0 1px 2px rgba(15, 23, 42, .05), inset 0 1px 0 rgba(255, 255, 255, .9); }
.app .btn-secondary:hover { background: #fff; }
.app .btn-ghost:hover { background: rgba(255, 255, 255, .7); }
.app .btn-danger { box-shadow: 0 6px 16px rgba(220, 38, 38, .22), inset 0 1px 0 rgba(255, 255, 255, .2); }

/* Maydonlar: oq, aniq chegarali — ma'lumot kiritishda shaffoflik xalaqit bermasin */
.app .form-control { min-height: 42px; box-shadow: inset 0 1px 2px rgba(15, 23, 42, .04); }
.app .form-control:hover { border-color: rgba(15, 23, 42, .28); }
.app .form-control:focus { background: #fff; }
.app .form-control-sm { min-height: 34px; border-radius: 10px; }
.app textarea.form-control { min-height: 88px; }
.app .phone-group { box-shadow: inset 0 1px 2px rgba(15, 23, 42, .04); overflow: hidden; }
.app .phone-group .form-control { box-shadow: none; }
.app .form-color { min-height: 0; }
.app input[type="checkbox"], .app input[type="radio"] { width: 18px; height: 18px; accent-color: var(--primary); }

/* Xabar va belgilar */
.app .alert { border-radius: 14px; box-shadow: 0 4px 14px rgba(15, 23, 42, .05); }
.app .badge { background: rgba(255, 255, 255, .7); }
.app .badge-primary { background: var(--primary-soft); border-color: rgba(37, 99, 215, .16); }
.app .badge-success { background: var(--success-soft); }
.app .badge-warning { background: var(--warning-soft); }
.app .badge-danger  { background: var(--danger-soft); }
.app code { background: rgba(15, 23, 42, .06); }

/* Tablar: kapsula ko'rinishida */
.app .tabs {
    display: inline-flex;
    gap: 2px;
    padding: 4px;
    margin-bottom: 20px;
    background: rgba(15, 23, 42, .06);
    border: 0;
    border-radius: 14px;
}
.app .tab { margin: 0; padding: 8px 16px; border: 0; border-radius: 10px; transition: background-color .18s ease, color .18s ease; }
.app .tab:hover { background: rgba(255, 255, 255, .5); }
.app .tab.active { background: #fff; color: var(--primary); box-shadow: 0 2px 6px rgba(15, 23, 42, .1); }

/* Ko'rsatkich kartalari: bosiladiganlari yengil ko'tariladi */
.app .stat { transition: transform .18s ease, box-shadow .18s ease; }
.app a.stat:hover { transform: translateY(-2px); border-color: var(--glass-border); box-shadow: 0 16px 36px rgba(15, 23, 42, .12), inset 0 1px 0 rgba(255, 255, 255, .85); }

/* Smenalar */
.app .week-day.is-today { border-color: rgba(37, 99, 215, .35); box-shadow: var(--glass-shadow), inset 0 3px 0 var(--primary); }
.app .week-day.is-closed { background: rgba(15, 23, 42, .04); -webkit-backdrop-filter: none; backdrop-filter: none; }
.app .shift { background: rgba(255, 255, 255, .8); border-color: var(--border); border-left-color: var(--dot, var(--primary)); }
.app .week-day-add:hover { background: rgba(255, 255, 255, .6); }

/* Kunlik jadval: kataklar aniq ko'rinishi kerak — shaffoflik kam */
.app .dg-off { background: repeating-linear-gradient(45deg, rgba(15, 23, 42, .03), rgba(15, 23, 42, .03) 4px, rgba(15, 23, 42, .08) 4px, rgba(15, 23, 42, .08) 8px); }
.app .dg-add { transition: background-color .15s ease, color .15s ease; }
.app .apt-block { border-radius: 8px; background: rgba(255, 255, 255, .92); box-shadow: 0 2px 6px rgba(15, 23, 42, .08); transition: transform .15s ease, box-shadow .15s ease; }
.app .apt-block:hover { filter: none; transform: translateY(-1px); box-shadow: 0 6px 14px rgba(15, 23, 42, .14); }
.app .apt-block.status-confirmed { background: #e6edfb; }
.app .apt-block.status-arrived, .app .apt-block.status-in_progress { background: #fff6dd; }
.app .apt-block.status-completed { background: #e7f8ec; }

/* Tish formulasi */
.app .tooth { transition: transform .12s ease, border-color .15s ease, box-shadow .15s ease; }
.app button.tooth:hover { transform: translateY(-2px); }

/* Ro'yxat va sahifalash */
.app .list-row { border-bottom-color: var(--border); }
.app .empty-state { padding: 48px 16px; }

/* Klaviatura fokusi doim ko'rinadi */
.app :focus-visible { box-shadow: 0 0 0 3px rgba(255, 255, 255, .9), 0 0 0 5px rgba(37, 99, 215, .55); }
.app .form-control:focus-visible { box-shadow: var(--focus); }
.app .phone-group .form-control:focus-visible { box-shadow: none; }

/* Zaxira: blur ishlamasa yoki foydalanuvchi shaffoflikni kamaytirgan bo'lsa */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    body.app { --glass: rgba(255, 255, 255, .94); }
}
@media (prefers-reduced-transparency: reduce) {
    body.app { --glass: #fff; --glass-strong: #fff; --field: #fff; }
}
@media (prefers-reduced-motion: reduce) {
    .app *, .app *::before, .app *::after { transition: none !important; }
}

/* Chop etish */
.pg-print { background: #fff; }
.print-sheet { max-width: 800px; margin: 24px auto; padding: 0 16px; }
.print-head { display: flex; justify-content: space-between; border-bottom: 2px solid var(--text); padding-bottom: 8px; margin-bottom: 16px; }
.print-sign { display: flex; justify-content: space-between; gap: 24px; margin: 40px 0 24px; }

@media (max-width: 900px) {
    .grid-2, .grid-wide-left { grid-template-columns: 1fr; }
    .search-wide { min-width: 0; width: 100%; }
}

@media print {
    .sidebar, .topbar, .footer, .btn, .no-print { display: none !important; }
    .content { margin: 0; padding: 0; }
    body, body.app { background: #fff; }
    body.app::before { display: none; }
    .app .card, .app .table-wrap { background: #fff; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* 10. Kassa: chiqimlar, smenani yopish ---------------------------------- */
.section-title { font-size: 16px; font-weight: 600; margin: 22px 0 10px; color: var(--text); }
.stat-accent { box-shadow: inset 0 0 0 2px var(--primary); }
.btn-link { background: none; border: 0; color: var(--primary); padding: 4px 0; box-shadow: none; cursor: pointer; }
.btn-link:hover { text-decoration: underline; }
.table-compact td, .table-compact th { padding: 6px 8px; }

.cash-forms { margin-bottom: 8px; }
.cash-forms details.card > summary { list-style: none; cursor: pointer; display: flex; align-items: center; }
.cash-forms details.card > summary::-webkit-details-marker { display: none; }
.cash-forms details.card > summary h3 { margin: 0; display: flex; align-items: center; gap: 8px; }
.cash-forms details.card > summary::after { content: '+'; margin-left: auto; font-size: 20px; color: var(--muted); }
.cash-forms details[open].card > summary::after { content: '−'; }
.cash-forms details[open].card > summary { margin-bottom: 14px; }

details.inline-action { position: relative; display: inline-block; }
details.inline-action > summary { list-style: none; }
details.inline-action > summary::-webkit-details-marker { display: none; }
.inline-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; display: flex; gap: 6px; padding: 10px;
              background: var(--field); border: 1px solid var(--border); border-radius: var(--radius-sm);
              box-shadow: 0 10px 30px rgba(15, 23, 42, .15); min-width: 300px; }

.denoms { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; margin: 10px 0 14px; }
.denom { display: grid; grid-template-columns: 70px 10px 64px minmax(0, 1fr); align-items: center; gap: 6px;
         padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--field); }
.denom-value { font-weight: 600; font-variant-numeric: tabular-nums; }
.denom-x { color: var(--muted); }
.denom-sum { text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.app .denom .form-control { width: 64px; min-width: 0; text-align: center; padding-left: 6px; padding-right: 6px; }
.close-totals { display: flex; flex-wrap: wrap; gap: 24px; padding: 12px 14px; margin-bottom: 14px;
                background: var(--surface); border-radius: var(--radius-sm); }
.close-totals > div { display: flex; flex-direction: column; gap: 2px; }
.close-totals strong { font-size: 20px; font-variant-numeric: tabular-nums; }

.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: minmax(120px, 220px) 1fr auto; align-items: center; gap: 12px; }
.bar-track { height: 10px; border-radius: 6px; background: var(--surface); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--primary), var(--primary-2, var(--primary))); }
.bar-value { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

@media (max-width: 640px) {
    .inline-pop { position: static; min-width: 0; margin-top: 6px; box-shadow: none; }
    .bar-row { grid-template-columns: 1fr auto; }
    .bar-track { grid-column: 1 / -1; order: 3; }
}

/* 11. POS, bildirishnomalar, analitika, laboratoriya, retsept ----------- */
.text-warning { color: #b45309; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; vertical-align: middle; margin-right: 4px; }
.bar-danger { background: linear-gradient(90deg, #f87171, var(--danger)) !important; }
.tabs-wrap { flex-wrap: wrap; }
.tab-count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 10px; font-size: 11px; line-height: 18px; text-align: center; background: rgba(100, 116, 139, .14); }
.tab-count-danger { background: var(--danger); color: #fff; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.timeline li { padding-left: 14px; border-left: 2px solid var(--border); }
.status-form { margin-bottom: 8px; }
.status-form .row .form-control-sm { flex: 1; min-width: 120px; }
.export-pop { flex-direction: column; min-width: 180px; }

/* Bildirishnomalar */
.notif { position: relative; }
.notif-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px;
             border-radius: 50%; border: 1px solid var(--border); background: var(--field); color: var(--text); cursor: pointer; }
.notif-btn .ui-icon { width: 18px; height: 18px; }
.notif-count { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
               background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.notif-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; width: min(340px, 90vw); padding: 8px;
               background: var(--field); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 18px 40px rgba(15, 23, 42, .18); }
.notif-title { font-weight: 600; padding: 6px 8px 8px; }
.notif-item { display: block; padding: 10px 10px 10px 12px; margin-bottom: 4px; border-radius: var(--radius-sm); color: var(--text);
              text-decoration: none; border-left: 3px solid var(--primary); background: var(--surface); }
.notif-item:hover { filter: brightness(.97); text-decoration: none; }
.notif-warning { border-left-color: #f59e0b; }
.notif-danger { border-left-color: var(--danger); }
.notif-success { border-left-color: var(--success); }
.notif-empty { padding: 10px; color: var(--muted); font-size: 13px; }

/* POS kassa */
.pos { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(320px, 1.4fr) minmax(300px, 1.1fr); gap: 16px; align-items: start; }
.pos .card { margin: 0; }
.pos h3 { margin: 0 0 10px; }
.pos-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 10px; }
.pos-search { position: relative; margin-bottom: 10px; }
.pos-results { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); max-height: 320px; overflow: auto; padding: 6px;
               background: var(--field); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: 0 12px 30px rgba(15, 23, 42, .15); }
.pos-results button { display: block; width: 100%; text-align: left; padding: 8px; border: 0; background: none; border-radius: 6px; cursor: pointer; color: var(--text); }
.pos-results button:hover { background: var(--surface); }
.pos-list { display: flex; flex-direction: column; gap: 6px; max-height: calc(100vh - 300px); overflow: auto; }
.pos-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 10px 12px;
            border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--field); cursor: pointer; color: var(--text); }
.pos-item:hover, .pos-item.active { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(37, 99, 215, .15); }
.pos-item-main { display: flex; flex-direction: column; min-width: 0; }
.pos-item-main strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pos-item-sum { font-weight: 700; color: var(--danger); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pos-empty, .pos-empty-small { color: var(--muted); text-align: center; padding: 30px 10px; }
.pos-empty .ui-icon { width: 42px; height: 42px; opacity: .4; }
.pos-refresh { margin-top: 8px; }
.pos-visit { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 8px; background: var(--field); }
.pos-visit.active { border-color: var(--primary); }
.pos-visit-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.pos-items { width: 100%; font-size: 13px; }
.pos-items td { padding: 3px 0; }
.pos-total { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 0 4px; border-top: 2px solid var(--border); margin-top: 6px; }
.pos-total strong { font-size: 24px; font-variant-numeric: tabular-nums; }
.pay-line { display: grid; grid-template-columns: 90px 1fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.pay-line .form-control { font-size: 18px; font-weight: 600; text-align: right; }
.pay-method { font-weight: 600; }
.pos-methods { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.pos-sum { display: flex; gap: 20px; padding: 10px 12px; margin-bottom: 12px; background: var(--surface); border-radius: var(--radius-sm); }
.pos-sum > div { display: flex; flex-direction: column; }
.pos-sum strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.pos-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pos-change { margin-top: 8px; font-size: 16px; }
.pos-change strong { font-size: 20px; color: var(--success); }
.pos-msg { margin-top: 10px; font-weight: 600; min-height: 1.4em; }
@media (max-width: 1100px) { .pos { grid-template-columns: 1fr 1fr; } .pos-queue { grid-column: 1 / -1; } .pos-list { max-height: 260px; } }
@media (max-width: 720px) { .pos { grid-template-columns: 1fr; } }

/* Analitika */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi .stat-value { font-size: 22px; }
.kpi-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; }
.kpi-delta { font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 10px; }
.kpi-delta.up { color: #15803d; background: rgba(22, 163, 74, .12); }
.kpi-delta.down { color: #b91c1c; background: rgba(220, 38, 38, .1); }
.an-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.an-grid .card { margin: 0; }
.an-full { grid-column: 1 / -1; }
.an-chart { position: relative; height: 280px; }
.an-chart-sm { height: 240px; }
.mini-bar { height: 4px; border-radius: 2px; background: var(--surface); margin-top: 4px; overflow: hidden; max-width: 220px; }
.mini-bar span { display: block; height: 100%; border-radius: 2px; }
.seg .btn { margin: 0; }
.heat-wrap { overflow-x: auto; }
.heat { border-collapse: separate; border-spacing: 3px; font-size: 11px; }
.heat th { color: var(--muted); font-weight: 500; padding: 0 4px; }
.heat td { width: 28px; height: 22px; border-radius: 4px; background: rgba(37, 99, 215, var(--a)); outline: 1px solid rgba(100, 116, 139, .08); }
@media (max-width: 900px) { .an-grid { grid-template-columns: 1fr; } }

/* Retsept */
.rx-items { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.rx-item { display: grid; grid-template-columns: 24px 2fr 1fr 1fr 1.4fr 1fr 2fr 32px; gap: 6px; align-items: center; }
.rx-n { color: var(--muted); text-align: right; }
.rx-list li { margin-bottom: 10px; }
@media (max-width: 900px) { .rx-item { grid-template-columns: 24px 1fr 1fr; } .rx-item .rx-drug, .rx-item .rx-instr { grid-column: span 2; } }

/* ---- 12. Xabarnomalar (email) ---- */
.nt-group { font-size: 15px; font-weight: 600; margin: 22px 0 8px; }
.nt-card { padding: 0; overflow: hidden; }
.nt-row { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-top: 1px solid var(--border); }
.nt-row:first-child { border-top: 0; }
.nt-row:hover { background: var(--bg, #f8fafc); }
.nt-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; color: inherit; text-decoration: none; }
.nt-title { font-weight: 600; }
.nt-desc { font-size: 13px; color: var(--muted); }
.nt-aud { white-space: nowrap; }
.nt-chevron { color: var(--muted); font-size: 22px; line-height: 1; text-decoration: none; padding: 0 2px; }
.nt-chevron:hover { color: var(--primary); }
.nt-save { display: flex; justify-content: flex-end; margin: 18px 0 8px; }
.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch-slider { position: absolute; inset: 0; background: #cbd5e1; border-radius: 22px; cursor: pointer; transition: background .15s; }
.switch-slider::before { content: ""; position: absolute; width: 18px; height: 18px; left: 2px; top: 2px; background: #fff; border-radius: 50%; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked + .switch-slider { background: var(--primary); }
.switch input:checked + .switch-slider::before { transform: translateX(18px); }
.switch input:focus-visible + .switch-slider { outline: 2px solid var(--primary); outline-offset: 2px; }
.switch-row { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; }
.chip { display: inline-block; margin: 4px 4px 0 0; padding: 2px 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface, #fff); font: 12px/18px ui-monospace, Menlo, Consolas, monospace; cursor: pointer; color: var(--text); }
.chip:hover { border-color: var(--primary); color: var(--primary); }
textarea.mono { font: 13px/1.5 ui-monospace, Menlo, Consolas, monospace; }
.mail-preview { width: 100%; height: 520px; border: 1px solid var(--border); border-radius: 8px; background: #f1f5f9; margin-top: 10px; }
.smtp-log { background: #0f172a; color: #e2e8f0; padding: 10px 12px; border-radius: 6px; font-size: 12px; white-space: pre-wrap; word-break: break-all; max-height: 260px; overflow: auto; margin: 8px 0 0; }
@media (max-width: 640px) { .nt-row { padding: 12px; gap: 10px; } .nt-aud { white-space: normal; } }

/* ---- 13. Supabase kirish: Google, 2FA ---- */
.auth-or { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--muted); font-size: 13px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.btn-google { display: flex; align-items: center; justify-content: center; gap: 10px; }
.otp-input { font: 600 22px/1.2 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .35em; text-align: center; }
.mfa-setup { align-items: flex-start; flex-wrap: wrap; }
.mfa-qr { flex: none; width: 196px; min-height: 196px; padding: 8px; background: #fff; border: 1px solid var(--border); border-radius: 10px; }
.mfa-qr img { display: block; width: 180px; height: 180px; }
.mfa-steps { margin: 0 0 12px; padding-left: 18px; line-height: 1.6; }
.mfa-secret { font-size: 13px; padding: 2px 6px; background: var(--bg, #f1f5f9); border-radius: 4px; user-select: all; }

/* ---- 14. Bemorlar: ro'yxat va karta (mobilga mos) ---- */
.pt-avatar {
    --h: 210;
    display: inline-flex; align-items: center; justify-content: center; flex: none;
    width: 40px; height: 40px; border-radius: 50%;
    font-size: 14px; font-weight: 600; letter-spacing: .02em;
    color: hsl(var(--h) 45% 32%); background: hsl(var(--h) 60% 92%);
}
.pt-avatar-lg { width: 64px; height: 64px; font-size: 22px; }

/* Qidiruv paneli */
.pt-search { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px; margin-bottom: 12px; }
.pt-search-main { position: relative; flex: 1 1 280px; }
.pt-search-main .ui-icon { position: absolute; left: 12px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.pt-search-main .form-control { padding-left: 38px; }
.pt-search select.form-control { flex: 0 1 200px; width: auto; }

/* Filtr chiplari — mobilda gorizontal suriladi */
.chips-scroll { display: flex; gap: 6px; margin: 0 0 14px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
.chips-scroll::-webkit-scrollbar { display: none; }
.chip-tab {
    flex: none; display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 500;
    color: var(--text-2); background: var(--surface); border: 1px solid var(--border); text-decoration: none; white-space: nowrap;
}
.chip-tab:hover { border-color: var(--border-strong); color: var(--text); text-decoration: none; }
.chip-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip-count { min-width: 20px; padding: 0 6px; border-radius: 10px; font-size: 11px; line-height: 18px; text-align: center; background: rgba(100, 116, 139, .14); }
.chip-tab.active .chip-count { background: rgba(255, 255, 255, .22); }
.chip-danger:not(.active) .chip-count { background: var(--danger-soft); color: var(--danger); }

/* Ro'yxat: kompyuterda jadval kabi, telefonda kartochka */
.pt-list { padding: 0; overflow: hidden; }
.pt-row {
    display: grid; grid-template-columns: minmax(240px, 2.2fr) 1.1fr 1.4fr 1.4fr 1fr;
    align-items: center; gap: 12px; padding: 12px 16px;
    border-top: 1px solid var(--border); color: inherit; text-decoration: none;
}
.pt-row:first-child { border-top: 0; }
a.pt-row:hover { background: var(--surface-2); text-decoration: none; }
.pt-head { padding-top: 10px; padding-bottom: 10px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); }
.pt-row .num, .pt-head .num { text-align: right; }
.pt-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pt-who-text { display: flex; flex-direction: column; min-width: 0; }
.pt-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.pt-meta, .pt-sub { font-size: 12px; color: var(--muted); }
.pt-meta code { font-size: 12px; }
.pt-cell { display: flex; flex-direction: column; min-width: 0; font-size: 14px; }
.pt-cell.num { align-items: flex-end; }
.pt-next { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; color: var(--primary); }
.pt-next .ui-icon { width: 14px; height: 14px; }
.pt-bal { font-weight: 600; white-space: nowrap; }
.pt-bal-debt { color: var(--danger); }
.pt-bal-adv { color: var(--success); }
.is-muted .pt-name { color: var(--muted); }

@media (max-width: 900px) {
    .pt-head { display: none; }
    .pt-row { grid-template-columns: 1fr 1fr; gap: 10px 12px; padding: 14px; }
    .pt-who { grid-column: 1 / -1; }
    .pt-cell::before { content: attr(data-label); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 2px; }
    .pt-cell.num { align-items: flex-start; }
    .pt-search select.form-control { flex: 1 1 140px; }
}

/* ---- Bemor kartasi ---- */
.pt-hero { padding: 20px; }
.pt-hero-top { display: flex; align-items: center; gap: 16px; }
.pt-hero-id { min-width: 0; }
.pt-hero-id h1 { margin: 0 0 6px; font-size: 24px; font-weight: 600; letter-spacing: -0.01em; }
.pt-hero-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; color: var(--text-2); }
.pt-hero-meta a { display: inline-flex; align-items: center; gap: 4px; color: var(--primary); }
.pt-hero-meta .ui-icon { width: 14px; height: 14px; }
.pt-warn { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 14px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--danger-soft); color: #991b1b; font-size: 14px; }
.pt-warn strong { display: inline-flex; align-items: center; gap: 6px; }
.pt-warn .ui-icon { width: 16px; height: 16px; }
.pt-warn-item { padding: 2px 10px; border-radius: 999px; background: #fff; border: 1px solid #fecaca; font-weight: 500; }
.pt-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

.pt-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }
.pt-stat { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); min-width: 0; }
.pt-stat-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.pt-stat strong { font-size: 20px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-stat-hint { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Tablar — yopishqoq, mobilda suriladi */
.pt-tabs {
    position: sticky; top: 0; z-index: 5;
    display: flex; gap: 4px; margin: 0 0 14px; padding: 4px;
    overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border);
}
.pt-tabs::-webkit-scrollbar { display: none; }
.pt-tabs a { flex: none; padding: 8px 14px; border-radius: 9px; font-size: 14px; font-weight: 500; color: var(--text-2); text-decoration: none; white-space: nowrap; }
.pt-tabs a:hover { color: var(--text); text-decoration: none; }
.pt-tabs a.active { background: var(--surface); color: var(--primary); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.pt-panel[hidden] { display: none; }
.pt-dl { grid-template-columns: max-content 1fr; }
.pt-inline-form { display: flex; flex-wrap: wrap; gap: 8px; }
.pt-inline-form input { flex: 1 1 160px; }
.pt-inline-form select { flex: 0 1 160px; width: auto; }

/* Anamnez */
.pt-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.pt-fieldset legend { font-weight: 600; margin-bottom: 10px; }
.pt-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.pt-check { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--field); cursor: pointer; font-size: 14px; }
.pt-check:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.pt-check.is-critical:has(input:checked) { border-color: var(--danger); background: var(--danger-soft); color: #991b1b; }
.pt-check input { width: 18px; height: 18px; flex: none; accent-color: var(--primary); }
.pt-check.is-critical input { accent-color: var(--danger); }
.pt-smoke { display: flex; align-items: flex-end; padding-bottom: 8px; }
.pt-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.pt-tag { padding: 3px 10px; border-radius: 999px; font-size: 13px; background: var(--primary-soft); color: var(--primary); }
.pt-tag-danger { background: var(--danger-soft); color: #991b1b; }
.pt-chart { overflow-x: auto; }

/* Izohlar */
.pt-note-form { display: flex; flex-direction: column; gap: 10px; }
.pt-note-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pt-note-bar select { width: auto; }
.pt-note-bar .btn { margin-left: auto; }
.pt-note { padding: 12px 0; border-top: 1px solid var(--border); }
.pt-note:first-child { border-top: 0; padding-top: 0; }
.pt-note p { margin: 6px 0 0; }
.pt-note-pinned { padding-left: 12px; border-left: 3px solid var(--warning); }
.pt-note-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.pt-note-tools { margin-left: auto; display: inline-flex; gap: 2px; }
.pt-note-tools .ui-icon { width: 16px; height: 16px; }

/* Faoliyat lentasi */
.tl { list-style: none; margin: 0; padding: 0; position: relative; }
.tl::before { content: ''; position: absolute; left: 15px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl-item { position: relative; display: flex; gap: 12px; padding: 8px 0; }
.tl-dot { position: relative; z-index: 1; flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border); color: var(--muted); }
.tl-dot .ui-icon { width: 15px; height: 15px; }
.tl-visit .tl-dot { color: var(--primary); border-color: #bfdbfe; }
.tl-payment .tl-dot { color: var(--success); border-color: #bbf7d0; }
.tl-refund .tl-dot, .tl-alert .tl-dot { color: var(--danger); border-color: #fecaca; }
.tl-note .tl-dot { color: var(--warning); border-color: #fde68a; }
.tl-body { min-width: 0; padding-top: 4px; }
.tl-title { font-weight: 500; }
.tl-sub { font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; }
.tl-time { font-size: 12px; color: var(--muted); }

@media (max-width: 900px) {
    .pt-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .pt-hero { padding: 16px; }
    .pt-hero-top { align-items: flex-start; }
    .pt-avatar-lg { width: 52px; height: 52px; font-size: 18px; }
    .pt-hero-id h1 { font-size: 20px; }
    /* Telefonda amallar 2 ustunda — hammasi ko'rinadi, yon tomonga surish shart emas */
    .pt-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 14px 0 0; }
    .pt-actions .btn { justify-content: center; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .pt-stats { gap: 8px; }
    .pt-stat { padding: 12px; }
    .pt-stat strong { font-size: 17px; }
    .pt-checks { grid-template-columns: 1fr; }
    .pt-dl { grid-template-columns: 1fr; gap: 2px 0; }
    .pt-dl dd { margin-bottom: 8px; }
    .pt-note-bar .btn { margin-left: 0; flex: 1 1 100%; }
}

/* ---- 15. Kassa: to'lov kutayotgan bemorlar ---- */
.pay-queue { margin-bottom: 16px; }
.pay-queue .card-header { flex-wrap: wrap; gap: 8px; }
.pay-queue-sum { font-size: 14px; color: var(--text-2); }
.pay-queue-filter { position: relative; margin-bottom: 10px; }
.pay-queue-filter .ui-icon { position: absolute; left: 12px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.pay-queue-filter .form-control { padding-left: 38px; }
.pay-queue-list { max-height: 420px; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.pay-queue-row { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 12px; padding: 10px 8px; border-radius: var(--radius-sm); color: inherit; text-decoration: none; border-top: 1px solid var(--border); }
.pay-queue-row:first-child { border-top: 0; }
.pay-queue-row:hover { background: var(--surface-2); text-decoration: none; }
.pay-queue-row[hidden] { display: none; }
.pay-queue-who { display: flex; flex-direction: column; min-width: 0; }
.pay-queue-who strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pay-queue-debt { color: var(--danger); white-space: nowrap; }
@media (max-width: 640px) {
    .pay-queue-row { grid-template-columns: auto 1fr auto; }
    .pay-queue-when { grid-column: 2; grid-row: 2; }
    .pay-queue-debt { grid-row: 1 / span 2; grid-column: 3; }
}
.pay-lab-form { display: flex; gap: 6px; justify-content: flex-end; }
.pay-lab-form select { width: auto; }

/* ---- 16. Mobil moslashuv (umumiy tuzatishlar) ---- */
/* Grid/flex bolalari jadval kengligiga cho'zilib, sahifani kengaytirmasin */
.content, .grid-2 > *, .grid-wide-left > *, .form-row > *, .row > * { min-width: 0; }
.sidebar-lang { display: none; padding: 8px 12px; }

@media (max-width: 900px) {
    /* Karta ichidagi .table-wrap siz jadvallar — o'z joyida gorizontal suriladi */
    .card > .table, .card > table, .content > .table, .table-plain, .grid-2 .table {
        display: block; width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
    }
    .card > .table thead, .card > .table tbody, .table-plain thead, .table-plain tbody, .grid-2 .table thead, .grid-2 .table tbody { width: 100%; }
    .table th, .table td { white-space: nowrap; }
    .table td.wrap, .table .pre { white-space: normal; }
    .page-head { flex-wrap: wrap; gap: 10px; }
    .page-head > .row, .page-head > div:last-child:not(:first-child) { flex-wrap: wrap; }
    .toolbar, .row { flex-wrap: wrap; }
}

@media (max-width: 640px) {
    /* Yuqori panel: til tanlash yon menyuga ko'chadi, joy torayadi */
    .topbar .lang-switch { display: none; }
    .sidebar-lang { display: block; }
    .topbar-right { gap: 6px; }
    .topbar-left { gap: 8px; }
    .topbar-title { font-size: 16px; }
    .topbar-left { flex: 1 1 auto; }
    .topbar-right { flex: none; }
    .content { padding: 12px 8px; }
    .card { padding: 14px; }
    .page-head h1 { font-size: 22px; }
    .form-row { grid-template-columns: 1fr !important; }
    .stat-row, .kpi-row { grid-template-columns: 1fr 1fr; }
}
.an-grid > *, .pt-stats > *, .stat-row > *, .grid-3 > * { min-width: 0; }
@media (max-width: 900px) { .an-grid { grid-template-columns: minmax(0, 1fr); } .an-grid > * { grid-column: auto !important; } }
/* Telefonda bir necha piksellik ortiqcha (soya, belgi) sahifani yon tomonga "qimirlatmasin" */
@media (max-width: 900px) { html, body { overflow-x: clip; } }
@media (max-width: 900px) {
    /* Tablar: bir qatorda, barmoq bilan suriladi (3 qatorga bo'linmaydi) */
    .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
    .tabs::-webkit-scrollbar { display: none; }
    .tabs .tab { flex: none; white-space: nowrap; }
    /* inline-flex tablar kontent kengligida o'sib ketmasin — ekran ichida qolib, ichida surilsin */
    .tabs, .app .tabs { max-width: 100%; }
    /* Jadval ichidagi tanlov va kiritish maydonlari siqilib qolmasin */
    .table select.form-control, .table input.form-control:not([type=checkbox]) { min-width: 112px; }
}

/* ---- 17. Ichki sahifalar foni: bir xil rang ----
   Rangni o'zgartirish: --app-bg-color. (Avval bu yerda klinika rasmi bor edi — olib tashlandi.) */
body.app {
    --app-bg-color: #ecf1f4;
    background: var(--app-bg-color);
}
body.app::before { background: none; }

/* ---- 18. Xodim kartasi (forma, ro'yxat, lavozimlar) va hujjatdan to'ldirish ---- */
/* hidden atributi har doim ustun (display: flex/grid berilgan elementlarda ham) */
[hidden] { display: none !important; }
.req { color: var(--danger); font-style: normal; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .02em; }
.d-block { display: block; }
.text-center { text-align: center; }
.link-btn { padding: 0; border: 0; background: none; color: var(--primary); font: inherit; cursor: pointer; text-decoration: underline; }
.check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.form-grid { display: grid; gap: 0 16px; }
.form-grid.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .span2 { grid-column: span 2; }

/* Sarlavha kartasi */
.staff-hero {
    position: relative; overflow: hidden;
    display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
    margin-bottom: 18px; padding: 22px 24px; border-radius: var(--radius);
    color: #fff;
    background:
        radial-gradient(1px 1px at 20% 30%, rgba(255, 255, 255, .6), transparent),
        radial-gradient(1px 1px at 70% 60%, rgba(255, 255, 255, .5), transparent),
        radial-gradient(1px 1px at 88% 20%, rgba(255, 255, 255, .6), transparent),
        linear-gradient(120deg, #0f1f3d 0%, #1d3a6e 55%, #3b3f8f 100%);
    box-shadow: 0 16px 36px rgba(15, 31, 61, .22), inset 0 1px 0 rgba(255, 255, 255, .14);
}
.staff-hero-ava {
    flex: none; display: grid; place-items: center; overflow: hidden;
    width: 68px; height: 68px; border-radius: 20px;
    font-size: 24px; font-weight: 600;
    background: linear-gradient(160deg, #7c6cf2, #4f46e5);
    box-shadow: 0 8px 20px rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .3);
    border: 2px solid rgba(255, 255, 255, .5);
}
.staff-hero-ava img { width: 100%; height: 100%; object-fit: cover; }
.staff-hero-text { flex: 1 1 260px; min-width: 0; }
.staff-hero-text h1 { margin: 2px 0 2px; font-size: 24px; color: #fff; }
.staff-hero-text p { margin: 0; opacity: .82; }
.staff-hero-tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .2); }
.staff-hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-light { background: linear-gradient(160deg, #3fb8c9, #2b8fd6); color: #fff; border-color: transparent; box-shadow: 0 6px 16px rgba(43, 143, 214, .35); }
.btn-light:hover { filter: brightness(1.06); color: #fff; }
.btn-ghost-light { background: rgba(255, 255, 255, .1); color: #fff; border: 1px solid rgba(255, 255, 255, .28); }
.btn-ghost-light:hover { background: rgba(255, 255, 255, .18); color: #fff; text-decoration: none; }

/* Joylashuv: chapda forma, o'ngda rasm va hujjatlar */
.staff-layout {
    display: grid; gap: 18px; align-items: start;
    grid-template-columns: minmax(0, 1fr) 340px;
    grid-template-areas: "main top" "main bottom";
    grid-template-rows: auto 1fr;
}
.staff-main { grid-area: main; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.staff-top { grid-area: top; }
.staff-bottom { grid-area: bottom; align-self: start; display: flex; flex-direction: column; gap: 16px; }
.staff-card { margin: 0; }
.staff-sec { display: flex; align-items: center; gap: 12px; margin: -4px 0 16px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.staff-sec h2 { margin: 0; font-size: 17px; }
.staff-sec p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.staff-sec-btn { margin-left: auto; }
.staff-sec-ico {
    flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; color: #fff;
    background: linear-gradient(160deg, #4c86ee, #2563d7); box-shadow: 0 6px 14px rgba(37, 99, 215, .25);
}
.staff-sec-ico.is-violet { background: linear-gradient(160deg, #8b7cf6, #6046e5); box-shadow: 0 6px 14px rgba(96, 70, 229, .25); }
.staff-sec-ico.is-amber  { background: linear-gradient(160deg, #f5b041, #e08a0b); box-shadow: 0 6px 14px rgba(224, 138, 11, .25); }
.staff-sec-ico.is-green  { background: linear-gradient(160deg, #34c38f, #13a06c); box-shadow: 0 6px 14px rgba(19, 160, 108, .25); }
.staff-sec-ico.is-pink   { background: linear-gradient(160deg, #f472b6, #db2777); box-shadow: 0 6px 14px rgba(219, 39, 119, .25); }
.staff-sec-ico .ui-icon { width: 20px; height: 20px; }
.staff-card-title { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 15px; }

/* Rasm */
.staff-photo-box {
    display: grid; place-items: center; overflow: hidden;
    width: 168px; height: 168px; margin: 4px auto 14px; border-radius: 28px;
    background: var(--surface-2); border: 1px solid var(--border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 8px 20px rgba(15, 23, 42, .08);
}
.staff-photo-box img { width: 100%; height: 100%; object-fit: cover; }
.staff-photo-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--muted); }
.staff-photo-empty .ui-icon { width: 44px; height: 44px; opacity: .6; }
.staff-upload { cursor: pointer; border-style: dashed; }

/* Kirish: almashtirgich */
.switch-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); cursor: pointer; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch { flex: none; position: relative; width: 42px; height: 24px; margin-top: 2px; border-radius: 999px; background: rgba(100, 116, 139, .35); transition: background .2s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.switch-row input:checked + .switch { background: var(--success, #16a34a); }
.switch-row input:checked + .switch::after { transform: translateX(18px); }
.switch-row input:focus-visible + .switch { box-shadow: var(--focus); }
.switch-row input:disabled + .switch { opacity: .6; }
.switch-row small { display: block; color: var(--muted); font-size: 12px; }
.staff-nologin { display: flex; align-items: center; gap: 8px; margin: 4px 0 0; padding: 10px 12px; border-radius: 12px; color: var(--text-2); background: var(--surface-2); font-size: 13px; }

/* Ish kunlari */
.staff-days { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 14px; }
.day-chip input { position: absolute; opacity: 0; pointer-events: none; }
.day-chip span {
    display: inline-grid; place-items: center; min-width: 46px; height: 38px; padding: 0 10px; border-radius: 12px;
    font-size: 13px; font-weight: 500; cursor: pointer; user-select: none;
    color: var(--text-2); background: var(--field); border: 1px solid var(--border-strong);
}
.day-chip input:checked + span { color: #fff; background: var(--primary); border-color: var(--primary); }
.day-chip input:focus-visible + span { box-shadow: var(--focus); }
.staff-days-presets { margin-left: auto; display: inline-flex; gap: 4px; }

/* Hujjatlar ro'yxati */
.staff-docs { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.staff-docs li { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border-left: 3px solid transparent; }
.staff-docs li.is-soon { border-left-color: var(--warning, #d97706); }
.staff-docs li.is-expired { border-left-color: var(--danger); background: var(--danger-soft); }
.staff-doc-main { flex: 1; min-width: 0; font-size: 14px; }
.staff-doc-main b { font-weight: 600; }
.staff-doc-act { display: flex; flex: none; }
.staff-doc-add summary { display: flex; align-items: center; gap: 6px; padding: 8px 0; font-weight: 600; cursor: pointer; color: var(--primary); list-style: none; }
.staff-doc-add summary::-webkit-details-marker { display: none; }
.staff-doc-add form { padding-top: 6px; }

/* Pastki "Saqlash" paneli — doim ko'rinadi */
.staff-actions {
    position: sticky; bottom: 12px; z-index: 5;
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 12px 14px; border-radius: 18px;
    background: var(--glass-strong, rgba(255, 255, 255, .9));
    border: 1px solid var(--glass-border, var(--border));
    box-shadow: 0 12px 30px rgba(15, 23, 42, .14);
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.staff-actions-note { margin-left: auto; }
.staff-actions .btn-primary { background: linear-gradient(160deg, #34c38f, #13a06c); border-color: transparent; box-shadow: 0 8px 18px rgba(19, 160, 108, .3); }

/* Ro'yxat */
.staff-alert { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.staff-alert:hover { text-decoration: none; filter: brightness(.98); }
.staff-who { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.staff-who strong { color: var(--text); }
.staff-who:hover strong { color: var(--primary); }
.staff-ava {
    flex: none; display: grid; place-items: center; overflow: hidden;
    width: 42px; height: 42px; border-radius: 14px; font-size: 14px; font-weight: 600;
    color: #fff; background: var(--ava, linear-gradient(160deg, #8b9bb4, #5b6b87));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3);
}
.staff-ava img { width: 100%; height: 100%; object-fit: cover; }
.staff-table td { vertical-align: middle; }
.staff-table .badge-danger, .staff-table .badge-warning { margin-left: 54px; }

/* Lavozimlar */
.pos-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; padding: 12px; }
.pos-add .form-control { flex: 1 1 180px; width: auto; }
.pos-add input[type=number] { flex: 0 0 90px; }

/* Hujjatdan to'ldirish oynasi */
.mrz-dlg {
    width: min(920px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: 0; overflow: auto;
    border: 1px solid var(--border); border-radius: 24px; color: var(--text); background: var(--field, #fff);
    box-shadow: 0 30px 80px rgba(15, 23, 42, .35);
}
.mrz-dlg::backdrop { background: rgba(15, 23, 42, .38); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.mrz-head {
    position: relative; display: flex; align-items: center; gap: 14px; padding: 20px 22px; color: #fff;
    background:
        radial-gradient(1px 1px at 30% 40%, rgba(255, 255, 255, .6), transparent),
        radial-gradient(1px 1px at 80% 30%, rgba(255, 255, 255, .5), transparent),
        linear-gradient(120deg, #0f1f3d, #1d3a6e 60%, #3b3f8f);
}
.mrz-head h2 { margin: 0; font-size: 20px; color: #fff; }
.mrz-head p { margin: 2px 0 0; font-size: 13px; opacity: .82; }
.mrz-head-ico { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: linear-gradient(160deg, #3fb8c9, #2b8fd6); }
.mrz-head-ico .ui-icon { width: 24px; height: 24px; }
.mrz-x { position: absolute; top: 14px; right: 14px; color: #fff; }
.mrz-steps { display: flex; gap: 8px; flex-wrap: wrap; margin: 0; padding: 14px 22px 0; list-style: none; }
.mrz-steps li { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--muted); background: var(--surface-2); }
.mrz-steps b { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: 12px; background: rgba(100, 116, 139, .2); color: var(--text-2); }
.mrz-steps li.is-active { color: var(--text); background: var(--primary-soft); }
.mrz-steps li.is-active b { background: #34c38f; color: #fff; }
.mrz-steps li.is-done b { background: var(--primary); color: #fff; }
.mrz-body { padding: 16px 22px 8px; }
.mrz-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.mrz-pane { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 18px; border: 1px dashed var(--border-strong); background: var(--surface-2); }
.mrz-pane h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 15px; }
.mrz-text { min-height: 120px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; letter-spacing: .08em; line-height: 1.7; text-transform: uppercase; resize: vertical; white-space: pre; overflow-wrap: normal; overflow-x: auto; }
.mrz-cam { position: relative; display: grid; place-items: center; overflow: hidden; aspect-ratio: 4 / 3; border-radius: 14px; background: var(--field, #fff); border: 1px solid var(--border); }
.mrz-cam video { display: none; width: 100%; height: 100%; object-fit: cover; }
.mrz-cam.is-on video { display: block; }
.mrz-cam.is-on .mrz-cam-empty { display: none; }
.mrz-cam-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px; text-align: center; font-size: 13px; color: var(--muted); }
.mrz-cam-empty .ui-icon { width: 36px; height: 36px; color: var(--primary); }
.mrz-cam-frame { display: none; position: absolute; inset: 18%; border: 2px solid rgba(255, 255, 255, .9); border-radius: 12px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .25); }
.mrz-cam.is-on .mrz-cam-frame { display: block; }
.mrz-drop { display: block; padding: 10px; border: 1px dashed var(--border-strong); border-radius: 12px; text-align: center; font-size: 13px; color: var(--text-2); cursor: pointer; background: var(--field, #fff); }
.mrz-drop.is-over { border-color: var(--primary); background: var(--primary-soft); }
.mrz-note-private { margin: 12px 0 0; }
.mrz-table th { width: 38%; font-weight: 500; color: var(--text-2); vertical-align: middle; }
.mrz-table td .form-control { min-width: 0; }
.mrz-chk { width: 40px; text-align: center; }
.mrz-actions { justify-content: flex-end; margin: 14px 0 6px; }
.mrz-msg { margin: 0; padding: 0 22px 16px; font-size: 13px; }
.mrz-msg.is-error { color: var(--danger); }
kbd { padding: 1px 6px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 6px; font-size: 12px; font-family: ui-monospace, monospace; background: var(--field, #fff); }
.mrz-filled { animation: mrzFill 2.4s ease; }
@keyframes mrzFill { 0%, 40% { box-shadow: 0 0 0 3px rgba(52, 195, 143, .45); border-color: #34c38f; } 100% { box-shadow: none; } }

@media (max-width: 1100px) {
    .staff-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "main" "bottom"; grid-template-rows: auto; }
    .staff-photo { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 0 16px; align-items: center; }
    .staff-photo .staff-card-title { grid-column: 1 / -1; }
    .staff-photo-box { grid-row: span 3; width: 120px; height: 120px; margin: 0; border-radius: 22px; }
    .staff-photo .form-hint { text-align: left; }
}
@media (max-width: 760px) {
    .form-grid.g2, .form-grid.g3 { grid-template-columns: minmax(0, 1fr); }
    .form-grid .span2 { grid-column: auto; }
    .staff-hero { padding: 18px; }
    .staff-hero-text h1 { font-size: 20px; }
    .staff-hero-actions { width: 100%; }
    .staff-hero-actions .btn { flex: 1; justify-content: center; }
    .staff-sec-btn { display: none; }
    .staff-days-presets { margin-left: 0; }
    .staff-actions { bottom: 8px; }
    .staff-actions .btn { flex: 1; justify-content: center; }
    .staff-actions-note { display: none; }
    .mrz-grid { grid-template-columns: minmax(0, 1fr); }
    .mrz-text { font-size: 12px; letter-spacing: .02em; }
    .mrz-head { padding: 16px; }
    .mrz-body { padding: 12px 14px 6px; }
    .mrz-steps { padding: 12px 14px 0; }
    .mrz-steps li { font-size: 12px; }
    .staff-table .badge-danger, .staff-table .badge-warning { margin-left: 0; }
}
@media print { .staff-actions, .staff-hero-actions, .staff-bottom { display: none !important; } }

/* ---- 19. Aelo logotipi (qaldirg'och) ---- */
.brand-logo { fill: currentColor; stroke: none; }
.sidebar-brand .brand-logo { stroke: none; }
.auth-brand-mark { display: inline-grid; place-items: center; width: 1.25em; height: 1.25em; margin-right: .3em; vertical-align: -0.22em; }
.auth-brand-mark .brand-logo { width: 100%; height: 100%; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .2)); }
.auth-brand > span.auth-brand-mark { display: inline-grid; margin-top: 0; font-size: inherit; opacity: 1; }

/* ---- 20. CRM: murojaatlar doskasi, vazifalar, voronka, hisobot ---- */
.crm-view { display: inline-flex; gap: 2px; padding: 3px; border-radius: 12px; background: rgba(15, 23, 42, .06); }
.crm-view a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 9px; font-size: 13px; font-weight: 500; color: var(--text-2); text-decoration: none; white-space: nowrap; }
.crm-view a:hover { text-decoration: none; color: var(--text); }
.crm-view a.active { background: var(--field, #fff); color: var(--text); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.crm-view .ui-icon { width: 15px; height: 15px; }

/* Doska */
.crm-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; align-items: start; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; }
.crm-col { min-width: 0; border-radius: 18px; background: rgba(15, 23, 42, .045); scroll-snap-align: start; --col: #64748b; }
.crm-col-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 8px; flex-wrap: wrap; }
.crm-col-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.crm-col-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--col); }
.crm-col-count { min-width: 22px; padding: 0 7px; border-radius: 10px; font-size: 12px; line-height: 20px; text-align: center; font-weight: 600; background: var(--field, #fff); }
.crm-col-sum { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.crm-col-body { display: flex; flex-direction: column; gap: 8px; min-height: 80px; max-height: 68vh; overflow-y: auto; padding: 4px 8px 10px; border-radius: 0 0 18px 18px; transition: background-color .15s; }
.crm-col-body.is-over { background: var(--primary-soft); outline: 2px dashed var(--primary); outline-offset: -4px; }
.crm-col-empty { margin: 14px 0; text-align: center; font-size: 13px; color: var(--muted); }
.crm-col-more { display: block; padding: 6px; text-align: center; font-size: 13px; }
.crm-col-new { --col: #2563d7; } .crm-col-contacted { --col: #8b5cf6; } .crm-col-booked { --col: #d97706; }
.crm-col-arrived { --col: #0891b2; } .crm-col-converted { --col: #16a34a; } .crm-col-lost { --col: #dc2626; }
.crm-col-p-draft { --col: #2563d7; } .crm-col-p-approved { --col: #d97706; } .crm-col-p-in_progress { --col: #0891b2; }
.crm-col-p-completed { --col: #16a34a; } .crm-col-p-cancelled { --col: #dc2626; }
.crm-board-hint { margin-top: 10px; }

.crm-card { position: relative; display: flex; gap: 4px; padding: 10px 6px 10px 12px; border-radius: 14px; background: var(--field, #fff); border: 1px solid var(--border); border-left: 3px solid var(--col); box-shadow: 0 1px 2px rgba(15, 23, 42, .05); }
.crm-card[draggable=true] { cursor: grab; }
.crm-card.is-drag { opacity: .45; }
.crm-card.is-high { box-shadow: 0 0 0 1px rgba(220, 38, 38, .25), 0 1px 2px rgba(15, 23, 42, .05); }
.crm-card.is-stale { background: var(--warning-soft, #fffbeb); }
.crm-card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; color: inherit; text-decoration: none; }
.crm-card-main:hover { text-decoration: none; }
.crm-card-main:hover strong { color: var(--primary); }
.crm-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.crm-card-top strong { font-size: 14px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.crm-card-int { font-size: 13px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.crm-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.crm-card-val { font-size: 12px; font-weight: 600; color: var(--success, #16a34a); white-space: nowrap; }
.crm-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.crm-card-foot .ui-icon { width: 13px; height: 13px; vertical-align: -2px; }
.crm-card-acts { display: flex; flex-direction: column; gap: 2px; }
.crm-card-acts .btn { padding: 6px; min-height: 0; }
.crm-card-acts-row { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-end; flex: none; max-width: 100%; }
.crm-board-plans .crm-card { flex-direction: column; padding-right: 10px; }
.crm-prob { min-width: 74px !important; width: auto; padding: 4px 6px; }
.crm-board-plans .crm-card form select { min-width: 110px !important; max-width: 160px; }
.crm-ava { flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: 10px; font-weight: 600; color: #fff; background: linear-gradient(160deg, #8b9bb4, #5b6b87); }

.crm-score { flex: none; display: inline-grid; place-items: center; min-width: 30px; height: 22px; padding: 0 6px; border-radius: 8px; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.crm-score.is-hot { color: #b91c1c; background: #fee2e2; } .crm-score.is-warm { color: #b45309; background: #fef3c7; } .crm-score.is-cold { color: #475569; background: #e2e8f0; }
.crm-score-lg { min-width: 54px; height: 54px; border-radius: 16px; font-size: 20px; }

.crm-st-new { background: #dbeafe; color: #1d4ed8; border-color: #bfdbfe; } .crm-st-contacted { background: #ede9fe; color: #6d28d9; border-color: #ddd6fe; }
.crm-st-booked { background: #fef3c7; color: #b45309; border-color: #fde68a; } .crm-st-arrived { background: #cffafe; color: #0e7490; border-color: #a5f3fc; }
.crm-st-converted { background: #dcfce7; color: #15803d; border-color: #bbf7d0; } .crm-st-lost { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }

/* Murojaat kartasi */
.crm-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.crm-head-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.crm-head h1 { margin: 0 0 2px; font-size: 22px; overflow-wrap: anywhere; }
.crm-flow { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; margin: 4px 0 0; padding: 0; list-style: none; }
.crm-flow li { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border-radius: 999px; font-size: 13px; color: var(--muted); background: var(--surface-2); }
.crm-flow li span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: 11px; font-weight: 700; background: rgba(100, 116, 139, .2); color: var(--text-2); }
.crm-flow li.is-done { color: var(--text-2); } .crm-flow li.is-done span { background: var(--primary); color: #fff; }
.crm-flow li.is-cur { color: var(--text); font-weight: 600; background: var(--primary-soft); } .crm-flow li.is-cur span { background: #16a34a; color: #fff; }
.crm-flow li.is-lost { background: var(--danger-soft); color: var(--danger); } .crm-flow li.is-lost span { background: var(--danger); color: #fff; }
.crm-show { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; margin-top: 16px; }
.crm-show-main, .crm-show-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.crm-show .card { margin: 0; }
.crm-dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 12px; margin: 0; font-size: 14px; }
.crm-dl dt { color: var(--muted); } .crm-dl dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.crm-note { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: 14px; }

/* Aloqa formasi */
.crm-act-form { display: flex; flex-direction: column; gap: 10px; }
.crm-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.crm-seg label, .crm-chip { position: relative; cursor: pointer; }
.crm-seg input, .crm-chip input { position: absolute; opacity: 0; pointer-events: none; }
.crm-seg span { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 12px; font-size: 14px; font-weight: 500; color: var(--text-2); background: var(--field, #fff); border: 1px solid var(--border-strong); }
.crm-seg span .ui-icon { width: 15px; height: 15px; }
.crm-seg input:checked + span { color: #fff; background: var(--primary); border-color: var(--primary); }
.crm-seg input:focus-visible + span, .crm-chip input:focus-visible + span { box-shadow: var(--focus); }
.crm-outcomes { display: flex; flex-wrap: wrap; gap: 6px; }
.crm-chip span { display: inline-block; padding: 6px 12px; border-radius: 999px; font-size: 13px; color: var(--text-2); background: var(--surface-2); border: 1px solid transparent; }
.crm-chip input:checked + span { font-weight: 600; color: var(--oc, var(--primary)); background: var(--field, #fff); border-color: var(--oc, var(--primary)); }
.crm-out-reached, .crm-out-booked { --oc: #15803d; } .crm-out-no_answer, .crm-out-callback { --oc: #b45309; } .crm-out-refused { --oc: #b91c1c; } .crm-out-other { --oc: #475569; }
.crm-out-badge { color: var(--oc); border-color: currentColor; background: transparent; }
.crm-act-bar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: flex-end; gap: 10px; }
.crm-follow { display: flex; flex-direction: column; gap: 2px; margin-right: auto; }

/* Aloqa tarixi */
.crm-tl { position: relative; display: flex; flex-direction: column; }
.crm-tl::before { content: ''; position: absolute; left: 15px; top: 8px; bottom: 8px; width: 2px; background: var(--border); }
.crm-tl-item { position: relative; display: flex; gap: 12px; padding: 8px 0; }
.crm-tl-dot { position: relative; z-index: 1; flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--field, #fff); border: 2px solid var(--border); color: var(--primary); }
.crm-tl-dot .ui-icon { width: 15px; height: 15px; }
.crm-tl-status .crm-tl-dot { color: var(--muted); } .crm-tl-note .crm-tl-dot { color: var(--warning, #d97706); }
.crm-tl-body { min-width: 0; padding-top: 4px; }
.crm-tl-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.crm-tl-body p { margin: 4px 0 0; font-size: 14px; }

/* Vazifalar */
.crm-tasks { display: flex; flex-direction: column; gap: 8px; }
.crm-task { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--surface, #fff); border: 1px solid var(--glass-border, var(--border)); border-left: 3px solid var(--primary); }
.card .crm-task { background: var(--surface-2); border-color: transparent; border-left-color: var(--primary); }
.crm-task.is-late { border-left-color: var(--danger); } .crm-task.is-high { border-left-color: #b91c1c; }
.crm-task.is-done { border-left-color: var(--muted); opacity: .8; }
.crm-task-ico { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; color: var(--primary); background: var(--primary-soft); }
.crm-task.is-late .crm-task-ico { color: var(--danger); background: var(--danger-soft); }
.crm-task-main { flex: 1; min-width: 0; }
.crm-task-main strong { display: block; font-weight: 600; overflow-wrap: anywhere; }
.crm-task-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 2px; font-size: 13px; color: var(--muted); }
.crm-task-meta .ui-icon { width: 13px; height: 13px; vertical-align: -2px; }
.crm-task-acts { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px; }
.crm-add summary { display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; color: var(--primary); list-style: none; }
.crm-add summary::-webkit-details-marker { display: none; }
.crm-add { margin-bottom: 14px; }
.crm-add-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 12px; margin-top: 12px; align-items: end; }
.crm-add-title { grid-column: 1 / -1; }
.crm-add-btn { grid-column: 1 / -1; display: flex; justify-content: flex-end; }

/* Oynalar */
.crm-dlg { width: min(460px, calc(100vw - 24px)); padding: 22px; border: 1px solid var(--border); border-radius: 22px; color: var(--text); background: var(--field, #fff); box-shadow: 0 30px 80px rgba(15, 23, 42, .35); }
.crm-dlg-wide { width: min(560px, calc(100vw - 24px)); }
.crm-dlg::backdrop { background: rgba(15, 23, 42, .38); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.crm-dlg h3 { margin: 0 0 10px; font-size: 18px; overflow-wrap: anywhere; }
.crm-dlg .crm-outcomes { margin-bottom: 12px; }
.crm-dlg-actions { justify-content: flex-end; margin-top: 14px; }
.crm-warn { margin-bottom: 10px; }

/* Hisobot */
.crm-kpis { margin-bottom: 16px; }
.crm-report { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.crm-report .card { margin: 0; }
.crm-funnel { display: flex; flex-direction: column; gap: 10px; }
.crm-funnel-row { display: grid; grid-template-columns: minmax(110px, 30%) minmax(0, 1fr) 44px 86px; align-items: center; gap: 10px; font-size: 14px; }
.crm-funnel-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.crm-funnel-bar { display: block; height: 10px; border-radius: 6px; background: rgba(15, 23, 42, .07); overflow: hidden; }
.crm-funnel-bar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--primary-2, #4c86ee), var(--primary)); }
.crm-funnel-row.is-lost .crm-funnel-bar i { background: linear-gradient(90deg, #f87171, #dc2626); }
.crm-funnel-row b { text-align: right; font-variant-numeric: tabular-nums; }
.crm-funnel-pct { text-align: right; font-size: 13px; color: var(--muted); }
.crm-conv { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--border); }
.table-plain-wrap { border: 0; box-shadow: none; background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
.crm-dict { margin-bottom: 16px; }

@media (max-width: 1000px) {
    .crm-show { grid-template-columns: minmax(0, 1fr); }
    .crm-add-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .crm-board { grid-auto-columns: 82vw; margin: 0 -8px; padding: 0 8px 8px; scroll-snap-type: x mandatory; }
    .crm-col-body { max-height: none; }
    .crm-task { flex-wrap: wrap; align-items: flex-start; }
    .crm-task-acts { width: 100%; justify-content: flex-start; padding-left: 48px; }
    .crm-task-acts .btn-label { display: inline; }
    .crm-add-form { grid-template-columns: minmax(0, 1fr); }
    .crm-funnel-row { grid-template-columns: minmax(90px, 34%) minmax(0, 1fr) 34px 64px; gap: 6px; font-size: 13px; }
    .crm-head h1 { font-size: 19px; }
    .crm-head > .row { width: 100%; }
    .crm-head > .row .btn { flex: 1; justify-content: center; }
    .crm-act-bar .btn { flex: 1; justify-content: center; }
    .crm-follow { width: 100%; }
    .crm-follow .form-control { width: 100%; min-width: 0; }
}

/* ---- 21. Telefon: qo'ng'iroqlar jurnali, ulash sahifasi, jonli oyna ---- */
.tel-date { flex: 0 1 150px; width: auto; }
.tel-table td { vertical-align: middle; }
.tel-dir { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin-right: 8px; border-radius: 9px; color: var(--primary); background: var(--primary-soft); vertical-align: middle; }
.tel-dir .ui-icon { width: 15px; height: 15px; }
.tel-dir-out { color: #0f766e; background: rgba(15, 118, 110, .10); }
.tel-dir.tel-bad { color: var(--danger, #c81e1e); background: rgba(200, 30, 30, .10); }
.tel-out-form .form-control-sm { min-width: 150px; }

.tel-pair { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; padding: 22px; border: 2px solid var(--primary); }
.tel-pair-qr { flex: 0 0 240px; width: 240px; padding: 10px; background: #fff; border-radius: 14px; line-height: 0; }
.tel-pair-qr svg { width: 100%; height: auto; display: block; }
.tel-pair-info { flex: 1 1 300px; min-width: 0; }
.tel-pair-info h3 { margin: 0 0 10px; }
.tel-steps { margin: 0 0 14px; padding-left: 20px; display: grid; gap: 6px; }
.tel-manual { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 12px; align-items: center; }
.tel-manual dt { color: var(--muted); font-size: 13px; }
.tel-manual dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.tel-code { font-size: 22px; font-weight: 700; letter-spacing: .12em; }

.tel-devices { display: grid; gap: 10px; padding: 14px 18px 18px; }
.tel-device { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); }
.tel-device-main { flex: 1 1 auto; min-width: 0; display: grid; gap: 3px; justify-items: start; }
.tel-dot { flex: none; width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: #c0c7d2; }
.tel-dot.on { background: #16a34a; box-shadow: 0 0 0 4px rgba(22, 163, 74, .18); }
.tel-add { padding: 14px 18px 18px; }
.tel-settings { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 18px; }
.tel-settings .check { align-items: flex-start; flex: 1 1 320px; }
.tel-settings .check input { margin-top: 4px; }
.tel-notes { margin: 0; padding: 0 18px 18px 36px; display: grid; gap: 5px; }

/* Jonli oyna: o'ng pastda, boshqa hamma narsaning ustida */
.tel-pop { position: fixed; right: 18px; bottom: 18px; z-index: 1200; display: flex; flex-direction: column; gap: 10px; width: min(360px, calc(100vw - 24px)); pointer-events: none; }
.tel-pop > * { pointer-events: auto; }
.tel-card { padding: 14px 16px; border-radius: 18px; background: #fff; color: #0c1a33; border: 1px solid rgba(15, 23, 42, .10); box-shadow: 0 18px 44px rgba(15, 23, 42, .22); border-left: 5px solid var(--primary); }
.tel-card.tel-active { border-left-color: #16a34a; }
.tel-card.tel-ended { border-left-color: #94a3b8; }
.tel-card.tel-card-bad { border-left-color: #c81e1e; }
.tel-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.tel-card-ico { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; color: #fff; background: var(--primary); }
.tel-card-ico .ui-icon { width: 17px; height: 17px; }
.tel-active .tel-card-ico { background: #16a34a; }
.tel-ended .tel-card-ico { background: #94a3b8; }
.tel-card-bad .tel-card-ico { background: #c81e1e; }
.tel-ringing .tel-card-ico { animation: tel-ring 1.1s ease-in-out infinite; }
@keyframes tel-ring { 0%, 100% { transform: rotate(0); box-shadow: 0 0 0 0 rgba(37, 99, 215, .45); } 20% { transform: rotate(-14deg); } 40% { transform: rotate(14deg); } 60% { transform: rotate(-8deg); box-shadow: 0 0 0 10px rgba(37, 99, 215, 0); } }
.tel-card-title { flex: 1 1 auto; min-width: 0; display: flex; align-items: baseline; gap: 8px; font-size: 13px; color: #5b6676; }
.tel-card-time { font-variant-numeric: tabular-nums; font-weight: 600; color: #0c1a33; }
.tel-card-x { flex: none; width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: #7a8494; font-size: 20px; line-height: 1; cursor: pointer; }
.tel-card-x:hover { background: rgba(15, 23, 42, .07); color: #0c1a33; }
.tel-card-who { display: grid; gap: 2px; }
.tel-card-name { font-size: 18px; font-weight: 700; color: #0c1a33; overflow-wrap: anywhere; }
a.tel-card-name:hover { color: var(--primary); }
.tel-card-phone { font-size: 14px; color: #5b6676; font-variant-numeric: tabular-nums; }
.tel-card-meta { margin: 8px 0 0; padding: 8px 0 0; list-style: none; border-top: 1px solid rgba(15, 23, 42, .08); display: grid; gap: 3px; font-size: 13px; color: #3d4b63; }
.tel-card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tel-card-out { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; font-size: 13px; color: #3d4b63; }
.tel-card-out-label { flex: 1 0 100%; color: #5b6676; }
.crm-chip-btn { padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(15, 23, 42, .14); background: #f4f6f9; color: #1f2937; font: inherit; font-size: 13px; cursor: pointer; }
.crm-chip-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); background: #fff; }
.crm-chip-btn:disabled { opacity: .5; cursor: default; }
.tel-toast { padding: 12px 16px; border-radius: 14px; background: #0c1a33; color: #fff; font-size: 14px; box-shadow: 0 12px 30px rgba(15, 23, 42, .28); }
.tel-toast-bad { background: #b91c1c; }
@media (max-width: 760px) {
    .tel-pop { right: 12px; left: 12px; bottom: 12px; width: auto; }
    .tel-pair { padding: 16px; gap: 16px; }
    .tel-pair-qr { flex-basis: 200px; width: 200px; margin: 0 auto; }
    .tel-device { flex-wrap: wrap; }
    .tel-date { flex: 1 1 130px; }
}
@media (prefers-reduced-motion: reduce) { .tel-ringing .tel-card-ico { animation: none; } }
@media print { .tel-pop { display: none; } }
.tel-table td:nth-child(2) { min-width: 230px; }
.tel-table .badge { white-space: nowrap; }

/* ---- 22. CRM: bemorlarni qaytarish, bosh sahifa, teglar, baho, shablonlar ---- */
.crm-kpis-6 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
a.stat { color: inherit; text-decoration: none; }
a.stat:hover .stat-label { color: var(--primary); }
.stat-value small { font-size: .55em; font-weight: 500; color: var(--muted); }
.crm-delta { font-size: 12px; font-weight: 600; color: var(--muted); }
.crm-delta.is-good { color: #15803d; }
.crm-delta.is-bad { color: var(--danger, #c81e1e); }
.crm-home { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.crm-home > .card { padding-bottom: 14px; }
.crm-home .crm-tasks { padding: 0 14px; }
.crm-home > .card > p, .crm-home .crm-seglist, .crm-home .crm-feed, .crm-home .crm-sub { margin-left: 18px; margin-right: 18px; }
.crm-seglist { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.crm-seglist a { display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; border-radius: 10px; color: inherit; text-decoration: none; background: var(--surface-2); }
.crm-seglist a:hover { color: var(--primary); }
.crm-seglist b { white-space: nowrap; }
.crm-sub { margin: 14px 0 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.crm-feed { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.crm-feed li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.crm-feed li:last-child { border-bottom: 0; }
.crm-feed li > div { flex: 1 0 100%; }
.crm-stars { color: #f59e0b; letter-spacing: 1px; white-space: nowrap; }
.crm-stars i { font-style: normal; color: #d1d5db; }
.crm-rating { border: 0; padding: 0; margin: 0 0 10px; display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; }
.crm-rating legend { float: left; width: 100%; margin-bottom: 4px; color: var(--muted); }
.crm-rating input { position: absolute; opacity: 0; pointer-events: none; }
.crm-rating label { font-size: 28px; line-height: 1; color: #d1d5db; cursor: pointer; padding: 0 2px; }
.crm-rating label:hover, .crm-rating label:hover ~ label, .crm-rating input:checked ~ label { color: #f59e0b; }
.crm-rating input:focus-visible + label { outline: 2px solid var(--primary); border-radius: 4px; }
.crm-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.crm-tag { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
    color: var(--tag, #2563d7); background: color-mix(in srgb, var(--tag, #2563d7) 12%, transparent); border: 1px solid color-mix(in srgb, var(--tag, #2563d7) 35%, transparent); }
.crm-tag-sm { padding: 1px 8px; font-size: 11px; margin-left: 4px; }
.crm-pt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.crm-recall-form, .crm-tag-form { padding: 0 18px 18px; }
.crm-recall-row { display: grid; grid-template-columns: 160px 1fr auto; gap: 8px; }
.crm-tag-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.crm-tag-opt { position: relative; cursor: pointer; }
.crm-tag-opt input { position: absolute; opacity: 0; pointer-events: none; }
.crm-tag-opt span { display: inline-block; padding: 6px 12px; border-radius: 999px; font-size: 13px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border-strong); }
.crm-tag-opt input:checked + span { color: var(--tag); font-weight: 600; background: color-mix(in srgb, var(--tag) 12%, #fff); border-color: var(--tag); }
.crm-tag-opt input:focus-visible + span { box-shadow: var(--focus); }
.crm-scripts { padding: 0; margin-bottom: 12px; }
.crm-scripts > summary { display: flex; align-items: center; gap: 8px; padding: 14px 18px; cursor: pointer; font-weight: 600; list-style: none; }
.crm-scripts > summary::-webkit-details-marker { display: none; }
.crm-scripts-list { display: grid; gap: 10px; padding: 0 18px 18px; }
.crm-script { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.crm-script-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.crm-script p { margin: 6px 0 0; font-size: 14px; color: var(--text-2); }
.crm-seg-table .crm-chk { width: 40px; }
.crm-seg-table input[type=checkbox], .crm-seg-table th input[type=checkbox] { width: 18px; height: 18px; }
.crm-camp-bar { position: sticky; bottom: 12px; z-index: 5; margin-top: 14px; padding: 16px 18px; }
.crm-camp-bar h3 { margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.crm-camp-grid { display: grid; grid-template-columns: 2fr 2fr 1.2fr 1.2fr; gap: 10px; }
.crm-camp-grid .form-group { margin: 0; }
.crm-color { width: 56px; min-width: 56px; padding: 4px; height: 40px; }
.crm-script-form { display: grid; grid-template-columns: 1fr 2fr 90px auto; gap: 8px; align-items: start; padding: 0 18px 10px; }
.crm-script-form.is-muted { opacity: .55; }
.crm-script-edit { padding-top: 6px; border-top: 1px solid var(--border); }
.crm-form-info { padding: 0 18px 18px; display: grid; gap: 8px; }
.crm-copy-row { display: flex; gap: 8px; }
.crm-copy-row .form-control { flex: 1; min-width: 0; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.crm-snippet { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; white-space: pre; }
.crm-rate-sum { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; padding: 0 18px 14px; }
.crm-rate-big { font-size: 30px; font-weight: 700; line-height: 1.1; }
.crm-rate-big small { font-size: 15px; color: var(--muted); font-weight: 500; }
.crm-rate-dist { flex: 1 1 240px; min-width: 0; padding: 0; }
.crm-low { border: 1px solid rgba(200, 30, 30, .25); }
@media (max-width: 900px) {
    .crm-home, .crm-pt-grid { grid-template-columns: 1fr; }
    .crm-camp-grid { grid-template-columns: 1fr 1fr; }
    .crm-script-form { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .crm-recall-row { grid-template-columns: 1fr; }
    .crm-camp-grid { grid-template-columns: 1fr; }
    .crm-camp-bar { position: static; }
    .crm-copy-row { flex-direction: column; }
}
.crm-rate-dist .crm-funnel-row { grid-template-columns: 44px minmax(0, 1fr) 40px; }
/* Bosh sahifadagi tor ustunda vazifa tugmalari pastga tushadi */
.crm-home .crm-task { flex-wrap: wrap; }
.crm-home .crm-task-main { flex: 1 1 200px; min-width: 0; }
.crm-home .crm-task-acts { flex: 1 0 100%; justify-content: flex-start; padding-left: 46px; }
.crm-home .crm-task-acts .btn-label { display: none; }
@media (max-width: 560px) { .crm-home .crm-task-acts { padding-left: 0; } }
