/* Official authenticated workspace: the same light visual language as the
   Web evaluation space. Loaded after preserved application/identity styles.
   No login, API, permission, record or workflow behaviour is changed here. */
#root .app-shell {
  --navy: #032e42;
  --blue: #0b4061;
  --blue-dark: #032e42;
  --blue-soft: #edf3f5;
  --ink: #173747;
  --muted: #536977;
  --faint: #61747e;
  --border: #c8d5da;
  --border-soft: #dce4e6;
  --surface: #fff;
  --surface-muted: #f5f7f5;
  --sidebar-width: 228px;
  --hm-control-size: 40px;
  --hm-small-control-size: 40px;
  color: var(--ink);
  background: var(--surface-muted);
  font-family: "Excellia Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}
#root .app-shell.sidebar-compact { --sidebar-width: 72px; }

/* Customer identity is retained in the original application's brand row. */
#root .app-shell .sidebar {
  color: var(--ink);
  background: var(--surface-muted);
  border-right: 1px solid var(--border-soft);
}
#root .app-shell .brand-row {
  min-height: 72px;
  height: 72px;
  padding: 12px 20px;
  gap: 10px;
  border-bottom: 1px solid var(--border-soft);
  background: #fff;
  color: var(--navy);
}
#root .app-shell .sidebar-brand { min-width: 0; width: 100%; gap: 10px; color: var(--navy); }
#root .app-shell .sidebar-brand img { display: block; width: 32px; height: 32px; flex: 0 0 32px; object-fit: contain; }
#root .app-shell .sidebar-brand-label { min-width: 0; font-size: 14px; line-height: 20px; font-weight: 650; color: var(--navy); overflow-wrap: anywhere; }
#root .app-shell .brand-copy strong { color: var(--navy); font-size: 15px; line-height: 21px; }
#root .app-shell .brand-copy span { color: var(--muted); }
#root .app-shell .main-nav { padding: 24px 16px 16px; }
#root .app-shell .nav-section-label { margin-bottom: 6px; color: var(--muted); font-size: 10px; line-height: 16px; font-weight: 600; letter-spacing: .05em; }
#root .app-shell .nav-item {
  min-height: 44px;
  padding: 11px 13px;
  gap: 11px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #3c5664;
  background: transparent;
  font-size: 13px;
  line-height: 20px;
  font-weight: 550;
  text-decoration: none;
  box-shadow: none;
  transition: background-color .15s ease, border-color .15s ease;
}
#root .app-shell .main-nav .nav-item + .nav-item { margin-top: 5px; }
#root .app-shell .nav-item:hover { color: var(--navy); background: #eaf0f1; }
#root .app-shell .nav-item.active,
#root .app-shell .nav-item.active:hover {
  color: #fff;
  border-color: var(--navy);
  background: var(--navy);
  box-shadow: inset 3px 0 0 #f59a14;
  font-weight: 650;
}
#root .app-shell .nav-item > svg { display: block; flex: 0 0 19px; width: 19px; height: 19px; }
#root .app-shell .sidebar-footer { padding: 14px 16px 16px; border-top: 1px solid var(--border-soft); }
#root .app-shell .sidebar-user { padding-inline: 2px; gap: 9px; }
#root .app-shell .sidebar-user strong { color: var(--navy); font-weight: 600; }
#root .app-shell .sidebar-user span { color: var(--muted); }
#root .app-shell .sidebar :is(.icon-button,.icon-button:hover) { color: var(--navy); border-color: transparent; background: transparent; }
#root .app-shell .sidebar .icon-button:hover { background: #e6edef; }
#root .app-shell .sidebar :is(button,a):focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
#root .app-shell .sidebar .nav-item.active:focus-visible { outline-color: #aa6008; outline-offset: 3px; }
#root .app-shell .sidebar-footer :is(.crm-product-attribution,.workspace-brand-credit) { display: none; }
#root .app-shell.sidebar-compact .brand-row { padding: 12px 16px; }
#root .app-shell.sidebar-compact .sidebar-brand { justify-content: center; width: 100%; }
#root .app-shell.sidebar-compact :is(.main-nav,.sidebar-footer) { padding-inline: 10px; }
#root .app-shell.sidebar-compact .nav-item { padding-inline: 8px; }

/* White header, quieter controls and an explicit page hierarchy. */
#root .app-shell .topbar {
  min-height: 72px;
  padding: 12px 28px;
  gap: 20px;
  background: #fff;
  border-bottom: 1px solid var(--border-soft);
  box-shadow: none;
}
#root .app-shell .topbar-left { gap: 12px; min-width: 0; }
#root .app-shell .topbar-actions { gap: 10px; }
#root .app-shell .page-heading h1 { color: var(--navy); font-size: 20px; line-height: 27px; font-weight: 650; letter-spacing: -.025em; }
#root .app-shell :is(.icon-button,.date-control,.connection-status) { border-color: var(--border); box-shadow: none; }
#root .app-shell .icon-button { border-radius: 7px; color: var(--blue); }
#root .app-shell .date-control { min-height: 40px; padding: 4px 10px; }
#root .app-shell .date-control span { font-size: 10px; letter-spacing: .025em; color: var(--muted); }
#root .app-shell .date-control input { color: var(--ink); font-size: 13px; }
#root .app-shell .connection-status { color: var(--muted); font-weight: 550; }
#root .app-shell .workspace { min-width: 0; display: flex; flex-direction: column; }
#root .app-shell .main-content { flex: 1; width: min(1440px,100%); padding: 28px 28px 36px; }
#root .app-shell .page-stack { gap: 20px; }
#root .app-shell .official-dashboard-intro { margin: 0 0 24px; }
#root .app-shell .official-dashboard-intro h2 { margin: 0 0 7px; color: var(--navy); font-size: clamp(23px,2.1vw,28px); line-height: 1.25; letter-spacing: -.035em; font-weight: 680; }
#root .app-shell .official-dashboard-intro p { max-width: 72ch; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
#root .app-shell .official-actions { display: flex; align-items: stretch; flex-wrap: wrap; gap: 10px; margin: 18px 0 0; }
#root .app-shell .official-actions a { min-height: 40px; padding: 9px 13px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--border); border-radius: 7px; color: var(--blue); background: #fff; font-size: 12px; line-height: 20px; font-weight: 600; text-decoration: none; }
#root .app-shell .official-actions a:hover { border-color: #90aab8; background: #edf3f5; }
#root .app-shell .official-actions a:first-child { background: var(--blue); color: #fff; border-color: var(--blue); }
#root .app-shell .official-actions a:first-child:hover { background: var(--navy); border-color: var(--navy); }
#root .app-shell .official-actions a svg { width: 17px; height: 17px; flex: 0 0 17px; }

/* Equal-sized summaries: colours remain meaningful in statuses and alerts. */
#root .app-shell .kpi-grid { grid-template-columns: repeat(5,minmax(0,1fr)); gap: 14px; }
#root .app-shell .kpi {
  min-width: 0;
  min-height: 146px;
  padding: 18px 16px;
  border: 1px solid var(--border-soft);
  border-radius: 9px;
  box-shadow: none;
  background: #fff;
}
#root .app-shell .kpi-top { min-height: 36px; gap: 9px; color: var(--muted); font-size: 12px; line-height: 18px; font-weight: 550; }
#root .app-shell :is(.kpi-icon,.panel-title-icon) { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; color: var(--blue); background: #edf3f5; }
#root .app-shell .kpi-red .kpi-icon { color: #ac2332; background: #fcf0f1; }
#root .app-shell .kpi-value { margin-top: 12px; color: var(--navy); font-size: clamp(21px,2vw,28px); line-height: 1.2; font-weight: 700; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
#root .app-shell .kpi-detail { margin-top: 7px; color: var(--muted); font-size: 11px; line-height: 17px; }
#root .app-shell .finance-kpis { grid-template-columns: repeat(4,minmax(0,1fr)); }
#root .app-shell .panel { border-color: var(--border-soft); border-radius: 9px; box-shadow: none; }
#root .app-shell .panel-header { min-height: 72px; padding: 16px 18px; gap: 12px; }
#root .app-shell .panel-header h2 { color: var(--navy); font-size: 15px; line-height: 22px; font-weight: 650; }
#root .app-shell .panel-header p { margin-top: 3px; color: var(--muted); line-height: 18px; }
#root .app-shell .dashboard-grid { grid-template-columns: minmax(0,1.45fr) minmax(300px,1fr); gap: 20px; }
#root .app-shell .text-button { color: var(--blue); font-size: 12px; font-weight: 600; }
#root .app-shell .alert-row { min-height: 66px; padding: 12px 18px; gap: 11px; }
#root .app-shell .alert-row strong { font-weight: 600; }
#root .app-shell .alert-row span { line-height: 18px; }
#root .app-shell .severity-marker { width: 3px; height: 32px; }
#root .app-shell .sales-chart[data-official-empty="true"] { display: grid; grid-template-columns: minmax(0,1fr); padding: 22px; }
#root .app-shell .sales-chart[data-official-empty="true"] > :is(.chart-scale,.chart-plot) { display: none; }
#root .app-shell .official-chart-empty { min-height: 180px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 12px; text-align: center; color: var(--muted); }
#root .app-shell .official-chart-empty > svg { width: 30px; height: 30px; color: #6c8796; }
#root .app-shell .official-chart-empty p { margin: 0; max-width: 48ch; font-size: 13px; line-height: 1.6; }
#root .app-shell .official-chart-empty a { padding: 8px; color: var(--blue); font-size: 12px; font-weight: 600; text-underline-offset: 3px; }

/* The same measured control and table scale across the authenticated pages. */
#root .app-shell :is(.table-toolbar,.management-panel-heading) { min-height: 68px; padding: 14px 18px; gap: 12px; }
#root .app-shell .data-table th { height: 44px; background: #f6f8f8; color: var(--muted); font-weight: 600; font-size: 11px; letter-spacing: .02em; }
#root .app-shell .data-table td { padding: 12px; font-size: 13px; line-height: 20px; }
#root .app-shell .data-table tbody tr:hover { background: #f6f9f9; }
#root .app-shell .data-table td > small { font-size: 12px; line-height: 18px; }
#root .app-shell .status-badge { min-height: 24px; padding: 3px 8px; border-radius: 5px; font-size: 11px; font-weight: 600; }
#root .app-shell :is(.search-field,.session-form input,.session-form select,.table-toolbar select,.inline-select) { border-color: var(--border); border-radius: 7px; box-shadow: none; }
#root .app-shell :is(.primary-button,.small-primary-button) { background: var(--blue); border-color: var(--blue); box-shadow: none; }
#root .app-shell :is(.primary-button,.small-primary-button):hover { background: var(--navy); border-color: var(--navy); }
#root .app-shell .secondary-button { color: var(--blue); background: #fff; border-color: var(--border); }
#root .app-shell .page-tabs { gap: 8px; background: #fff; border-color: var(--border-soft); }
#root .app-shell .page-tabs button.active { background: #edf3f5; color: var(--navy); border-color: #c8d7dd; }
#root .app-shell .avatar { background: #e6eff2; color: var(--blue); }
#root .app-shell :is(.summary-strip,.pilot-summary,.settings-card,.settings-hero) { box-shadow: none; border-color: var(--border-soft); border-radius: 9px; }

/* Product credit stays quiet; customer identity owns the header. */
#root .app-shell .official-workspace-footer { width: min(1440px,100%); margin: auto auto 0; padding: 20px 28px 26px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 18px 24px; color: #69777d; font-size: 10px; line-height: 17px; background: transparent; }
#root .app-shell .official-workspace-footer::before { content: ""; flex: 0 0 100%; height: 1px; background: var(--border-soft); }
#root .app-shell .official-workspace-footer :is(.crm-product-attribution,.workspace-brand-credit) { display: flex; align-items: baseline; justify-content: flex-start; width: auto; padding: 0; margin: 0; gap: 4px; color: #69777d; font-size: 10px; line-height: 17px; }
#root .app-shell .official-workspace-footer :is(.crm-product-attribution,.workspace-brand-credit) img { width: 60px; height: 15.25px; object-fit: contain; transform: none; opacity: .85; }
#root .app-shell .official-workspace-footer > nav { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 22px; }
#root .app-shell .official-workspace-footer a { color: #536977; text-underline-offset: 3px; }
#root .app-shell .official-workspace-footer a:hover { color: var(--navy); }
#root .app-shell :is(button,input,select,textarea,a,[tabindex]):focus-visible { outline: 2px solid #0b4061; outline-offset: 3px; }

@media (max-width: 1299px) and (min-width: 901px) {
  #root .app-shell .kpi-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  #root .app-shell .finance-kpis { grid-template-columns: repeat(4,minmax(0,1fr)); }
  #root .app-shell .dashboard-grid { grid-template-columns: minmax(0,1fr); }
  #root .app-shell .kpi { min-height: 136px; }
}
@media (max-width: 1050px) and (min-width: 901px) {
  #root .app-shell .finance-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 900px) {
  #root .app-shell, #root .app-shell.sidebar-compact { --sidebar-width: 240px; }
  #root .app-shell .sidebar .brand-row { padding: 12px 16px; }
  #root .app-shell .sidebar .sidebar-brand { width: 180px; justify-content: flex-start; }
  #root .app-shell .sidebar .sidebar-brand-label { display: flex; }
  #root .app-shell .main-nav, #root .app-shell .sidebar-footer { padding-inline: 16px; }
  #root .app-shell .topbar { padding-inline: 20px; }
  #root .app-shell .main-content { padding: 24px 20px 32px; }
  #root .app-shell .kpi-grid, #root .app-shell .finance-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); }
  #root .app-shell .dashboard-grid { grid-template-columns: minmax(0,1fr); }
  #root .app-shell .official-workspace-footer { padding-inline: 20px; }
}
@media (max-width: 600px) {
  #root .app-shell { --hm-control-size: 44px; --hm-small-control-size: 44px; }
  #root .app-shell .topbar { padding: 12px; gap: 10px; flex-wrap: wrap; }
  #root .app-shell .topbar-left { min-width: 0; gap: 9px; }
  #root .app-shell .topbar-actions { min-width: 0; gap: 8px; margin-left: auto; }
  #root .app-shell .page-heading h1 { font-size: 18px; line-height: 24px; }
  #root .app-shell .main-content { padding: 22px 14px 28px; }
  #root .app-shell .official-dashboard-intro { margin-bottom: 20px; }
  #root .app-shell .official-dashboard-intro h2 { font-size: 24px; }
  #root .app-shell .official-actions { gap: 8px; }
  #root .app-shell .official-actions a { min-height: 44px; flex: 1 1 160px; font-size: 12px; }
  #root .app-shell .kpi-grid, #root .app-shell .finance-kpis { grid-template-columns: minmax(0,1fr); gap: 12px; }
  #root .app-shell .kpi { min-height: 130px; padding: 16px; }
  #root .app-shell .kpi-top { font-size: 13px; }
  #root .app-shell .kpi-value { font-size: 26px; }
  #root .app-shell .panel-header { min-height: 68px; padding: 14px; gap: 10px; }
  #root .app-shell .panel-header h2 { font-size: 14px; line-height: 20px; }
  #root .app-shell .panel-header p { font-size: 11px; line-height: 17px; }
  #root .app-shell .panel-action { min-width: 0; }
  #root .app-shell .panel-action .text-button { font-size: 11px; padding-inline: 3px; }
  #root .app-shell .table-toolbar { padding: 14px; }
  #root .app-shell .official-workspace-footer { padding: 18px 14px 24px; gap: 16px; align-items: flex-start; flex-direction: column; }
  #root .app-shell .official-workspace-footer::before { width: 100%; flex-basis: auto; }
  #root .app-shell .official-workspace-footer > nav { gap: 12px 18px; }
  #root .app-shell .official-workspace-footer a { min-height: 32px; display: inline-flex; align-items: center; }
}
@media (pointer: coarse) {
  #root .app-shell { --hm-control-size: 44px; --hm-small-control-size: 44px; }
  #root .app-shell .nav-item { min-height: 46px; }
}
@media (prefers-reduced-motion: reduce) {
  #root .app-shell :is(.nav-item,.bar,.sidebar) { transition: none; }
}

#root .app-shell .official-mobile-company,#root .app-shell .official-close-menu{display:none}
@media(max-width:900px){#root .app-shell .official-mobile-company{display:flex;align-items:center;gap:6px;color:#536977;font-size:11px;line-height:18px;margin-bottom:2px}#root .app-shell .official-mobile-company img{width:18px;height:18px;object-fit:contain}#root .app-shell .official-close-menu{display:grid;place-items:center;flex:0 0 36px;width:36px;height:36px;margin-left:auto;border:1px solid #c8d5da;border-radius:7px;background:#fff;color:#0b4061;font-size:24px}#root .app-shell .page-heading h1{font-size:18px;line-height:23px}}

@media(max-width:900px){#root .app-shell .page-heading .official-mobile-company > span{display:inline;font-size:11px;font-weight:550;color:#536977;line-height:18px;text-transform:none;letter-spacing:normal}}

#root .app-shell .sidebar-brand-label{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}#root .app-shell .official-dashboard-intro h2{overflow-wrap:anywhere}@media(max-width:900px){#root .app-shell .official-mobile-company{min-width:0;max-width:100%}#root .app-shell .official-mobile-company img{flex:0 0 18px}#root .app-shell .official-mobile-company>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}}
