:root {
  --sidebar: 248px;
  --sidebar-collapsed: 76px;
  --ink: #101323;
  --muted: #667085;
  --line: #d9deea;
  --bg: #f4f6f9;
  --panel: #ffffff;
  --accent: #4f46e5;
  --accent-dark: #3730a3;
  --teal: #0f766e;
  --amber: #b45309;
  --shadow: 0 14px 34px rgba(16, 19, 35, .08);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font: 13px/1.32 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: inherit; text-decoration: none; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  background: #12162a;
  color: #fff;
  padding: 12px 10px;
  z-index: 2;
  transition: width .2s ease;
  box-shadow: 12px 0 30px rgba(16, 19, 35, .18);
  overflow-y: auto;
}
.brand-row {
  height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  font-weight: 900;
  flex: 0 0 auto;
}
.brand-text { font-size: 17px; line-height: 1.05; font-weight: 900; flex: 1; }
.icon-button {
  width: 32px;
  height: 32px;
  padding: 0;
  border-color: rgba(255,255,255,.14);
  background: rgba(255,255,255,.08);
  color: #fff;
}
.sidebar nav { display: grid; gap: 10px; padding-bottom: 18px; }
.menu-group {
  display: grid;
  gap: 6px;
}
.menu-group-toggle {
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 7px;
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.78);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font: inherit;
}
.menu-group-toggle span,
.menu-group-toggle i {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(255,255,255,.08);
  flex: 0 0 auto;
}
.menu-group-toggle strong {
  flex: 1;
  text-align: left;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.menu-group-toggle i {
  width: 22px;
  height: 22px;
  font-style: normal;
  transition: transform .18s ease;
}
.menu-group-toggle:hover {
  background: rgba(255,255,255,.09);
  color: #fff;
}
.menu-items {
  display: none;
  gap: 3px;
  padding-left: 8px;
}
.menu-group.is-open .menu-items {
  display: grid;
}
.menu-group.is-open .menu-group-toggle {
  background: rgba(79,70,229,.22);
  color: #fff;
}
.menu-group.is-open .menu-group-toggle i {
  transform: rotate(180deg);
}
.sidebar a {
  min-height: 32px;
  padding: 6px 9px;
  border-radius: 7px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 11px;
  color: rgba(255,255,255,.82);
}
.sidebar a span {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(255,255,255,.08);
  flex: 0 0 auto;
}
.sidebar a:hover { background: rgba(255,255,255,.10); color: #fff; }
.sidebar.is-collapsed { width: var(--sidebar-collapsed); }
.sidebar.is-collapsed .brand-text,
.sidebar.is-collapsed nav strong,
.sidebar.is-collapsed .menu-group-toggle i { display: none; }
.sidebar.is-collapsed .brand-row { justify-content: center; }
.sidebar.is-collapsed .menu-toggle { position: absolute; left: 20px; bottom: 16px; }
.sidebar.is-collapsed a,
.sidebar.is-collapsed .menu-group-toggle { justify-content: center; padding-inline: 8px; }
.sidebar.is-collapsed a span { background: rgba(255,255,255,.12); }
.sidebar.is-collapsed nav { gap: 10px; }
.sidebar.is-collapsed .menu-group { gap: 8px; }
.sidebar.is-collapsed .menu-items { padding-left: 0; }
.topbar {
  position: fixed;
  left: var(--sidebar);
  right: 0;
  top: 0;
  height: 46px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 24px;
  z-index: 1;
  transition: left .2s ease;
}
.sidebar.is-collapsed + .topbar { left: var(--sidebar-collapsed); }
body.calendar-focus .sidebar,
body.calendar-focus .topbar {
  display: none;
}
body.calendar-focus .app-shell,
body.calendar-focus .sidebar.is-collapsed ~ .app-shell {
  margin-left: 0;
  padding: 28px 20px 18px;
}
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
}
.profile { color: var(--muted); font-size: 12px; }
.app-shell { margin-left: var(--sidebar); padding: 64px 18px 22px; transition: margin-left .2s ease; }
.sidebar.is-collapsed ~ .app-shell { margin-left: var(--sidebar-collapsed); }
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #231b45, #3b2b72 48%, #0f766e);
}
.login-panel {
  width: min(420px, calc(100vw - 32px));
  background: #fff;
  border-radius: 8px;
  padding: 32px;
  box-shadow: 0 24px 80px rgba(0,0,0,.22);
}
.login-panel h1 { margin: 0 0 4px; font-size: 30px; }
.login-panel p { color: var(--muted); margin: 0 0 24px; }
.form-stack, .form-grid { display: grid; gap: 12px; }
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 980px; }
.inner-form-grid { max-width: none; margin-top: 14px; }
.form-row-three {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.form-section {
  margin: 12px 0 0;
  font-size: 15px;
  color: var(--accent-dark);
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}
label { display: grid; gap: 5px; font-weight: 700; font-size: 12px; }
textarea { min-height: 120px; resize: vertical; }
.wide { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.check input { width: auto; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
legend { font-weight: 800; }
.permission-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 8px; }
.button, button {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 11px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.button-group { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 10px 20px rgba(79, 70, 229, .22); }
.primary:hover { background: var(--accent-dark); }
.danger { background: #dc2626; border-color: #dc2626; color: #fff; margin-right: auto; }
.danger:hover { background: #b91c1c; }
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.page-head h1 { margin: 0; font-size: 24px; }
.eyebrow { color: var(--accent-dark); text-transform: uppercase; font-size: 10px; font-weight: 900; letter-spacing: .08em; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.metrics article, .table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  box-shadow: var(--shadow);
}
.metrics strong { display: block; font-size: 22px; }
.metrics span { color: var(--muted); }
.table-wrap { overflow-x: auto; }
.table-pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
}
.table-pagination label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.table-pagination select {
  width: auto;
  min-width: 76px;
  height: 34px;
  padding: 5px 28px 5px 9px;
  font-size: 12px;
}
.table-pagination button {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 12px;
}
.table-pagination button:disabled {
  cursor: not-allowed;
  opacity: .45;
}
.table-pagination-status {
  min-width: 96px;
  text-align: center;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(280px, .85fr) minmax(420px, 1.15fr);
  gap: 12px;
  margin-bottom: 12px;
}
.dashboard-grid.single {
  grid-template-columns: minmax(280px, 520px);
}
.card-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.card-headline h2 {
  margin: 0;
}
.card-headline .toolbar {
  margin: 0;
}
.stage-pill {
  --stage-color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--stage-color) 14%, white);
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
}
.stage-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--stage-color);
}
.stage-pill.closed {
  --stage-color: #0f766e;
  background: #dcfce7;
  color: #166534;
}
.monthly-chart {
  min-height: 190px;
  display: grid;
  grid-template-columns: repeat(12, minmax(34px, 1fr));
  align-items: end;
  gap: 8px;
  padding-top: 8px;
}
.month-bar {
  display: grid;
  gap: 5px;
  align-items: end;
  min-width: 0;
}
.bar-track {
  height: 128px;
  display: flex;
  align-items: end;
  border-radius: 6px;
  background: #eef2f7;
  overflow: hidden;
}
.bar-track span {
  width: 100%;
  min-height: 4px;
  display: block;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--accent), #0f766e);
}
.month-bar strong,
.month-bar small {
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.month-bar strong {
  font-size: 10px;
  text-transform: uppercase;
}
.month-bar small {
  color: var(--muted);
  font-size: 9px;
}
.quota-toolbar {
  margin: 0;
  justify-content: flex-end;
}
.quota-toolbar select {
  min-width: 150px;
}
.quota-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}
.quota-summary article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  box-shadow: 0 8px 22px rgba(16, 19, 35, .06);
}
.quota-summary strong {
  display: block;
  font-size: 18px;
}
.quota-summary span {
  color: var(--muted);
  font-size: 11px;
}
.quota-map-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  box-shadow: var(--shadow);
}
.quota-map-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.quota-map-head strong {
  display: block;
  font-size: 14px;
}
.quota-map-head span {
  color: var(--muted);
  font-size: 11px;
}
.quota-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.quota-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.quota-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  display: inline-block;
}
.quota-dot.sold { background: #16a34a; }
.quota-dot.heat-1 { background: #fff7ed; border: 1px solid #fed7aa; }
.quota-dot.heat-2 { background: #fde68a; }
.quota-dot.heat-3 { background: #fb923c; }
.quota-dot.heat-4 { background: #ef4444; }
.quota-dot.heat-5 { background: #991b1b; }
.quota-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
  gap: 5px;
}
.quota-cell {
  min-width: 0;
  width: 100%;
  min-height: 34px;
  padding: 6px 4px;
  border-radius: 7px;
  border: 1px solid #fed7aa;
  background: #fff7ed;
  color: #7c2d12;
  font-size: 11px;
  line-height: 1;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 3px 8px rgba(16, 19, 35, .05);
}
.quota-cell.sold {
  border-color: #86efac;
  background: #dcfce7;
  color: #166534;
}
.quota-cell.heat-1 {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}
.quota-cell.heat-2 {
  border-color: #fcd34d;
  background: #fde68a;
  color: #78350f;
}
.quota-cell.heat-3 {
  border-color: #fb923c;
  background: #fed7aa;
  color: #7c2d12;
}
.quota-cell.heat-4 {
  border-color: #f87171;
  background: #ef4444;
  color: #fff;
}
.quota-cell.heat-5 {
  border-color: #7f1d1d;
  background: #991b1b;
  color: #fff;
  box-shadow: 0 6px 14px rgba(153, 27, 27, .22);
}
.quota-cell.heat-1:hover,
.quota-cell.heat-2:hover,
.quota-cell.heat-3:hover,
.quota-cell.heat-4:hover,
.quota-cell.heat-5:hover,
.quota-cell.sold:hover {
  transform: translateY(-1px) scale(1.08);
  position: relative;
  z-index: 1;
}
.upload-panel {
  max-width: 620px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
}
.preview-panel { margin-top: 18px; }
.upload-panel p { margin: 0; color: var(--muted); }
.import-debug { margin-top: 16px; }
.import-debug pre { white-space: pre-wrap; margin: 0; color: var(--muted); }
.table-wrap h2 { margin: 0 0 10px; font-size: 16px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; border-bottom: 1px solid var(--line); padding: 8px 8px; white-space: nowrap; }
th { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.compact-table { padding: 12px; }
.compact-table table { font-size: 12px; }
.compact-table th,
.compact-table td { padding: 6px 8px; line-height: 1.2; }
.compact-table th { font-size: 10px; }
.clickable-row { cursor: pointer; }
.clickable-row:hover { background: #f8fafc; }
.status-toggle {
  width: 26px;
  height: 26px;
  min-width: 26px;
  padding: 0;
  border-radius: 999px;
  font-size: 13px;
  line-height: 1;
}
.status-toggle.received {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}
.status-toggle.pending {
  background: #fef3c7;
  border-color: #facc15;
  color: #92400e;
}
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.toolbar select, .toolbar input { max-width: 190px; }
.sales-period-filter {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 0 4px;
}
.sales-period-filter label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  line-height: 1.05;
}
.sales-period-filter select {
  min-width: 136px;
  min-height: 32px;
  padding-block: 6px;
}
.sales-period-filter span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.dashboard-filter {
  justify-content: flex-end;
}
.kanban {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(190px, 1fr);
  gap: 8px;
  min-height: calc(100vh - 122px);
  overflow-x: auto;
  padding-bottom: 10px;
}
.column {
  background: #e9edf5;
  border-radius: 7px;
  min-height: 500px;
  display: flex;
  flex-direction: column;
}
.column-head {
  background: #fff;
  border-top: 3px solid var(--accent);
  border-radius: 7px 7px 0 0;
  padding: 7px 8px;
  display: grid;
  gap: 1px;
}
.column-head strong { font-size: 11px; line-height: 1.1; text-transform: uppercase; }
.column-head span { color: var(--muted); font-size: 10px; }
.dropzone { flex: 1; display: grid; align-content: start; gap: 5px; padding: 5px; }
.deal-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 34px 7px 8px;
  display: grid;
  gap: 3px;
  cursor: grab;
  box-shadow: 0 5px 12px rgba(16, 19, 35, .04);
  position: relative;
}
.deal-card-link {
  border: 0;
  padding: 0;
  justify-content: flex-start;
  text-align: left;
  background: transparent;
  box-shadow: none;
}
.deal-card strong { font-size: 11px; font-weight: 700; line-height: 1.2; }
.deal-card span { color: var(--muted); font-size: 10px; line-height: 1.2; }
.deal-card small, .deal-card em { font-size: 10px; line-height: 1.2; color: var(--muted); }
.deal-card em { color: #7c3aed; font-style: normal; }
.deal-action-badge {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}
.deal-action-badge.empty {
  background: #fee2e2;
  border-color: #fecaca;
  color: #dc2626;
}
.deal-action-badge.overdue {
  background: #fef3c7;
  border-color: #facc15;
  color: #92400e;
}
.deal-action-badge.future {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}
.deal-action-badge.type-whatsapp {
  font-size: 10px;
}
.dropzone.drag-over { outline: 2px dashed var(--accent); outline-offset: -6px; }
.messages { margin-bottom: 14px; display: grid; gap: 8px; }
.message { padding: 10px 12px; border-radius: 6px; background: #eef7ee; color: #166534; }
.message.error { background: #fee2e2; color: #991b1b; }
.swatch { width: 18px; height: 18px; display: inline-block; border-radius: 4px; margin-right: 8px; vertical-align: middle; }
.actions { display: flex; justify-content: flex-end; gap: 10px; }
.empty-state {
  max-width: 620px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: var(--shadow);
}
.empty-state h1 { margin: 8px 0; font-size: 26px; }
.empty-state p { color: var(--muted); margin: 0 0 18px; }
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: start center;
  padding: 92px 18px 24px;
  background: rgba(16, 19, 35, .58);
}
.modal-backdrop[hidden] { display: none; }
.modal-panel {
  width: min(860px, calc(100vw - 36px));
  max-height: calc(100vh - 120px);
  overflow: auto;
  position: relative;
  background: #fff;
  border: 1px solid rgba(255,255,255,.75);
  border-radius: 8px;
  box-shadow: 0 28px 90px rgba(16, 19, 35, .36);
}
.deal-modal { padding: 26px; }
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 999px;
}
.modal-step { display: grid; gap: 14px; }
.modal-step[hidden] { display: none; }
.modal-step h2 { margin: 0; font-size: 24px; }
.modal-icon {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  color: #fff;
  font-weight: 900;
}
.modal-results {
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}
.modal-results[hidden] { display: none; }
.customer-pick {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 12px 14px;
  display: grid;
  gap: 2px;
  justify-content: stretch;
  text-align: left;
  background: transparent;
  box-shadow: none;
}
.customer-pick[hidden] { display: none; }
.customer-pick:hover,
.customer-pick.is-selected { background: #eef2ff; }
.customer-pick span { color: var(--muted); font-size: 12px; font-weight: 600; }
.modal-actions,
.modal-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.modal-heading { border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.modal-heading h2 { margin: 0; }
.activity-modal {
  width: min(1160px, calc(100vw - 24px));
  padding: 0;
  max-height: calc(100vh - 44px);
  background: #f3f5fa;
  border-color: #e3e7f1;
}
.activity-backdrop {
  padding: 22px 12px;
  place-items: start center;
}
.activity-topbar {
  min-height: 74px;
  padding: 14px 22px 12px;
  border-bottom: 1px solid #dfe4ef;
  background: linear-gradient(180deg, #ffffff 0%, #f8f9fd 100%);
  box-shadow: 0 8px 18px rgba(16, 19, 35, .05);
}
.activity-topbar h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.15;
}
.activity-topbar p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}
.activity-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 0;
}
.activity-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 2px 44px 2px 0;
}
.title-edit-button {
  width: 22px;
  height: 22px;
  min-width: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  box-shadow: none;
  font-size: 14px;
}
.title-edit-button:hover {
  background: #eef2ff;
}
.activity-inline-title-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  max-width: 720px;
  margin: 7px 44px 4px 0;
}
.activity-inline-title-form[hidden] {
  display: none;
}
.activity-inline-title-form input {
  min-height: 34px;
  background: #fff;
}
.activity-main { padding: 14px 18px 18px; display: grid; gap: 10px; background: #f3f5fa; }
.activity-side {
  background: #eef2f8;
  border-left: 1px solid var(--line);
  padding: 14px 12px;
  display: grid;
  align-content: start;
  gap: 10px;
}
.activity-side section,
.activity-compose,
.activity-card {
  background: #fff;
  border: 1px solid #dfe4ef;
  border-radius: 7px;
  padding: 10px;
  box-shadow: 0 8px 18px rgba(16, 19, 35, .045);
}
.activity-compose {
  border-top: 3px solid #d8d5ff;
}
.activity-compose { display: grid; gap: 8px; }
.activity-type-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border: 1px solid #dfe4ef;
  border-radius: 8px;
  overflow: hidden;
}
.activity-type-tabs button {
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: #f8fafc;
  box-shadow: none;
  min-height: 34px;
  padding: 7px 8px;
  font-size: 12px;
}
.activity-type-tabs button:last-child { border-right: 0; }
.activity-type-tabs button.is-active {
  background: linear-gradient(180deg, #f4f3ff 0%, #e9e7ff 100%);
  color: var(--accent-dark);
  box-shadow: inset 0 2px 0 var(--accent);
}
.activity-compose textarea {
  min-height: 74px;
  background: #fbfcff;
}
.activity-compose input[type="datetime-local"] {
  max-width: 220px;
}
.activity-compose .modal-actions {
  min-height: 34px;
}
.activity-history h3,
.activity-side h3 { margin: 0 0 6px; font-size: 13px; }
.activity-history {
  min-height: 220px;
}
.activity-history h3 {
  padding: 0 2px 2px;
  color: var(--accent-dark);
}
.activity-card {
  margin-top: 7px;
  display: grid;
  gap: 6px;
  border-left: 3px solid #a5b4fc;
}
.activity-card:hover {
  box-shadow: 0 12px 26px rgba(16, 19, 35, .08);
}
.activity-card header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 10px;
  padding-bottom: 5px;
  border-bottom: 1px solid #edf0f6;
  background: #f8f9fd;
  margin: -10px -10px 0;
  padding: 7px 10px 6px;
  border-radius: 6px 6px 0 0;
}
.activity-card header strong {
  color: var(--accent-dark);
  font-size: 11px;
}
.activity-call header strong { color: #0f766e; }
.activity-meeting header strong { color: #b45309; }
.activity-whatsapp header strong { color: #15803d; }
.activity-call { border-left-color: #0f766e; }
.activity-meeting { border-left-color: #b45309; }
.activity-whatsapp { border-left-color: #15803d; }
.activity-card p { margin: 0; white-space: pre-wrap; font-size: 12px; line-height: 1.35; }
.activity-side section {
  position: relative;
  overflow: hidden;
}
.activity-side section::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: #d8d5ff;
}
.activity-side p {
  margin: 0;
  display: flex;
  gap: 4px;
  align-items: baseline;
  flex-wrap: wrap;
}
.activity-side p strong {
  font-size: 17px;
}
.activity-side p span {
  color: var(--muted);
}
.activity-side dl { margin: 0; display: grid; grid-template-columns: 82px 1fr; gap: 6px; }
.activity-side dt { color: var(--muted); font-weight: 800; }
.activity-side dd { margin: 0; }
.activity-danger-zone {
  border-left-color: #fecaca;
}
.activity-danger-zone::before {
  background: #fecaca;
}
.danger-outline {
  width: 100%;
  border-color: #fecaca;
  background: #fff5f5;
  color: #b91c1c;
}
.danger-outline:hover {
  background: #fee2e2;
}
.muted-text { color: var(--muted); font-size: 12px; }
.agenda-workspace {
  display: grid;
  gap: 16px;
  min-height: calc(100vh - 118px);
}
.agenda-toolbar {
  display: grid;
  grid-template-columns: auto auto minmax(280px, 1fr) auto;
  align-items: center;
  gap: 12px;
  background: #eef1f8;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: 0 10px 28px rgba(16, 19, 35, .06);
}
.calendar-view-tabs,
.calendar-nav,
.agenda-filter {
  display: flex;
  align-items: center;
  gap: 8px;
}
.calendar-view-tabs {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(16, 19, 35, .06);
}
.calendar-view-tabs span {
  min-width: 68px;
  padding: 12px 14px;
  text-align: center;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  border-right: 1px solid var(--line);
}
.calendar-view-tabs span:last-child { border-right: 0; }
.calendar-view-tabs .is-active {
  color: var(--accent);
  background: #fff;
  box-shadow: inset 0 3px 0 var(--accent);
}
.calendar-nav .ghost {
  color: var(--accent);
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}
.icon-nav {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--accent);
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(16, 19, 35, .08);
}
.agenda-filter {
  justify-self: end;
}
.agenda-filter select {
  width: 210px;
  min-height: 42px;
  font-weight: 700;
}
.agenda-filter button,
.calendar-focus-button {
  min-height: 42px;
}
.agenda-month-title {
  text-align: center;
  padding: 4px 0 0;
}
.agenda-month-title h1 {
  margin: 2px 0 0;
  color: var(--accent);
  font-size: 32px;
}
.calendar-shell {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.calendar-shell.compact { height: calc(100vh - 236px); min-height: 540px; }
.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(128px, 1fr));
}
.calendar-grid { height: calc(100vh - 278px); min-height: 498px; grid-auto-rows: 1fr; }
.calendar-weekdays {
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.calendar-weekdays strong {
  padding: 9px 12px;
  color: var(--ink);
  font-size: 14px;
  text-align: center;
}
.calendar-day {
  min-height: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 5px;
  background: #fff;
  overflow: hidden;
}
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.calendar-day header strong {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
}
.calendar-day header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.calendar-day.is-today header strong {
  background: var(--accent);
  color: #fff;
}
.calendar-day.is-outside {
  background: #f8fafc;
  color: #98a2b3;
}
.calendar-events { display: grid; gap: 3px; max-height: calc(100% - 28px); overflow: hidden; }
.calendar-event {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0 5px;
  border-left: 0;
  border-radius: 3px;
  padding: 2px 5px;
  background: var(--accent);
  color: #fff;
  min-height: 20px;
}
.calendar-event time,
.calendar-event small {
  color: rgba(255,255,255,.86);
  font-size: 10px;
}
.calendar-event time { font-weight: 900; }
.calendar-event strong,
.calendar-event small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.calendar-event strong { font-size: 11px; }
.calendar-event small { grid-column: 1 / -1; }
.calendar-event.type-call { background: #4f46e5; }
.calendar-event.type-meeting { background: #c47a45; }
.calendar-event.type-whatsapp { background: #0f766e; }
body.calendar-focus .agenda-workspace {
  min-height: calc(100vh - 46px);
}
body.calendar-focus .calendar-shell.compact {
  height: calc(100vh - 164px);
  min-height: 0;
}
body.calendar-focus .calendar-grid {
  height: calc(100vh - 206px);
  min-height: 0;
}
@media (max-width: 860px) {
  .sidebar { width: 100%; height: 58px; inset: 0 0 auto 0; display: flex; align-items: center; gap: 12px; overflow-x: auto; }
  .brand-row { margin: 0; }
  .brand-text { display: none; }
  .menu-toggle { display: none; }
  .sidebar nav { display: flex; overflow-x: auto; }
  .menu-group { display: flex; gap: 8px; }
  .menu-group p { display: none; }
  .sidebar.is-collapsed { width: 100%; }
  .sidebar.is-collapsed nav strong { display: inline; }
  .topbar, .sidebar.is-collapsed + .topbar { left: 0; top: 58px; }
  .app-shell, .sidebar.is-collapsed ~ .app-shell { margin-left: 0; padding-top: 124px; }
  .form-grid, .metrics, .permission-grid, .dashboard-grid { grid-template-columns: 1fr; }
  .form-row-three { grid-template-columns: 1fr; }
  .toolbar { flex-wrap: wrap; }
  .modal-backdrop { padding-top: 136px; }
  .modal-actions, .modal-heading { align-items: stretch; flex-direction: column; }
  .activity-layout { grid-template-columns: 1fr; }
  .activity-side { border-left: 0; border-top: 1px solid var(--line); }
  .activity-type-tabs { grid-template-columns: 1fr 1fr; }
  .activity-inline-title-form { grid-template-columns: 1fr; margin-right: 44px; }
  body.calendar-focus .app-shell,
  body.calendar-focus .sidebar.is-collapsed ~ .app-shell {
    padding: 14px;
  }
  .agenda-toolbar {
    grid-template-columns: 1fr;
  }
  .agenda-filter,
  .calendar-nav {
    justify-self: stretch;
  }
  .calendar-view-tabs span { flex: 1; min-width: 0; }
  .agenda-filter select { width: 100%; }
  .calendar-shell { overflow-x: auto; }
  .calendar-weekdays,
  .calendar-grid { min-width: 900px; }
  .quota-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quota-map-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .quota-grid {
    grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
  }
}
