:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --panel-2: #f0f4f8;
  --ink: #17202a;
  --muted: #667085;
  --line: #e3e8ef;
  --brand: #0F2747;
  --brand-2: #B3ADA4;
  --accent: #c67b32;
  --button: #0F2747;
  --sidebar: #0F2747;
  --danger: #c2413a;
  --warning: #b7791f;
  --success: #16845f;
  --shadow: 0 20px 60px rgba(16, 24, 40, .08);
  --radius: 8px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(340px, 520px) 1fr;
  background: #0f1f2b;
}
.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px;
  background: var(--panel);
}
.auth-visual {
  position: relative;
  overflow: hidden;
  padding: 48px;
  color: #fff;
  background:
    linear-gradient(rgba(15, 31, 43, .58), rgba(15, 31, 43, .70)),
    url("https://images.unsplash.com/photo-1497366754035-f200968a6e72?auto=format&fit=crop&w=1600&q=80") center/cover;
}
.configurable-login-visual { display: grid; align-content: end; min-height: 100vh; }
.auth-visual-bg { position: absolute; inset: 0; }
.auth-visual-content { position: relative; z-index: 1; align-self: end; }
.auth-visual h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(38px, 5vw, 72px);
  line-height: 1;
}
.auth-visual p { max-width: 620px; color: rgba(255,255,255,.78); font-size: 18px; }
.logo-row { display: flex; gap: 12px; align-items: center; margin-bottom: 28px; }
.brand-mark {
  width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: var(--radius); background: var(--brand); color: #fff; font-weight: 800;
}
.auth-card h2 { margin: 0 0 8px; font-size: 28px; }
.auth-card p { color: var(--muted); margin: 0 0 24px; }
.link-button {
  border: 0; background: transparent; color: var(--brand); font-weight: 800;
  padding: 2px 0; width: max-content; justify-self: start;
}

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 268px 1fr; }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 22px 16px;
  background: var(--sidebar); color: #fff; display: flex; flex-direction: column; gap: 18px;
  overflow-y: auto;
}
.sidebar .logo-row { margin-bottom: 4px; padding: 0 8px; }
.sidebar small { color: rgba(255,255,255,.55); }
.nav { display: grid; gap: 4px; }
.nav button {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 11px 12px;
  border: 0; border-radius: var(--radius); color: rgba(255,255,255,.72); background: transparent; text-align: left;
}
.nav button:hover, .nav button.active { background: rgba(255,255,255,.10); color: #fff; }
.nav svg, .icon { width: 18px; height: 18px; flex: 0 0 18px; }
.sidebar-foot { margin-top: auto; padding: 12px; border-top: 1px solid rgba(255,255,255,.10); }

.main { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 72px; padding: 0 28px; background: rgba(246,247,249,.9); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line);
}
.searchbar { flex: 1; max-width: 560px; position: relative; }
.searchbar input { width: 100%; padding: 12px 14px 12px 40px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.searchbar .icon { position: absolute; left: 14px; top: 12px; color: var(--muted); }
.global-search-results {
  position: absolute;
  z-index: 80;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  display: none;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.global-search-results.open {
  display: grid;
  gap: 4px;
}
.global-search-results button {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.global-search-results button:hover {
  background: color-mix(in srgb, var(--brand) 10%, transparent);
}
.global-search-results span,
.global-search-empty {
  color: var(--muted);
  font-size: 12px;
}
.global-search-empty {
  padding: 10px;
}
.top-actions { display: flex; gap: 10px; align-items: center; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--brand-2); color: #fff; display: grid; place-items: center; font-weight: 800; overflow: hidden; }
.avatar img, .profile-avatar-preview img {
  width: 100%; height: 100%; object-fit: cover; object-position: center; border-radius: 50%; display: block;
}
.profile-avatar-preview {
  width: 72px; height: 72px; margin-top: 10px; border-radius: 50%;
  overflow: hidden; border: 1px solid var(--line); background: var(--panel-2);
}

.content { padding: 28px; max-width: 1640px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.page-head h1 { margin: 0; font-size: 30px; }
.page-head p { margin: 6px 0 0; color: var(--muted); }

.grid { display: grid; gap: 16px; }
.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(16,24,40,.04); padding: 18px;
}
.metric { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.metric b { display: block; font-size: 28px; margin-top: 8px; }
.metric span, .muted { color: var(--muted); }
.metric .brand-mark { background: var(--panel-2); color: var(--brand); }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 16px; }
.toolbar input, .toolbar select, .field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; background: #fff; color: var(--ink);
}
.field textarea { min-height: 86px; resize: vertical; }
.field label { display: block; font-size: 12px; color: var(--muted); margin: 0 0 6px; font-weight: 700; text-transform: uppercase; }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--ink); padding: 9px 13px; font-weight: 700;
}
.btn.primary { background: var(--button, var(--brand)); border-color: var(--button, var(--brand)); color: #fff; }
.btn.danger { background: #fff5f5; color: var(--danger); border-color: #f1c3c0; }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.icon-btn { width: 40px; padding: 0; }

.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table { width: 100%; border-collapse: collapse; min-width: 820px; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; background: #fbfcfd; }
tr:hover td { background: #fbfcfd; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 999px; font-size: 12px; font-weight: 800; background: var(--panel-2); color: var(--brand-2); }
.pill.success { background: #e7f7ef; color: var(--success); }
.pill.warning { background: #fff5df; color: var(--warning); }
.pill.danger { background: #fff0ef; color: var(--danger); }
.pill.neutral { background: #edf1f5; color: #475467; }

.split { display: grid; grid-template-columns: 1.25fr .75fr; gap: 16px; align-items: start; }
.kanban { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 14px; overflow: auto; }
.kanban-col { background: #eef2f6; border-radius: var(--radius); padding: 12px; min-height: 240px; }
.kanban-col h3 { margin: 0 0 10px; font-size: 14px; color: var(--muted); }
.kanban-item { padding: 12px; border: 1px solid var(--line); background: #fff; border-radius: var(--radius); margin-bottom: 10px; }
.progress { height: 8px; overflow: hidden; border-radius: 999px; background: #e8edf2; }
.progress span { display: block; height: 100%; background: var(--brand); border-radius: 999px; transition: width .25s ease; }

.tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { border: 0; background: transparent; padding: 12px 10px; color: var(--muted); font-weight: 800; white-space: nowrap; }
.tabs button.active { color: var(--brand); box-shadow: inset 0 -2px var(--brand); }

.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(17,28,36,.48); }
.modal {
  width: min(1040px, 100%); max-height: 92vh; overflow: auto; background: #fff;
  border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line);
}
.modal.small { width: min(560px, 100%); }
.modal-head, .modal-foot { position: sticky; background: #fff; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-foot { bottom: 0; border-top: 1px solid var(--line); border-bottom: 0; justify-content: flex-end; }
.modal-body { padding: 18px; }

.timeline { position: relative; display: grid; gap: 12px; }
.timeline-item { display: grid; grid-template-columns: 26px 1fr; gap: 10px; }
.dot { width: 12px; height: 12px; margin: 4px auto 0; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px #e7f4f1; }
.timeline-item .card { padding: 12px; }
.doc-preview { width: 100%; height: 420px; border: 1px solid var(--line); border-radius: var(--radius); background: #f8fafc; }
.empty { display: grid; place-items: center; min-height: 220px; border: 1px dashed #cbd5e1; border-radius: var(--radius); color: var(--muted); text-align: center; padding: 24px; }
.toast { position: fixed; right: 18px; bottom: 18px; z-index: 80; padding: 12px 14px; border-radius: var(--radius); background: #111c24; color: #fff; box-shadow: var(--shadow); animation: rise .25s ease; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.branding-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.brand-card h2 { margin-top: 0; }
.upload-zone {
  position: relative; display: grid; place-items: center; min-height: 120px; padding: 14px;
  border: 1px dashed #b8c2cc; border-radius: var(--radius); background: #fbfcfd; text-align: center; overflow: hidden;
}
.upload-zone.small { min-height: 86px; }
.upload-zone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-zone img { max-width: 100%; max-height: 86px; object-fit: contain; }
.theme-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.color-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.color-field { display: grid; grid-template-columns: 44px 1fr 34px; gap: 8px; align-items: center; }
.color-field label { grid-column: 1 / -1; }
.color-field input[type="color"] { height: 42px; padding: 3px; }
.color-field span { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); }
.toggle-row { display: flex; gap: 10px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: #fbfcfd; font-weight: 700; }
.toggle-row input { width: 18px; height: 18px; }
.preview-card { grid-row: span 2; }
.mini-app { display: grid; grid-template-columns: 150px 1fr; min-height: 260px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.mini-app aside { color: #fff; padding: 18px; display: grid; align-content: start; gap: 12px; }
.mini-app main { padding: 18px; display: grid; align-content: start; gap: 14px; }
.mini-app button { width: max-content; border: 0; border-radius: var(--radius); color: #fff; padding: 10px 14px; font-weight: 800; }
.mini-card, .mini-top { border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); padding: 14px; }
.actions-card { display: flex; gap: 10px; align-items: center; justify-content: flex-end; grid-column: 1 / -1; }
.branding-preview { display: grid; gap: 14px; }
.preview-login {
  display: grid; grid-template-columns: minmax(180px, .8fr) 1fr; min-height: 280px;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.preview-login-form { padding: 18px; display: grid; align-content: center; gap: 10px; }
.preview-login-form h3, .preview-login-form p { margin: 0; }
.preview-login-form button {
  border: 0; border-radius: var(--radius); color: #fff; min-height: 38px; padding: 8px 12px; font-weight: 800;
}
.preview-login-image { position: relative; min-height: 220px; overflow: hidden; }
.preview-login-image > div { position: absolute; inset: 0; }
.live-upload img { max-width: 100%; max-height: 96px; object-fit: contain; }

.client-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  background: var(--bg);
}
.client-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 14px;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
}
.client-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
}
.client-brand strong,
.client-sidebar-foot b {
  display: block;
  line-height: 1.2;
}
.client-brand small,
.client-sidebar-foot small {
  display: block;
  color: rgba(255,255,255,.64);
  font-size: 12px;
  margin-top: 3px;
}
.client-nav {
  display: grid;
  gap: 4px;
}
.client-nav button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 0;
  border-radius: var(--radius);
  padding: 11px 12px;
  color: rgba(255,255,255,.72);
  background: transparent;
  text-align: left;
  font-weight: 750;
}
.client-nav button:hover,
.client-nav button.active {
  color: #fff;
  background: rgba(255,255,255,.12);
}
.client-nav .icon {
  width: 18px;
  height: 18px;
}
.client-sidebar-foot {
  margin-top: auto;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
  align-items: center;
  padding: 12px 8px 0;
  border-top: 1px solid rgba(255,255,255,.12);
}
.client-sidebar-foot .btn {
  grid-column: 1 / -1;
  width: 100%;
  color: #fff;
  border-color: rgba(255,255,255,.16);
}
.client-main {
  min-width: 0;
}
.client-topbar {
  position: sticky;
  top: 0;
  z-index: 6;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.client-topbar > div:first-child b,
.client-topbar > div:first-child span {
  display: block;
}
.client-topbar > div:first-child span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}
.client-content {
  width: min(1420px, 100%);
  margin: 0 auto;
  padding: 22px 24px 34px;
}
.client-hero,
.client-company-hero,
.client-module-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}
.client-hero {
  min-height: 132px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.client-eyebrow {
  display: block;
  color: var(--brand);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.client-hero h1,
.client-company-hero h1,
.client-module-head h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
}
.client-hero p,
.client-module-head p,
.client-section-head p,
.client-company-title p {
  margin: 6px 0 0;
  color: var(--muted);
}
.client-hero small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}
.client-search-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 16px 0;
}
.client-search {
  position: relative;
  flex: 1;
  max-width: 540px;
}
.client-search input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 14px 10px 40px;
  background: var(--panel);
  color: var(--ink);
}
.client-search .icon {
  position: absolute;
  left: 14px;
  top: 12px;
  color: var(--muted);
}
.client-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.client-metric {
  min-height: 104px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 14px;
  box-shadow: 0 1px 2px rgba(16,24,40,.04);
}
.client-metric-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--panel-2);
  color: var(--brand);
  margin-bottom: 12px;
}
.client-metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}
.client-metric b {
  display: block;
  margin-top: 4px;
  font-size: 26px;
}
.client-section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 10px 0 12px;
}
.client-section-head h2 {
  margin: 0;
  font-size: 18px;
}
.client-company-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.client-company-card {
  display: grid;
  gap: 12px;
  min-height: 214px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 1px 2px rgba(16,24,40,.04);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.client-company-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--brand) 30%, var(--line));
  box-shadow: 0 14px 28px rgba(16,24,40,.08);
}
.client-company-card-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}
.client-company-card h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.25;
}
.client-company-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.client-company-logo {
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--panel-2);
  color: var(--brand);
  font-weight: 850;
  overflow: hidden;
}
.client-company-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.client-company-meta {
  min-height: 26px;
}
.client-mini-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.client-mini-stats div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  padding: 9px;
}
.client-mini-stats b,
.client-mini-stats span {
  display: block;
}
.client-mini-stats span {
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}
.client-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
}
.client-status span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
}
.client-status.success { background: #e7f7ef; color: var(--success); }
.client-status.warning { background: #fff5df; color: var(--warning); }
.client-status.danger { background: #fff0ef; color: var(--danger); }
.client-company-title {
  display: flex;
  align-items: center;
  gap: 14px;
}
.client-tabs {
  margin-top: 6px;
}
.client-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
.client-info-panel,
.client-table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 1px 2px rgba(16,24,40,.04);
}
.client-info-panel {
  padding: 18px;
}
.client-info-panel h2 {
  margin: 0 0 14px;
  font-size: 18px;
}
.client-info-panel dl {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 10px 16px;
  margin: 0;
}
.client-info-panel dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.client-info-panel dd {
  margin: 0;
  min-width: 0;
}
.client-table-wrap {
  overflow: auto;
}
.client-table-wrap table {
  min-width: 760px;
}
.client-table-wrap th,
.client-table-wrap td {
  padding: 11px 12px;
}
.client-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}
.client-empty {
  display: grid;
  place-items: center;
  min-height: 160px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--panel);
  text-align: center;
  padding: 20px;
}
.company-autocomplete {
  display: grid;
  gap: 8px;
}
.company-autocomplete select {
  min-height: 42px;
}
.company-combobox {
  position: relative;
  width: 100%;
}
.company-combobox-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.company-combobox.open .company-combobox-control,
.company-combobox-control:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent);
}
.company-combobox .company-search-input {
  min-height: 42px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.company-combobox-toggle {
  border: 0;
  border-left: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
}
.company-combobox-toggle:disabled {
  cursor: not-allowed;
  opacity: .6;
}
.company-options {
  position: absolute;
  z-index: 60;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: none;
  max-height: 240px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.company-combobox.open .company-options {
  display: grid;
  gap: 4px;
}
.company-option {
  width: 100%;
  display: grid;
  gap: 2px;
  padding: 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.company-option:hover,
.company-option.selected {
  background: color-mix(in srgb, var(--brand) 10%, transparent);
}
.company-option span {
  color: var(--muted);
  font-size: 12px;
}
.company-option.empty {
  cursor: default;
  color: var(--muted);
}
.notification-wrap {
  position: relative;
}
.notification-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
}
.notification-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(360px, calc(100vw - 28px));
  max-height: 420px;
  overflow: auto;
  display: none;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow);
  z-index: 30;
}
.notification-panel.open {
  display: grid;
  gap: 6px;
}
.notification-panel-head,
.notification-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.notification-panel-head {
  padding: 8px 10px;
}
.notification-item {
  padding: 10px;
  border-radius: var(--radius);
  background: var(--panel-2);
}
.notification-item.read {
  opacity: .68;
}
.notification-panel p {
  margin: 0;
  padding: 10px;
  border-radius: var(--radius);
  background: var(--panel-2);
}
.notification-panel b,
.notification-panel small {
  display: block;
}
.notification-panel small {
  margin-top: 4px;
  color: var(--muted);
}
.btn.mini {
  min-height: 28px;
  padding: 5px 8px;
  font-size: 12px;
}
.notification-preferences {
  display: grid;
  gap: 10px;
  margin: 0;
}
.notification-preferences h2 {
  margin: 0 0 4px;
  font-size: 16px;
}
.financial-report-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.financial-company-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.managerial-filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
  align-items: end;
}
.managerial-filters .field {
  min-width: 0;
}
.managerial-kpis {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.managerial-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.managerial-chart {
  min-width: 0;
}
.managerial-chart h2,
.managerial-grid h2 {
  margin: 0;
  font-size: 17px;
}
.managerial-chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.managerial-chart-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.managerial-bars {
  display: grid;
  gap: 12px;
}
.managerial-bar-row {
  display: grid;
  gap: 7px;
}
.managerial-bar-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}
.managerial-bar-label span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.managerial-bar-label b {
  color: var(--brand);
}
.managerial-bar-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 10%, transparent);
}
.managerial-bar-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}
.managerial-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
  align-items: start;
}
.compact-table {
  margin-top: 12px;
}
.compact-table table th,
.compact-table table td {
  padding: 11px 12px;
}
.empty.compact {
  padding: 14px;
  min-height: auto;
}
.managerial-timeline {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}
.managerial-timeline-item {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
}
.managerial-timeline-item > span {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--brand) 12%, transparent);
}
.managerial-timeline-item div {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.managerial-timeline-item:last-child div {
  padding-bottom: 0;
  border-bottom: 0;
}
.managerial-timeline-item b,
.managerial-timeline-item small {
  display: block;
}
.managerial-timeline-item p {
  margin: 3px 0;
  color: var(--ink);
}
.managerial-timeline-item small {
  color: var(--muted);
}
.managerial-module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.managerial-module-grid > div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}
.managerial-module-grid > div > span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.managerial-module-grid b {
  color: var(--ink);
}
.managerial-module-grid small {
  color: var(--muted);
  text-align: right;
}

.fiscal-tabs {
  margin-top: 14px;
}

.fiscal-filter-grid {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) repeat(4, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
  margin: 16px 0;
}

.fiscal-kpis .metric,
.fiscal-alerts {
  border-color: color-mix(in srgb, var(--brand) 18%, var(--line));
}

.fiscal-alerts {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.fiscal-wizard {
  display: grid;
  gap: 14px;
}

.fiscal-wizard > .card {
  margin: 0;
  border-radius: 8px;
  box-shadow: none;
}

.fiscal-wizard h2 {
  margin: 10px 0 12px;
  font-size: 16px;
}

.fiscal-wizard .toolbar {
  flex-wrap: wrap;
}

.client-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dashboard-tabs,
.societario-tabs {
  margin: 14px 0;
}

.societario-kpis {
  margin-bottom: 16px;
}

.societario-movements {
  margin-bottom: 16px;
}

.stalled-panel {
  margin-bottom: 16px;
}

.segmented {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.segmented button {
  border: 0;
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}

.segmented button.active {
  color: var(--brand);
  background: #fff;
  box-shadow: 0 6px 18px rgba(15, 39, 71, .08);
}

.societario-result {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.card.flat {
  margin: 0;
  box-shadow: none;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.faq-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.faq-links a {
  color: var(--brand);
  font-weight: 800;
  text-decoration: none;
}

.ged-searchbar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.ged-searchbar .client-search {
  flex: 1;
  min-width: 260px;
}

.ged-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.ged-category-card {
  display: grid;
  gap: 8px;
  min-height: 168px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 10px 28px rgba(15, 39, 71, .06);
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.ged-category-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--brand) 32%, var(--line));
  box-shadow: 0 16px 36px rgba(15, 39, 71, .1);
}

.ged-folder {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 10%, #fff);
}

.ged-category-card b {
  font-size: 16px;
}

.ged-category-card strong {
  font-size: 28px;
}

.ged-category-card small,
.ged-category-summary p {
  color: var(--muted);
}

.ged-kpis,
.ged-favorites,
.essential-widget,
.essential-dashboard {
  margin-bottom: 16px;
}

.ged-doc-table {
  min-width: 760px;
}

.ged-doc-table th:nth-child(1) { width: 42%; }
.ged-doc-table th:nth-child(2) { width: 18%; }
.ged-doc-table th:nth-child(3) { width: 18%; }
.ged-doc-table th:nth-child(4) { width: 22%; }

.ged-doc-table td {
  vertical-align: top;
}

.ged-doc-table tbody tr {
  transition: background .16s ease;
}

.ged-doc-table tbody tr:hover {
  background: color-mix(in srgb, var(--brand) 3%, var(--panel));
}

.ged-doc-main {
  min-width: 260px;
}

.ged-doc-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.ged-doc-title > span {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.ged-doc-main p {
  display: -webkit-box;
  margin: 0 0 8px;
  max-width: 440px;
  overflow: hidden;
  color: var(--muted);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.ged-doc-type {
  display: inline-flex;
  margin: 0 0 8px;
  color: var(--brand);
  font-weight: 800;
}

.ged-file,
.ged-date-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
  color: var(--muted);
}

.ged-file .icon {
  width: 14px;
  height: 14px;
}

.ged-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  min-width: 160px;
}

.ged-actions .icon-btn {
  width: auto;
  min-height: 34px;
  padding: 7px 9px;
  border-radius: 8px;
  font-size: 12px;
  justify-content: center;
}

.ged-actions .icon {
  width: 15px;
  height: 15px;
}

.collapsible-widget {
  position: relative;
  margin-bottom: 16px;
}

.collapsible-widget > .card {
  margin-bottom: 0;
}

.widget-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.widget-toggle {
  min-height: 34px;
  padding: 8px 12px;
}

.widget-hidden {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  border-style: dashed;
  background: color-mix(in srgb, var(--panel-2) 72%, var(--panel));
}

.widget-hidden h2 {
  margin: 0 0 4px;
}

.widget-hidden p {
  margin: 0;
  color: var(--muted);
}

.ged-essential-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.ged-essential-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.ged-essential-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.ged-essential-card b {
  display: block;
  margin-bottom: 4px;
}

.ged-essential-card small {
  color: var(--muted);
}

.doc-compliance {
  display: grid;
  justify-items: end;
  gap: 2px;
}

.doc-compliance b {
  font-size: 24px;
}

.doc-compliance span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.essential-alerts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

@media (max-width: 1060px) {
  .app-shell { grid-template-columns: 80px 1fr; }
  .sidebar { padding: 16px 10px; }
  .sidebar .logo-row div:not(.brand-mark), .nav span, .sidebar-foot { display: none; }
  .nav button { justify-content: center; }
  .kpis, .split { grid-template-columns: 1fr 1fr; }
  .managerial-filters,
  .managerial-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .managerial-charts,
  .managerial-grid {
    grid-template-columns: 1fr;
  }
  .fiscal-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ged-searchbar {
    align-items: stretch;
    flex-direction: column;
  }
  .ged-doc-table {
    min-width: 680px;
  }
  .ged-actions {
    grid-template-columns: 1fr;
    min-width: 118px;
  }
  .widget-hidden {
    align-items: stretch;
    flex-direction: column;
  }
  .client-shell { grid-template-columns: 78px minmax(0, 1fr); }
  .client-sidebar { padding: 14px 10px; }
  .client-brand div:not(.brand-mark), .client-nav span, .client-sidebar-foot div:not(.avatar), .client-sidebar-foot .btn { display: none; }
  .client-brand { justify-content: center; padding: 4px 0; }
  .client-nav button { justify-content: center; }
  .client-sidebar-foot { display: flex; justify-content: center; padding-top: 12px; }
  .client-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .client-company-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-3 { grid-column: span 2; }
}
@media (max-width: 720px) {
  .auth-shell, .app-shell, .kpis, .split, .form-grid, .preview-login { grid-template-columns: 1fr; }
  .auth-visual { min-height: 360px; order: -1; }
  .sidebar { position: static; height: auto; flex-direction: row; overflow-x: auto; }
  .sidebar .logo-row { min-width: 58px; }
  .nav { grid-auto-flow: column; grid-auto-columns: 48px; }
  .main { min-width: 0; }
  .topbar { height: auto; padding: 14px; align-items: stretch; flex-direction: column; }
  .content { padding: 18px 14px; }
  .page-head { flex-direction: column; }
  .span-2, .span-3 { grid-column: span 1; }
  .kanban { grid-template-columns: 1fr; }
  .branding-grid, .color-grid, .mini-app { grid-template-columns: 1fr; }
  .actions-card { justify-content: stretch; flex-direction: column; }
  .actions-card .btn { width: 100%; }
  .managerial-filters,
  .managerial-kpis,
  .managerial-charts,
  .managerial-grid,
  .fiscal-filter-grid {
    grid-template-columns: 1fr;
  }
  .managerial-chart-head {
    flex-direction: column;
  }
  .client-shell { grid-template-columns: 1fr; }
  .client-sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    gap: 10px;
  }
  .client-brand { min-width: 48px; }
  .client-nav {
    grid-auto-flow: column;
    grid-auto-columns: 48px;
    align-items: center;
  }
  .client-sidebar-foot { display: none; }
  .client-topbar {
    position: static;
    height: auto;
    padding: 12px 14px;
  }
  .client-content { padding: 16px 14px 24px; }
  .client-hero,
  .client-company-hero,
  .client-module-head,
  .client-search-panel,
  .client-section-head {
    align-items: stretch;
    flex-direction: column;
  }
  .client-hero { min-height: auto; padding-bottom: 14px; }
  .client-metrics,
  .client-company-grid {
    grid-template-columns: 1fr;
  }
  .client-info-panel dl {
    grid-template-columns: 1fr;
  }
}
