/*
 * AsterConf v2 — modern dark app shell
 * Linear / Vercel / Stripe-inspired
 *
 * Visual signature:
 *   - Grid-aligned ambient dots background
 *   - Glassmorphic sidebar with gradient brand block
 *   - Animated signal/activity indicators
 *   - Generous typography hierarchy
 *   - Soft borders + ambient glow on focused elements
 */

/* ─── LIGHT THEME ─────────────────────────────────────────────
   Default = dark. `<html data-theme="light">` toggles to light mode.
   Bu blok mavjud dark hardcoded ranglarni light variant bilan
   override qiladi. Toggle JS sidebar pastida joylashgan.
*/
html[data-theme="light"] {
  color-scheme: light;
}
html[data-theme="light"] body.app-shell {
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  color: #334155;
}
html[data-theme="light"] body.app-shell::before {
  background:
    radial-gradient(900px circle at 100% 0%, rgba(249,115,22,0.10), transparent 55%),
    radial-gradient(720px circle at -5% 0%, rgba(99,102,241,0.08), transparent 60%),
    radial-gradient(680px circle at 110% 100%, rgba(251,146,60,0.06), transparent 60%),
    radial-gradient(800px circle at 0% 110%, rgba(56,189,248,0.06), transparent 60%);
  filter: saturate(115%);
  opacity: 0.7;
}
html[data-theme="light"] body.app-shell::after {
  background:
    linear-gradient(180deg, rgba(248,250,252,0.4) 0%, transparent 200px, transparent 100%),
    repeating-linear-gradient(35deg,  transparent 0, transparent 78px, rgba(15,23,42,0.025) 78px, rgba(15,23,42,0.025) 79px),
    repeating-linear-gradient(-35deg, transparent 0, transparent 78px, rgba(249,115,22,0.02) 78px, rgba(249,115,22,0.02) 79px);
}

html[data-theme="light"] body.auth-shell {
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  color: #334155;
}
html[data-theme="light"] body.auth-shell::before {
  background:
    radial-gradient(900px circle at 80% 20%, rgba(249,115,22,0.12), transparent 55%),
    radial-gradient(720px circle at 15% 30%, rgba(99,102,241,0.08), transparent 60%),
    radial-gradient(680px circle at 90% 90%, rgba(251,146,60,0.08), transparent 60%),
    radial-gradient(800px circle at 5% 95%, rgba(56,189,248,0.06), transparent 60%);
  opacity: 0.7;
}
html[data-theme="light"] body.auth-shell::after {
  background:
    repeating-linear-gradient(35deg,  transparent 0, transparent 78px, rgba(15,23,42,0.03) 78px, rgba(15,23,42,0.03) 79px),
    repeating-linear-gradient(-35deg, transparent 0, transparent 78px, rgba(249,115,22,0.025) 78px, rgba(249,115,22,0.025) 79px);
}
html[data-theme="light"] .auth-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.95) 0%, rgba(248,250,252,0.95) 100%);
  border-color: rgba(15,23,42,0.08);
  box-shadow: 0 30px 80px rgba(15,23,42,0.12), 0 0 0 1px rgba(15,23,42,0.04) inset;
}

/* Sidebar */
html[data-theme="light"] .app-side {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-right-color: rgba(15,23,42,0.08);
}
html[data-theme="light"] .app-side__top { border-bottom-color: rgba(15,23,42,0.06); }
html[data-theme="light"] .app-brand__name { color: #0f172a; }
html[data-theme="light"] .app-brand__sub  { color: #64748b; }
html[data-theme="light"] .app-nav__link {
  color: #475569;
}
html[data-theme="light"] .app-nav__link:hover {
  background: rgba(15,23,42,0.04);
  color: #0f172a;
}
html[data-theme="light"] .app-nav__link.is-active {
  background: linear-gradient(135deg, rgba(249,115,22,0.10) 0%, rgba(249,115,22,0.04) 100%);
  color: #c2410c;
  box-shadow: inset 0 0 0 1px rgba(249,115,22,0.25);
}
html[data-theme="light"] .app-side__bottom { border-top-color: rgba(15,23,42,0.06); }
html[data-theme="light"] .app-user {
  background: rgba(15,23,42,0.03);
  border-color: rgba(15,23,42,0.06);
}
html[data-theme="light"] .app-user__name { color: #0f172a; }
html[data-theme="light"] .app-user__role { color: #64748b; }
html[data-theme="light"] .app-user__logout button { color: #64748b; }
html[data-theme="light"] .app-user__logout button:hover { background: rgba(239,68,68,0.08); color: #b91c1c; }

/* Topbar */
html[data-theme="light"] .app-topbar {
  background: rgba(248,250,252,0.85);
  border-bottom-color: rgba(15,23,42,0.06);
}
html[data-theme="light"] .app-topbar__breadcrumb a { color: #64748b; }
html[data-theme="light"] .app-topbar__breadcrumb a:hover { color: #0f172a; }
html[data-theme="light"] .app-topbar__breadcrumb .crumb-current { color: #0f172a; }
html[data-theme="light"] .app-topbar__time {
  background: rgba(15,23,42,0.04);
  color: #64748b;
  border-color: rgba(15,23,42,0.06);
}

/* Page hero typography */
html[data-theme="light"] .page-hero__title { color: #0f172a; }
html[data-theme="light"] .page-hero__subtitle { color: #64748b; }

/* KPI tiles + dt-card + filter-bar */
html[data-theme="light"] .kpi,
html[data-theme="light"] .dt-card,
html[data-theme="light"] .ig-card,
html[data-theme="light"] .u-tcard,
html[data-theme="light"] .tg-card,
html[data-theme="light"] .ig-pwd-banner,
html[data-theme="light"] .u-pwd-banner {
  background: rgba(255,255,255,0.85);
  border-color: rgba(15,23,42,0.08);
  box-shadow: 0 1px 3px rgba(15,23,42,0.04);
}
html[data-theme="light"] .kpi:hover,
html[data-theme="light"] .ig-card:hover,
html[data-theme="light"] .u-tcard:hover,
html[data-theme="light"] .tg-card:hover {
  border-color: rgba(249,115,22,0.3);
  box-shadow: 0 8px 24px rgba(15,23,42,0.08);
}
html[data-theme="light"] .kpi__value { color: #0f172a; }
html[data-theme="light"] .kpi__label { color: #64748b; }
html[data-theme="light"] .kpi__meta  { color: #94a3b8; }
html[data-theme="light"] .dt-card__header {
  background: rgba(15,23,42,0.02);
  border-bottom-color: rgba(15,23,42,0.06);
}
html[data-theme="light"] .dt-card__title { color: #0f172a; }
html[data-theme="light"] .dt-card__count {
  background: rgba(15,23,42,0.05);
  color: #64748b;
}
html[data-theme="light"] .ig-tcard__head,
html[data-theme="light"] .u-tcard__head {
  background: rgba(15,23,42,0.02);
  border-bottom-color: rgba(15,23,42,0.06);
}

/* Table */
html[data-theme="light"] .dt-table thead th {
  background: rgba(15,23,42,0.02);
  color: #64748b;
  border-bottom-color: rgba(15,23,42,0.06);
}
html[data-theme="light"] .dt-table tbody tr {
  border-bottom-color: rgba(15,23,42,0.04);
}
html[data-theme="light"] .dt-table tbody tr:hover { background: rgba(15,23,42,0.025); }
html[data-theme="light"] .dt-table tbody tr[data-href]:hover {
  background: rgba(249,115,22,0.05);
  box-shadow: inset 3px 0 0 #f97316;
}
html[data-theme="light"] .dt-project { color: #0f172a; }
html[data-theme="light"] .dt-tenant  { color: #334155; }
html[data-theme="light"] .dt-id, html[data-theme="light"] .dt-time { color: #64748b; }
html[data-theme="light"] .dt-meta    { color: #94a3b8; }
html[data-theme="light"] .dt-service {
  background: rgba(15,23,42,0.05);
  color: #475569;
}

/* Inputs / filter bar */
html[data-theme="light"] .filter-bar {
  background: rgba(255,255,255,0.7);
  border-color: rgba(15,23,42,0.08);
}
html[data-theme="light"] .filter-bar__input,
html[data-theme="light"] .filter-bar__select,
html[data-theme="light"] .v2-input,
html[data-theme="light"] .v2-textarea {
  background: #ffffff;
  border-color: rgba(15,23,42,0.1);
  color: #0f172a;
}
html[data-theme="light"] .v2-input::placeholder,
html[data-theme="light"] .v2-textarea::placeholder,
html[data-theme="light"] .filter-bar__input::placeholder {
  color: #94a3b8;
}
html[data-theme="light"] .filter-bar__select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'><path d='M3 4.5L6 7.5L9 4.5' stroke='%2364748b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}
html[data-theme="light"] .filter-btn--ghost {
  background: rgba(15,23,42,0.03);
  color: #475569;
  border-color: rgba(15,23,42,0.08);
}
html[data-theme="light"] .filter-btn--ghost:hover {
  background: rgba(15,23,42,0.06);
}
html[data-theme="light"] .v2-field__label { color: #475569; }
html[data-theme="light"] .v2-field__hint  { color: #94a3b8; }

/* Custom dropdown menu */
html[data-theme="light"] .dd-trigger {
  background: #ffffff;
  border-color: rgba(15,23,42,0.1);
  color: #0f172a;
}
html[data-theme="light"] .dd-trigger:hover { background: rgba(15,23,42,0.02); }
html[data-theme="light"] .dd-menu {
  background: #ffffff;
  border-color: rgba(15,23,42,0.08);
  box-shadow: 0 20px 50px rgba(15,23,42,0.15), 0 4px 12px rgba(15,23,42,0.08);
}
html[data-theme="light"] .dd-item { color: #334155; }
html[data-theme="light"] .dd-item:hover {
  background: rgba(15,23,42,0.04);
  color: #0f172a;
}
html[data-theme="light"] .dd-item.is-selected {
  background: rgba(249,115,22,0.10);
  color: #c2410c;
}
html[data-theme="light"] .dd-item__sep { background: rgba(15,23,42,0.06); }

/* Custom file input */
html[data-theme="light"] .v2-file {
  background: #ffffff;
  border-color: rgba(15,23,42,0.1);
}
html[data-theme="light"] .v2-file:hover {
  background: rgba(15,23,42,0.02);
  border-color: rgba(15,23,42,0.18);
}
html[data-theme="light"] .v2-file__btn {
  background: rgba(15,23,42,0.05);
  color: #0f172a;
  border-color: rgba(15,23,42,0.1);
}
html[data-theme="light"] .v2-file__name { color: #94a3b8; }
html[data-theme="light"] .v2-file.has-file .v2-file__name { color: #0f172a; }

/* Empty state */
html[data-theme="light"] .empty-v2__title { color: #0f172a; }
html[data-theme="light"] .empty-v2__desc  { color: #64748b; }

/* ━━━ LIGHT MODE: legacy classes (.card, .btn, .input, .pill, code) ━━━ */

html[data-theme="light"] .app-canvas .card,
html[data-theme="light"] .app-canvas .info-card,
html[data-theme="light"] .app-canvas .gauge-card,
html[data-theme="light"] .app-canvas .conf-section,
html[data-theme="light"] .app-canvas .od-card {
  background: rgba(255,255,255,0.85) !important;
  border-color: rgba(15,23,42,0.08) !important;
  box-shadow: 0 1px 3px rgba(15,23,42,0.04);
}

html[data-theme="light"] .app-canvas .input,
html[data-theme="light"] .app-canvas input[type=text],
html[data-theme="light"] .app-canvas input[type=password],
html[data-theme="light"] .app-canvas input[type=email],
html[data-theme="light"] .app-canvas input[type=number],
html[data-theme="light"] .app-canvas input[type=tel],
html[data-theme="light"] .app-canvas input[type=search],
html[data-theme="light"] .app-canvas input[type=color],
html[data-theme="light"] .app-canvas textarea,
html[data-theme="light"] .app-canvas select {
  background: #ffffff !important;
  border-color: rgba(15,23,42,0.1) !important;
  color: #0f172a !important;
}
html[data-theme="light"] .app-canvas input::placeholder,
html[data-theme="light"] .app-canvas textarea::placeholder {
  color: #94a3b8;
}

html[data-theme="light"] .app-canvas .btn {
  background: rgba(15,23,42,0.04);
  border-color: rgba(15,23,42,0.1);
  color: #475569;
}
html[data-theme="light"] .app-canvas .btn:hover {
  background: rgba(15,23,42,0.08);
  color: #0f172a;
}
html[data-theme="light"] .app-canvas .btn--primary,
html[data-theme="light"] .app-canvas .btn[type=submit]:not(.btn--ghost):not(.btn--secondary) {
  color: #ffffff !important;
}

html[data-theme="light"] .app-canvas .btn--danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
  color: #ffffff !important;
  border-color: transparent !important;
}

/* Section titles + body text + hints */
html[data-theme="light"] .app-canvas h1,
html[data-theme="light"] .app-canvas h2,
html[data-theme="light"] .app-canvas h3,
html[data-theme="light"] .app-canvas h4,
html[data-theme="light"] .app-canvas .od-section-title,
html[data-theme="light"] .app-canvas .conf-section__title,
html[data-theme="light"] .app-canvas .info-card__title,
html[data-theme="light"] .app-canvas .gauge-card__title { color: #0f172a; }

html[data-theme="light"] .app-canvas .hint,
html[data-theme="light"] .app-canvas .gauge-card__sub,
html[data-theme="light"] .app-canvas .info-card__grid dt,
html[data-theme="light"] .app-canvas .conf-section__hint { color: #64748b; }

html[data-theme="light"] .app-canvas .info-card__grid dd { color: #0f172a; }

html[data-theme="light"] .app-canvas .field label { color: #475569; }

/* Codeblocks (VDS / SIP / creds) — keep them readable in light mode */
html[data-theme="light"] .app-canvas .codeblock {
  background: #0f172a !important;
  color: #e5e7eb !important;
  border-color: rgba(15,23,42,0.15) !important;
}
html[data-theme="light"] .app-canvas .codeblock--creds { color: #fbbf24 !important; }
html[data-theme="light"] .app-canvas .codeblock-copy {
  background: rgba(255,255,255,0.1) !important;
  border-color: rgba(255,255,255,0.15) !important;
  color: #cbd5e1 !important;
}

/* Tables in legacy templates */
html[data-theme="light"] .app-canvas .table-wrap,
html[data-theme="light"] .app-canvas table.data {
  background: rgba(255,255,255,0.85) !important;
  border-color: rgba(15,23,42,0.08) !important;
}
html[data-theme="light"] .app-canvas table thead th {
  background: rgba(15,23,42,0.02) !important;
  color: #64748b !important;
  border-bottom-color: rgba(15,23,42,0.06) !important;
}
html[data-theme="light"] .app-canvas table tbody td {
  color: #334155;
  border-bottom-color: rgba(15,23,42,0.04);
}
html[data-theme="light"] .app-canvas table tbody tr:hover { background: rgba(15,23,42,0.025); }

/* Pillar (status badge with dot) — old `.pill` */
html[data-theme="light"] .app-canvas .pill--new        { color: #2563eb !important; background: rgba(59,130,246,0.10) !important;  border-color: rgba(59,130,246,0.25); }
html[data-theme="light"] .app-canvas .pill--accepted   { color: #d97706 !important; background: rgba(251,191,36,0.15) !important;  border-color: rgba(251,191,36,0.35); }
html[data-theme="light"] .app-canvas .pill--in_progress{ color: #9333ea !important; background: rgba(192,132,252,0.10) !important; border-color: rgba(192,132,252,0.25); }
html[data-theme="light"] .app-canvas .pill--done       { color: #059669 !important; background: rgba(52,211,153,0.10) !important;  border-color: rgba(52,211,153,0.25); }
html[data-theme="light"] .app-canvas .pill--live       { color: #047857 !important; background: rgba(16,185,129,0.12) !important;  border-color: rgba(16,185,129,0.30); }
html[data-theme="light"] .app-canvas .pill--cancelled  { color: #dc2626 !important; background: rgba(248,113,113,0.10) !important; border-color: rgba(248,113,113,0.25); }

/* Status pills v2 (dt-status) — adjust for light bg */
html[data-theme="light"] .dt-status--new        { color: #2563eb; background: rgba(59,130,246,0.10);  border-color: rgba(59,130,246,0.25); }
html[data-theme="light"] .dt-status--accepted   { color: #d97706; background: rgba(251,191,36,0.15);  border-color: rgba(251,191,36,0.35); }
html[data-theme="light"] .dt-status--inprogress { color: #9333ea; background: rgba(192,132,252,0.10); border-color: rgba(192,132,252,0.25); }
html[data-theme="light"] .dt-status--done       { color: #059669; background: rgba(52,211,153,0.10);  border-color: rgba(52,211,153,0.25); }
html[data-theme="light"] .dt-status--live       { color: #047857; background: rgba(16,185,129,0.12);  border-color: rgba(16,185,129,0.30); }
html[data-theme="light"] .dt-status--cancelled  { color: #dc2626; background: rgba(248,113,113,0.10); border-color: rgba(248,113,113,0.25); }

/* Service type chip */
html[data-theme="light"] .dt-service--pbx { color: #64748b; background: rgba(15,23,42,0.05); }
html[data-theme="light"] .dt-service--ip  { color: #c2410c; background: rgba(251,146,60,0.10); }
html[data-theme="light"] .dt-service--crm { color: #9333ea; background: rgba(192,132,252,0.10); }

/* IPCtl subnav */
html[data-theme="light"] .ipctl-subnav a { color: #64748b; }
html[data-theme="light"] .ipctl-subnav a:hover { color: #c2410c; background: rgba(249,115,22,0.06); }
html[data-theme="light"] .ipctl-subnav a.active {
  color: #c2410c;
  background: rgba(249,115,22,0.10);
  box-shadow: inset 0 0 0 1px rgba(249,115,22,0.25);
}

/* Stale / success / error banners (legacy) */
html[data-theme="light"] .app-canvas .stale-banner,
html[data-theme="light"] .app-canvas .error-box {
  background: rgba(239,68,68,0.06) !important;
  border-color: rgba(239,68,68,0.25) !important;
  color: #991b1b !important;
}
html[data-theme="light"] .app-canvas .success-box {
  background: rgba(16,185,129,0.06) !important;
  border-color: rgba(16,185,129,0.25) !important;
  color: #065f46 !important;
}

/* alert variants v2 */
html[data-theme="light"] .ac-alert--success { background: rgba(16,185,129,0.08); color: #065f46; }
html[data-theme="light"] .ac-alert--error   { background: rgba(239,68,68,0.08);  color: #991b1b; }
html[data-theme="light"] .ac-alert--warning { background: rgba(245,158,11,0.10); color: #92400e; }
html[data-theme="light"] .ac-alert--info    { background: rgba(59,130,246,0.08); color: #1e40af; }

/* Order-form / order-edit specific (oe-cb checkbox cards, of-file, etc.) */
html[data-theme="light"] .app-canvas .oe-cb,
html[data-theme="light"] .app-canvas .of-file,
html[data-theme="light"] .app-canvas .wh-preset,
html[data-theme="light"] .app-canvas .of-block {
  background: rgba(255,255,255,0.85) !important;
  border-color: rgba(15,23,42,0.1) !important;
  color: #334155;
}
html[data-theme="light"] .app-canvas .oe-cb:hover,
html[data-theme="light"] .app-canvas .of-file:hover { border-color: rgba(249,115,22,0.4) !important; }
html[data-theme="light"] .app-canvas .oe-cb input[type=checkbox]:checked + .oe-cb__txt { color: #c2410c; }
html[data-theme="light"] .app-canvas .of-file__icon { color: #94a3b8; }

/* Gauge background ring */
html[data-theme="light"] .app-canvas .gauge-bg { stroke: rgba(15,23,42,0.08) !important; }

/* Bar tracks (per-core CPU) */
html[data-theme="light"] .app-canvas .bar-row__track { background: rgba(15,23,42,0.06) !important; }
html[data-theme="light"] .app-canvas .bar-row__label,
html[data-theme="light"] .app-canvas .bar-row__pct { color: #64748b !important; }

/* SSH provisioning terminal — keep dark even in light theme */
html[data-theme="light"] .app-canvas .xterm,
html[data-theme="light"] .app-canvas .xterm-viewport {
  background: #0f172a !important;
}

/* Strong color overrides for hardcoded text */
html[data-theme="light"] .app-canvas [style*="color: var(--text)"],
html[data-theme="light"] .app-canvas [style*="color: var(--text-default)"] { color: #334155 !important; }
html[data-theme="light"] .app-canvas [style*="color: var(--text-muted)"] { color: #64748b !important; }
html[data-theme="light"] .app-canvas [style*="color: var(--text-dim)"],
html[data-theme="light"] .app-canvas [style*="color: var(--text-subtle)"] { color: #94a3b8 !important; }

/* Hardcoded white text (#f8fafc / #fff) — light mode'da ko'rinmaydi.
   Templatda inline style="color: #f8fafc" deb yozilgan joylar uchun
   automatic override. Hero project names, bold accents, "Live"
   badges va h.k. */
html[data-theme="light"] [style*="color: #f8fafc"],
html[data-theme="light"] [style*="color:#f8fafc"],
html[data-theme="light"] [style*="color: #fff"]:not([style*="background"]),
html[data-theme="light"] [style*="color:#fff"]:not([style*="background"]) {
  color: #0f172a !important;
}

/* Page hero — light mode'da accent bold matn dark, lekin "title-accent"
   gradient saqlanadi (orange gradient). */
html[data-theme="light"] .page-hero__title span:not(.page-hero__title-accent) {
  color: #0f172a;
}
html[data-theme="light"] .page-hero__title svg { filter: none; }

/* Brand sub (sidebar logo subtitle) */
html[data-theme="light"] .app-brand__sub { color: #64748b; }

/* Generic h1/h2/h3/h4/h5/h6 across app-canvas — light mode'da dark text */
html[data-theme="light"] .app-canvas h1,
html[data-theme="light"] .app-canvas h2,
html[data-theme="light"] .app-canvas h3,
html[data-theme="light"] .app-canvas h4,
html[data-theme="light"] .app-canvas h5,
html[data-theme="light"] .app-canvas h6 { color: #0f172a; }

/* Strong, bold, b tags */
html[data-theme="light"] .app-canvas strong,
html[data-theme="light"] .app-canvas b { color: #0f172a; }

/* All "div.dt-project" — order list bold project names */
html[data-theme="light"] .dt-project,
html[data-theme="light"] .dt-tenant strong,
html[data-theme="light"] .ig-meta__name,
html[data-theme="light"] .u-tcard__name,
html[data-theme="light"] .tg-card__name,
html[data-theme="light"] .ig-user__name,
html[data-theme="light"] .u-meta__name {
  color: #0f172a !important;
}

/* KPI value numbers — light mode'da dark */
html[data-theme="light"] .kpi__value { color: #0f172a !important; }
html[data-theme="light"] .ig-stat-tile__num { color: #0f172a !important; }

/* ok-title, login-title, etc */
html[data-theme="light"] .ok-title,
html[data-theme="light"] .login-title,
html[data-theme="light"] .login-brand__name,
html[data-theme="light"] .empty-v2__title,
html[data-theme="light"] .dt-card__title,
html[data-theme="light"] .login-foot { color: #0f172a; }
html[data-theme="light"] .login-sub { color: #64748b; }

/* Form labels in legacy + new */
html[data-theme="light"] label { color: #475569; }
html[data-theme="light"] .v2-field__label,
html[data-theme="light"] .ac-field__label { color: #475569; }

/* Codeblock — keep dark theme even in light mode (mono terminal style) */
html[data-theme="light"] .codeblock,
html[data-theme="light"] .codeblock-wrap pre {
  background: #0f172a !important;
  color: #e5e7eb !important;
  border-color: rgba(15,23,42,0.15) !important;
}
html[data-theme="light"] .codeblock--creds { color: #fbbf24 !important; }
html[data-theme="light"] .codeblock-copy {
  background: rgba(255,255,255,0.08) !important;
  border-color: rgba(255,255,255,0.15) !important;
  color: #cbd5e1 !important;
}

/* Theme toggle button in sidebar bottom */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  cursor: pointer;
  width: 100%;
  margin-top: 8px;
  transition: all .15s;
}
.theme-toggle:hover { background: rgba(255,255,255,0.06); color: var(--text-strong); }
.theme-toggle .mi { font-size: 18px; }
.theme-toggle__label { flex: 1; text-align: left; }
html[data-theme="light"] .theme-toggle {
  background: rgba(15,23,42,0.03);
  border-color: rgba(15,23,42,0.06);
  color: #475569;
}
html[data-theme="light"] .theme-toggle:hover { background: rgba(15,23,42,0.06); color: #0f172a; }

/* ─── APP SHELL ─────────────────────────────────────────────── */

body.app-shell {
  margin: 0;
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
  background:
    /* Base dark with a subtle vertical fade — darker at top */
    linear-gradient(180deg, #06080d 0%, #050608 100%);
  color: var(--text-default);
  font-family: var(--font-sans);
  position: relative;
  overflow-x: hidden;
}

/* Aurora layer — multi-color glow blobs that drift slowly. The blobs
   are large (>800px) and blurred so they read as ambient atmospheric
   light, not distinct shapes. */
body.app-shell::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    /* Top-right: signature brand orange */
    radial-gradient(900px circle at 100% 0%, rgba(249,115,22,0.14), transparent 55%),
    /* Top-left: cool indigo */
    radial-gradient(720px circle at -5% 0%, rgba(99,102,241,0.10), transparent 60%),
    /* Bottom-right: warm amber */
    radial-gradient(680px circle at 110% 100%, rgba(251,146,60,0.08), transparent 60%),
    /* Bottom-left: subtle teal */
    radial-gradient(800px circle at 0% 110%, rgba(56,189,248,0.07), transparent 60%);
  filter: saturate(135%);
  animation: aurora-drift 28s ease-in-out infinite;
}

@keyframes aurora-drift {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); opacity: 1; }
  33%      { transform: translate3d(20px, -10px, 0) scale(1.04); opacity: 0.9; }
  66%      { transform: translate3d(-12px, 14px, 0) scale(1.02); opacity: 0.95; }
}

/* Foreground layer — telephony-themed subtle linework. Diagonal
   waveform-like lines (very subtle), plus a soft top fade so the
   topbar reads cleanly over it. */
body.app-shell::after {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    /* Top vignette — keep topbar readable */
    linear-gradient(180deg, rgba(5,6,9,0.4) 0%, transparent 200px, transparent 100%),
    /* Subtle waveform mesh: two diagonal line sets that interfere */
    repeating-linear-gradient(
      35deg,
      transparent 0,
      transparent 78px,
      rgba(255,255,255,0.015) 78px,
      rgba(255,255,255,0.015) 79px
    ),
    repeating-linear-gradient(
      -35deg,
      transparent 0,
      transparent 78px,
      rgba(249,115,22,0.014) 78px,
      rgba(249,115,22,0.014) 79px
    );
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 90%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 90%);
}

/* ─── SIDEBAR ───────────────────────────────────────────────── */

.app-side {
  position: sticky;
  top: 0;
  height: 100vh;
  background: linear-gradient(180deg, #0c0e13 0%, #08090c 100%);
  border-right: 1px solid rgba(255,255,255,0.05);
  display: flex;
  flex-direction: column;
  z-index: 10;
  padding: 20px 14px;
  gap: 4px;
}

.app-side__top {
  padding: 6px 8px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  margin-bottom: 14px;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-strong);
  transition: opacity .15s;
}
.app-brand:hover { opacity: .85; text-decoration: none; }

.app-brand__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f97316 0%, #ea580c 60%, #c2410c 100%);
  color: #fff;
  flex-shrink: 0;
  box-shadow:
    0 0 0 1px rgba(249,115,22,0.4),
    0 4px 14px rgba(249,115,22,0.25),
    inset 0 1px 0 rgba(255,255,255,0.2);
  position: relative;
}
.app-brand__mark::after {
  content: "";
  position: absolute; inset: -3px;
  border-radius: 13px;
  background: radial-gradient(circle, rgba(249,115,22,0.2), transparent 70%);
  z-index: -1;
}

.app-brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.app-brand__name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #f8fafc;
}
.app-brand__sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
  font-weight: 500;
  letter-spacing: -0.005em;
}

/* Nav */
.app-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}
.app-nav__link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: background .12s ease, color .12s ease, transform .12s ease;
  position: relative;
}
.app-nav__link svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.9; }
.app-nav__link:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text-strong);
  text-decoration: none;
}
.app-nav__link.is-active {
  background: linear-gradient(135deg, rgba(249,115,22,0.14) 0%, rgba(249,115,22,0.06) 100%);
  color: #fb923c;
  box-shadow: inset 0 0 0 1px rgba(249,115,22,0.2);
}
.app-nav__link.is-active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 18px;
  background: #f97316;
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 12px rgba(249,115,22,0.6);
}
.app-nav__link.is-active svg { opacity: 1; }

/* User card at bottom */
.app-side__bottom {
  border-top: 1px solid rgba(255,255,255,0.05);
  padding-top: 14px;
  margin-top: 14px;
}
.app-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 10px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.04);
}
.app-user__avatar {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  background: linear-gradient(135deg, #f97316, #c2410c);
  color: #fff;
  flex-shrink: 0;
  text-transform: uppercase;
}
.app-user__info { flex: 1; min-width: 0; }
.app-user__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-user__role { font-size: 10.5px; color: var(--text-muted); letter-spacing: 0.02em; text-transform: uppercase; }
.app-user__logout button {
  background: transparent; border: none; color: var(--text-muted);
  cursor: pointer; padding: 6px; border-radius: 6px; transition: all .12s;
}
.app-user__logout button:hover { color: #ef4444; background: rgba(239,68,68,0.1); }
.app-user__logout svg { width: 16px; height: 16px; }

/* ─── MAIN AREA ─────────────────────────────────────────────── */

.app-main {
  min-width: 0;
  position: relative;
  z-index: 1;
}

/* Top bar */
.app-topbar {
  position: sticky;
  top: 0;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 28px;
  background: rgba(8,9,12,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  z-index: 5;
}
.app-topbar__menu {
  display: none;
  background: transparent; border: none; color: var(--text-muted);
  cursor: pointer; padding: 6px; border-radius: 6px;
}
.app-topbar__menu svg { width: 20px; height: 20px; }

.app-topbar__breadcrumb {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}
.app-topbar__breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color .12s;
}
.app-topbar__breadcrumb a:hover { color: var(--text-strong); }
.app-topbar__breadcrumb .crumb-sep { color: var(--text-subtle); opacity: 0.6; }
.app-topbar__breadcrumb .crumb-current {
  color: var(--text-strong);
  font-weight: 500;
}

.app-topbar__actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.app-topbar__time {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.05);
}

/* Signal indicator — animated bars */
.app-signal {
  display: inline-flex;
  gap: 2px;
  align-items: flex-end;
  height: 14px;
}
.app-signal span {
  width: 3px;
  background: var(--text-muted);
  border-radius: 1px;
  display: inline-block;
  opacity: 0.3;
}
.app-signal span:nth-child(1) { height: 4px; }
.app-signal span:nth-child(2) { height: 7px; }
.app-signal span:nth-child(3) { height: 10px; }
.app-signal span:nth-child(4) { height: 13px; }
.app-signal--active span {
  background: #10b981;
  opacity: 1;
}
.app-signal--active span:nth-child(1) { animation: signal-pulse 1.4s ease-in-out infinite; }
.app-signal--active span:nth-child(2) { animation: signal-pulse 1.4s ease-in-out infinite 0.15s; }
.app-signal--active span:nth-child(3) { animation: signal-pulse 1.4s ease-in-out infinite 0.3s; }
.app-signal--active span:nth-child(4) { animation: signal-pulse 1.4s ease-in-out infinite 0.45s; }
@keyframes signal-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* Canvas (page content) */
.app-canvas {
  padding: 32px 28px 80px;
  max-width: 1440px;
  margin: 0 auto;
}

/* Sidebar backdrop (mobile) */
.app-side__backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 9;
}
.app-side__backdrop.is-open { display: block; }

@media (max-width: 900px) {
  body.app-shell { grid-template-columns: 1fr; }
  .app-side {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: 280px;
    transform: translateX(-100%);
    transition: transform .25s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 15;
  }
  .app-side.is-open { transform: translateX(0); }
  .app-topbar__menu { display: inline-flex; }
  .app-canvas { padding: 22px 18px 60px; }
}

/* ─── PAGE HERO (used by sahifa templates) ──────────────────── */

.page-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.page-hero__title {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.035em;
  color: #f8fafc;
  line-height: 1.05;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}
.page-hero__title-accent {
  background: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.page-hero__subtitle {
  font-size: 14.5px;
  color: var(--text-muted);
  margin-top: 8px;
  max-width: 540px;
  line-height: 1.5;
}
.page-hero__actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ─── KPI tiles (used in dashboards) ────────────────────────── */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.kpi {
  position: relative;
  padding: 18px 20px;
  background: linear-gradient(180deg, rgba(255,255,255,0.025) 0%, rgba(255,255,255,0.01) 100%);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color .15s, transform .15s;
}
.kpi:hover {
  border-color: rgba(249,115,22,0.3);
  transform: translateY(-1px);
}
.kpi::after {
  content: "";
  position: absolute; top: 0; right: 0;
  width: 60px; height: 60px;
  background: radial-gradient(circle at top right, rgba(249,115,22,0.15), transparent 70%);
  pointer-events: none;
}
.kpi__label {
  display: flex; align-items: center; gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.kpi__label svg { width: 14px; height: 14px; opacity: 0.7; }
.kpi__value {
  font-size: 30px;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.kpi__meta {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
}
.kpi__meta strong { color: #10b981; font-weight: 600; }
.kpi__meta strong.is-down { color: #ef4444; }

/* ─── DATA TABLE v2 ─────────────────────────────────────────── */

.dt-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.025) 0%, rgba(255,255,255,0.01) 100%);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  overflow: hidden;
}
.dt-card__header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.dt-card__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-strong);
  letter-spacing: -0.01em;
}
.dt-card__count {
  font-size: 12px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  padding: 3px 9px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}

.dt-table-wrap { overflow-x: auto; }
.dt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.dt-table thead th {
  padding: 12px 20px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  background: rgba(255,255,255,0.015);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  white-space: nowrap;
}
.dt-table tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.03);
  transition: background .12s;
}
.dt-table tbody tr:hover {
  background: rgba(255,255,255,0.025);
}
.dt-table tbody tr[data-href] { cursor: pointer; position: relative; }
.dt-table tbody tr[data-href]:hover {
  background: rgba(249,115,22,0.05);
  box-shadow: inset 3px 0 0 #f97316;
}
.dt-table tbody tr[data-href]:hover .dt-project { color: #fb923c; }
.dt-table tbody tr[data-href]:hover .dt-action {
  background: rgba(249,115,22,0.18);
  color: #fb923c;
  transform: translateX(2px);
}
.dt-table tbody tr:last-child { border-bottom: none; }
.dt-table tbody td {
  padding: 14px 20px;
  vertical-align: middle;
}

.dt-id {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.dt-project {
  font-weight: 600;
  color: #f8fafc;
  font-size: 13.5px;
  letter-spacing: -0.005em;
}
.dt-meta {
  font-size: 11.5px;
  color: var(--text-subtle);
  margin-top: 2px;
}

/* Status pills with leading dot */
.dt-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  white-space: nowrap;
}
.dt-status::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}
.dt-status--new        { color: #60a5fa; background: rgba(59,130,246,0.10);  border-color: rgba(59,130,246,0.25); }
.dt-status--accepted   { color: #fbbf24; background: rgba(251,191,36,0.10);  border-color: rgba(251,191,36,0.25); }
.dt-status--inprogress { color: #c084fc; background: rgba(192,132,252,0.10); border-color: rgba(192,132,252,0.25); }
.dt-status--done       { color: #34d399; background: rgba(52,211,153,0.10);  border-color: rgba(52,211,153,0.25); }
.dt-status--live       { color: #10b981; background: rgba(16,185,129,0.12);  border-color: rgba(16,185,129,0.30); }
.dt-status--cancelled  { color: #f87171; background: rgba(248,113,113,0.10); border-color: rgba(248,113,113,0.25); }
.dt-status--live::before { animation: dot-pulse 1.6s ease-in-out infinite; }
@keyframes dot-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.4); opacity: 0.6; }
}

/* Service type chip */
.dt-service {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  font-size: 11.5px;
  border-radius: 6px;
  background: rgba(255,255,255,0.04);
  color: var(--text-default);
  white-space: nowrap;
}
.dt-service svg { width: 13px; height: 13px; opacity: 0.8; }
.dt-service--pbx { color: #94a3b8; }
.dt-service--ip  { color: #fb923c; background: rgba(251,146,60,0.08); }
.dt-service--crm { color: #c084fc; background: rgba(192,132,252,0.08); }

.dt-tenant {
  font-size: 13px;
  color: var(--text-default);
  font-weight: 500;
}

.dt-time {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.dt-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: 7px;
  background: rgba(255,255,255,0.04);
  color: var(--text-muted);
  transition: all .15s;
  text-decoration: none;
}
.dt-action:hover {
  background: rgba(249,115,22,0.15);
  color: #fb923c;
  transform: translateX(2px);
  text-decoration: none;
}
.dt-action svg { width: 14px; height: 14px; }

/* ─── FILTER BAR ────────────────────────────────────────────── */

.filter-bar {
  display: grid;
  grid-template-columns: 200px 1fr auto auto;
  gap: 10px;
  padding: 14px 18px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 12px;
  margin-bottom: 20px;
  align-items: center;
}
.filter-bar__search {
  position: relative;
  display: flex;
  align-items: center;
}
.filter-bar__search svg {
  position: absolute; left: 12px; width: 14px; height: 14px;
  color: var(--text-subtle);
}
.filter-bar__input {
  width: 100%;
  height: 36px;
  padding: 0 12px 0 32px;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  color: var(--text-strong);
  font-size: 13px;
  font-family: var(--font-sans);
  transition: border-color .12s, box-shadow .12s;
}
.filter-bar__input::placeholder { color: var(--text-subtle); }
.filter-bar__input:focus {
  outline: none;
  border-color: rgba(249,115,22,0.5);
  box-shadow: 0 0 0 3px rgba(249,115,22,0.12);
}
.filter-bar__select {
  height: 36px;
  padding: 0 32px 0 12px;
  background-color: rgba(0,0,0,0.3);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'><path d='M3 4.5L6 7.5L9 4.5' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  color: var(--text-strong);
  font-size: 13px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.filter-bar__select:focus {
  outline: none;
  border-color: rgba(249,115,22,0.5);
  box-shadow: 0 0 0 3px rgba(249,115,22,0.12);
}

.filter-btn {
  height: 36px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: -0.005em;
  box-shadow: 0 1px 0 rgba(255,255,255,0.15) inset, 0 4px 12px rgba(249,115,22,0.25);
  transition: all .15s;
  text-decoration: none;
}
.filter-btn:hover { transform: translateY(-1px); box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset, 0 6px 16px rgba(249,115,22,0.35); }
.filter-btn:active { transform: translateY(0); }
.filter-btn svg { width: 13px; height: 13px; }

.filter-btn--ghost {
  background: rgba(255,255,255,0.04);
  color: var(--text-default);
  box-shadow: none;
  border: 1px solid rgba(255,255,255,0.06);
}
.filter-btn--ghost:hover {
  background: rgba(255,255,255,0.08);
  transform: none;
  box-shadow: none;
}

@media (max-width: 900px) {
  .filter-bar { grid-template-columns: 1fr; }
}

/* ─── CUSTOM FILE INPUT (replaces native <input type=file>) ──── */

.v2-file {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 4px 4px 4px 4px;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .12s, background .12s, box-shadow .12s;
  user-select: none;
  overflow: hidden;
}
.v2-file:hover { border-color: rgba(255,255,255,0.12); background: rgba(0,0,0,0.4); }
.v2-file:focus-within,
.v2-file.is-drag {
  border-color: rgba(249,115,22,0.5);
  box-shadow: 0 0 0 3px rgba(249,115,22,0.12);
  background: rgba(249,115,22,0.04);
}
.v2-file input[type=file] {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0; pointer-events: none;
}
.v2-file__btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  color: var(--text-strong);
  font-size: 12.5px;
  font-weight: 500;
  flex-shrink: 0;
  transition: all .12s;
}
.v2-file:hover .v2-file__btn,
.v2-file:focus-within .v2-file__btn {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 1px 0 rgba(255,255,255,0.15) inset, 0 2px 8px rgba(249,115,22,0.25);
}
.v2-file__btn .mi { font-size: 14px; }
.v2-file__name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: var(--text-subtle);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-mono);
}
.v2-file.has-file .v2-file__name {
  color: var(--text-strong);
}
.v2-file__clear {
  width: 26px; height: 26px;
  border-radius: 5px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: all .12s;
  flex-shrink: 0;
}
.v2-file.has-file .v2-file__clear { display: inline-flex; }
.v2-file__clear:hover { background: rgba(239,68,68,0.15); color: #fca5a5; }
.v2-file__clear .mi { font-size: 14px; }

/* Drop-zone variant — larger, dashed border */
.v2-file--zone {
  height: auto;
  flex-direction: column;
  gap: 8px;
  padding: 24px 18px;
  border-style: dashed;
  border-width: 2px;
  text-align: center;
  cursor: pointer;
}
.v2-file--zone .v2-file__btn { display: none; }
.v2-file--zone .v2-file__name {
  font-family: var(--font-sans);
  font-size: 13px;
  white-space: normal;
  text-align: center;
}
.v2-file--zone::before {
  content: 'cloud_upload';
  font-family: 'Material Symbols Outlined';
  font-size: 32px;
  color: var(--text-subtle);
  margin-bottom: 4px;
  transition: color .15s, transform .15s;
}
.v2-file--zone:hover::before,
.v2-file--zone.is-drag::before {
  color: #fb923c;
  transform: translateY(-2px);
}

/* ─── MATERIAL SYMBOLS (Google Fonts) ───────────────────────── */
/* Replacement for emoji icons across the app.
   Usage: <span class="mi">add</span>
   Variants: .mi--sm, .mi--lg, .mi--fill (filled variant) */
.material-symbols-outlined,
.mi {
  font-family: 'Material Symbols Outlined', sans-serif;
  font-weight: 400;
  font-style: normal;
  font-size: 18px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  flex-shrink: 0;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
}
.mi--sm   { font-size: 14px; font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 20; }
.mi--md   { font-size: 18px; }
.mi--lg   { font-size: 22px; font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 32; }
.mi--xl   { font-size: 28px; font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 40; }
.mi--fill { font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }
.mi--bold { font-variation-settings: 'FILL' 0, 'wght' 600, 'GRAD' 0, 'opsz' 24; }

/* ─── AUTH SHELL (login sahifa) ─────────────────────────────── */

body.auth-shell {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(180deg, #06080d 0%, #050608 100%);
  position: relative;
  overflow: hidden;
  font-family: var(--font-sans);
  color: var(--text-default);
}
/* Aurora layer — same multi-color glow blobs as app-shell */
body.auth-shell::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px circle at 80% 20%, rgba(249,115,22,0.18), transparent 55%),
    radial-gradient(720px circle at 15% 30%, rgba(99,102,241,0.12), transparent 60%),
    radial-gradient(680px circle at 90% 90%, rgba(251,146,60,0.10), transparent 60%),
    radial-gradient(800px circle at 5% 95%, rgba(56,189,248,0.08), transparent 60%);
  filter: saturate(135%);
  animation: aurora-drift 28s ease-in-out infinite;
}
/* Subtle linework on top */
body.auth-shell::after {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      35deg,
      transparent 0,
      transparent 78px,
      rgba(255,255,255,0.02) 78px,
      rgba(255,255,255,0.02) 79px
    ),
    repeating-linear-gradient(
      -35deg,
      transparent 0,
      transparent 78px,
      rgba(249,115,22,0.016) 78px,
      rgba(249,115,22,0.016) 79px
    );
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 90%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 90%);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(180deg, rgba(20,23,30,0.95) 0%, rgba(15,18,24,0.95) 100%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 36px 32px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.04) inset;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: relative;
  z-index: 1;
}

/* ─── PAGE-LEVEL UTILITIES (xohlagan sahifa ishlatishi mumkin) ── */

/* Generic content card (replaces eski `.card`). Yangi sahifalar
   `.v2-card` ishlatadi; eski sahifalar `.card` orqali panel.css'dan
   styles oladi. */
.v2-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.025) 0%, rgba(255,255,255,0.01) 100%);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 22px 24px;
}
.v2-card + .v2-card { margin-top: 16px; }

.v2-card__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.v2-card__title svg { width: 14px; height: 14px; opacity: 0.7; }

/* Generic form field group (v2). */
.v2-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.v2-field__label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: -0.005em;
}
.v2-field__hint {
  font-size: 11.5px;
  color: var(--text-subtle);
}
.v2-input,
.v2-textarea {
  width: 100%;
  padding: 10px 12px;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  color: var(--text-strong);
  font-family: var(--font-sans);
  font-size: 14px;
  transition: border-color .12s, box-shadow .12s;
}
.v2-textarea {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
  min-height: 100px;
}
.v2-input:focus,
.v2-textarea:focus {
  outline: none;
  border-color: rgba(249,115,22,0.5);
  box-shadow: 0 0 0 3px rgba(249,115,22,0.12);
  background: rgba(0,0,0,0.5);
}
.v2-input::placeholder,
.v2-textarea::placeholder { color: var(--text-subtle); }

/* Backward-compat: eski sahifa class'larini yangi look bilan moslab
   qo'yamiz. `.input` (panel.css) hozir ham mavjud — biz qo'shamiz
   yangi rangli rebrand bilan ustun chiqib turishi uchun. */
.app-canvas .container,
.app-canvas .container--wide { max-width: none; padding: 0; }

.app-canvas .card {
  background: linear-gradient(180deg, rgba(255,255,255,0.025) 0%, rgba(255,255,255,0.01) 100%) !important;
  border: 1px solid rgba(255,255,255,0.06) !important;
  border-radius: 14px !important;
}

.app-canvas .input,
.app-canvas input[type=text],
.app-canvas input[type=password],
.app-canvas input[type=email],
.app-canvas input[type=number],
.app-canvas input[type=tel],
.app-canvas textarea,
.app-canvas select {
  background: rgba(0,0,0,0.3) !important;
  border: 1px solid rgba(255,255,255,0.06) !important;
  border-radius: 8px !important;
  color: var(--text-strong) !important;
}
.app-canvas .input:focus,
.app-canvas input:focus,
.app-canvas textarea:focus,
.app-canvas select:focus {
  border-color: rgba(249,115,22,0.5) !important;
  box-shadow: 0 0 0 3px rgba(249,115,22,0.12) !important;
  outline: none !important;
}

.app-canvas .btn {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  color: var(--text-default);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  transition: all .15s;
}
.app-canvas .btn:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text-strong);
}
.app-canvas .btn--primary,
.app-canvas .btn[type=submit]:not(.btn--ghost):not(.btn--secondary) {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%) !important;
  color: #fff !important;
  border-color: transparent !important;
  box-shadow: 0 1px 0 rgba(255,255,255,0.15) inset, 0 4px 12px rgba(249,115,22,0.25);
}
.app-canvas .btn--primary:hover,
.app-canvas .btn[type=submit]:not(.btn--ghost):not(.btn--secondary):hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* Old `.pill` status badge → glow-dot style (matches dt-status) */
.app-canvas .pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 8px !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  border-radius: 999px !important;
  border: 1px solid transparent;
}
.app-canvas .pill::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; box-shadow: 0 0 6px currentColor;
}
.app-canvas .pill--new        { color: #60a5fa !important; background: rgba(59,130,246,0.10) !important;  border-color: rgba(59,130,246,0.25); }
.app-canvas .pill--accepted   { color: #fbbf24 !important; background: rgba(251,191,36,0.10) !important;  border-color: rgba(251,191,36,0.25); }
.app-canvas .pill--in_progress{ color: #c084fc !important; background: rgba(192,132,252,0.10) !important; border-color: rgba(192,132,252,0.25); }
.app-canvas .pill--done       { color: #34d399 !important; background: rgba(52,211,153,0.10) !important;  border-color: rgba(52,211,153,0.25); }
.app-canvas .pill--live       { color: #10b981 !important; background: rgba(16,185,129,0.12) !important;  border-color: rgba(16,185,129,0.30); }
.app-canvas .pill--live::before { animation: dot-pulse 1.6s ease-in-out infinite; }
.app-canvas .pill--cancelled  { color: #f87171 !important; background: rgba(248,113,113,0.10) !important; border-color: rgba(248,113,113,0.25); }

/* Hero block (old `.hero` class in template) — moslashtirilgan */
.app-canvas .hero {
  margin-bottom: 24px;
  padding: 0;
  background: none;
  border: none;
  display: flex; align-items: center; gap: 16px;
}
.app-canvas .hero__icon { display: none; }
.app-canvas .hero__title {
  font-size: 28px; font-weight: 800; color: #f8fafc;
  letter-spacing: -0.025em;
}
.app-canvas .hero__sub { color: var(--text-muted); font-size: 13.5px; }

/* Tables (.data class in templates) */
.app-canvas .table-wrap {
  background: linear-gradient(180deg, rgba(255,255,255,0.025) 0%, rgba(255,255,255,0.01) 100%);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  overflow: hidden;
}
.app-canvas table.data,
.app-canvas table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.app-canvas table thead th {
  padding: 12px 18px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  background: rgba(255,255,255,0.015);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  text-align: left;
}
.app-canvas table tbody td {
  padding: 13px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  color: var(--text-default);
}
.app-canvas table tbody tr:hover { background: rgba(255,255,255,0.025); }
.app-canvas table tbody tr:last-child td { border-bottom: none; }

/* Field labels in legacy `.field` */
.app-canvas .field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.app-canvas .field label {
  font-size: 12.5px; font-weight: 500;
  color: var(--text-muted); letter-spacing: -0.005em;
}

/* Generic section title (h1, h2 inside canvas) */
.app-canvas h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; color: #f8fafc; }
.app-canvas h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.015em; color: #f8fafc; }
.app-canvas h3 { font-size: 16px; font-weight: 600; color: #f8fafc; }

/* ─── CUSTOM DROPDOWN (replaces native <select>) ────────────── */

.dd {
  position: relative;
  display: inline-block;
}
.dd > summary {
  list-style: none;
  cursor: pointer;
}
.dd > summary::-webkit-details-marker { display: none; }
.dd > summary::marker { display: none; content: ""; }

.dd-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  height: 36px;
  padding: 0 12px;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  color: var(--text-strong);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: border-color .12s, box-shadow .12s, background .12s;
}
.dd-trigger:hover { border-color: rgba(255,255,255,0.12); background: rgba(0,0,0,0.4); }
.dd[open] .dd-trigger {
  border-color: rgba(249,115,22,0.5);
  box-shadow: 0 0 0 3px rgba(249,115,22,0.12);
  background: rgba(0,0,0,0.5);
}
.dd-trigger__chevron {
  width: 12px; height: 12px;
  color: var(--text-muted);
  transition: transform .15s ease;
  flex-shrink: 0;
}
.dd[open] .dd-trigger__chevron { transform: rotate(180deg); color: #fb923c; }
.dd-trigger__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  box-shadow: 0 0 8px currentColor;
}
.dd-trigger__label { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.dd-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 100%;
  max-height: 320px;
  overflow-y: auto;
  background: linear-gradient(180deg, #14171e 0%, #10131a 100%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 6px;
  box-shadow:
    0 20px 50px rgba(0,0,0,0.6),
    0 4px 12px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,255,255,0.04);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: dd-open .15s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes dd-open {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.dd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--text-default);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  width: 100%;
  text-decoration: none;
  transition: background .1s, color .1s;
  white-space: nowrap;
}
.dd-item:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-strong);
  text-decoration: none;
}
.dd-item.is-selected {
  background: rgba(249,115,22,0.12);
  color: #fb923c;
}
.dd-item__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dd-item__check {
  width: 14px; height: 14px;
  margin-left: auto;
  opacity: 0;
  flex-shrink: 0;
}
.dd-item.is-selected .dd-item__check { opacity: 1; color: #fb923c; }
.dd-item__sep {
  height: 1px;
  background: rgba(255,255,255,0.06);
  margin: 4px 6px;
  cursor: default;
  padding: 0;
}
.dd-item__sep:hover { background: rgba(255,255,255,0.06); }

/* Status dots inside dropdown items — colored circles per status */
.dd-item__dot--new        { background: #60a5fa; box-shadow: 0 0 6px #60a5fa; }
.dd-item__dot--accepted   { background: #fbbf24; box-shadow: 0 0 6px #fbbf24; }
.dd-item__dot--inprogress { background: #c084fc; box-shadow: 0 0 6px #c084fc; }
.dd-item__dot--done       { background: #34d399; box-shadow: 0 0 6px #34d399; }
.dd-item__dot--live       { background: #10b981; box-shadow: 0 0 8px #10b981; animation: dot-pulse 1.6s ease-in-out infinite; }
.dd-item__dot--cancelled  { background: #f87171; box-shadow: 0 0 6px #f87171; }
.dd-item__dot--all        { background: linear-gradient(135deg, #fb923c, #60a5fa); }

/* ─── EMPTY STATE v2 ────────────────────────────────────────── */

.empty-v2 {
  text-align: center;
  padding: 70px 28px;
  color: var(--text-muted);
}
.empty-v2__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px; height: 64px;
  margin: 0 auto 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(249,115,22,0.12), rgba(249,115,22,0.04));
  border: 1px solid rgba(249,115,22,0.15);
  color: #fb923c;
}
.empty-v2__icon svg { width: 28px; height: 28px; }
.empty-v2__title {
  font-size: 17px;
  font-weight: 600;
  color: #f8fafc;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.empty-v2__desc {
  font-size: 13.5px;
  color: var(--text-muted);
  max-width: 380px;
  margin: 0 auto 18px;
  line-height: 1.55;
}
