:root {
  --brand: #009a44;
  --brand-2: #00b350;
  --brand-soft: #e3f5ea;
  --gold: #e0b400;
  --gold-soft: #fdf6d6;
  --red: #ce1126;
  --yellow: #f7d116;
  --navy: #0f2c52;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --border: #e6e9ee;
  --border-2: #d5dae2;
  --text: #11161d;
  --text-2: #3f4a5a;
  --muted: #79808c;
  --danger: #c0392b;
  --danger-soft: #fbeae8;
  --warn: #b7791f;
  --warn-soft: #fdf3e1;
  --ok: #1f8a4c;
  --ok-soft: #e5f5ec;
  --info: #2563a8;
  --info-soft: #e7f0fa;
  --side: #0f2c52;
  --side-text: #b8c7dc;
  --side-active: #ffffff;
  --shadow: 0 1px 2px rgba(15, 44, 82, 0.06);
  --shadow-lg: 0 12px 40px rgba(15, 44, 82, 0.2);
  --radius: 8px;
  --radius-sm: 6px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}
:root[data-theme='dark'] {
  --brand: #1fc467;
  --brand-2: #3ad67e;
  --brand-soft: #0f3020;
  --red: #ff4d63;
  --yellow: #f7d116;
  --navy: #cfe0ff;
  --gold: #e8b04a;
  --gold-soft: #3a2f18;
  --bg: #0b1422;
  --surface: #111c2e;
  --surface-2: #15223a;
  --border: #22314a;
  --border-2: #2d3f5c;
  --text: #e6eeeb;
  --text-2: #b0c0ba;
  --muted: #7f928b;
  --danger: #f07167;
  --danger-soft: #3a1c1a;
  --warn: #e8b04a;
  --warn-soft: #362b16;
  --ok: #4cc987;
  --ok-soft: #173325;
  --info: #6aa8ef;
  --info-soft: #172a40;
  --side: #081a33;
  --side-text: #9fb1cc;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
}
body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a {
  color: var(--brand);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
h1,
h2,
h3,
h4 {
  margin: 0;
  letter-spacing: -0.01em;
}
h1 {
  font-size: 22px;
}
h2 {
  font-size: 17px;
}
h3 {
  font-size: 15px;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
svg.i {
  width: 18px;
  height: 18px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 12px;
}
.nowrap {
  white-space: nowrap;
}
.right {
  text-align: right;
}
.row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.grow {
  flex: 1;
  min-width: 0;
}
.wrap {
  flex-wrap: wrap;
}
.between {
  justify-content: space-between;
}
.hidden {
  display: none !important;
}
.ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- layout ---------- */
.app {
  display: grid;
  grid-template-columns: 232px 1fr;
  height: 100vh;
}
.side {
  background: var(--side);
  color: var(--side-text);
  display: flex;
  flex-direction: column;
  padding: 14px 10px;
  overflow-y: auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 18px;
  color: #fff;
}
/* Logo square: the BISSAU7VEN mark (SVG) or an uploaded logo. */
.logo {
  display: block;
  width: 36px;
  height: 36px;
  flex: none;
  overflow: hidden;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(15, 44, 82, 0.12);
}
.logo.lg {
  width: 64px;
  height: 64px;
  border-radius: 14px;
}
.logo svg,
.logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.brand .name {
  min-width: 0;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.15;
  white-space: nowrap;
}
.brand .name small {
  display: block;
  font-weight: 500;
  font-size: 11px;
  color: var(--side-text);
  letter-spacing: 0.04em;
}
.nav-sec {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #7d93b5;
  padding: 14px 10px 6px;
  font-weight: 600;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--side-text);
  font-weight: 500;
  text-decoration: none;
  margin-bottom: 1px;
}
.nav a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
.nav a.active {
  background: rgba(0, 154, 68, 0.24);
  color: var(--side-active);
  box-shadow: inset 3px 0 0 #f7d116;
}
.nav a.active svg {
  color: #3ad67e;
}
.nav a .count {
  margin-left: auto;
  background: #f7d116;
  color: #1d1405;
  font-size: 11px;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 7px;
}
.side-foot {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.me {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  color: #fff;
}
.me:hover {
  background: rgba(255, 255, 255, 0.06);
}
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
}
.top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
}
.search-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  max-width: 460px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  text-align: left;
}
.search-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-btn kbd {
  white-space: nowrap;
  margin-left: auto;
  font-size: 11px;
  border: 1px solid var(--border-2);
  border-radius: 5px;
  padding: 1px 6px;
  background: var(--surface);
}
.content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}
.page {
  max-width: 1320px;
  margin: 0 auto;
}
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.page-head p {
  margin: 4px 0 0;
  color: var(--muted);
}
.btn.menu-toggle {
  display: none;
}

/* ---------- controls ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-2);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none !important;
  line-height: 1.2;
}
.btn:hover {
  background: var(--surface-2);
  border-color: var(--muted);
}
.btn svg.i {
  width: 16px;
  height: 16px;
}
.btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
:root[data-theme='dark'] .btn.primary {
  color: #06140f;
}
.btn.primary:hover {
  background: var(--brand-2);
  border-color: var(--brand-2);
}
.btn.gold {
  background: var(--gold);
  border-color: var(--gold);
  color: #1d1405;
}
.btn.danger {
  color: var(--danger);
}
.btn.danger:hover {
  background: var(--danger-soft);
  border-color: var(--danger);
}
.btn.ghost {
  border-color: transparent;
  background: transparent;
}
.btn.ghost:hover {
  background: var(--surface-2);
}
.btn.sm {
  padding: 5px 10px;
  font-size: 12.5px;
}
.btn.icon {
  padding: 7px;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.input,
select.input,
textarea.input {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  background: var(--surface);
  outline: none;
}
.input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}
textarea.input {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}
label.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
}
label.field .hint {
  font-weight: 400;
  color: var(--muted);
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-grid .full {
  grid-column: 1 / -1;
}
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 500;
}
.check input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
}
.seg {
  display: inline-flex;
  border: 1px solid var(--border-2);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}
.seg button {
  border: 0;
  background: none;
  padding: 7px 12px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-2);
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.seg button + button {
  border-left: 1px solid var(--border-2);
}
.seg button.on {
  background: var(--brand-soft);
  color: var(--brand);
}

/* ---------- cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.card-h h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-b {
  padding: 16px;
}
.grid {
  display: grid;
  gap: 16px;
}
.g2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.g3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.g4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.g-main {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}
.kpi {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.kpi .lbl {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 7px;
}
.kpi .lbl svg {
  width: 16px;
  height: 16px;
  color: var(--brand);
}
.kpi .val {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.kpi .sub {
  font-size: 12px;
  color: var(--muted);
}
.empty {
  text-align: center;
  padding: 38px 16px;
  color: var(--muted);
}
.empty svg.i {
  width: 34px;
  height: 34px;
  color: var(--border-2);
  margin-bottom: 8px;
}
.empty h3 {
  color: var(--text);
  margin-bottom: 4px;
}

/* ---------- tables ---------- */
.table-wrap {
  overflow-x: auto;
}
table.t {
  width: 100%;
  border-collapse: collapse;
}
table.t th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 600;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  white-space: nowrap;
  cursor: default;
  user-select: none;
}
table.t th.sort {
  cursor: pointer;
}
table.t th.sort:hover {
  color: var(--text);
}
table.t td {
  padding: 10px 14px;
  font-variant-numeric: tabular-nums;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.t tr:last-child td {
  border-bottom: 0;
}
table.t tbody tr.click {
  cursor: pointer;
}
table.t tbody tr.click:hover {
  background: var(--surface-2);
}
.toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.toolbar .input {
  width: auto;
}
.search-in {
  position: relative;
  flex: 1;
  min-width: 180px;
  max-width: 340px;
}
.search-in svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  width: 16px;
  height: 16px;
}
.search-in input {
  padding-left: 32px;
  width: 100%;
}

/* ---------- badges, avatars ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 650;
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.badge.ok {
  background: var(--ok-soft);
  color: var(--ok);
  border-color: transparent;
}
.badge.warn {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: transparent;
}
.badge.danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: transparent;
}
.badge.info {
  background: var(--info-soft);
  color: var(--info);
  border-color: transparent;
}
.badge.brand {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: transparent;
}
.badge.gold {
  background: var(--gold-soft);
  color: var(--warn);
  border-color: transparent;
}
.tag {
  display: inline-block;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 5px;
  background: var(--gold-soft);
  color: var(--warn);
  font-weight: 600;
  margin-right: 4px;
}
.av {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
  color: #fff;
  flex: none;
}
.av.lg {
  width: 56px;
  height: 56px;
  font-size: 20px;
}
.av.sm {
  width: 24px;
  height: 24px;
  font-size: 10px;
}
.av.sq {
  border-radius: 9px;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex: none;
}
.progress {
  height: 6px;
  border-radius: 4px;
  background: var(--border);
  overflow: hidden;
}
.progress > i {
  display: block;
  height: 100%;
  background: var(--brand);
  border-radius: 4px;
}

/* ---------- lists ---------- */
.list {
  display: flex;
  flex-direction: column;
}
.li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
}
.li:last-child {
  border-bottom: 0;
}
.li.click {
  cursor: pointer;
}
.li.click:hover {
  background: var(--surface-2);
}
.li .t1 {
  font-weight: 600;
}
.li .t2 {
  font-size: 12.5px;
  color: var(--muted);
}

/* ---------- timeline ---------- */
.tl {
  position: relative;
  padding-left: 8px;
}
.tl-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  position: relative;
}
.tl-item::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 40px;
  bottom: -10px;
  width: 2px;
  background: var(--border);
}
.tl-item:last-child::before {
  display: none;
}
.tl-ic {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  flex: none;
  z-index: 1;
}
.tl-ic svg {
  width: 15px;
  height: 15px;
}
.tl-ic.call {
  background: var(--info-soft);
  color: var(--info);
  border-color: transparent;
}
.tl-ic.email {
  background: var(--gold-soft);
  color: var(--warn);
  border-color: transparent;
}
.tl-ic.meeting {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: transparent;
}
.tl-ic.note {
  background: var(--surface-2);
}
.tl-body {
  flex: 1;
  min-width: 0;
}
.tl-body .meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.tl-body .txt {
  white-space: pre-wrap;
  word-wrap: break-word;
}
.composer {
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.composer textarea {
  border: 0;
  width: 100%;
  padding: 12px;
  min-height: 70px;
  resize: vertical;
  outline: none;
  background: transparent;
}
.composer .bar {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 8px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  flex-wrap: wrap;
}

/* ---------- detail pages ---------- */
.detail {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.profile {
  padding: 20px;
}
.profile .head {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
}
.kv {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 9px 10px;
  font-size: 13px;
}
.kv dt {
  color: var(--muted);
}
.kv dd {
  margin: 0;
  word-break: break-word;
}
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  padding: 0 12px;
  overflow-x: auto;
}
.tabs button {
  border: 0;
  background: none;
  padding: 12px 12px;
  cursor: pointer;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.tabs button.on {
  color: var(--brand);
  border-color: var(--brand);
}
.tabs button .n {
  font-size: 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 6px;
  color: var(--text-2);
}
.crumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 10px;
}

/* ---------- kanban ---------- */
.kanban {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(250px, 1fr);
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 12px;
  align-items: start;
}
.kcol {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 210px);
}
.kcol-h {
  padding: 12px 12px 10px;
  border-bottom: 1px solid var(--border);
}
.kcol-h .row {
  font-weight: 700;
}
.kcol-h .sum {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}
.kcol-b {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  min-height: 80px;
}
.kcol.over {
  outline: 2px dashed var(--brand);
  outline-offset: -2px;
  background: var(--brand-soft);
}
.kcard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 11px 12px;
  cursor: grab;
  box-shadow: var(--shadow);
}
.kcard:hover {
  border-color: var(--border-2);
}
.kcard.dragging {
  opacity: 0.45;
}
.kcard .t {
  font-weight: 650;
  margin-bottom: 4px;
}
.kcard .v {
  font-weight: 700;
  color: var(--brand);
}
.kcard .m {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  gap: 6px;
}

/* ---------- calendar ---------- */
.cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}
.cal .dow {
  padding: 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.cal .day {
  min-height: 104px;
  padding: 6px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  overflow: hidden;
}
.cal .day.out {
  background: var(--surface-2);
  color: var(--muted);
}
.cal .day.today .num {
  background: var(--brand);
  color: #fff;
}
.cal .num {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-weight: 600;
  margin-bottom: 3px;
}
.cal .ev {
  display: block;
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 2px;
  font-size: 11.5px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--brand-soft);
  color: var(--brand);
}
.cal .ev.deal {
  background: var(--gold-soft);
  color: var(--warn);
}
.cal .ev.done {
  text-decoration: line-through;
  opacity: 0.6;
}

/* ---------- documents ---------- */
.docs-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.folders a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border-radius: 7px;
  color: var(--text-2);
  font-weight: 500;
  text-decoration: none;
}
.folders a:hover {
  background: var(--surface-2);
}
.folders a.on {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 650;
}
.folders a .n {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--muted);
}
.dropzone {
  border: 2px dashed var(--border-2);
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
  color: var(--muted);
  transition: 0.15s;
  cursor: pointer;
}
.dropzone.over,
.dropzone:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}
.ficon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  flex: none;
  letter-spacing: 0.02em;
}

/* ---------- modal, toast, palette ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 18, 14, 0.5);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 16px;
  z-index: 50;
  overflow-y: auto;
  animation: fade 0.12s;
}
.modal {
  background: var(--surface);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  animation: pop 0.15s;
  display: flex;
  flex-direction: column;
  max-height: 88vh;
}
.modal.wide {
  max-width: 860px;
}
.modal.xwide {
  max-width: 1100px;
}
.modal-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-b {
  padding: 20px;
  overflow-y: auto;
}
.modal-f {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 0 0 10px 10px;
  flex-wrap: wrap;
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
@keyframes pop {
  from {
    transform: translateY(8px) scale(0.98);
    opacity: 0;
  }
}
.toasts {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
}
.toast {
  background: var(--text);
  color: var(--bg);
  padding: 11px 16px;
  border-radius: 9px;
  box-shadow: var(--shadow-lg);
  font-weight: 550;
  display: flex;
  gap: 9px;
  align-items: center;
  animation: pop 0.2s;
  max-width: 380px;
}
.toast.err {
  background: var(--danger);
  color: #fff;
}
.toast.ok svg {
  color: #45d1a1;
}
.palette {
  max-width: 620px;
}
.palette input {
  border: 0;
  border-bottom: 1px solid var(--border);
  padding: 16px 18px;
  font-size: 16px;
  width: 100%;
  outline: none;
  background: transparent;
  border-radius: 14px 14px 0 0;
}
.palette .res {
  max-height: 56vh;
  overflow-y: auto;
  padding: 6px;
}
.palette .it {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.palette .it.sel {
  background: var(--brand-soft);
}
.palette .grp {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  padding: 10px 12px 4px;
  font-weight: 600;
}
.dropdown {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 40;
  min-width: 200px;
}
.dropdown button {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
  border: 0;
  background: none;
  padding: 8px 10px;
  border-radius: 7px;
  cursor: pointer;
  text-align: left;
  font-weight: 500;
}
.dropdown button:hover {
  background: var(--surface-2);
}
.dropdown hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 5px 0;
}

/* ---------- charts ---------- */
.chart {
  width: 100%;
}
.chart .bar {
  transition: opacity 0.1s;
}
.chart .bar:hover {
  opacity: 0.8;
}
.chart text {
  fill: var(--muted);
  font-size: 11px;
  font-family: var(--font);
}
.chart .grid-l {
  stroke: var(--border);
  stroke-width: 1;
}
.chart-tip {
  position: fixed;
  pointer-events: none;
  background: var(--text);
  color: var(--bg);
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 12px;
  z-index: 90;
  box-shadow: var(--shadow-lg);
  white-space: nowrap;
}
.hbar {
  display: grid;
  grid-template-columns: 130px 1fr 110px;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 13px;
}
.hbar .track {
  height: 12px;
  border-radius: 0 4px 4px 0;
  background: transparent;
}
.hbar .fill {
  height: 100%;
  border-radius: 0 4px 4px 0;
  background: var(--brand);
  min-width: 2px;
}

/* ---------- templates / editor ---------- */
.editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}
.code {
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  font-size: 13px;
  min-height: 520px !important;
}
.paper {
  background: #fff;
  color: #1c2125;
  padding: 40px 44px;
  border-radius: 6px;
  box-shadow: var(--shadow);
  min-height: 520px;
  font-size: 13px;
  line-height: 1.6;
  border: 1px solid var(--border);
}
.paper h1 {
  font-size: 22px;
  margin: 0 0 10px;
}
.paper h2 {
  font-size: 15px;
  color: #0b6b4f;
  margin: 16px 0 4px;
}
.paper p {
  margin: 0 0 10px;
}
.paper ul {
  margin: 0 0 10px;
  padding-left: 20px;
}
.paper .sigph {
  display: inline-block;
  border-bottom: 1px solid #888;
  width: 220px;
  height: 34px;
  margin: 8px 0 2px;
  position: relative;
}
.paper .sigph span {
  position: absolute;
  bottom: -18px;
  left: 0;
  font-size: 10px;
  color: #777;
  white-space: nowrap;
}
.paper .sigwrap {
  margin-bottom: 22px;
}
.paper .mf {
  background: #fff4d6;
  border-radius: 3px;
  padding: 0 2px;
  color: #7a5200;
}
.paper .mf.fill {
  background: #e3f0ff;
  color: #1d4f91;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  border: 1px solid var(--border-2);
  background: var(--surface);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 12px;
  cursor: pointer;
  font-family: ui-monospace, Consolas, monospace;
}
.chip:hover {
  border-color: var(--brand);
  color: var(--brand);
}

/* ---------- pdf / signature editor ---------- */
.sig-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.sig-side {
  position: sticky;
  top: 0;
}
.pdf-pages {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--surface-2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.pdf-page {
  position: relative;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  background: #fff;
}
.pdf-page canvas {
  display: block;
  width: 100%;
  height: auto;
}
.pdf-page .pnum {
  position: absolute;
  top: -1px;
  right: -1px;
  font-size: 11px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  padding: 2px 7px;
  border-radius: 0 0 0 6px;
}
.fld {
  position: absolute;
  border: 2px solid;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: move;
  user-select: none;
  overflow: hidden;
  touch-action: none;
}
.fld .x {
  position: absolute;
  top: -1px;
  right: -1px;
  width: 16px;
  height: 16px;
  font-size: 12px;
  line-height: 14px;
  text-align: center;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border-radius: 0 0 0 4px;
  cursor: pointer;
  display: none;
}
.fld:hover .x,
.fld.sel .x {
  display: block;
}
.fld .rz {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 10px;
  height: 10px;
  cursor: nwse-resize;
  background: currentColor;
  opacity: 0.6;
}
.fld.sel {
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.18);
}
.placing .pdf-page {
  cursor: crosshair;
}
.signer-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  background: var(--surface);
}
.signer-pill.on {
  border-color: currentColor;
  box-shadow: inset 0 0 0 1px currentColor;
}
.palette-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.palette-btns button {
  display: flex;
  align-items: center;
  gap: 7px;
  justify-content: flex-start;
}
.palette-btns button.on {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand);
}

/* ---------- quote editor ---------- */
.items td {
  padding: 6px 6px;
}
.items .input {
  padding: 6px 8px;
}
.totals {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 24px;
  margin-left: auto;
  width: 320px;
  font-size: 14px;
}
.totals .grand {
  font-size: 18px;
  font-weight: 750;
  color: var(--brand);
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

/* ---------- auth ---------- */
.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--bg);
}
.auth .card {
  width: 100%;
  max-width: 420px;
  padding: 32px;
}
.auth .brand {
  color: var(--text);
  padding: 0 0 20px;
}
.auth .brand .name small {
  color: var(--muted);
}
.err-box {
  background: var(--danger-soft);
  color: var(--danger);
  padding: 9px 12px;
  border-radius: 8px;
  font-weight: 550;
  font-size: 13px;
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .g4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .g-main,
  .detail,
  .editor-layout,
  .sig-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .sig-side {
    position: static;
  }
}
@media (max-width: 820px) {
  .app {
    grid-template-columns: 1fr;
  }
  .side {
    position: fixed;
    inset: 0 auto 0 0;
    width: 250px;
    z-index: 60;
    transform: translateX(-100%);
    transition: transform 0.2s;
  }
  .side.open {
    transform: none;
    box-shadow: var(--shadow-lg);
  }
  .btn.menu-toggle {
    display: inline-flex;
  }
  .content {
    padding: 16px;
  }
  .top {
    padding: 10px 16px;
  }
  .g2,
  .g3,
  .docs-layout,
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .search-btn kbd,
  .hide-sm {
    display: none;
  }
  .hbar {
    grid-template-columns: 90px 1fr 90px;
  }
  .totals {
    width: 100%;
  }
}
@media (max-width: 520px) {
  .g4 {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media print {
  .side,
  .top {
    display: none;
  }
  .app {
    display: block;
  }
}

/* ---------- BISSAU7VEN ---------- */
.flag {
  height: 4px;
  display: flex;
  flex: none;
}
.flag i {
  flex: 1;
}
.flag i:nth-child(1) {
  background: #ce1126;
}
.flag i:nth-child(2) {
  background: #f7d116;
}
.flag i:nth-child(3) {
  background: #009a44;
}
.side .flag {
  margin: -14px -10px 12px;
}
.wordmark {
  font-weight: 800;
  letter-spacing: -0.01em;
}
.wordmark .r {
  color: #ce1126;
}
.wordmark .y {
  color: #e0b400;
}
.wordmark .g {
  color: #009a44;
}
.side .wordmark .r {
  color: #ff5a6e;
}
.side .wordmark .y {
  color: #f7d116;
}
.side .wordmark .g {
  color: #3ad67e;
}
.bell {
  position: relative;
}
.bell .dotn {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
  padding: 0 4px;
}
.notif-panel {
  position: fixed;
  top: 58px;
  right: 16px;
  width: 380px;
  max-width: calc(100vw - 32px);
  max-height: 70vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  z-index: 45;
}
.notif {
  display: flex;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.notif:hover {
  background: var(--surface-2);
}
.notif.unread {
  background: var(--brand-soft);
}
.notif .b {
  font-size: 12.5px;
  color: var(--text-2);
  white-space: pre-wrap;
  max-height: 90px;
  overflow: hidden;
}
.chat {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 16px;
  height: calc(100vh - 150px);
  min-height: 480px;
}
.chat-list {
  overflow: auto;
}
.chat-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.chat-msgs {
  flex: 1;
  overflow: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.bubble {
  max-width: 82%;
  padding: 10px 13px;
  border-radius: 10px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.bubble.me {
  align-self: flex-end;
  background: var(--brand);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.bubble.bot {
  align-self: flex-start;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.bubble .acts {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.chat-input {
  border-top: 1px solid var(--border);
  padding: 12px;
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.chat-input textarea {
  flex: 1;
  resize: none;
  min-height: 44px;
  max-height: 160px;
}
.typing {
  display: inline-flex;
  gap: 4px;
}
.typing i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  animation: blink 1.2s infinite;
}
.typing i:nth-child(2) {
  animation-delay: 0.2s;
}
.typing i:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes blink {
  50% {
    opacity: 0.2;
  }
}
.starter {
  text-align: left;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
}
.starter:hover {
  border-color: var(--brand);
}
.bot-mark {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
  flex: none;
}
.bot-mark.sm {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}
.bot-mark svg.i {
  width: 20px;
  height: 20px;
}
.mail {
  display: grid;
  grid-template-columns: 190px minmax(260px, 380px) minmax(0, 1fr);
  height: calc(100vh - 170px);
  min-height: 480px;
  overflow: hidden;
}
.mail > div {
  border-right: 1px solid var(--border);
  overflow: auto;
}
.mail > div:last-child {
  border-right: 0;
}
.mail-item {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.mail-item:hover {
  background: var(--surface-2);
}
.mail-item.on {
  background: var(--brand-soft);
}
.mail-item.unread .s {
  font-weight: 700;
}
.mail-item .s {
  font-size: 13.5px;
}
.mail-item .f {
  font-size: 12.5px;
  color: var(--text-2);
}
.mail-item .d {
  font-size: 11.5px;
  color: var(--muted);
}
.mail-body iframe {
  width: 100%;
  border: 0;
  min-height: 55vh;
  background: #fff;
  border-radius: 8px;
}
.wa-msg {
  padding: 7px 11px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  margin-bottom: 6px;
  max-width: 92%;
  font-size: 13px;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.wa-msg b {
  color: var(--brand);
  font-size: 12px;
}
.wa-msg .t {
  font-size: 11px;
  color: var(--muted);
  margin-left: 6px;
}
.wa-msg.sys {
  background: transparent;
  border-style: dashed;
  color: var(--muted);
  font-size: 12px;
}
.sum-sec h4 {
  margin: 16px 0 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  display: flex;
  gap: 6px;
  align-items: center;
}
.sum-sec ul {
  margin: 0;
  padding-left: 18px;
  line-height: 1.6;
}
.post-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.post-card .txt {
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.5;
}
.net {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  color: #fff;
  white-space: nowrap;
}
.flow-step {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  background: var(--surface);
}
.flow-step.trig {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.flow-arrow {
  width: 2px;
  height: 18px;
  background: var(--border-2);
  margin: 0 auto;
}
.role-pill {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  font-weight: 650;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(15, 44, 82, 0.08);
  color: var(--navy);
}
.briefing {
  white-space: pre-wrap;
  line-height: 1.6;
  font-size: 13.5px;
}
.md p {
  margin: 0 0 8px;
}
.md ul {
  margin: 0 0 8px;
  padding-left: 18px;
}
.md h3,
.md h4 {
  margin: 10px 0 6px;
  font-size: 14px;
}
@media (max-width: 1100px) {
  .mail {
    grid-template-columns: 1fr;
    height: auto;
  }
  .mail > div {
    max-height: 60vh;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .chat {
    grid-template-columns: 1fr;
    height: auto;
  }
  .chat-list {
    max-height: 200px;
  }
  .chat-main {
    height: 70vh;
  }
}

/* ---------- Sidebar header and mobile menu ---------- */
.side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.side-head .brand-slot {
  min-width: 0;
}
.side-close {
  display: none;
  color: var(--side-text);
}
.side-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.side-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(8, 18, 34, 0.5);
  animation: fade 0.15s;
}
.side-backdrop[hidden] {
  display: none;
}
@media (max-width: 820px) {
  .side {
    width: min(280px, 86vw);
    padding-top: 14px;
  }
  .side.open {
    box-shadow: 8px 0 32px rgba(8, 18, 34, 0.35);
  }
  .side-close {
    display: inline-flex;
  }
  .side .nav a {
    padding: 10px 10px;
  }
  body.menu-open {
    overflow: hidden;
  }
}
@media (prefers-reduced-motion: reduce) {
  .side,
  .side-backdrop {
    transition: none;
    animation: none;
  }
}
