/* ============================================================
   VisionCore — Design System v3
   Premium B2B Industrial Safety Platform
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* --- Tokens ------------------------------------------------- */
:root {
  --brand-700: #1d4ed8;
  --brand-600: #2563eb;
  --brand-500: #3b82f6;
  --brand-100: #dbeafe;
  --brand-50:  #eff6ff;

  --gray-950: #0a0a0f;
  --gray-900: #111118;
  --gray-800: #1e1e2a;
  --gray-700: #2e2e3a;
  --gray-600: #4a4a5a;
  --gray-500: #6b6b7b;
  --gray-400: #9090a0;
  --gray-300: #c0c0cc;
  --gray-200: #e2e2ea;
  --gray-100: #f0f0f5;
  --gray-50:  #f7f7fa;
  --white:    #ffffff;

  --green-700: #15803d;
  --green-600: #16a34a;
  --green-100: #dcfce7;
  --green-50:  #f0fdf4;
  --amber-700: #a16207;
  --amber-600: #d97706;
  --amber-100: #fef3c7;
  --amber-50:  #fffbeb;
  --red-700:   #b91c1c;
  --red-600:   #dc2626;
  --red-100:   #fee2e2;
  --red-50:    #fef2f2;
  --purple-600:#7c3aed;
  --purple-100:#ede9fe;
  --cyan-600:  #0891b2;

  --surface:      #f8f9fb;
  --surface-card: var(--white);
  --sidebar-bg:   var(--white);
  --sidebar-text: var(--gray-500);
  --sidebar-hover: var(--gray-50);
  --sidebar-active-bg: var(--brand-50);
  --sidebar-active-text: var(--brand-700);
  --brand-200: #bfdbfe;

  --border:    #e5e5ee;
  --border-lt: #f0f0f5;

  --shadow-xs: 0 1px 2px rgba(0,0,0,.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 8px -2px rgba(0,0,0,.08), 0 2px 4px -2px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 24px -4px rgba(0,0,0,.1), 0 4px 8px -4px rgba(0,0,0,.05);

  --radius:    8px;
  --radius-sm: 6px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  --sidebar-w: 240px;
  --topbar-h:  52px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* --- Reset -------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: var(--font); font-size: 13px; color: var(--gray-800); background: var(--surface); -webkit-font-smoothing: antialiased; line-height: 1.5; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { color: var(--brand-700); }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
#app { min-height: 100%; }
.lucide { width: 16px; height: 16px; stroke-width: 1.8; flex-shrink: 0; }

/* ============================================================
   LOGIN
   ============================================================ */
.vc-login-wrap {
  min-height: 100vh;
  display: flex;
  background: var(--gray-950);
}
.vc-login-left {
  flex: 1.1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 64px;
  color: var(--white);
  background: linear-gradient(165deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  position: relative;
  overflow: hidden;
}
.vc-login-left::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(37,99,235,.15) 0%, transparent 70%);
  pointer-events: none;
}
.vc-login-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 48px; }
.vc-login-logo-icon { width: 36px; height: 36px; background: var(--brand-600); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: white; }
.vc-login-logo-icon .lucide { width: 20px; height: 20px; }
.vc-login-logo-name { font-size: 20px; font-weight: 700; letter-spacing: -0.3px; }
.vc-login-tagline { font-size: 32px; font-weight: 700; line-height: 1.2; letter-spacing: -0.5px; margin-bottom: 16px; }
.vc-login-tagline span { color: var(--brand-500); }
.vc-login-sub { font-size: 14px; color: #94a3b8; line-height: 1.6; max-width: 400px; margin-bottom: 40px; }
.vc-login-stats { display: flex; gap: 32px; }
.vc-login-stat-val { font-size: 24px; font-weight: 700; color: white; }
.vc-login-stat-label { font-size: 12px; color: #64748b; margin-top: 2px; }

.vc-login-right {
  flex: 0.9;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: var(--surface);
}
.vc-login-card {
  width: 100%;
  max-width: 380px;
  background: white;
  border-radius: var(--radius-xl);
  padding: 36px;
  box-shadow: var(--shadow-lg);
}
.vc-login-card h2 { font-size: 20px; font-weight: 700; margin-bottom: 4px; color: var(--gray-900); }
.vc-login-card > p { font-size: 13px; color: var(--gray-500); margin-bottom: 24px; }

.vc-login-role-group { display: flex; gap: 8px; margin-bottom: 20px; }
.vc-login-role-opt {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-600);
  transition: all .15s;
}
.vc-login-role-opt:hover { border-color: var(--brand-500); background: var(--brand-50); }
.vc-login-role-opt.selected { border-color: var(--brand-600); background: var(--brand-50); color: var(--brand-700); }
.vc-login-role-opt .lucide { width: 20px; height: 20px; }

/* ============================================================
   SHELL
   ============================================================ */
.vc-shell { display: flex; flex-direction: column; min-height: 100vh; }
.vc-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  z-index: 100;
  gap: 16px;
}
.vc-topbar-brand { display: flex; align-items: center; gap: 8px; width: calc(var(--sidebar-w) - 20px); flex-shrink: 0; border-right: 1px solid var(--border); margin-right: 0; padding-right: 16px; }
.vc-topbar-brand-icon { width: 28px; height: 28px; background: var(--brand-600); border-radius: 6px; display: flex; align-items: center; justify-content: center; color: white; }
.vc-topbar-brand-icon .lucide { width: 15px; height: 15px; }
.vc-topbar-brand-name { font-size: 14px; font-weight: 700; color: var(--gray-900); letter-spacing: -0.3px; }
.vc-topbar-center { flex: 1; display: flex; align-items: center; }
.vc-site-selector {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-600);
  cursor: pointer;
  transition: background .15s;
}
.vc-site-selector:hover { background: var(--gray-100); }
.vc-site-selector .lucide { width: 14px; height: 14px; color: var(--gray-400); }
.vc-site-selector--static {
  cursor: default;
  pointer-events: none;
}
.vc-site-selector--static:hover { background: transparent !important; }
.vc-topbar-right { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.vc-topbar-right #btn-end-support { margin-right: 6px; }
.vc-topbar-right .vc-persona-label { font-size: 11px; font-weight: 500; color: var(--gray-400); padding: 3px 8px; background: var(--gray-100); border-radius: var(--radius-full); margin-right: 6px; }

.vc-btn-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--gray-500);
  cursor: pointer;
  transition: all .15s;
}
.vc-btn-icon:hover { background: var(--gray-100); color: var(--gray-700); }

.vc-shell { --vertical-tab-h: 0px; }
.vc-shell.vc-multi-vertical { --vertical-tab-h: 34px; }

.vc-vertical-tabstrip {
  display: none;
}
.vc-shell.vc-multi-vertical .vc-vertical-tabstrip {
  display: flex;
  align-items: stretch;
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  right: 0;
  height: var(--vertical-tab-h);
  z-index: 99;
  padding: 0 10px;
  gap: 2px;
  background: var(--gray-900);
  border-bottom: 1px solid var(--gray-800);
}
.vc-vertical-tab {
  padding: 0 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.02em;
  border: none;
  background: transparent;
  color: var(--gray-400);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-family: inherit;
}
.vc-vertical-tab:hover { color: var(--gray-200); background: rgba(255, 255, 255, 0.05); }
.vc-vertical-tab.is-active {
  color: var(--white);
  border-bottom-color: var(--brand-500);
}

.vc-vertical-stub {
  margin-top: 8px;
  padding: 48px 32px;
  text-align: center;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  max-width: 520px;
}
.vc-vertical-stub .lucide { width: 40px; height: 40px; color: var(--gray-300); margin: 0 auto 16px; }
.vc-vertical-stub-title { font-size: 16px; font-weight: 600; color: var(--gray-900); margin-bottom: 8px; }
.vc-vertical-stub-text { font-size: 13px; color: var(--gray-500); line-height: 1.55; margin: 0; }

.vc-preview-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--gray-950);
}
.vc-preview-iframe {
  display: block;
  width: 100%;
  height: min(72vh, 820px);
  min-height: 480px;
  border: 0;
}

.vc-avatar {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-full);
  background: var(--brand-600);
  color: white;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-left: 6px;
}

.vc-body { display: flex; margin-top: calc(var(--topbar-h) + var(--vertical-tab-h)); min-height: calc(100vh - var(--topbar-h) - var(--vertical-tab-h)); }

/* Sidebar */
.vc-sidebar {
  position: fixed;
  top: calc(var(--topbar-h) + var(--vertical-tab-h));
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  padding: 12px 10px;
  overflow-y: auto;
  z-index: 90;
}
.vc-nav-section { margin-bottom: 6px; }
.vc-nav-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--gray-400);
  padding: 10px 12px 6px;
}
.vc-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--gray-600);
  font-size: 13px;
  font-weight: 450;
  text-decoration: none;
  transition: all .12s;
  margin-bottom: 1px;
}
.vc-nav-link:hover { background: var(--sidebar-hover); color: var(--gray-800); }
.vc-nav-link.active { background: var(--sidebar-active-bg); color: var(--sidebar-active-text); font-weight: 600; }
.vc-nav-link .lucide { width: 16px; height: 16px; color: var(--gray-400); }
.vc-nav-link:hover .lucide { color: var(--gray-600); }
.vc-nav-link.active .lucide { color: var(--brand-600); }
.vc-nav-badge { margin-left: auto; font-size: 10px; font-weight: 600; background: var(--red-600); color: white; border-radius: var(--radius-full); padding: 1px 6px; min-width: 18px; text-align: center; }
.vc-sidebar-divider { height: 1px; background: var(--border-lt); margin: 8px 12px; }

/* Main */
.vc-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 24px 28px;
  max-width: calc(100vw - var(--sidebar-w));
}

/* Вертикали AMC внутри main: скрываем сайдбар VisionCore, контент — на всю ширину */
.vc-body--amc-embed .vc-sidebar { display: none; }
.vc-body--amc-embed .vc-main {
  margin-left: 0;
  max-width: none;
  padding: 0;
  min-width: 0;
}

/* ============================================================
   COMPONENTS
   ============================================================ */

/* Page Header */
.vc-page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; gap: 16px; }
.vc-page-title { font-size: 18px; font-weight: 700; color: var(--gray-900); letter-spacing: -0.3px; }
.vc-page-sub { font-size: 12px; color: var(--gray-500); margin-top: 2px; }
.vc-page-actions { display: flex; gap: 8px; align-items: center; }

/* Buttons */
.vc-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all .15s;
  white-space: nowrap;
}
.vc-btn .lucide { width: 14px; height: 14px; }
.vc-btn-primary { background: var(--brand-600); color: white; }
.vc-btn-primary:hover { background: var(--brand-700); }
.vc-btn-secondary { background: white; color: var(--gray-700); border: 1px solid var(--border); }
.vc-btn-secondary:hover { background: var(--gray-50); border-color: var(--gray-300); }
.vc-btn-ghost { background: none; color: var(--gray-600); }
.vc-btn-ghost:hover { background: var(--gray-100); }
.vc-btn-danger { background: var(--red-600); color: white; }
.vc-btn-danger:hover { background: var(--red-700); }
.vc-btn-sm { padding: 5px 10px; font-size: 11px; }
.vc-btn-sm .lucide { width: 13px; height: 13px; }

/* Cards */
.vc-card { background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); }
.vc-card-pad { padding: 16px; }
.vc-card-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border-lt); }
.vc-card-title { font-size: 13px; font-weight: 600; color: var(--gray-800); }
.vc-card-body { padding: 16px; }

/* Labels */
.vc-section-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--gray-500); margin-bottom: 10px; }
.vc-label { display: block; font-size: 12px; font-weight: 500; color: var(--gray-600); margin-bottom: 4px; }

/* Forms */
.vc-field { margin-bottom: 12px; }
.vc-input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--gray-800);
  background: var(--white);
  transition: border-color .15s;
  outline: none;
}
.vc-input:focus { border-color: var(--brand-500); box-shadow: 0 0 0 2px rgba(37,99,235,.1); }
select.vc-input { appearance: auto; }

/* Badges */
.vc-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}
.vc-dot { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }
.vc-badge-critical { background: var(--red-50); color: var(--red-700); }
.vc-badge-critical .vc-dot { background: var(--red-600); }
.vc-badge-high { background: #fff7ed; color: #c2410c; }
.vc-badge-high .vc-dot { background: #ea580c; }
.vc-badge-medium { background: var(--amber-50); color: var(--amber-700); }
.vc-badge-medium .vc-dot { background: var(--amber-600); }
.vc-badge-low { background: var(--gray-100); color: var(--gray-600); }
.vc-badge-low .vc-dot { background: var(--gray-400); }
.vc-badge-new { background: var(--brand-50); color: var(--brand-700); }
.vc-badge-new .vc-dot { background: var(--brand-600); }
.vc-badge-in_progress { background: var(--amber-50); color: var(--amber-700); }
.vc-badge-in_progress .vc-dot { background: var(--amber-600); }
.vc-badge-closed { background: var(--gray-100); color: var(--gray-600); }
.vc-badge-closed .vc-dot { background: var(--gray-400); }
.vc-badge-false_positive { background: var(--gray-100); color: var(--gray-500); }
.vc-badge-false_positive .vc-dot { background: var(--gray-400); }
.vc-badge-active, .vc-badge-online { background: var(--green-50); color: var(--green-700); }
.vc-badge-active .vc-dot, .vc-badge-online .vc-dot { background: var(--green-600); }
.vc-badge-warning { background: var(--amber-50); color: var(--amber-700); }
.vc-badge-warning .vc-dot { background: var(--amber-600); }
.vc-badge-offline { background: var(--red-50); color: var(--red-700); }
.vc-badge-offline .vc-dot { background: var(--red-600); }
.vc-badge-published { background: var(--green-50); color: var(--green-700); }
.vc-badge-published .vc-dot { background: var(--green-600); }
.vc-badge-draft { background: var(--amber-50); color: var(--amber-700); }
.vc-badge-draft .vc-dot { background: var(--amber-600); }
.vc-badge-archived { background: var(--gray-100); color: var(--gray-500); }
.vc-badge-archived .vc-dot { background: var(--gray-400); }
.vc-badge-pending { background: var(--amber-50); color: var(--amber-700); }
.vc-badge-pending .vc-dot { background: var(--amber-600); }
.vc-badge-approved { background: var(--green-50); color: var(--green-700); }
.vc-badge-approved .vc-dot { background: var(--green-600); }
.vc-badge-rejected { background: var(--red-50); color: var(--red-700); }
.vc-badge-rejected .vc-dot { background: var(--red-600); }

/* Tables */
.vc-table-wrap { overflow-x: auto; background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.vc-table { width: 100%; border-collapse: collapse; }
.vc-table th { padding: 9px 14px; font-size: 11px; font-weight: 600; color: var(--gray-500); text-align: left; background: var(--gray-50); border-bottom: 1px solid var(--border); text-transform: uppercase; letter-spacing: .03em; }
.vc-table td { padding: 10px 14px; border-bottom: 1px solid var(--border-lt); font-size: 13px; }
.vc-table tr:last-child td { border-bottom: none; }
.vc-table tr:hover td { background: var(--gray-50); }
.vc-event-row { cursor: pointer; }
.vc-table-link { font-size: 12px; font-weight: 500; color: var(--brand-600); }

/* Alerts */
.vc-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 12px;
  line-height: 1.5;
}
.vc-alert .lucide { width: 15px; height: 15px; flex-shrink: 0; margin-top: 1px; }
.vc-alert-critical { background: var(--red-50); color: var(--red-700); border: 1px solid var(--red-100); }
.vc-alert-warning { background: var(--amber-50); color: var(--amber-700); border: 1px solid var(--amber-100); }
.vc-alert-info { background: var(--brand-50); color: var(--brand-700); border: 1px solid var(--brand-100); }

/* KPI Grid */
.vc-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 12px; margin-bottom: 20px; }
.vc-kpi {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
}
.vc-kpi-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.vc-kpi-label { font-size: 11px; font-weight: 500; color: var(--gray-500); }
.vc-kpi-icon-wrap { width: 28px; height: 28px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; }
.vc-kpi-icon-wrap.red { background: var(--red-50); color: var(--red-600); }
.vc-kpi-icon-wrap.green { background: var(--green-50); color: var(--green-600); }
.vc-kpi-icon-wrap.amber { background: var(--amber-50); color: var(--amber-600); }
.vc-kpi-icon-wrap.blue { background: var(--brand-50); color: var(--brand-600); }
.vc-kpi-icon-wrap .lucide { width: 14px; height: 14px; }
.vc-kpi-val { font-size: 22px; font-weight: 700; color: var(--gray-900); letter-spacing: -0.5px; }
.vc-kpi-val small { font-size: 13px; font-weight: 500; color: var(--gray-500); }
.vc-kpi-sub { font-size: 11px; color: var(--gray-400); margin-top: 2px; }
.vc-kpi-trend { font-size: 11px; font-weight: 500; margin-top: 4px; }
.vc-kpi-trend.up { color: var(--red-600); }
.vc-kpi-trend.down { color: var(--green-600); }

/* Filters */
.vc-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; align-items: center; }
.vc-search-wrap { position: relative; }
.vc-search-wrap .lucide { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--gray-400); pointer-events: none; }
.vc-search-input { padding: 7px 10px 7px 30px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 12px; width: 200px; outline: none; }
.vc-search-input:focus { border-color: var(--brand-500); }
.vc-filter-select { padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 12px; background: white; cursor: pointer; outline: none; }

/* Grids */
.vc-grid-2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; }
.vc-grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.vc-col-stack { display: flex; flex-direction: column; gap: 14px; }
.vc-flex-between { display: flex; align-items: center; justify-content: space-between; }
.vc-flex-center { display: flex; align-items: center; }

/* Misc */
.vc-back { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--gray-500); cursor: pointer; margin-bottom: 14px; padding: 4px 0; }
.vc-back:hover { color: var(--brand-600); }
.vc-back .lucide { width: 14px; height: 14px; }
.vc-divider { height: 1px; background: var(--border); margin: 14px 0; }
.vc-empty { display: flex; flex-direction: column; align-items: center; padding: 40px 20px; color: var(--gray-400); text-align: center; }
.vc-empty .lucide { width: 32px; height: 32px; margin-bottom: 10px; }
.vc-empty-title { font-size: 14px; font-weight: 600; color: var(--gray-600); margin-bottom: 4px; }
.vc-empty-sub { font-size: 12px; color: var(--gray-500); margin-top: 4px; max-width: 320px; line-height: 1.5; }
.vc-empty-action { margin-top: 12px; }
.vc-settings-divider { height: 1px; background: var(--border); margin: 14px 0; }
.vc-tag { display: inline-block; padding: 2px 7px; border-radius: var(--radius-sm); background: var(--gray-100); font-size: 11px; color: var(--gray-600); font-weight: 450; }
.vc-det-chip { display: inline-block; padding: 2px 7px; border-radius: var(--radius-sm); background: rgba(37,99,235,.06); color: var(--brand-700); font-size: 10px; font-weight: 500; }
.vc-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================================================
   CAMERA PREVIEW
   ============================================================ */
.vc-cam-preview {
  position: relative;
  background: var(--gray-900);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16/9;
}
.vc-cam-feed-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.vc-video-toggle {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 9;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  padding: 4px 8px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: var(--radius-full);
  background: rgba(7,8,13,.72);
  color: rgba(255,255,255,.9);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(8px);
}
.vc-video-toggle:hover { background: rgba(104,105,245,.82); border-color: rgba(255,255,255,.24); }
.vc-video-toggle .lucide { width: 12px; height: 12px; }
.vc-cam-feed-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: rgba(255,255,255,.45);
  font-size: 12px;
  text-align: center;
  padding: 16px;
  z-index: 0;
}
.vc-cam-feed-placeholder svg { width: 28px; height: 28px; opacity: .6; }
.vc-edge-panel { padding: 8px 14px !important; }
.vc-edge-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border-lt); }
.vc-edge-row:last-child { border-bottom: none; }
.vc-table-link-btn { background: none; border: none; padding: 0; font: inherit; cursor: pointer; color: var(--brand-600); }
.vc-table-link-btn:hover { text-decoration: underline; }
.vc-preview-badge-demo { background: rgba(16,185,129,.2); color: #6ee7b7; }
.vc-preview-badge-muted { background: rgba(255,255,255,.08); color: rgba(255,255,255,.5); }
.vc-cam-feed-bg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
}
.vc-cam-feed-bg svg { width: 100%; height: 100%; }
.vc-cam-status-dot {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  z-index: 5;
}
.vc-cam-status-dot.online { background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,.5); }
.vc-cam-status-dot.warning { background: #f59e0b; box-shadow: 0 0 6px rgba(245,158,11,.5); }
.vc-cam-status-dot.offline { background: #ef4444; box-shadow: 0 0 6px rgba(239,68,68,.5); }
.vc-cam-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 8px 10px;
  z-index: 4;
}
.vc-cam-timestamp { font-family: var(--font-mono); font-size: 10px; color: rgba(255,255,255,.7); }
.vc-cam-label { font-size: 10px; color: rgba(255,255,255,.8); font-weight: 500; background: rgba(0,0,0,.4); padding: 2px 6px; border-radius: 3px; }

.vc-snapshot-corner { position: absolute; width: 14px; height: 14px; border-color: rgba(255,255,255,.4); border-style: solid; z-index: 6; }
.vc-corner-tl { top: 6px; left: 6px; border-width: 2px 0 0 2px; }
.vc-corner-tr { top: 6px; right: 6px; border-width: 2px 2px 0 0; }
.vc-corner-bl { bottom: 6px; left: 6px; border-width: 0 0 2px 2px; }
.vc-corner-br { bottom: 6px; right: 6px; border-width: 0 2px 2px 0; }

/* ============================================================
   CAMERA CARDS GRID
   ============================================================ */
.vc-cam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.vc-cam-card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all .15s;
}
.vc-cam-card:hover { border-color: var(--brand-500); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.vc-cam-card .vc-cam-preview { border-radius: 0; }
.vc-cam-info { padding: 10px 14px 12px; }
.vc-cam-name { font-size: 13px; font-weight: 600; color: var(--gray-900); margin-bottom: 2px; }
.vc-cam-meta { font-size: 11px; color: var(--gray-500); margin-bottom: 6px; }
.vc-cam-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.vc-cam-zones-count { font-size: 11px; font-weight: 500; color: var(--gray-500); display: flex; align-items: center; gap: 4px; }
.vc-cam-zones-count .lucide { width: 12px; height: 12px; }

.vc-preview-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.55);
  color: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.vc-snapshot-note {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.75);
  background: rgba(0, 0, 0, 0.65);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  text-align: center;
  max-width: 90%;
  pointer-events: none;
}

/* Zone canvas overlay (стиль донора Camera) */
.vc-zone-canvas-wrap {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}
.vc-zone-canvas-wrap.is-editable {
  pointer-events: auto;
  cursor: crosshair;
}
.vc-zone-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Zone overlay boxes (legacy rect) */
.vc-det-box {
  position: absolute;
  border: 1.5px solid;
  border-radius: 2px;
  z-index: 7;
  pointer-events: none;
}
.vc-det-box-label {
  position: absolute;
  top: -1px;
  left: -1px;
  font-size: 9px;
  font-weight: 500;
  padding: 1px 5px;
  border-radius: 0 0 3px 0;
  white-space: nowrap;
}

/* ============================================================
   LAYOUT HELPERS
   ============================================================ */
.vc-layout-main-side { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; align-items: start; }
.vc-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.vc-detail-field label { font-size: 11px; color: var(--gray-400); font-weight: 500; margin-bottom: 2px; display: block; }
.vc-detail-field p { font-size: 13px; color: var(--gray-800); font-weight: 500; }
.vc-info-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 12px 0; }
.vc-info-item label { font-size: 11px; color: var(--gray-400); display: block; margin-bottom: 2px; }
.vc-info-item p { font-size: 13px; font-weight: 500; color: var(--gray-800); }

/* Timeline */
.vc-timeline { list-style: none; padding-left: 16px; border-left: 2px solid var(--border); }
.vc-timeline-item { position: relative; padding: 0 0 14px 14px; }
.vc-timeline-dot { position: absolute; left: -21px; top: 2px; width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--border); background: white; }
.vc-timeline-dot.red { border-color: var(--red-600); background: var(--red-100); }
.vc-timeline-dot.orange { border-color: var(--amber-600); background: var(--amber-100); }
.vc-timeline-dot.green { border-color: var(--green-600); background: var(--green-100); }
.vc-timeline-time { font-size: 11px; color: var(--gray-400); font-family: var(--font-mono); }
.vc-timeline-text { font-size: 12px; color: var(--gray-700); margin-top: 1px; }

/* Confidence */

/* ============================================================
   CAMERA DETAIL PAGE
   ============================================================ */
.vc-camera-detail-preview {
  position: relative;
  background: var(--gray-900);
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16/9;
  min-height: 280px;
}
.vc-camera-detail-preview .vc-cam-feed-bg { position: absolute; inset: 0; }
.vc-camera-zones-panel { background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.vc-zone-list-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-lt);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  transition: background .1s;
}
.vc-zone-list-item:last-child { border-bottom: none; }
.vc-zone-list-item:hover { background: var(--gray-50); }
.vc-zone-color-dot { width: 10px; height: 10px; border-radius: 3px; margin-top: 3px; flex-shrink: 0; }
.vc-zone-list-info { flex: 1; min-width: 0; }
.vc-zone-list-name { font-size: 13px; font-weight: 600; color: var(--gray-800); }
.vc-zone-list-rule { font-size: 11px; color: var(--gray-500); margin-top: 1px; }
.vc-zone-list-meta { font-size: 10px; color: var(--gray-400); margin-top: 3px; display: flex; gap: 8px; }

/* ============================================================
   ZONE EDITOR (fullscreen modal)
   ============================================================ */
.vc-zone-editor-full { display: flex; height: 100%; min-height: 0; }
.vc-zone-editor-canvas { flex: 1; min-width: 0; background: var(--gray-900); display: flex; flex-direction: column; overflow: hidden; position: relative; }
.vc-zone-editor-canvas .vc-cam-preview { width: 100%; border-radius: 0; aspect-ratio: 16/9; flex-shrink: 0; position: relative; }
.vc-zone-editor-canvas-spacer { flex: 1; background: #0a0a12; }
.vc-zone-editor-panel { width: 340px; min-width: 340px; background: var(--white); overflow-y: auto; padding: 20px; border-left: 1px solid var(--border); flex-shrink: 0; }
@media (max-width: 900px) {
  .vc-zone-editor-full { flex-direction: column; overflow-y: auto; max-height: 92vh; }
  .vc-zone-editor-canvas { flex: none; }
  .vc-zone-editor-canvas .vc-cam-preview { width: 100% !important; min-height: 220px !important; aspect-ratio: 16/9 !important; flex-shrink: 0 !important; }
  .vc-zone-editor-canvas-spacer { display: none; }
  .vc-zone-editor-panel { width: 100%; min-width: 0; flex: none; border-left: none; border-top: 1px solid var(--border); padding: 16px; }
  .vc-zone-toolbar { position: sticky; bottom: 0; z-index: 10; }
}
@media (max-width: 600px) {
  .vc-zone-editor-panel .vc-btn { width: 100%; justify-content: center; }
  .vc-zone-editor-panel .vc-field { margin-bottom: 12px; }
  .vc-modal.vc-modal-fullscreen { width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; }
}

.vc-zone-drawn-rect {
  position: absolute;
  border: 2px solid;
  border-radius: 2px;
  z-index: 8;
  pointer-events: auto;
  cursor: pointer;
}
.vc-zone-drawn-label {
  position: absolute;
  bottom: -1px;
  left: -1px;
  font-size: 9px;
  font-weight: 500;
  padding: 1px 5px;
  border-radius: 3px 0 0 0;
  color: white;
  white-space: nowrap;
}
.vc-zone-proposed-rect {
  position: absolute;
  border: 2px dashed #f59e0b;
  background: rgba(245,158,11,.1);
  border-radius: 2px;
  z-index: 9;
}
.vc-zone-proposed-rect-label {
  position: absolute;
  top: -18px;
  left: 0;
  font-size: 10px;
  font-weight: 500;
  color: #f59e0b;
  background: rgba(0,0,0,.7);
  padding: 1px 6px;
  border-radius: 3px;
}
.vc-zone-propose-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: rgba(255,255,255,.5);
  z-index: 10;
  pointer-events: none;
}
.vc-zone-toolbar {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  background: rgba(0,0,0,.3);
  backdrop-filter: blur(4px);
}
.vc-zone-tool {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.7);
  cursor: pointer;
}
.vc-zone-tool.active { background: var(--brand-600); color: white; }
.vc-zone-add-form { margin-top: 4px; }

/* ============================================================
   PROPOSAL CARDS
   ============================================================ */
.vc-proposal-card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 12px;
}
.vc-proposal-card-preview {
  position: relative;
  height: 140px;
  background: var(--gray-900);
  overflow: hidden;
}
.vc-proposal-card-preview .vc-cam-feed-bg { position: absolute; inset: 0; }
.vc-proposal-zone-overlay {
  position: absolute;
  border: 2px dashed;
  border-radius: 2px;
  z-index: 5;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
}
.vc-proposal-zone-label {
  font-size: 9px;
  font-weight: 500;
  padding: 1px 5px;
  background: rgba(0,0,0,.6);
  color: white;
  border-radius: 2px;
  margin: 2px;
}
.vc-proposal-card-body { padding: 14px 16px; }
.vc-proposal-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.vc-proposal-card-title { font-size: 14px; font-weight: 600; color: var(--gray-900); }
.vc-proposal-card-desc { font-size: 12px; color: var(--gray-600); line-height: 1.5; margin-bottom: 10px; }
.vc-proposal-card-meta { font-size: 11px; color: var(--gray-400); display: flex; gap: 12px; align-items: center; }
.vc-proposal-card-actions { display: flex; gap: 6px; margin-top: 12px; }

/* ============================================================
   SITE CARDS
   ============================================================ */
.vc-site-card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
}
.vc-site-card-header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.vc-site-card-icon { width: 36px; height: 36px; background: var(--gray-100); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; color: var(--gray-600); flex-shrink: 0; }
.vc-site-card-icon .lucide { width: 18px; height: 18px; }
.vc-site-card-name { font-size: 14px; font-weight: 600; color: var(--gray-900); }
.vc-site-card-sub { font-size: 11px; color: var(--gray-500); margin-top: 1px; }
.vc-site-card-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px 0; border-top: 1px solid var(--border-lt); border-bottom: 1px solid var(--border-lt); margin-bottom: 12px; }
.vc-site-stat-val { font-size: 18px; font-weight: 700; color: var(--gray-900); text-align: center; }
.vc-site-stat-label { font-size: 10px; color: var(--gray-500); text-align: center; margin-top: 1px; }
.vc-site-card-footer { display: flex; align-items: center; justify-content: space-between; }
.vc-text-danger { color: var(--red-600) !important; }

/* ============================================================
   MODALS
   ============================================================ */
.vc-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.vc-modal {
  background: var(--white);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.vc-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.vc-modal-header h3 { font-size: 15px; font-weight: 600; color: var(--gray-900); }
.vc-modal-close { border: none; background: none; cursor: pointer; color: var(--gray-400); padding: 4px; border-radius: var(--radius-sm); }
.vc-modal-close:hover { color: var(--gray-700); background: var(--gray-100); }
.vc-modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.vc-modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); flex-shrink: 0; }

.vc-modal.vc-modal-lg { max-width: 560px; width: 96vw; }
.vc-modal.vc-modal-fullscreen { max-width: 96vw; max-height: 92vh; width: 96vw; height: 92vh; }
.vc-modal.vc-modal-fullscreen .vc-modal-body { padding: 0; overflow: hidden; flex: 1; min-height: 0; }
.vc-snapshot-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vc-cam-feed-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; gap: 8px; color: var(--gray-500); font-size: 12px; }

/* ============================================================
   TOGGLE
   ============================================================ */
.vc-toggle-wrap { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border-lt); }
.vc-toggle-label { font-size: 13px; color: var(--gray-700); }
.vc-toggle {
  width: 36px;
  height: 20px;
  border-radius: 10px;
  border: none;
  background: var(--gray-300);
  position: relative;
  cursor: pointer;
  transition: background .2s;
}
.vc-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
  transition: transform .2s;
}
.vc-toggle.on { background: var(--brand-600); }
.vc-toggle.on::after { transform: translateX(16px); }

/* ============================================================
   ZONES PAGE (Camera-first grid)
   ============================================================ */
.vc-zones-camera-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.vc-zones-cam-card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all .15s;
}
.vc-zones-cam-card:hover { border-color: var(--brand-500); box-shadow: var(--shadow-md); }
.vc-zones-cam-card .vc-cam-preview { border-radius: 0; height: 140px; aspect-ratio: auto; }
.vc-zones-cam-card-body { padding: 10px 14px 12px; }
.vc-zones-cam-card-name { font-size: 13px; font-weight: 600; color: var(--gray-900); margin-bottom: 2px; }
.vc-zones-cam-card-meta { font-size: 11px; color: var(--gray-500); }
.vc-zones-cam-card-zones { display: flex; align-items: center; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.vc-zone-mini-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 500;
  background: var(--gray-50);
  color: var(--gray-600);
  border: 1px solid var(--border-lt);
}
.vc-zone-mini-dot { width: 6px; height: 6px; border-radius: 2px; }

/* ============================================================
   USER AVATAR
   ============================================================ */
.vc-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}

/* Module Cards */
/* Module icon (shared) */
.vc-module-icon { width: 36px; height: 36px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.vc-module-icon.active-module { background: var(--brand-50); color: var(--brand-600); }
.vc-module-icon.inactive-module { background: var(--gray-100); color: var(--gray-400); }

/* Module cards grid */
.vc-mod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; margin-top: 8px; }

.vc-mod-card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow .15s;
}
.vc-mod-card:hover { box-shadow: var(--shadow-sm); }
.vc-mod-card.vc-mod-inactive { opacity: .75; }
.vc-mod-card.vc-mod-inactive:hover { opacity: 1; }

.vc-mod-card-head { display: flex; align-items: center; gap: 10px; }
.vc-mod-card-title { flex: 1; min-width: 0; }
.vc-mod-name { font-size: 14px; font-weight: 700; color: var(--gray-900); }
.vc-mod-cat { font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; color: var(--gray-400); }
.vc-mod-desc { font-size: 12px; color: var(--gray-600); line-height: 1.5; }

.vc-mod-status { font-size: 11px; font-weight: 600; white-space: nowrap; padding: 2px 8px; border-radius: 10px; }
.vc-mod-status.on { color: var(--green-700); background: var(--green-50); }
.vc-mod-status.off { color: var(--gray-500); background: var(--gray-100); }
.vc-mod-status.paid { color: var(--amber-700); background: var(--amber-50); }

.vc-mod-features { display: flex; flex-wrap: wrap; gap: 4px; }
.vc-mod-feature { font-size: 10px; font-weight: 500; padding: 2px 7px; background: var(--gray-50); border: 1px solid var(--border-lt); border-radius: 4px; color: var(--gray-600); }

.vc-mod-cta-small { font-size: 11px; color: var(--amber-700); display: flex; align-items: center; gap: 4px; padding: 6px 8px; background: var(--amber-50); border-radius: var(--radius-sm); }

/* Banner */
.vc-modules-banner {
  display: flex;
  gap: 16px;
  padding: 20px 24px;
  background: linear-gradient(135deg, var(--brand-50) 0%, #eff6ff 50%, var(--amber-50) 100%);
  border: 1px solid var(--brand-200);
  border-radius: var(--radius-lg);
  align-items: flex-start;
}
.vc-modules-banner-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--brand-600); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.vc-modules-banner-body { flex: 1; min-width: 0; }
.vc-modules-banner-title { font-size: 16px; font-weight: 700; color: var(--gray-900); margin-bottom: 4px; }
.vc-modules-banner-text { font-size: 13px; color: var(--gray-600); line-height: 1.6; }

/* Actions bar */
.vc-actions-bar { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--border-lt); }

/* Snapshot */
.vc-snapshot {
  position: relative;
  background: var(--gray-900);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16/10;
}
.vc-snapshot-overlay { position: absolute; inset: 0; padding: 8px 10px; display: flex; flex-direction: column; justify-content: space-between; z-index: 4; }
.vc-det-box.red { border-color: var(--red-600); }
.vc-det-box.red .vc-det-box-label { background: var(--red-600); color: white; }

/* Premium CTA */
.vc-premium-cta { background: var(--gray-50); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.vc-premium-cta h4 { font-size: 13px; font-weight: 600; color: var(--gray-800); margin-bottom: 6px; }
.vc-premium-cta p { font-size: 12px; color: var(--gray-500); line-height: 1.5; margin-bottom: 10px; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1200px) {
  .vc-layout-main-side { grid-template-columns: 1fr; }
  .vc-grid-2 { grid-template-columns: 1fr; }
}

/* ============================================================
   DARK THEME (F3.1)
   ============================================================ */
[data-theme="dark"] {
  color-scheme: dark;
  --surface: #07080d;
  --surface-card: #121521;
  --sidebar-bg: #0b0d14;
  --sidebar-text: #85889b;
  --sidebar-hover: #151827;
  --sidebar-active-bg: rgba(104, 105, 245, .18);
  --sidebar-active-text: #f4f4ff;
  --border: #242839;
  --border-lt: #1b1f2e;
  --gray-50: #151927;
  --gray-100: #1c2030;
  --gray-200: #282c3a;
  --gray-300: #363a4b;
  --gray-400: #7781a8;
  --gray-500: #9aa6d6;
  --gray-600: #bcc7f0;
  --gray-700: #dbe2ff;
  --gray-800: #ececff;
  --gray-900: #f7f7ff;
  --brand-50: rgba(104, 105, 245, .14);
  --brand-100: rgba(104, 105, 245, .22);
  --brand-200: rgba(133, 135, 255, .42);
  --brand-500: #6869f5;
  --brand-600: #8587ff;
  --brand-700: #b8b9ff;
  --red-50: rgba(239, 68, 68, .14);
  --red-100: rgba(239, 68, 68, .22);
  --red-600: #ff5b6e;
  --red-700: #ff9aa6;
  --green-50: rgba(34, 197, 94, .14);
  --green-100: rgba(34, 197, 94, .22);
  --green-600: #35d07f;
  --green-700: #86efac;
  --amber-50: rgba(245, 158, 11, .14);
  --amber-100: rgba(245, 158, 11, .22);
  --amber-600: #fbbf24;
  --amber-700: #fde68a;
  --shadow-xs: 0 1px 2px rgba(0,0,0,.32);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.38);
  --shadow-md: 0 6px 16px rgba(0,0,0,.42);
  --shadow-lg: 0 10px 24px -4px rgba(0,0,0,.45);
}
[data-theme="dark"] html,
[data-theme="dark"] body { color: var(--gray-700); background: var(--surface); }
[data-theme="dark"] .vc-topbar,
[data-theme="dark"] .vc-sidebar,
[data-theme="dark"] .vc-card,
[data-theme="dark"] .vc-modal,
[data-theme="dark"] .vc-login-card,
[data-theme="dark"] .vc-zone-editor-panel,
[data-theme="dark"] .vc-table-wrap,
[data-theme="dark"] .vc-kpi,
[data-theme="dark"] .vc-cam-card,
[data-theme="dark"] .vc-proposal-card,
[data-theme="dark"] .vc-mod-card,
[data-theme="dark"] .vc-site-card { background: var(--surface-card); }
[data-theme="dark"] .vc-topbar { border-bottom-color: var(--border); }
[data-theme="dark"] .vc-sidebar { border-right-color: var(--border); }
[data-theme="dark"] .vc-input,
[data-theme="dark"] .vc-search-input,
[data-theme="dark"] .vc-filter-select { background: var(--gray-50); border-color: var(--border); color: var(--gray-800); }
[data-theme="dark"] .vc-table th { background: var(--gray-50); }
[data-theme="dark"] .vc-table tr:hover td { background: var(--gray-50); }
[data-theme="dark"] .vc-login-right { background: var(--surface); }
[data-theme="dark"] .vc-login-card { background: var(--surface-card); }
[data-theme="dark"] .vc-premium-cta,
[data-theme="dark"] .vc-modules-banner { background: var(--gray-50); }
[data-theme="dark"] .vc-shell { background: var(--surface); }
[data-theme="dark"] .vc-topbar { background: #0b0d14; }
[data-theme="dark"] .vc-shell.vc-multi-vertical .vc-vertical-tabstrip {
  background: #07080d;
  border-bottom-color: #1b1f2e;
  box-shadow: 0 1px 0 rgba(255,255,255,.03);
}
[data-theme="dark"] .vc-vertical-tab { color: #8f9bd2; }
[data-theme="dark"] .vc-vertical-tab:hover {
  color: #dbe2ff;
  background: rgba(104, 105, 245, .12);
}
[data-theme="dark"] .vc-vertical-tab.is-active {
  color: #f7f8ff;
  background: rgba(104, 105, 245, .16);
  border-bottom-color: var(--brand-600);
}
[data-theme="dark"] .vc-topbar-brand-icon { background: linear-gradient(135deg, var(--brand-500), var(--brand-700)); }
[data-theme="dark"] .vc-btn-icon { background: #151927; border-color: #242839; color: var(--gray-700); }
[data-theme="dark"] .vc-btn-icon:hover,
[data-theme="dark"] .vc-theme-btn[data-theme-current="dark"] { background: var(--brand-50); border-color: var(--brand-500); color: var(--brand-700); }
[data-theme="dark"] .vc-site-selector,
[data-theme="dark"] .vc-persona-label { background: #151927; border-color: #242839; color: var(--gray-700); }
[data-theme="dark"] .vc-monitor-side,
[data-theme="dark"] .vc-monitor-cam,
[data-theme="dark"] .vc-notif-channel-card { background: var(--surface-card); border-color: var(--border); }
[data-theme="dark"] .vc-cam-card,
[data-theme="dark"] .vc-monitor-cam,
[data-theme="dark"] .vc-live-tile { box-shadow: 0 0 0 1px rgba(255,255,255,.02), 0 14px 30px rgba(0,0,0,.3); }
[data-theme="dark"] .vc-monitor-alarm { background: #171b2a; }
[data-theme="dark"] .vc-monitor-alarm:hover { background: rgba(104, 105, 245, .16); }

/* ============================================================
   INDUSTRIAL — visual completeness (F4)
   ============================================================ */
.vc-bbox-layer { position: absolute; inset: 0; z-index: 6; pointer-events: none; }
.vc-det-box { position: absolute; border: 2px solid; border-radius: 2px; box-sizing: border-box; }
.vc-det-box.red { border-color: var(--red-600); }
.vc-det-box.blue { border-color: var(--brand-500); }
.vc-det-box-label { position: absolute; top: -18px; left: -2px; font-size: 9px; font-weight: 600; padding: 1px 5px; border-radius: 2px; white-space: nowrap; background: var(--red-600); color: #fff; }
.vc-det-box.blue .vc-det-box-label { background: var(--brand-600); }

.vc-live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.vc-live-tile { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); cursor: pointer; background: var(--gray-900); }
.vc-live-tile-feed { position: relative; aspect-ratio: 16/9; }
.vc-live-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 700; color: #fff; background: var(--red-600); padding: 2px 8px; border-radius: var(--radius-full); }

.vc-monitor-page { display: flex; flex-direction: column; gap: 14px; min-height: calc(100vh - 120px); }
.vc-monitor-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.vc-monitor-stats { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.vc-monitor-stats span { display: inline-flex; align-items: center; min-height: 28px; padding: 5px 10px; border-radius: var(--radius-full); background: var(--surface-card); border: 1px solid var(--border); color: var(--gray-600); font-size: 12px; font-weight: 600; }
.vc-monitor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; align-items: stretch; flex: 1; min-height: 0; }
.vc-monitor-main { min-width: 0; }
.vc-monitor-camera-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 10px; }
.vc-monitor-cam { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface-card); cursor: pointer; box-shadow: var(--shadow-xs); transition: border-color .15s, transform .15s; }
.vc-monitor-cam:hover { border-color: var(--brand-500); transform: translateY(-1px); }
.vc-monitor-cam-feed { position: relative; aspect-ratio: 16/9; background: var(--gray-900); overflow: hidden; }
.vc-monitor-cam-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; font-size: 12px; font-weight: 600; }
.vc-monitor-side { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-card); overflow: hidden; display: flex; flex-direction: column; min-height: 320px; }
.vc-monitor-side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border-lt); font-weight: 700; }
.vc-monitor-alarm-list { display: flex; flex: 1; min-height: 0; max-height: calc(100vh - 240px); flex-direction: column; gap: 6px; padding: 10px; overflow: auto; }
.vc-monitor-alarm { display: flex; justify-content: space-between; gap: 10px; padding: 10px; border-radius: var(--radius-sm); background: var(--gray-50); border-left: 3px solid var(--red-600); cursor: pointer; }
.vc-monitor-alarm:hover { background: var(--brand-50); }
.vc-monitor-alarm-main { min-width: 0; }
.vc-monitor-alarm-title { font-size: 12px; font-weight: 700; color: var(--gray-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vc-monitor-alarm-meta { margin-top: 2px; font-size: 11px; color: var(--gray-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vc-monitor-alarm-side { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 10px; color: var(--gray-500); font-family: var(--font-mono); }

@media (max-width: 1100px) {
  .vc-monitor-layout { grid-template-columns: 1fr; }
  .vc-monitor-side { min-height: auto; }
}

@media (max-width: 720px) {
  .vc-monitor-head { align-items: flex-start; flex-direction: column; }
  .vc-monitor-stats { justify-content: flex-start; }
  .vc-monitor-camera-grid { grid-template-columns: 1fr; }
}

.vc-hse-strip { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 4px; }
.vc-hse-chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-card); font-size: 12px; font-weight: 500; color: var(--gray-700); text-decoration: none; transition: border-color .15s; }
.vc-hse-chip:hover { border-color: var(--brand-500); color: var(--brand-700); }

.vc-bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.vc-bar-label { width: 100px; font-size: 12px; color: var(--gray-600); flex-shrink: 0; }
.vc-bar-track { flex: 1; height: 8px; background: var(--gray-100); border-radius: 4px; overflow: hidden; }
.vc-bar-fill { height: 100%; background: var(--brand-500); border-radius: 4px; }
.vc-bar-fill-warn { background: var(--amber-600); }
.vc-bar-val { width: 28px; font-size: 12px; font-weight: 600; text-align: right; }

.vc-heatmap-wrap { overflow-x: auto; }
.vc-heatmap-row { display: flex; align-items: center; gap: 4px; margin-bottom: 4px; }
.vc-heatmap-head .vc-heatmap-hour { font-size: 10px; color: var(--gray-500); text-align: center; }
.vc-heatmap-label { width: 72px; font-size: 11px; font-weight: 500; flex-shrink: 0; }
.vc-heatmap-hour { width: 36px; flex-shrink: 0; }
.vc-heatmap-cell { width: 36px; height: 28px; border-radius: 4px; font-size: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.vc-heatmap-cell.cold { background: var(--gray-100); color: var(--gray-400); }
.vc-heatmap-cell.mid { background: #bfdbfe; color: var(--brand-700); }
.vc-heatmap-cell.warm { background: #fde68a; color: var(--amber-700); }
.vc-heatmap-cell.hot { background: #fecaca; color: var(--red-700); font-weight: 600; }

.vc-llm-card { background: linear-gradient(135deg, var(--brand-50) 0%, var(--surface-card) 100%); border: 1px solid var(--brand-200); border-radius: var(--radius); padding: 16px; }
.vc-llm-header { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--brand-700); margin-bottom: 10px; }
.vc-llm-text { font-size: 12px; line-height: 1.6; color: var(--gray-700); margin: 0; }
.vc-llm-section { margin-top: 12px; }
.vc-llm-reg { font-size: 11px; color: var(--gray-500); font-style: italic; margin: 0; }

.vc-clip-strip { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-lt); }
.vc-clip-label { font-size: 11px; font-weight: 600; color: var(--gray-600); display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.vc-clip-frames { display: flex; gap: 6px; overflow-x: auto; }
.vc-clip-frame { flex-shrink: 0; text-align: center; }
.vc-clip-frame-inner { width: 64px; height: 40px; background: var(--gray-100); border-radius: 4px; display: flex; align-items: center; justify-content: center; color: var(--gray-400); border: 2px solid transparent; }
.vc-clip-frame.active .vc-clip-frame-inner { border-color: var(--brand-500); }
.vc-clip-frame span { font-size: 9px; color: var(--gray-500); }

.vc-comments-list { display: flex; flex-direction: column; gap: 10px; }
.vc-comment { padding: 10px 12px; background: var(--gray-50); border-radius: var(--radius-sm); }
.vc-comment-head { display: flex; justify-content: space-between; font-size: 11px; margin-bottom: 4px; }
.vc-comment p { font-size: 12px; color: var(--gray-700); margin: 0; line-height: 1.5; }

.vc-ppe-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.vc-ppe-chip { display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px; border-radius: var(--radius-full); border: 1px solid var(--border); font-size: 11px; cursor: pointer; user-select: none; }
.vc-ppe-chip input { display: none; }
.vc-ppe-chip.on { background: var(--brand-50); border-color: var(--brand-500); color: var(--brand-700); }
.vc-ppe-chip.is-disabled { opacity: .85; cursor: default; }

.vc-notif-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-top: 16px; }
.vc-notif-channel-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; background: var(--surface-card); }
.vc-notif-channel-head { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 8px; }

.vc-table-sm th, .vc-table-sm td { padding: 8px 10px; font-size: 12px; }

[data-theme="dark"] .vc-llm-card { background: linear-gradient(135deg, rgba(37,99,235,.12) 0%, var(--surface-card) 100%); }
[data-theme="dark"] .vc-hse-chip { background: var(--surface-card); color: var(--gray-300); }
[data-theme="dark"] .vc-comment { background: var(--gray-50); }
