* { box-sizing: border-box; }
:root {
  --bg: #edf2f8;
  --bg-2: #e7eef7;
  --panel: #ffffff;
  --line: #dfe7f1;
  --ink: #19273a;
  --muted: #68778b;
  --brand: #1f6feb;
  --brand2: #0f4fbf;
  --brand-soft: #eaf2ff;
  --sidebar: #111a28;
  --sidebar-hover: #182335;
  --sidebar-active: #0d1725;
  --sidebar-text: #b8c6dc;
  --sidebar-title: #6f85a6;
  --success: #118a4e;
  --danger: #c74234;
  --warning: #c78309;
  --radius: 14px;
  --shadow: 0 10px 26px rgba(22, 37, 65, .08);
}
body {
  --brand: var(--theme-accent, #1f6feb);
  --brand2: var(--theme-accent, #0f4fbf);
  --sidebar: var(--theme-sidebar, #111a28);
  --panel: var(--theme-card, #ffffff);
  --bg: var(--theme-bg, #edf2f8);
  --bg-2: var(--theme-bg, #e7eef7);
  margin: 0;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(31,111,235,.10) 0, rgba(31,111,235,0) 42%),
    radial-gradient(circle at 86% 2%, rgba(17,26,40,.10) 0, rgba(17,26,40,0) 45%),
    linear-gradient(180deg, #f7fafe 0%, var(--bg) 140px, var(--bg-2) 100%);
}
a { color: var(--brand); text-decoration: none; }
.btn, input, select, textarea, table { font: inherit; }
.topbar {
  position: sticky; top: 0; z-index: 5;
  display:flex; justify-content:space-between; align-items:center; gap:12px;
  padding: 14px 18px;
  color:#fff;
  background: linear-gradient(180deg, var(--theme-topbar, #2b7dff), var(--brand2));
  border-bottom: 1px solid rgba(0,0,0,.10);
  box-shadow: 0 8px 20px rgba(16, 44, 93, .18);
}
.brand { display:flex; align-items:baseline; gap:10px; flex-wrap:wrap; }
.topbar-logo {
  max-height: 32px;
  max-width: 120px;
  width: auto;
  object-fit: contain;
  background: rgba(255,255,255,.94);
  border-radius: 8px;
  padding: 2px 6px;
}
.brand a { color:#fff; font-weight:800; font-size:18px; letter-spacing: .2px; }
.brand span { opacity:.85; font-size:12px; }
.top-actions { display:flex; align-items:center; gap:10px; }
.notifications-menu { position: relative; }
.notifications-menu summary { list-style: none; }
.notifications-menu summary::-webkit-details-marker { display: none; }
.notifications-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.24);
  background: rgba(255,255,255,.12);
  color: #fff;
  font-weight: 600;
}
.notifications-trigger:hover,
.notifications-menu[open] .notifications-trigger {
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.34);
}
.notifications-trigger-label {
  font-size: 13px;
  line-height: 1;
}
.notifications-trigger-count {
  min-width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  background: #fff;
  color: var(--theme-topbar, var(--brand));
  font-size: 12px;
  font-weight: 800;
}
.notifications-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: min(420px, calc(100vw - 24px));
  background: #fff;
  border: 1px solid #dbe6df;
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(15, 42, 36, .24);
  overflow: hidden;
  z-index: 40;
}
.notifications-dropdown-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #e6efec;
  background: linear-gradient(180deg, #f6fbfa, #edf7f4);
}
.notifications-dropdown-head strong {
  display: block;
  color: #173530;
}
.notifications-dropdown-head small {
  display: block;
  margin-top: 2px;
  color: #5c746f;
  font-size: 12px;
}
.notifications-dropdown-head a {
  font-size: 12px;
  font-weight: 700;
  color: #0f5f4c;
}
.notifications-dropdown-list {
  max-height: 340px;
  overflow: auto;
}
.notifications-dropdown-item {
  display: block;
  padding: 12px 14px;
  border-bottom: 1px solid #edf3f0;
  color: #173530;
  text-decoration: none;
  background: #fff;
}
.notifications-dropdown-item:last-child { border-bottom: 0; }
.notifications-dropdown-item:hover { background: #f7fbfa; }
.notifications-dropdown-item strong {
  display: block;
  font-size: 13px;
  margin-bottom: 3px;
}
.notifications-dropdown-item span {
  display: block;
  font-size: 12px;
  color: #58706b;
  line-height: 1.4;
}
.notifications-dropdown-type {
  font-size: 11px !important;
  color: #0f5f4c !important;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 4px;
}
.notifications-dropdown-item.is-empty {
  background: linear-gradient(180deg, #fbfefd, #f6fbfa);
}
.profile-menu { position: relative; }
.profile-menu summary { list-style: none; }
.profile-menu summary::-webkit-details-marker { display: none; }
.profile-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.profile-trigger:hover { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.2); }
.profile-avatar-top {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid #d1d5db;
  background: #fff;
  display: inline-grid;
  place-items: center;
  color: #334155;
  font-weight: 700;
  font-size: 14px;
}
.profile-avatar-top.placeholder { background: #eef2f7; }
.profile-caret { color: rgba(255,255,255,.88); font-size: 14px; line-height: 1; }
.profile-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 220px;
  background: #fff;
  border: 1px solid #dfe7f2;
  border-radius: 12px;
  box-shadow: 0 14px 28px rgba(15,23,42,.18);
  padding: 8px;
  z-index: 40;
}
.profile-dropdown-head {
  padding: 8px 10px 10px 10px;
  border-bottom: 1px solid #eef2f7;
  margin-bottom: 6px;
}
.profile-dropdown-head strong {
  display: block;
  color: #0f172a;
  font-size: 14px;
}
.profile-dropdown-head small {
  display: block;
  color: #64748b;
  font-size: 12px;
}
.profile-dropdown a {
  display: block;
  color: #1e293b;
  text-decoration: none;
  border-radius: 8px;
  padding: 8px 10px;
  font-weight: 600;
  font-size: 13px;
}
.profile-dropdown a:hover { background: #f1f5f9; color: #0f172a; }
.pill {
  background: linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,.10));
  border:1px solid rgba(255,255,255,.22);
  border-radius:999px;
  padding:6px 10px;
  font-size:12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
.btn { display:inline-block; padding:9px 12px; border-radius:10px; border:1px solid transparent; cursor:pointer; transition: all .15s ease; }
.btn.ghost { color:#fff; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.25); }
.btn.ghost:hover { background: rgba(255,255,255,.14); }
.btn.primary { color:#fff; background: linear-gradient(180deg, var(--theme-topbar, var(--brand)), var(--brand)); border-color: var(--brand); box-shadow: 0 1px 0 rgba(255,255,255,.18) inset; }
.btn.primary:hover { background: var(--brand); }
.btn.soft { background:#f4f4f4; border-color: #d2d6de; color: #444; }
.btn.soft:hover { background:#e7e7e7; }
.link-btn {
  border: 0;
  background: transparent;
  color: var(--brand);
  padding: 0;
  margin: 0;
  font: inherit;
  cursor: pointer;
}
.link-btn:hover { text-decoration: underline; }
.shell { display:grid; grid-template-columns: 230px 1fr; min-height: calc(100vh - 52px); }
.sidebar {
  background:
    linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,0) 70px),
    var(--sidebar);
  border-right:1px solid #172235;
  padding:14px;
  box-shadow: inset -1px 0 0 rgba(255,255,255,.02), 8px 0 20px rgba(8,12,18,.12);
}
.nav-group + .nav-group { margin-top: 16px; }
.nav-title { color: var(--theme-sidebar-title, var(--sidebar-title)); font-size:11px; text-transform:uppercase; letter-spacing:.08em; margin-bottom:7px; font-weight:700; opacity:.9; }
.nav-link {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  color: var(--theme-sidebar-text, var(--sidebar-text));
  padding:9px 11px;
  border-radius: 4px;
  margin-bottom:4px;
  border-left: 3px solid transparent;
}
.nav-main {
  display:flex;
  align-items:center;
  gap:9px;
  flex: 1 1 auto;
  min-width:0;
}
.nav-text {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: inline-grid;
  place-items: center;
}
.nav-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-caret {
  opacity: .65;
  font-size: 16px;
  line-height: 1;
  flex: 0 0 auto;
  margin-left: 6px;
}
.nav-link:hover { background: var(--sidebar-hover); color:#fff; }
.nav-link.active {
  background: linear-gradient(90deg, var(--theme-sidebar-active, var(--brand)), transparent);
  color:#fff;
  border-left-color: var(--theme-sidebar-active, var(--brand));
  font-weight:600;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}
.nav-link.active .nav-caret { opacity: .95; }
.shell > main { min-width: 0; display: flex; flex-direction: column; }
.content { padding:18px; }
.footer { border-top:1px solid #dbe3ed; background:rgba(255,255,255,.75); backdrop-filter: blur(6px); color:var(--muted); padding:10px 16px; font-size:12px; }
.card {
  background: var(--panel);
  border:1px solid #dfe7f2;
  border-radius: var(--radius);
  padding:14px;
  box-shadow: var(--shadow);
  transition: transform .14s ease, box-shadow .14s ease;
}
.card:hover { transform: translateY(-1px); box-shadow: 0 14px 26px rgba(22,37,65,.11); }
.page-head { display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; margin-bottom:14px; }
.page-head h1, .page-head h2 { margin:0; letter-spacing: .1px; }
.muted { color: var(--muted); }

/* Tema visual verde aplicado en todos los modulos del CRM */
.vision-ui .page-head h1,
.vision-ui .page-head h2 {
  color: var(--vision-header-bg, #0f5f4c);
  font-weight: 800;
}
.vision-ui .card {
  border-color: var(--vision-input-border, #b8d8cf);
  background: linear-gradient(180deg, #f5fbf9 0%, #eef7f4 100%);
  box-shadow: 0 8px 20px rgba(40, 94, 76, .10);
}
.vision-ui .card:hover {
  box-shadow: 0 12px 26px rgba(40, 94, 76, .14);
}
.vision-ui .table-wrap {
  border-color: var(--vision-input-border, #b8d8cf);
}
.vision-ui th {
  background: var(--vision-table-header-bg, #dcefe9);
  color: var(--vision-header-bg, #0f5f4c);
  border-bottom-color: var(--vision-input-border, #b8d8cf);
}
.vision-ui tbody tr:hover td {
  background: #edf8f4;
}
.vision-ui .field-wrap label {
  color: var(--vision-header-bg, #0f5f4c);
  font-weight: 700;
}
.vision-ui .field-wrap input,
.vision-ui .field-wrap select,
.vision-ui .field-wrap textarea {
  background: var(--vision-input-bg, #cbe9e2);
  border-color: var(--vision-input-border, #8fcfc2);
  color: #0c3d33;
}
.vision-ui .field-wrap input::placeholder,
.vision-ui .field-wrap textarea::placeholder {
  color: #3d7a69;
}
.vision-ui .field input:focus,
.vision-ui .field-wrap input:focus,
.vision-ui .field-wrap select:focus,
.vision-ui .field-wrap textarea:focus {
  border-color: var(--vision-input-border, #58ad96);
  box-shadow: 0 0 0 3px rgba(88,173,150,.2);
}
.vision-ui .btn.primary {
  background: var(--vision-primary-btn, #3e9474);
  border-color: var(--vision-primary-btn, #3e9474);
}
.vision-ui .btn.primary:hover {
  background: var(--vision-primary-btn, #357e64);
}
.vision-ui .btn.soft {
  background: #d9ece6;
  border-color: #9fcfc2;
  color: #0f5f4c;
}
.vision-ui .btn.soft:hover {
  background: #cae4dd;
}
.vision-ui .alert.error {
  border-color: #f0b7b7;
  background: #fff1f1;
}
.vision-ui .alert.success {
  border-color: #9fd7c7;
  background: #ecfaf5;
}
.grid.cards { display:grid; grid-template-columns: repeat(auto-fit,minmax(170px,1fr)); gap:12px; }
.grid.cards .card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff, #fbfcfe);
}
.grid.cards .card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--theme-topbar, var(--brand)), var(--brand));
}
.grid.cards .card::after {
  content: "";
  position: absolute;
  right: -10px;
  top: -10px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(60,141,188,.10), rgba(60,141,188,0));
}
.stat-label { color: #6d7c90; font-size:13px; margin-bottom:6px; font-weight: 600; }
.stat-value { font-weight:700; font-size:28px; color:#10293f; letter-spacing: .2px; }
.table-wrap { border:1px solid #dfe7f2; border-radius:12px; overflow:auto; background:#fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.8); -webkit-overflow-scrolling: touch; }
table { width:100%; border-collapse: collapse; min-width: 840px; }
th, td { border-bottom:1px solid #edf2f8; padding:10px 12px; text-align:left; vertical-align: top; }
tbody tr { transition: background-color .12s ease; }
tbody tr:hover td { background: #f8fbff; }
th {
  background: linear-gradient(180deg, #fbfcfe, #f3f6fa);
  color:#394a62;
  position: sticky;
  top: 0;
  white-space: nowrap;
  box-shadow: inset 0 -1px 0 #e6edf5;
}
.purchase-orders-wrap {
  overflow-x: hidden;
}
.purchase-orders-table {
  min-width: 0;
  table-layout: fixed;
}
.purchase-orders-table th,
.purchase-orders-table td {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  font-size: 13px;
  padding: 8px 10px;
}
.purchase-orders-table th {
  white-space: normal;
  line-height: 1.2;
}
.purchase-orders-table td:last-child,
.purchase-orders-table th:last-child {
  width: 74px;
}
.purchase-orders-table td:nth-child(1),
.purchase-orders-table th:nth-child(1),
.purchase-orders-table td:nth-child(2),
.purchase-orders-table th:nth-child(2),
.purchase-orders-table td:nth-child(6),
.purchase-orders-table th:nth-child(6),
.purchase-orders-table td:nth-child(7),
.purchase-orders-table th:nth-child(7),
.purchase-orders-table td:nth-child(11),
.purchase-orders-table th:nth-child(11),
.purchase-orders-table td:nth-child(12),
.purchase-orders-table th:nth-child(12) {
  text-align: center;
}
.chip { display:inline-block; padding:4px 8px; border-radius:999px; background:#ecf5fb; border:1px solid #cfe4f2; color:#245f82; font-size:12px; }
.toolbar {
  display:flex; gap:10px; align-items:center; flex-wrap:wrap;
  margin-bottom:12px;
  background: linear-gradient(180deg, #ffffff, #fbfcfe);
  border:1px solid #dfe7f2;
  border-radius:12px;
  padding:12px;
  box-shadow: var(--shadow);
}
.toolbar input, .toolbar select {
  border:1px solid #d7e0ec;
  border-radius:10px;
  padding:8px 10px;
  min-width: 220px;
  background:#fff;
  color:#333;
}
.toolbar input:focus, .toolbar select:focus,
.field input:focus, .field-wrap input:focus, .field-wrap select:focus, .field-wrap textarea:focus {
  outline: 2px solid rgba(31,111,235,.12);
  border-color: var(--brand);
}
.settings-panel {
  border-radius: 10px;
}
.settings-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px 14px;
}
.settings-grid .field-wrap label {
  font-size: 12px;
  color: #33465f;
}
.settings-grid .field-wrap input,
.settings-grid .field-wrap select,
.settings-grid .field-wrap textarea {
  border-radius: 4px;
  border-color: #d5deea;
  padding: 8px 9px;
}
.settings-grid .field-wrap textarea { min-height: 72px; }
.settings-checks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px 12px;
  padding: 8px 0;
}
.settings-checks label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #34475f;
}
.alert { border:1px solid; border-radius:3px; padding:10px 12px; margin-bottom:12px; }
.alert.success { background:#eafaf1; color:#1a6d3f; border-color:#b6e0c7; }
.alert.error { background:#fdf0ef; color:#9f2f23; border-color:#efc1ba; }
.pagination { display:flex; gap:8px; justify-content:flex-end; align-items:center; flex-wrap:wrap; margin-top:10px; }
.pagination a, .pagination span { border:1px solid #d2d6de; background:#fff; padding:7px 10px; border-radius:3px; }
.pagination .current { background:#f4f4f4; border-color:#d2d6de; color:#444; font-weight:600; }
.login-wrap {
  min-height:100vh;
  display:grid;
  place-items:center;
  padding:20px;
  background:
    linear-gradient(rgba(4, 20, 48, .25), rgba(4, 20, 48, .25)),
    var(--login-bg-image, none),
    radial-gradient(circle at 10% 92%, rgba(59, 194, 255, .45) 0, rgba(59,194,255,0) 28%),
    linear-gradient(90deg, var(--login-bg-color, #0056a8) 0%, var(--login-bg-color, #0056a8) 100%);
  background-size: auto, cover, auto, auto;
  background-position: center, center, center, center;
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat;
}
.login-card {
  width:min(430px,100%);
  background:#fff;
  border:1px solid #dfe7f2;
  border-radius:16px;
  padding:20px;
  box-shadow:0 18px 36px rgba(27,36,48,.12);
}
.login-card h1 { margin:0 0 6px; }
.login-card p { margin:0 0 14px; color:var(--muted); }
.login-card-imp {
  width: min(460px, 100%);
  background: #e9edf4;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 16px;
  padding: 28px 34px 26px;
  box-shadow: 0 22px 38px rgba(4, 25, 55, .28);
}
.login-card-logo-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 10px;
}
.login-logo-imp {
  max-width: 280px;
  max-height: 170px;
  width: auto;
  background: #fff;
  border-radius: 0;
  padding: 10px;
  box-shadow: 0 1px 0 rgba(0,0,0,.03);
}
.login-card-appname {
  margin-top: 2px;
  text-align: center;
  font-size: 15px;
  color: var(--login-primary, #18365b);
  font-weight: 700;
}
.login-card-appsub {
  margin: 6px 0 16px;
  text-align: center;
  color: var(--login-primary, #45617f);
  font-size: 13px;
  opacity: .8;
}
.login-form-imp { display: grid; gap: 2px; }
.field-center label {
  text-align: center;
  font-weight: 700;
  color: var(--login-primary, #0f315a);
  margin-bottom: 8px;
}
.login-card-imp .field input {
  text-align: center;
  background: #dde5f1;
  border: 1px solid #d0d9e8;
  border-radius: 999px;
  padding: 12px 16px;
}
.login-submit { width: 100%; margin-top: 4px; padding: 11px 12px; font-weight: 700; }
.login-submit-imp {
  margin-top: 14px;
  border-radius: 999px;
  padding: 13px 14px;
  background: var(--login-btn, #102f53);
  border-color: var(--login-btn, #102f53);
  letter-spacing: .3px;
}
.login-submit-imp:hover { filter: brightness(.95); }
.login-card-hints {
  margin-top: 14px;
  display: grid;
  gap: 6px;
  color: #5f728c;
  font-size: 11px;
  text-align: center;
}
.field { margin-bottom:12px; }
.field label { display:block; font-size:13px; color:#445469; margin-bottom:4px; }
.field input { width:100%; border:1px solid #d7e0ec; border-radius:10px; padding:10px 12px; }
.small { font-size:12px; color:var(--muted); }
ul.flat { margin: 8px 0 0; padding-left: 18px; }

/* Forms used by product/category CRUD */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.field-wrap label {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  color: #555;
}
.field-wrap input,
.field-wrap select,
.field-wrap textarea {
  width: 100%;
  border: 1px solid #d7e0ec;
  border-radius: 10px;
  padding: 9px 10px;
  background: #fff;
  color: #333;
}
.field-wrap select[multiple] { min-height: 120px; }
.field-wrap textarea {
  min-height: 96px;
  resize: vertical;
  font-family: inherit;
}
.inline-color {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 8px;
  align-items: center;
}
.inline-color input[type="color"] {
  width: 60px;
  min-width: 0;
  height: 38px;
  padding: 2px;
  border-radius: 8px;
  cursor: pointer;
}
.inline-color .hex-input {
  background: #f6f9fd;
  color: #42556e;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.brand-preview-wrap {
  min-height: 520px;
  border-radius: 16px;
  border: 1px solid #dbe6f3;
  padding: 20px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(rgba(4, 20, 48, .25), rgba(4, 20, 48, .25)),
    var(--p-login-bg-image, none),
    linear-gradient(90deg, var(--p-login-bg, #0056A8), var(--p-login-bg, #0056A8));
  background-size: cover, cover, auto;
  background-position: center, center, center;
  background-repeat: no-repeat, no-repeat, no-repeat;
}
.brand-preview-card {
  width: min(460px, 100%);
  background: #e9edf4;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 16px;
  padding: 24px 30px;
  box-shadow: 0 22px 38px rgba(4, 25, 55, .28);
}
.brand-preview-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}
.brand-preview-logo {
  max-width: 260px;
  max-height: 150px;
  background: #fff;
  padding: 10px;
}
.brand-preview-title {
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--p-login-primary, #0f315a);
}
.brand-preview-subtitle {
  text-align: center;
  margin: 6px 0 14px;
  color: var(--p-login-primary, #0f315a);
  opacity: .8;
  font-size: 13px;
}
.brand-preview-field { margin-bottom: 10px; }
.brand-preview-field label {
  display: block;
  text-align: center;
  font-weight: 700;
  color: var(--p-login-primary, #0f315a);
  margin-bottom: 8px;
}
.brand-preview-input {
  background: #dde5f1;
  border: 1px solid #d0d9e8;
  border-radius: 999px;
  padding: 12px 16px;
  text-align: center;
  color: #18365b;
}
.brand-preview-button {
  margin-top: 14px;
  border-radius: 999px;
  padding: 13px 14px;
  text-align: center;
  color: #fff;
  font-weight: 700;
  letter-spacing: .3px;
  border: 1px solid var(--p-login-btn, #102f53);
  background: var(--p-login-btn, #102f53);
}
.brand-preview-hints {
  margin-top: 14px;
  display: grid;
  gap: 6px;
  color: #5f728c;
  font-size: 11px;
  text-align: center;
}
.field-span-2 {
  grid-column: 1 / -1;
}
.kv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
}
.kv-grid > div {
  background: linear-gradient(180deg, #ffffff, #fbfcfe);
  border: 1px solid #e7edf6;
  border-radius: 10px;
  padding: 10px 12px;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: 1.35fr .65fr;
  gap: 14px;
  margin-bottom: 14px;
}
.hero-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 85% 15%, rgba(255,255,255,.22) 0, rgba(255,255,255,0) 42%),
    linear-gradient(135deg, var(--theme-topbar, #1f6feb), var(--brand2));
  color: #fff;
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 18px 34px rgba(15, 49, 115, .24);
}
.hero-card h1 { margin: 0 0 8px; font-size: 24px; }
.hero-copy {
  display: grid;
  gap: 6px;
  margin-top: 4px;
  max-width: 62ch;
}
.hero-card p {
  margin: 0;
  color: rgba(255,255,255,.92);
  line-height: 1.45;
  font-size: 15px;
}
.hero-actions { display:flex; gap:10px; flex-wrap:wrap; margin-top:18px; }
.hero-actions .btn {
  min-height: 40px;
  padding: 10px 14px;
  border-radius: 12px;
}
.btn.light {
  background: rgba(255,255,255,.14);
  color: #fff;
  border-color: rgba(255,255,255,.25);
}
.btn.light:hover { background: rgba(255,255,255,.22); }
.mini-panel {
  border-radius: 18px;
  background: rgba(255,255,255,.8);
  border: 1px solid #dfe7f2;
  box-shadow: var(--shadow);
  padding: 14px;
}
.mini-panel h3 {
  margin: 0 0 10px;
  font-size: 14px;
  color: #304158;
}
.mini-list {
  display: grid;
  gap: 8px;
}
.mini-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid #e7edf6;
  border-radius: 12px;
  padding: 9px 10px;
}
.mini-item strong { font-size: 13px; }
.mini-item span { color: var(--muted); font-size: 12px; }
.dashboard-panels {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 14px;
  margin-top: 14px;
}
.kpi-charts {
  grid-template-columns: 1fr 1fr;
}
.kpi-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.kpi-pill {
  border: 1px solid #e1eaf5;
  border-radius: 12px;
  padding: 12px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
}
.kpi-pill .kpi-label {
  display: block;
  color: #64748b;
  font-size: 12px;
  margin-bottom: 4px;
}
.kpi-pill strong {
  display: block;
  color: #10293f;
  font-size: 20px;
  line-height: 1.2;
}
.chart-wrap {
  position: relative;
  min-height: 230px;
}
.chart-wrap canvas {
  width: 100% !important;
  height: 230px !important;
}
.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.quick-link {
  display: block;
  border: 1px solid #e1eaf5;
  border-radius: 12px;
  padding: 12px;
  color: inherit;
  background: linear-gradient(180deg, #fff, #fbfdff);
}
.quick-link:hover {
  border-color: #bfd5fb;
  box-shadow: 0 8px 20px rgba(18, 52, 105, .08);
}
.quick-link .q-title { display:block; font-weight: 700; margin-bottom: 4px; }
.quick-link .q-sub { display:block; color: var(--muted); font-size: 12px; }
.list-card-header {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin-bottom:10px;
}
.list-card-header h2 {
  margin: 0;
  font-size: 16px;
}
.timeline {
  display: grid;
  gap: 10px;
}
.timeline.compact { gap: 8px; }
.timeline-item {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 10px;
  align-items: start;
}
.timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 5px;
  background: linear-gradient(180deg, var(--theme-topbar, var(--brand)), var(--brand));
  box-shadow: 0 0 0 3px rgba(31,111,235,.10);
}
.timeline-body {
  border: 1px solid #e4ebf5;
  border-radius: 12px;
  padding: 10px 12px;
  background: linear-gradient(180deg, #fff, #fbfdff);
}
.timeline-title {
  font-weight: 700;
  color: #233449;
}
.timeline-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}
.timeline-note {
  margin-top: 8px;
  color: #2a394d;
  background: #f5f8fd;
  border: 1px solid #e2eaf5;
  border-radius: 10px;
  padding: 8px 10px;
  white-space: pre-wrap;
}
.metric-bars {
  display: grid;
  gap: 10px;
}
.metric-bar-row {
  display: grid;
  grid-template-columns: 92px 1fr 170px;
  gap: 10px;
  align-items: center;
}
.metric-bar-label {
  font-weight: 600;
  color: #31445f;
}
.metric-bar-track {
  height: 11px;
  background: #edf2fb;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid #e0e8f4;
}
.metric-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--theme-topbar, var(--brand)), var(--brand));
  border-radius: 999px;
}
.metric-bar-value {
  text-align: right;
  font-weight: 600;
  color: #1f2f44;
}
.dash-spotlight {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, .8fr);
  gap: 24px;
  padding: 24px 26px;
  margin-bottom: 14px;
  border-radius: 22px;
  background:
    radial-gradient(circle at 100% 0%, rgba(255,255,255,.18) 0, rgba(255,255,255,0) 36%),
    linear-gradient(135deg, #0f172a 0%, #0f766e 52%, #1d4ed8 100%);
  color: #fff;
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 24px 40px rgba(15,23,42,.18);
}
.vision-ui .dash-spotlight.card {
  --dash-hero-green: #1F710E;
  --dash-hero-green-dark: #185b0b;
  --dash-hero-green-light: #2b8f17;
  background:
    radial-gradient(circle at 100% 0%, rgba(255,255,255,.14) 0, rgba(255,255,255,0) 34%),
    linear-gradient(135deg, var(--dash-hero-green-dark) 0%, var(--dash-hero-green) 52%, var(--dash-hero-green-light) 100%);
  border-color: rgba(31, 113, 14, .42);
  box-shadow: 0 20px 36px rgba(31, 113, 14, .22);
}
.vision-ui .dash-spotlight-copy h1,
.vision-ui .dash-spotlight-copy p,
.vision-ui .dash-signal strong,
.vision-ui .dash-signal span,
.vision-ui .dash-signal small {
  color: #ffffff;
}
.vision-ui .dash-signal {
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.16);
}
.vision-ui .dash-spotlight .btn.light {
  background: rgba(24, 91, 11, .34);
  border-color: rgba(255,255,255,.22);
  color: #ffffff;
}
.vision-ui .dash-spotlight .btn.light:hover {
  background: rgba(43, 143, 23, .42);
}
.vision-ui .dash-spotlight .dash-eyebrow {
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.20);
}
.dash-spotlight-copy h1 {
  margin: 8px 0 10px;
  font-size: 34px;
  line-height: 1.05;
}
.dash-spotlight-copy p {
  margin: 0 0 10px;
  max-width: 54ch;
  color: rgba(255,255,255,.88);
  line-height: 1.62;
  font-size: 15px;
}
.dash-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 700;
}
.dash-spotlight-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.dash-spotlight-side {
  display: grid;
  gap: 12px;
}
.dash-signal {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.08);
  backdrop-filter: blur(10px);
}
.dash-signal span {
  display: block;
  color: rgba(255,255,255,.76);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.dash-signal strong {
  display: block;
  margin-top: 6px;
  font-size: 28px;
  line-height: 1.05;
}
.dash-signal small {
  display: block;
  margin-top: 6px;
  color: rgba(255,255,255,.72);
}
.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.commercial-insight {
  margin: 10px 0 14px;
}
.commercial-head {
  display: grid;
  grid-template-columns: 1.15fr .95fr 1fr 1.25fr;
  gap: 16px;
  align-items: end;
  margin-bottom: 10px;
  color: #597188;
  font-size: 13px;
}
.commercial-head strong {
  color: #0f2f52;
  font-size: 14px;
}
.commercial-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.commercial-card {
  border-radius: 24px;
  padding: 18px 18px 20px;
}
.commercial-card h2 {
  margin: 0 0 8px;
  color: #0f2f52;
  font-size: 18px;
}
.commercial-card p {
  margin: 0 0 14px;
  color: #5f7488;
  line-height: 1.45;
}
.commercial-bar-card,
.commercial-donut-card {
  border-radius: 20px;
  background: linear-gradient(180deg, #f7fbff, #eef5fc);
  padding: 18px;
  border: 1px solid #dfebf7;
}
.commercial-bar-card {
  display: grid;
  gap: 10px;
  min-height: 338px;
}
.commercial-bar-row {
  display: grid;
  grid-template-columns: minmax(120px, 170px) 1fr 72px;
  gap: 10px;
  align-items: center;
}
.commercial-bar-label {
  color: #17324f;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.commercial-bar-track {
  height: 16px;
  border-radius: 999px;
  background: #e6eef8;
  overflow: hidden;
}
.commercial-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #1F710E, #2f8d18);
}
.commercial-bar-value {
  text-align: right;
  color: #17324f;
  font-weight: 700;
}
.commercial-table-wrap table {
  min-width: 0;
}
.commercial-donut-card {
  margin-top: 12px;
  display: grid;
  justify-items: center;
  gap: 12px;
  min-height: 338px;
}
.commercial-donut {
  width: 255px;
  height: 255px;
  border-radius: 50%;
  background:
    conic-gradient(#f7a400 calc(var(--donut-pct, 0) * 1%), #d9dee5 0);
  display: grid;
  place-items: center;
  position: relative;
}
.commercial-donut::after {
  content: "";
  position: absolute;
  width: 116px;
  height: 116px;
  border-radius: 50%;
  background: #eef5fc;
  box-shadow: inset 0 0 0 1px #dbe7f2;
}
.commercial-donut-hole {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  text-align: center;
}
.commercial-donut-hole strong {
  color: #0f2f52;
  font-size: 28px;
}
.commercial-donut-hole small {
  color: #64748b;
}
.commercial-legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
  color: #0f2f52;
  font-size: 13px;
}
.commercial-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.commercial-legend .dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
}
.commercial-legend .dot.primary { background: #f7a400; }
.commercial-legend .dot.muted { background: #d9dee5; }
.dash-kpi {
  position: relative;
  overflow: hidden;
  min-height: 140px;
  padding: 16px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 100% 0%, rgba(29,78,216,.14) 0, rgba(29,78,216,0) 42%),
    linear-gradient(180deg, #ffffff, #f8fbff);
}
.dash-kpi::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, #0f766e, #1d4ed8);
}
.dash-kpi-label {
  display: block;
  color: #64748b;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 700;
}
.dash-kpi strong {
  display: block;
  margin-top: 14px;
  font-size: 30px;
  color: #0f172a;
  line-height: 1;
}
.dash-kpi small {
  display: block;
  margin-top: 12px;
  color: #475569;
}
.dash-snapshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.dash-snapshot {
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
}
.dash-snapshot span {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.dash-snapshot strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
  color: #0f172a;
}
.dash-grid {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}
.dash-grid-main {
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, .9fr);
}
.dash-grid-triple {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.dash-grid-quad {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.dash-grid-secondary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.dash-panel {
  border-radius: 18px;
  padding: 16px;
}
.dash-panel-span-2 {
  grid-column: 1 / -1;
}
.dash-panel-large {
  min-height: 420px;
}
.dash-chart {
  position: relative;
  min-height: 280px;
}
.dash-chart-compact {
  min-height: 220px;
}
.dash-chart canvas {
  width: 100% !important;
  height: 280px !important;
}
.dash-chart-compact canvas {
  height: 220px !important;
}
.dash-empty {
  display: grid;
  place-items: center;
  min-height: 160px;
  color: #64748b;
  text-align: center;
}
.dash-settings-form {
  display: grid;
  gap: 10px;
}
.dash-settings-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px 120px;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff, #f8fbff);
}
.dash-settings-copy strong {
  display: block;
  color: #0f172a;
}
.dash-settings-copy small {
  color: #64748b;
}
.dash-settings-input {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}
.dash-settings-input input {
  width: 72px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 8px 10px;
  text-align: right;
  background: #fff;
}
.dash-settings-track {
  display: block;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #e5eefb;
}
.dash-settings-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0f766e, #1d4ed8);
}
.dash-settings-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}
.dash-timeline {
  display: grid;
  gap: 12px;
}
.dash-timeline-item {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 12px;
  align-items: start;
}
.dash-timeline-mark {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  margin-top: 5px;
  background: linear-gradient(180deg, #0f766e, #1d4ed8);
  box-shadow: 0 0 0 4px rgba(15,118,110,.12);
}
.dash-timeline-copy {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px;
  background: linear-gradient(180deg, #fff, #f8fbff);
}
.dash-timeline-copy strong,
.dash-timeline-copy span,
.dash-timeline-copy small {
  display: block;
}
.dash-timeline-copy span {
  margin-top: 4px;
  color: #475569;
}
.dash-timeline-copy small {
  margin-top: 6px;
  color: #64748b;
}
.dash-progress-list {
  display: grid;
  gap: 10px;
}
.dash-progress-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 1fr) 64px;
  gap: 10px;
  align-items: center;
}
.dash-progress-copy strong,
.dash-progress-copy small {
  display: block;
}
.dash-progress-copy small {
  color: #64748b;
}
.dash-progress-bar {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: #e8eef8;
  border: 1px solid #d6e0ef;
}
.dash-progress-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0f766e, #1d4ed8);
}
.dash-progress-value {
  text-align: right;
  font-weight: 700;
  color: #0f172a;
}
.dash-heatmap {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}
.dash-heatmap-head,
.dash-heatmap-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.3fr) repeat(6, minmax(84px, 1fr));
  gap: 8px;
  align-items: stretch;
}
.dash-heatmap-head span {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.dash-heatmap-row strong {
  display: grid;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fbff;
  border: 1px solid #dbe6f4;
  color: #0f172a;
  font-size: 12px;
}
.dash-heatmap-cell {
  display: grid;
  place-items: center;
  text-align: center;
  padding: 10px 8px;
  border-radius: 12px;
  background: rgba(29, 78, 216, var(--cell-opacity, .12));
  border: 1px solid rgba(29, 78, 216, .12);
  color: #0f172a;
  font-size: 11px;
  font-weight: 700;
}
.dash-project-fallback-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(140px, 1fr);
  gap: 10px;
  align-items: center;
}
.dash-project-fallback-copy strong,
.dash-project-fallback-copy small {
  display: block;
}
.dash-project-fallback-copy small {
  color: #64748b;
}
.vision-ui .profile-dropdown-head {
  background: linear-gradient(180deg, #eaf6f1, #f6fbf8);
  border-radius: 10px;
}
.vision-ui .profile-dropdown-head strong {
  color: #0f5f4c;
}
.kanban-board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(280px, 1fr);
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 6px;
}
.kanban-col {
  background: rgba(255,255,255,.8);
  border: 1px solid #dfe7f2;
  border-radius: 16px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 480px;
}
.kanban-col-head {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  padding: 12px;
  border-bottom: 1px solid #e9eff8;
  background: linear-gradient(180deg, #fff, #fbfdff);
  border-radius: 16px 16px 0 0;
}
.kanban-col-title {
  font-weight: 700;
  color: #22344a;
}
.kanban-col-count {
  min-width: 28px;
  text-align: center;
  border-radius: 999px;
  background: #edf3ff;
  color: #224d97;
  border: 1px solid #cfe0ff;
  font-weight: 700;
  font-size: 12px;
  padding: 4px 8px;
}
.kanban-col-body {
  padding: 12px;
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 180px;
}
.kanban-card {
  background: #fff;
  border: 1px solid #e5ecf6;
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 4px 12px rgba(22,37,65,.05);
  cursor: grab;
}
.kanban-card:active { cursor: grabbing; }
.kanban-card-title {
  font-weight: 700;
  color: #233348;
  margin-bottom: 6px;
}
.kanban-card-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}
.kanban-card-actions {
  margin-top: 8px;
  font-size: 12px;
}
.kanban-card-actions a {
  color: var(--brand);
}

/* Small admin badges */
td code {
  font-size: 12px;
  background: #f4f4f4;
  padding: 2px 4px;
  border-radius: 3px;
}

@media (max-width: 1200px) {
  .shell { grid-template-columns: 220px 1fr; }
  .content { padding: 16px; }
  .dashboard-hero { grid-template-columns: 1.15fr .85fr; }
  .dashboard-panels { grid-template-columns: 1fr; }
  .dash-spotlight { grid-template-columns: 1fr; }
  .dash-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .commercial-head,
  .commercial-grid,
  .dash-grid-main,
  .dash-grid-quad,
  .dash-grid-triple,
  .dash-grid-secondary { grid-template-columns: 1fr; }
  .kpi-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.cards { grid-template-columns: repeat(auto-fit,minmax(150px,1fr)); }
  .toolbar input, .toolbar select { min-width: 180px; }
  .metric-bar-row { grid-template-columns: 88px 1fr 140px; }
}

@media (max-width: 992px) {
  .shell { grid-template-columns: 1fr; min-height: auto; }
  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 10px 12px;
  }
  .sidebar nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 10px;
  }
  .nav-group {
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.04);
    border-radius: 10px;
    padding: 8px;
  }
  .nav-link {
    min-height: 52px;
    align-items: flex-start;
  }
  .nav-main {
    align-items: flex-start;
  }
  .nav-icon {
    margin-top: 2px;
  }
  .nav-text {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.25;
    word-break: break-word;
  }
  .nav-group + .nav-group { margin-top: 0; }
  .topbar {
    position: static;
    padding: 12px 14px;
    gap: 10px;
  }
  .brand { align-items: center; }
  .brand span { display: none; }
  .pill { display:none; }
  .dashboard-hero,
  .dashboard-panels { grid-template-columns: 1fr; }
  .dash-kpi-grid { grid-template-columns: 1fr 1fr; }
  .commercial-head { grid-template-columns: 1fr 1fr; }
  .dash-grid-quad { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-summary-grid { grid-template-columns: 1fr; }
  .mini-panel { padding: 12px; }
  .quick-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid,
  .kv-grid { grid-template-columns: 1fr; }
  .field-span-2 { grid-column: auto; }
  .table-wrap table { min-width: 700px; }
  .kanban-board { grid-auto-columns: minmax(240px, 1fr); }
}

@media (max-width: 768px) {
  .content { padding: 12px; }
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }
  .top-actions {
    justify-content: space-between;
    width: 100%;
  }
  .notifications-dropdown {
    right: auto;
    left: 0;
    width: min(420px, calc(100vw - 24px));
  }
  .top-actions .btn.ghost { margin-left: auto; }
  .shell { grid-template-columns: 72px 1fr; align-items: start; }
  .sidebar {
    border-bottom: 0;
    border-right: 1px solid var(--line);
    padding: 8px 8px;
    min-height: calc(100vh - 72px);
    overflow: visible;
  }
  .sidebar nav { display:block; }
  .nav-group {
    background: transparent;
    border: 0;
    padding: 0;
  }
  .nav-group + .nav-group { margin-top: 8px; }
  .nav-title { display:none; }
  .nav-link {
    position: relative;
    min-height: 44px;
    padding: 10px 8px;
    border-radius: 10px;
    border-left: 0;
    justify-content: center;
  }
  .nav-main { justify-content: center; width: 100%; }
  .nav-icon { width: 20px; height: 20px; flex-basis: 20px; }
  .nav-icon svg { width: 20px; height: 20px; }
  .nav-caret { display:none; }
  .nav-text { display:none; }
  .nav-link.active {
    border-left: 0;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
  }
  .nav-link.active .nav-text {
    display:block;
    position:absolute;
    left: 52px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    background: rgba(17,26,40,.96);
    color: #fff;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 8px;
    padding: 6px 9px;
    font-size: 12px;
    line-height: 1.2;
    white-space: nowrap;
    box-shadow: 0 8px 18px rgba(8,12,18,.2);
    pointer-events: none;
  }
  .page-head {
    align-items: flex-start;
    margin-bottom: 12px;
  }
  .page-head .btn { width: auto; }
  .hero-card {
    padding: 14px;
    border-radius: 14px;
  }
  .dash-spotlight {
    padding: 14px;
    border-radius: 18px;
  }
  .dash-spotlight-copy h1 { font-size: 24px; }
  .dash-kpi-grid { grid-template-columns: 1fr; }
  .commercial-head,
  .dash-grid-quad { grid-template-columns: 1fr; }
  .dash-settings-row,
  .dash-progress-row {
    grid-template-columns: 1fr;
  }
  .commercial-bar-row { grid-template-columns: 1fr; }
  .commercial-bar-value { text-align: left; }
  .dash-heatmap-head,
  .dash-heatmap-row,
  .dash-project-fallback-row {
    grid-template-columns: 1fr;
  }
  .dash-settings-input { justify-content: flex-start; }
  .dash-progress-value { text-align: left; }
  .hero-card h1 { font-size: 20px; line-height: 1.2; }
  .hero-copy { gap: 8px; max-width: none; }
  .hero-card p { font-size: 14px; line-height: 1.5; }
  .hero-actions {
    gap: 8px;
    margin-top: 14px;
  }
  .hero-actions .btn {
    flex: 1 1 100%;
    text-align: center;
    justify-content: center;
  }
  .grid.cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat-value { font-size: 24px; }
  .toolbar {
    padding: 10px;
    gap: 8px;
  }
  .toolbar input, .toolbar select, .toolbar .btn {
    width: 100%;
    min-width: 0;
  }
  .pagination { justify-content: flex-start; }
  .mini-item { align-items: flex-start; }
  .mini-item span { text-align: right; }
  .metric-bar-row { grid-template-columns: 1fr; gap: 6px; }
  .metric-bar-value { text-align: left; }
  .table-wrap table { min-width: 620px; }
  th, td { padding: 9px 10px; }
  .kanban-board { gap: 10px; grid-auto-columns: minmax(220px, 88vw); }
  .kanban-col { min-height: 420px; }
  .brand-preview-wrap { min-height: 420px; padding: 12px; }
  .brand-preview-card { padding: 18px; }
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .content { padding: 10px; }
  .topbar { padding: 10px 12px; }
  .brand a { font-size: 16px; }
  .topbar-logo { max-height: 28px; max-width: 96px; }
  .notifications-trigger-label { display: none; }
  .notifications-trigger { padding: 8px 10px; }
  .notifications-dropdown {
    left: 0;
    right: auto;
    width: min(360px, calc(100vw - 20px));
  }
  .grid.cards { grid-template-columns: 1fr; }
  .dash-spotlight { padding: 12px; }
  .dash-spotlight-copy h1 { font-size: 20px; }
  .dash-signal strong { font-size: 22px; }
  .card { padding: 12px; border-radius: 12px; }
  .hero-card { padding: 12px; }
  .hero-card h1 { font-size: 18px; }
  .hero-card p { font-size: 13px; }
  .hero-actions .btn { padding: 10px 12px; border-radius: 10px; }
  .nav-title { font-size: 10px; }
  .nav-link.active .nav-text { font-size: 11px; left: 50px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
  .login-card,
  .login-card-imp { padding: 16px; border-radius: 14px; }
  .login-logo-imp { max-width: 180px; max-height: 110px; }
  .table-wrap { border-radius: 10px; }
  .table-wrap table { min-width: 560px; }
  .quick-link { padding: 10px; }
}
