/* ==========================================================================
   Uy Market - Web ERP / CRM System (Desktop Stylesheet - Executive Dark Theme)
   ========================================================================== */

:root {
  /* Brand & Status Colors */
  --uy-primary: #2563eb;
  --uy-primary-hover: #1d4ed8;
  --uy-primary-weak: rgba(37, 99, 235, 0.15);
  
  --uy-accent: #ea580c;
  --uy-accent-soft: rgba(234, 88, 12, 0.15);
  --uy-green: #22c55e;
  --uy-red: #ef4444;
  --uy-orange: #f97316;
  --uy-cyan: #38bdf8;
  --uy-purple: #a855f7;

  /* Chart Hatch Patterns (Dark Background) */
  --uy-hatch-bg: #141720;
  --uy-hatch-l: #252a38;
  --uy-hatch-d: #1c202c;

  /* Dark Executive Theme Surfaces & High-Contrast Typography (Photo 1) */
  --color-bg: #0b0c10;
  --color-panel: #14161d;
  --color-panel-header: #101217;
  --color-panel-hover: #191c26;
  
  --color-fg: #f8fafc;
  --color-fg-muted: #94a3b8;
  --color-fg-subtle: #64748b;
  
  --color-border: #20232e;
  --color-border-subtle: #171922;
  --cds-chart-grid: rgba(255, 255, 255, 0.06);

  /* Dark Executive Sidebar (Photo 1) */
  --sidebar-bg: #111319;
  --sidebar-border: #1c1f28;
  --sidebar-fg: #f8fafc;
  --sidebar-fg-muted: #94a3b8;

  /* Typography (Photo 2) */
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Geometry & Shadows */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 25px -3px rgba(37, 99, 235, 0.35);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Bulletproof [hidden] rule to guarantee modals & inactive views never leak or block UI */
[hidden] {
  display: none !important;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-fg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Tabular figures for all numbers and currencies */
b, strong, .num, .val, .uy-tile-v, .uy-list-v, [data-field*="price"], [data-field*="usd"], [data-field*="units"], [data-field*="budget"] {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* ==========================================================================
   Fullscreen Layout (Desktop ERP)
   ========================================================================== */

#uy-shell {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: var(--color-bg);
}

/* Desktop Sidebar (Dark Executive Sidebar - Photo 1) */
#uy-side {
  width: 250px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  flex-shrink: 0;
  user-select: none;
  transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 30;
}

#uy-shell.is-collapsed #uy-side {
  width: 74px;
  padding: 20px 10px;
}

#uy-shell.is-collapsed #uy-side .lbl,
#uy-shell.is-collapsed #uy-side .uy-nav-sec,
#uy-shell.is-collapsed #uy-side .uy-user .lbl,
#uy-shell.is-collapsed #uy-side .uy-create span {
  display: none;
}

#uy-shell.is-collapsed #uy-side .uy-create {
  padding: 10px;
  justify-content: center;
}

/* Logo */
.uy-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  padding: 0 4px;
}

.uy-logo-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: rgba(37, 99, 235, 0.2);
  border: 1px solid rgba(37, 99, 235, 0.4);
  border-radius: var(--radius-md);
  color: #38bdf8;
  flex-shrink: 0;
}

.uy-logo small {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--sidebar-fg-muted);
  font-weight: 600;
}

.uy-logo b {
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

/* Sidebar Toggle Button */
.uy-side-toggle {
  align-self: flex-end;
  background: transparent;
  border: 0;
  color: var(--sidebar-fg-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  transition: color 0.15s ease;
}

.uy-side-toggle:hover {
  color: #ffffff;
}

/* + Создать проект Button (Photo 1) */
.uy-create {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: var(--uy-primary);
  color: #ffffff;
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  transition: all 0.2s ease;
  margin-bottom: 22px;
}

.uy-create:hover {
  background: var(--uy-primary-hover);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
  transform: translateY(-1px);
}

/* Sidebar Navigation */
.uy-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.uy-nav hr {
  border: 0;
  border-top: 1px solid var(--sidebar-border);
  margin: 12px 0;
}

/* Section Header (ОСНОВНОЕ / УПРАВЛЕНИЕ) */
.uy-nav-sec {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sidebar-fg-muted);
  margin: 14px 0 6px 12px;
}

.uy-nav button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  position: relative;
}

.uy-nav button svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  stroke-width: 2;
  color: inherit;
}

.uy-nav button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

/* Active Navigation Item (Photo 1) */
.uy-nav button[aria-current="page"] {
  background: rgba(37, 99, 235, 0.14);
  color: #38bdf8;
  font-weight: 600;
}

.uy-nav button[aria-current="page"] svg {
  color: #38bdf8;
}

.uy-nav button[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: #38bdf8;
  border-radius: 0 4px 4px 0;
}

/* Navigation Badge (Pill) */
.uy-nav-badge {
  margin-left: auto;
  background: rgba(37, 99, 235, 0.25);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #93c5fd;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

/* Sidebar Footer & User Profile */
.uy-side-foot {
  flex: none;
  margin-top: auto;
  border-top: 1px solid var(--sidebar-border);
  padding-top: 14px;
}

.uy-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  margin-top: 6px;
  border-radius: var(--radius-md);
}

.uy-user .lbl small {
  display: block;
  font-size: 11px;
  color: var(--sidebar-fg-muted);
}

.uy-user .lbl b {
  display: block;
  font-size: 13px;
  color: #ffffff;
  font-weight: 600;
}

/* Main Workspace */
#uy-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--color-bg);
}

/* Desktop Topbar (Photo 1) */
#uy-top {
  height: 64px;
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  flex-shrink: 0;
  z-index: 20;
}

.uy-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #161821;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0 14px;
  width: 340px;
  height: 40px;
  color: var(--color-fg-muted);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.uy-search:focus-within {
  background: #1b1e2a;
  border-color: var(--uy-primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}

.uy-search input {
  border: 0;
  background: transparent;
  outline: none;
  color: var(--color-fg);
  font-size: 13px;
  font-family: inherit;
  width: 100%;
}

.uy-search input::placeholder {
  color: var(--color-fg-subtle);
}

.uy-top-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.uy-select {
  background: #161821;
  border: 1px solid var(--color-border);
  color: var(--color-fg);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  height: 38px;
  border-radius: var(--radius-md);
  padding: 0 14px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.uy-select:focus {
  border-color: var(--uy-primary);
}

/* Language Segmented Pill */
.uy-seg {
  display: inline-flex;
  background: #161821;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 2px;
}

.uy-seg button {
  border: 0;
  background: transparent;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-fg-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.uy-seg button[aria-pressed="true"] {
  background: #252835;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.uy-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: #161821;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-fg);
  cursor: pointer;
  position: relative;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.uy-icon-btn:hover {
  background: #202431;
  border-color: #38bdf8;
}

.uy-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--uy-red);
}

/* Main Scroll Area */
#uy-main {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px 28px 48px;
}

/* Page Headings (Photo 1) */
.uy-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 16px;
}

.uy-head h1 {
  font-size: 24px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.uy-take {
  margin-top: 4px;
  font-size: 13px;
  color: var(--color-fg-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Generic Buttons */
.uy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--uy-primary);
  color: #ffffff;
  border: 0;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.uy-btn:hover {
  background: var(--uy-primary-hover);
}

.uy-btn.ghost {
  background: #161821;
  color: var(--color-fg);
  border: 1px solid var(--color-border);
}

.uy-btn.ghost:hover {
  background: #202431;
  border-color: #38bdf8;
}

.uy-btn.ghost.pill {
  border-radius: var(--radius-full);
  padding: 7px 16px;
  font-size: 12px;
}

/* Tabs (Photo 1 - Elegant White Pill for Active Tab) */
.uy-tabs {
  display: flex;
  gap: 6px;
  border-bottom: none;
  margin-bottom: 22px;
}

.uy-tabs button {
  padding: 7px 18px;
  border: 0;
  background: transparent;
  color: var(--color-fg-muted);
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
}

.uy-tabs button:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.uy-tabs button[aria-selected="true"] {
  background: #ffffff;
  color: #0b0c10;
  font-weight: 700;
}

.uy-tabs button[aria-selected="true"]::after {
  display: none;
}

.uy-tabs button .cnt {
  margin-left: 6px;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.15);
  padding: 2px 6px;
  border-radius: var(--radius-full);
}

.uy-tabs button[aria-selected="true"] .cnt {
  background: #e2e8f0;
  color: #0f172a;
}

/* ==========================================================================
   Tiles & KPI Cards (Photo 1 & Photo 3)
   ========================================================================== */

.uy-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.uy-tiles.row {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1200px) {
  .uy-tiles.row {
    grid-template-columns: repeat(2, 1fr);
  }
}

.uy-tile {
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.uy-tile:hover {
  border-color: #33394a;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.uy-tile-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.uy-tile-t {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-fg-muted);
}

.uy-note {
  font-size: 11px;
  color: var(--color-fg-subtle);
  margin-top: 2px;
}

.uy-tile-ic {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #181b24;
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.uy-tile-v {
  font-size: 26px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 6px 0 2px;
}

.uy-uzs {
  font-size: 12px;
  color: var(--color-fg-muted);
  margin-bottom: 12px;
}

.uy-tile-f {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: auto;
  font-size: 12px;
}

.uy-tile-ch {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
  color: var(--color-fg-subtle);
}

.uy-delta {
  font-weight: 600;
  font-size: 12px;
}

.uy-delta.good {
  color: var(--uy-green);
}

.uy-delta.bad {
  color: var(--uy-red);
}

/* Pills & Chips */
.uy-chip {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.uy-chip.good {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.uy-chip.bad {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.3);
}

.uy-pill {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.uy-pill.good {
  background: #bbf7d0;
  color: #14532d;
}

.uy-pill.bad {
  background: #fecaca;
  color: #7f1d1d;
}

/* ==========================================================================
   Grids & Cards
   ========================================================================== */

.uy-grid {
  display: grid;
  gap: 20px;
  margin-bottom: 22px;
}

.uy-grid.two, .uy-grid.top {
  grid-template-columns: 2fr 1fr;
}

.uy-grid.two-equal {
  grid-template-columns: 1fr 1fr;
}

.uy-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 1024px) {
  .uy-grid.two, .uy-grid.top, .uy-grid.two-equal, .uy-grid.three {
    grid-template-columns: 1fr;
  }
}

.uy-card {
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.uy-card-h {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 12px;
}

.uy-card-h h2 {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.uy-card-h p {
  font-size: 12px;
  color: var(--color-fg-muted);
  margin-top: 2px;
}

.uy-ov-h {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.uy-ov-v {
  font-size: 28px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.uy-legend {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--color-fg-muted);
  margin: 8px 0 2px;
}

.uy-link {
  background: transparent;
  border: 0;
  color: var(--color-fg-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.uy-link:hover {
  color: #38bdf8;
  text-decoration: underline;
}

/* ==========================================================================
   Tables & Lists (Point 2 - Clean High-Contrast Dark Table Layout)
   ========================================================================== */

.uy-tbl-wrap {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-panel);
  margin-top: 12px;
  box-shadow: var(--shadow-sm);
}

.uy-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: left;
}

.uy-tbl th {
  background: var(--color-panel-header);
  padding: 13px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
  text-align: left;
}

.uy-tbl th button {
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  justify-content: flex-start;
  text-align: left;
}

.uy-tbl th button:hover {
  color: #ffffff;
}

.uy-tbl th[aria-sort="ascending"] button::after {
  content: ' ↑';
  font-size: 11px;
  color: var(--uy-primary);
}

.uy-tbl th[aria-sort="descending"] button::after {
  content: ' ↓';
  font-size: 11px;
  color: var(--uy-primary);
}

.uy-tbl td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border-subtle);
  color: var(--color-fg);
  vertical-align: middle;
}

.uy-tbl tr:last-child td {
  border-bottom: 0;
}

.uy-tbl tr:hover td {
  background: var(--color-panel-hover);
}

.uy-tbl th.num {
  text-align: right;
}

.uy-tbl th.num button {
  justify-content: flex-end;
  text-align: right;
}

.uy-tbl td.num {
  text-align: right;
  font-weight: 600;
  color: #ffffff;
}

.uy-tbl .sum td {
  font-weight: 700;
  border-top: 1px solid var(--color-border);
  background: var(--color-panel-header);
  color: #ffffff;
}

.uy-tbl .pct td {
  font-style: italic;
  color: var(--color-fg-muted);
}

/* Badges in tables (Photo 2) */
.uy-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
}

.uy-badge.s-new, .uy-badge.s-lead, .uy-badge.s-draft {
  background: rgba(37, 99, 235, 0.18);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.uy-badge.s-in_progress, .uy-badge.s-active, .uy-badge.s-review {
  background: rgba(234, 88, 12, 0.18);
  color: #fb923c;
  border: 1px solid rgba(251, 146, 60, 0.35);
}

.uy-badge.s-docs, .uy-badge.s-paused, .uy-badge.s-planning {
  background: rgba(147, 51, 234, 0.18);
  color: #c084fc;
  border: 1px solid rgba(192, 132, 252, 0.35);
}

.uy-badge.s-done, .uy-badge.s-deal, .uy-badge.s-signed {
  background: rgba(34, 197, 94, 0.18);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.35);
}

.uy-badge.s-cancelled, .uy-badge.s-lost {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.35);
}

/* Product & Buildings List (Dashboard Right Card - Photo 1) */
.uy-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.uy-list-i {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: #101217;
  border: 1px solid var(--color-border);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.uy-list-i:hover {
  background: #181a22;
  border-color: #2b2f3d;
}

.uy-list-ic {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 14px;
}

.uy-list-t {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.uy-list-t b {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 2px;
}

.uy-list-t small {
  font-size: 12px;
  color: var(--color-fg-muted);
}

.uy-list-v {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  flex-shrink: 0;
  margin-left: 14px;
}

/* User Avatar */
.uy-ava {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
  flex-shrink: 0;
}

.who {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Progress bar cell in tables */
.uy-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.uy-bar .t {
  flex: 1;
  height: 6px;
  background: #232733;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.uy-bar .t i {
  display: block;
  height: 100%;
  background: var(--uy-primary);
  border-radius: var(--radius-full);
}

.uy-bar-track {
  width: 44px;
  height: 6px;
  background: #192333;
  border-radius: 9999px;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
}

.uy-bar-track i {
  display: block;
  height: 100%;
  background: #1f6fe5;
  border-radius: 9999px;
}

.uy-bar span {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-fg-muted);
  width: 40px;
  text-align: right;
}

.uy-bar b {
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  width: 32px;
  text-align: right;
}

/* ==========================================================================
   Новостройки / Buildings Cards (Point 3 - Pixel-Perfect to Photo 4)
   ========================================================================== */

.uy-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

.uy-card.uy-bld {
  padding: 0;
  overflow: hidden;
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.uy-card.uy-bld:hover {
  border-color: #33394a;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Cover header rectangle with blue icon box (Photo 4) */
.uy-bld-cover {
  height: 85px;
  background: linear-gradient(135deg, #18283b 0%, #17324d 100%);
  display: flex;
  align-items: center;
  padding: 0 18px;
  border-bottom: 1px solid var(--color-border);
}

.uy-bld-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Card Body */
.uy-bld-body {
  padding: 16px 18px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.uy-bld-title {
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 4px 0;
  letter-spacing: -0.01em;
}

.uy-bld-sub {
  font-size: 13px;
  color: var(--color-fg-muted);
  margin: 0 0 14px 0;
}

/* Progress bar (Segmented: Blue + Orange on Soft Dark Track) */
.uy-bld-bar {
  height: 6px;
  border-radius: var(--radius-full);
  background: #232733;
  overflow: hidden;
  display: flex;
  margin-bottom: 16px;
}

.uy-bld-bar-sold {
  height: 100%;
  background: var(--uy-primary);
  transition: width 0.3s ease;
}

.uy-bld-bar-res {
  height: 100%;
  background: var(--uy-orange);
  transition: width 0.3s ease;
}

/* Indicators Grid (2 rows x 3 columns - Photo 4) */
.uy-bld-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px 10px;
}

.uy-bld-metric {
  display: flex;
  flex-direction: column;
}

.uy-bld-metric .val {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.uy-bld-metric .lbl {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-fg-muted);
  margin-top: 3px;
}

/* Tasks cards (Photo 1 - 6 columns grid, dark executive theme) */
.uy-cards.task-cards {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

@media (max-width: 1560px) {
  .uy-cards.task-cards {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  }
}

.uy-card.uy-task {
  padding: 14px 14px 12px 14px;
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, border-color 0.15s ease;
  min-width: 0;
}

.uy-card.uy-task:hover {
  border-color: rgba(56, 189, 248, 0.4);
}

.uy-task .tp {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.uy-task .tt {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  min-width: 0;
}

.uy-task .tt .who {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: #cbd5e1;
  min-width: 0;
  overflow: hidden;
}

.uy-task .tt .who span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.uy-task .tt .who .uy-ava {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.uy-task .tt .uy-note {
  font-size: 12px;
  color: #64748b;
  flex-shrink: 0;
  margin-left: 6px;
  font-weight: 500;
}

.uy-task h3 {
  font-size: 14.5px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 8px 0;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.uy-task .tags {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.uy-task .tags .uy-badge.deal-tag {
  background: rgba(37, 99, 235, 0.2);
  color: #38bdf8;
  border: none;
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 600;
}

.uy-task .tags .uy-badge.prop-tag {
  background: #1e222d;
  color: #94a3b8;
  border: none;
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 500;
}

.uy-task .tb {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  color: var(--color-fg-muted);
  margin-bottom: 12px;
}

.uy-task .tb div {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.uy-task .tb svg {
  color: #64748b;
  flex-shrink: 0;
}

.uy-task .price {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
}

.uy-task .price svg {
  color: #94a3b8;
}

.uy-task .tf {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #1c1f28;
  padding-top: 10px;
  margin-top: auto;
  font-size: 11.5px;
  color: #94a3b8;
}

.uy-task .tf span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.uy-task .tf svg {
  color: #64748b;
}

.uy-task .tf span:last-child {
  color: #38bdf8;
  font-weight: 600;
}

.uy-task .tf span:last-child svg {
  color: #38bdf8;
}

.uy-task .tf span.late {
  color: #ef4444;
}

.uy-task .tf span.late svg {
  color: #ef4444;
}

.uy-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

/* Donut & Stack charts */
.uy-donut {
  display: flex;
  align-items: center;
  gap: 20px;
}

.uy-donut-c {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.uy-donut-c .ctr {
  position: absolute;
  text-align: center;
  pointer-events: none;
}

.uy-donut-c .ctr small {
  display: block;
  font-size: 11px;
  color: var(--color-fg-muted);
}

.uy-donut-c .ctr b {
  font-size: 18px;
  color: #ffffff;
}

.uy-rows {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.uy-rows .r {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.uy-sw {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 6px;
}

.uy-stack {
  display: flex;
  align-items: stretch;
  height: 34px;
  gap: 6px;
  border-radius: 8px;
  margin: 10px 0 16px 0;
}

.uy-stack div {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  border-radius: 6px;
  min-width: 6px;
}

.uy-hbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.uy-hbar .r {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr) 80px;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.uy-hbar .t {
  height: 10px;
  background: #1f2330;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.uy-hbar .t i {
  display: block;
  height: 100%;
  border-radius: var(--radius-full);
}

/* ==========================================================================
   Charts & Tooltip
   ========================================================================== */

.uy-chart {
  position: relative;
  width: 100%;
}

.uy-tip {
  position: absolute;
  background: rgba(11, 15, 25, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 12px;
  color: #ffffff;
  pointer-events: none;
  z-index: 40;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  line-height: 1.6;
}

.uy-tip .h {
  font-weight: 700;
  margin-bottom: 4px;
  color: #94a3b8;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 4px;
}

.uy-tip .r {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

/* ==========================================================================
   Modals & Popovers (Guaranteed No-Blur Bug)
   ========================================================================== */

#uy-overlay {
  display: none;
}

#uy-overlay:not([hidden]) {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}

.uy-modal {
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 26px 28px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  color: var(--color-fg);
}

.uy-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.uy-fields label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-fg-muted);
}

.uy-fields input, .uy-fields select, .uy-fields textarea {
  background: #181b24;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: #ffffff;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.uy-fields input:focus, .uy-fields select:focus, .uy-fields textarea:focus {
  background: #1d212c;
  border-color: var(--uy-primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}

.uy-hint {
  background: #1a2331;
  border: 1px solid rgba(59, 130, 246, 0.22);
  border-radius: 12px;
  padding: 13px 16px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.uy-hint-title, .uy-hint strong {
  font-size: 13.5px;
  font-weight: 600;
  color: #ffffff;
  display: block;
}

.uy-hint-desc, .uy-hint-text, .uy-hint span {
  font-size: 12.5px;
  line-height: 1.45;
  color: #94a3b8;
  display: block;
}

.uy-row-end .uy-btn {
  width: 100%;
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 13px 16px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  display: block;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
  transition: background 0.15s ease, transform 0.1s ease;
}

.uy-row-end .uy-btn:active {
  background: #1d4ed8;
  transform: scale(0.99);
}

#uy-bell-pop {
  display: none;
}

#uy-bell-pop:not([hidden]) {
  display: block;
  position: fixed;
  top: 70px;
  right: 28px;
  width: 340px;
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-lg);
  z-index: 90;
}

/* Utility Animations */
.uy-anim {
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Regions Card (Откуда клиенты - Photo 1 Pixel-Perfect)
   ========================================================================== */
#card-regions-ov {
  overflow: hidden;
}

.uy-reg {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  padding: 6px 0 2px;
}

.uy-reg-s {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.uy-reg-s > div {
  display: flex;
  flex-direction: column;
}

.uy-reg-s .uy-note {
  font-size: 11px;
  color: var(--color-fg-muted);
  line-height: 1.3;
  margin: 0;
}

.uy-reg-big {
  font-size: 26px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.15;
  margin: 3px 0 2px;
  letter-spacing: -0.01em;
}

.uy-reg-b {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.uy-reg-b .r {
  display: flex;
  align-items: center;
  gap: 14px;
}

.uy-reg-b .n {
  width: 110px;
  font-size: 11.5px;
  color: var(--color-fg-muted);
  text-align: right;
  flex-shrink: 0;
  white-space: nowrap;
}

.uy-reg-b .t {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.uy-reg-b .t i {
  height: 15px;
  background: #6243a7;
  border-radius: 7px;
  display: block;
  min-width: 6px;
  transition: width 0.3s ease;
  flex-shrink: 0;
}

.uy-reg-b .pill {
  font-size: 11.5px;
  font-weight: 700;
  color: #ffffff;
  flex-shrink: 0;
  line-height: 1;
}

/* ==========================================================================
   Summary Cards Grid (8+ Compact Cards - Photo 1 Pixel-Perfect)
   ========================================================================== */
.uy-sums {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

@media (max-width: 1400px) {
  .uy-sums {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .uy-sums {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.uy-card.uy-sum {
  padding: 14px 12px;
  border-radius: var(--radius-md);
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.uy-card.uy-sum:hover {
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.uy-card.uy-sum .uy-tile-l {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.uy-card.uy-sum .uy-tile-ic {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.uy-card.uy-sum .uy-note {
  font-size: 10.5px;
  color: var(--color-fg-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.uy-sum-l {
  display: grid;
  grid-template-columns: 1fr auto;
  row-gap: 5px;
  column-gap: 6px;
  margin: 10px 0 12px;
  padding: 0;
}

.uy-sum-l dt {
  font-size: 11px;
  color: var(--color-fg-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
  line-height: 1.4;
  font-weight: 400;
}

.uy-sum-l dd {
  font-size: 11px;
  color: #ffffff;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
  margin: 0;
  line-height: 1.4;
}

.uy-sum-l dd.big {
  font-size: 14.5px;
  font-weight: 700;
  color: #ffffff;
}

.uy-card.uy-sum .uy-link {
  font-size: 11px;
  color: var(--color-fg-muted);
  margin-top: auto;
  align-self: flex-start;
}

/* ==========================================================================
   Справочник / Dictionary 4-Column Grid & Styles (Photo 3 & 4)
   ========================================================================== */

.uy-dict-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

@media (max-width: 1400px) {
  .uy-dict-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .uy-dict-grid {
    grid-template-columns: 1fr;
  }
}

.uy-dict-grid .uy-card {
  padding: 16px 18px;
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.uy-dict-grid .uy-card-h {
  margin-bottom: 8px;
}

.uy-dict-grid .uy-card-h h2 {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
}

.uy-dict-grid .uy-tbl-wrap {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  margin-top: 0;
  overflow-x: auto;
}

.uy-dict-grid .uy-tbl {
  font-size: 13px;
}

.uy-dict-grid .uy-tbl th {
  background: transparent;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
  border-bottom: 1px solid var(--color-border);
  text-transform: none;
}

.uy-dict-grid .uy-tbl th button {
  text-transform: none;
  font-size: 12px;
  font-weight: 600;
}

/* Sky-blue color for "Код" header as in Photo 3 & 4 */
.uy-dict-grid .uy-tbl th:first-child button {
  color: #38bdf8;
}

.uy-dict-grid .uy-tbl td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--color-border-subtle);
  font-size: 13px;
  color: var(--color-fg);
}


/* ── Settings grid ─────────────────────────────────── */
.uy-set {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}
@media (max-width: 1200px) {
  .uy-set { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .uy-set { grid-template-columns: 1fr; }
}
.uy-set p {
  line-height: 1.55;
  margin: 0;
  font-size: 13px;
  color: var(--color-fg-muted);
}

/* ── Key-value pairs (company info) ────────────────── */
.uy-kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  font-size: 13px;
  margin: 0;
}
.uy-kv dt {
  color: var(--color-fg-muted);
}
.uy-kv dd {
  margin: 0;
  font-weight: 500;
  color: #ffffff;
  word-break: break-all;
}

/* ── History list ──────────────────────────────────── */
.uy-hist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.uy-hist li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border-subtle);
}
.uy-hist li:last-child {
  border-bottom: 0;
}
.uy-hist .uy-ava {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}
.uy-hist .uy-hist-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}
.uy-hist .uy-hist-title {
  font-size: 13.5px;
  color: var(--color-fg);
}
.uy-hist .uy-hist-title b {
  font-weight: 600;
  color: #ffffff;
}
.uy-hist .uy-hist-sub {
  font-size: 12.5px;
  color: var(--color-fg-muted);
}
.uy-hist time {
  font-size: 12px;
  color: var(--color-fg-muted);
  white-space: nowrap;
  margin-left: auto;
  text-align: right;
  padding-left: 12px;
}

/* Demo Mode Indicator */
.uy-demo-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  background: rgba(31, 111, 229, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}
