/* ============ Tokens ============ */
:root {
  --sidebar: #013125;
  --sidebar-hover: rgba(255,255,255,.06);
  --sidebar-active: rgba(255,255,255,.10);
  --sidebar-active-text: #4ADE80;
  --primary: #21C45D;
  --primary-600: #16A34A;
  --primary-50: #ECFDF3;
  --primary-100: #D1FAE0;
  --text: #101218;
  --text-2: #374151;
  --muted: #6B7280;
  --muted-2: #9CA3AF;
  --border: #E7EAEE;
  --border-2: #D9DEE4;
  --surface: #F7F8FA;
  --surface-2: #F1F3F5;
  --bg: #FFFFFF;
  --ok: #059669;   --ok-bg: #E7F7EF;
  --warn: #D97706; --warn-bg: #FEF3E2;
  --danger: #DC2626; --danger-bg: #FDECEC;
  --blue: #2563EB; --blue-bg: #E8EFFD;
  --purple: #9333EA; --purple-bg: #F3E8FD;
  --orange: #EA580C; --orange-bg: #FFEDE3;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16,18,24,.04), 0 1px 3px rgba(16,18,24,.06);
  --shadow-lg: 0 12px 40px rgba(16,18,24,.18);
  --sidebar-w: 248px;
  --sidebar-w-collapsed: 78px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text); background: var(--bg); font-size: 14px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.ic { flex-shrink: 0; display: inline-block; vertical-align: middle; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; }

/* ============ Shell ============ */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w-collapsed); background: var(--sidebar); color: #fff;
  position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column;
  transition: width .2s ease; z-index: 30;
}
.app.expanded .sidebar { width: var(--sidebar-w); }
.main-col { flex: 1; margin-left: var(--sidebar-w-collapsed); min-width: 0; transition: margin .2s ease; display: flex; flex-direction: column; }
.app.expanded .main-col { margin-left: var(--sidebar-w); }

.sb-brand { height: 62px; display: flex; align-items: center; gap: 10px; padding: 0 22px; border-bottom: 1px solid rgba(255,255,255,.08); position: relative; }
.sb-logo { width: 34px; height: 34px; border-radius: 10px; background: var(--primary); display: grid; place-items: center; font-weight: 700; color: var(--sidebar); font-size: 15px; flex-shrink: 0; }
.sb-name { font-weight: 700; font-size: 15px; line-height: 1.05; white-space: nowrap; overflow: hidden; opacity: 0; transition: opacity .15s; }
.sb-name small { display: block; font-weight: 500; font-size: 11px; color: rgba(255,255,255,.6); }
.app.expanded .sb-name { opacity: 1; }
.sb-toggle {
  position: absolute; right: -12px; top: 19px; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; color: var(--text-2); border: 1px solid var(--border); display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow);
}
.app.expanded .sb-toggle svg { transform: rotate(180deg); }
.sb-nav { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.sb-link {
  display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 15px; border-radius: 12px;
  color: rgba(255,255,255,.88); white-space: nowrap; overflow: hidden; position: relative;
}
.sb-link:hover { background: var(--sidebar-hover); }
.sb-link.active { background: var(--sidebar-active); color: var(--sidebar-active-text); }
.sb-link .sb-label { opacity: 0; transition: opacity .15s; font-weight: 500; }
.app.expanded .sb-link .sb-label { opacity: 1; }
.sb-link.active::after { content: ""; position: absolute; right: 12px; width: 6px; height: 6px; border-radius: 50%; background: var(--sidebar-active-text); opacity: 0; }
.app.expanded .sb-link.active::after { opacity: 1; }
.sb-foot { padding: 12px; border-top: 1px solid rgba(255,255,255,.08); }

.topbar {
  height: 62px; border-bottom: 1px solid var(--border); background: #fff; display: flex; align-items: center;
  padding: 0 28px 0 24px; gap: 16px; position: sticky; top: 0; z-index: 20;
}
.topbar-title { font-size: 19px; font-weight: 700; flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-title a.back { font-size: 14px; font-weight: 500; display: inline-flex; gap: 8px; align-items: center; color: var(--text-2); }
.topbar-user { display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--primary-100); color: var(--primary-600); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex-shrink: 0; overflow: hidden; }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.topbar-user .who { text-align: right; line-height: 1.2; }
.topbar-user .who b { font-weight: 600; font-size: 14px; display: block; }
.topbar-user .who span { font-size: 12px; color: var(--muted); }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--text-2); position: relative; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn .dot { position: absolute; top: 7px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); border: 2px solid #fff; }

.view { padding: 28px; max-width: 1480px; width: 100%; }

/* ============ Elements ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px;
  border-radius: 10px; border: 1px solid var(--border); background: #fff; cursor: pointer; font-weight: 500; white-space: nowrap;
}
.btn:hover { background: var(--surface); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--primary-600); border-color: var(--primary-600); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-bg); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.input, .select, .textarea {
  width: 100%; height: 40px; border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: 0 12px; outline: none;
}
.textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px var(--primary-50); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.search { position: relative; }
.search .ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search .input { padding-left: 38px; }
label.lbl { display: block; font-weight: 500; font-size: 13px; margin-bottom: 6px; color: var(--text-2); }
label.lbl .req { color: var(--danger); }
.hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.field { margin-bottom: 14px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card-white { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); }
.card-pad { padding: 20px; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-title { font-size: 19px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.section-title .ic { color: var(--primary); }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.link { color: var(--primary); font-weight: 500; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; background: none; border: 0; padding: 0; }
.link:hover { color: var(--primary-600); }
.muted { color: var(--muted); }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; }
.page-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

/* status dot badges */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.ativo { color: var(--ok); }
.status.pendente { color: var(--warn); }
.status.inativo { color: var(--muted); }

.pill { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.green { background: var(--ok-bg); color: var(--ok); }
.pill.orange { background: var(--warn-bg); color: var(--warn); }
.pill.red { background: var(--danger-bg); color: var(--danger); }
.pill.blue { background: var(--blue-bg); color: var(--blue); }
.pill.gray { background: var(--surface-2); color: var(--muted); }
.pill.outline-orange { border: 1px solid #F8C98F; color: var(--warn); background: #fff; }
.pill.outline-red { border: 1px solid #F5B5B5; color: var(--danger); background: #fff; }
.pill.outline-gray { border: 1px solid var(--border-2); color: var(--muted); background: #fff; }

/* segmented control */
.seg { display: inline-flex; background: var(--surface-2); border-radius: 12px; padding: 4px; gap: 2px; }
.seg button { border: 0; background: transparent; height: 32px; padding: 0 14px; border-radius: 9px; cursor: pointer; color: var(--muted); font-weight: 500; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.seg button.on { background: #fff; color: var(--text); box-shadow: var(--shadow); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { height: 34px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--border); background: #fff; cursor: pointer; font-weight: 500; }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }

/* table */
.table-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow: auto; background: #fff; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-weight: 500; color: var(--muted); font-size: 13px; padding: 13px 18px; background: var(--surface); border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 14px 18px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--surface); }
.tbl .actions { text-align: right; white-space: nowrap; }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .ic { color: var(--muted-2); margin-bottom: 8px; }
.empty b { display: block; color: var(--text); margin-bottom: 2px; }

/* ============ Dashboard ============ */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; margin-bottom: 34px; }
.kpi { position: relative; overflow: hidden; padding: 24px; min-height: 190px; display: flex; flex-direction: column; justify-content: flex-end; cursor: pointer; transition: transform .12s, box-shadow .12s; }
.kpi:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.kpi .kpi-ic { position: absolute; top: 24px; left: 24px; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; }
.kpi .kpi-bg { position: absolute; right: -18px; bottom: -14px; color: rgba(16,18,24,.05); }
.kpi .eyebrow { color: var(--text-2); font-weight: 500; letter-spacing: .08em; }
.kpi .num { font-size: 30px; font-weight: 700; line-height: 1.2; margin: 4px 0 2px; }
.kpi .sub { font-size: 12px; color: var(--muted); }
.tone-green { background: var(--ok-bg); color: var(--ok); }
.tone-orange { background: var(--orange-bg); color: var(--orange); }
.tone-blue { background: var(--blue-bg); color: var(--blue); }
.tone-purple { background: var(--purple-bg); color: var(--purple); }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 436px; gap: 32px; }
.client-cards { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.client-card { display: flex; align-items: center; gap: 14px; padding: 16px; position: relative; cursor: pointer; transition: box-shadow .12s, border-color .12s; }
.client-card:hover { border-color: var(--border-2); box-shadow: var(--shadow); }
.client-card .info { min-width: 0; flex: 1; }
.client-card .name { font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-card .cat { font-size: 13px; color: var(--muted); margin: 1px 0 3px; }
.logo { width: 48px; height: 48px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: 16px; flex-shrink: 0; overflow: hidden; border: 1px solid var(--border); background: #fff; }
.logo img { width: 100%; height: 100%; object-fit: cover; }
.logo.lg { width: 72px; height: 72px; border-radius: 14px; font-size: 24px; }

.quick { display: flex; flex-direction: column; gap: 10px; margin-bottom: 26px; }
.quick-item { display: flex; align-items: center; gap: 12px; padding: 13px 16px; cursor: pointer; }
.quick-item:hover { box-shadow: var(--shadow); }
.quick-item .q-ic { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; }
.quick-item b { font-weight: 600; display: block; }
.quick-item span { font-size: 12px; color: var(--muted); }
.quick-item > .ic:last-child { margin-left: auto; color: var(--muted-2); }

.mini-agenda .date-line { text-align: center; color: var(--text-2); padding: 14px; border-bottom: 1px solid var(--border); }
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; padding: 12px; }
.week-strip button { border: 0; background: transparent; border-radius: 10px; padding: 6px 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); font-size: 12px; }
.week-strip button b { font-size: 15px; color: var(--text); font-weight: 600; }
.week-strip button.on { background: var(--primary); color: #fff; }
.week-strip button.on b { color: #fff; }
.week-strip button .has { width: 4px; height: 4px; border-radius: 50%; background: var(--primary); }
.week-strip button.on .has { background: #fff; }
.mini-events { padding: 0 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.mini-event { border-left: 3px solid var(--primary); background: #fff; border-radius: 8px; padding: 9px 12px; cursor: pointer; }
.mini-event .t { font-size: 11px; font-weight: 700; color: var(--primary-600); text-transform: uppercase; letter-spacing: .04em; }
.mini-event .n { font-size: 13px; }

/* ============ Kanban ============ */
.toolbar { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.filters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.kanban { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 20px; align-items: start; }
.k-col { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; min-height: 300px; }
.k-col.drag-over { border-color: var(--primary); background: var(--primary-50); }
.k-head { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; margin: 2px 4px 14px; }
.k-head .dot { width: 9px; height: 9px; border-radius: 50%; }
.k-head .count { margin-left: auto; background: var(--surface-2); border-radius: 999px; padding: 1px 9px; font-size: 12px; color: var(--muted); }
.k-cards { display: flex; flex-direction: column; gap: 12px; }
.k-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 14px 14px 12px; cursor: grab; }
.k-card:hover { box-shadow: var(--shadow); }
.k-card.dragging { opacity: .5; }
.k-card .top { display: flex; gap: 10px; align-items: flex-start; }
.k-card .title { font-weight: 600; flex: 1; }
.k-card.done .title { color: var(--muted); }
.k-card .desc { font-size: 12px; color: var(--muted); margin: 8px 0 10px 30px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.k-card .meta { margin-left: 30px; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; font-size: 12px; color: var(--muted); }
.k-card .meta span { display: inline-flex; gap: 4px; align-items: center; }
.k-card .row { margin: 10px 0 0 30px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.k-card .resp { display: flex; align-items: center; gap: 6px; font-size: 12px; line-height: 1.1; }
.k-card .resp small { display: block; color: var(--muted); font-size: 10px; }
.k-card .st { margin: 8px 0 0 30px; font-size: 12px; display: inline-flex; gap: 5px; align-items: center; font-weight: 500; }
.chk { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--primary); background: #fff; display: grid; place-items: center; cursor: pointer; flex-shrink: 0; padding: 0; color: #fff; margin-top: 1px; }
.chk.on { background: var(--primary); }
.menu-btn { border: 0; background: transparent; cursor: pointer; color: var(--muted); padding: 2px; border-radius: 6px; }
.menu-btn:hover { background: var(--surface-2); color: var(--text); }

/* dropdown */
.dropdown { position: absolute; z-index: 50; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 170px; }
.dropdown button { display: flex; width: 100%; align-items: center; gap: 10px; border: 0; background: transparent; padding: 9px 10px; border-radius: 8px; cursor: pointer; text-align: left; }
.dropdown button:hover { background: var(--surface); }
.dropdown button.danger { color: var(--danger); }

/* ============ Agenda ============ */
.cal { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.cal-head h3 { font-size: 17px; }
.cal-nav { display: flex; gap: 6px; align-items: center; }
.tgrid { display: grid; overflow: auto; max-height: calc(100vh - 290px); position: relative; }
.tgrid .hcell { position: sticky; top: 0; background: var(--surface); z-index: 2; border-bottom: 1px solid var(--border); border-left: 1px solid var(--border); padding: 8px; text-align: center; font-size: 12px; color: var(--muted); text-transform: capitalize; }
.tgrid .hcell b { display: block; font-size: 18px; color: var(--text); }
.tgrid .hcell.today b { color: var(--primary-600); }
.tgrid .hour { font-size: 11px; color: var(--muted); text-align: right; padding: 2px 8px 0 0; height: 52px; border-bottom: 1px solid var(--border); }
.tgrid .slot { height: 52px; border-left: 1px solid var(--border); border-bottom: 1px solid var(--border); cursor: pointer; position: relative; }
.tgrid .slot:hover { background: var(--surface); }
.ev { position: absolute; left: 4px; right: 4px; background: var(--primary-50); border-left: 3px solid var(--primary); border-radius: 6px; padding: 4px 7px; font-size: 12px; overflow: hidden; z-index: 1; cursor: pointer; }
.ev b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev.t-visita { background: var(--blue-bg); border-color: var(--blue); }
.ev.t-treinamento { background: var(--purple-bg); border-color: var(--purple); }
.ev.t-reuniao { background: var(--warn-bg); border-color: var(--warn); }
.mgrid { display: grid; grid-template-columns: repeat(7, 1fr); }
.mgrid .mh { padding: 10px; font-size: 12px; color: var(--muted); text-align: center; background: var(--surface); border-bottom: 1px solid var(--border); text-transform: capitalize; }
.mgrid .md { min-height: 112px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 6px; cursor: pointer; }
.mgrid .md:nth-child(7n) { border-right: 0; }
.mgrid .md.out { background: var(--surface); color: var(--muted-2); }
.mgrid .md .dn { font-size: 13px; font-weight: 600; margin-bottom: 4px; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; }
.mgrid .md.today .dn { background: var(--primary); color: #fff; }
.mgrid .mev { font-size: 11px; background: var(--primary-50); border-left: 3px solid var(--primary); border-radius: 4px; padding: 2px 6px; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mgrid .mev.t-visita { background: var(--blue-bg); border-color: var(--blue); }
.mgrid .mev.t-treinamento { background: var(--purple-bg); border-color: var(--purple); }
.mgrid .mev.t-reuniao { background: var(--warn-bg); border-color: var(--warn); }

/* ============ Clientes ============ */
.cl-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.cl-card { padding: 16px; cursor: pointer; position: relative; }
.cl-card:hover { box-shadow: var(--shadow); border-color: var(--border-2); }
.cl-card .top { display: flex; gap: 12px; align-items: center; }
.cl-card .name { font-weight: 600; font-size: 15px; }
.cl-card .foot { display: flex; gap: 14px; align-items: center; margin-top: 14px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.cl-card .foot span { display: inline-flex; gap: 4px; align-items: center; }
.cl-card .menu-btn { position: absolute; top: 12px; right: 12px; }

/* form page */
.form-page { max-width: 1040px; margin: 0 auto; }
.form-sec { display: grid; grid-template-columns: 260px 1fr; gap: 28px; padding: 26px 0; border-bottom: 1px solid var(--border); }
.form-sec h3 { font-size: 15px; margin-bottom: 4px; }
.form-sec .desc { font-size: 13px; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.type-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.type-card { border: 1.5px solid var(--border); border-radius: 12px; padding: 14px; cursor: pointer; position: relative; background: #fff; }
.type-card b { display: block; margin: 8px 0 2px; }
.type-card span { font-size: 12px; color: var(--muted); }
.type-card.on { border-color: var(--primary); background: var(--primary-50); }
.type-card .ic { color: var(--primary-600); }
.type-card .tick { position: absolute; top: 12px; right: 12px; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--border-2); display: grid; place-items: center; background: #fff; }
.type-card.on .tick { background: var(--primary); border-color: var(--primary); color: #fff; }
.logo-drop { width: 110px; height: 110px; border: 1.5px dashed var(--border-2); border-radius: 12px; display: grid; place-items: center; text-align: center; cursor: pointer; color: var(--muted); font-size: 12px; overflow: hidden; background: var(--surface); }
.logo-drop img { width: 100%; height: 100%; object-fit: cover; }
.form-foot { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--border); padding: 14px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; }
.resp-row { display: grid; grid-template-columns: 1fr 1fr 40px; gap: 10px; margin-bottom: 10px; align-items: end; }

/* client detail */
.cd-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.cd-head .t h1 { font-size: 24px; }
.cd-head .t span { color: var(--muted); }
.cd-head .acts { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.status-select { height: 36px; border-radius: 10px; border: 1px solid var(--border); padding: 0 34px 0 26px; background: #fff; font-weight: 500; appearance: none; cursor: pointer; position: relative; }
.status-wrap { position: relative; display: inline-block; }
.status-wrap::before { content: ""; position: absolute; left: 11px; top: 50%; width: 7px; height: 7px; border-radius: 50%; transform: translateY(-50%); background: var(--c, var(--ok)); z-index: 1; pointer-events: none; }
.status-wrap::after { content: ""; position: absolute; right: 12px; top: 50%; width: 7px; height: 7px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.tabs { display: flex; gap: 4px; padding: 5px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); overflow-x: auto; margin-bottom: 22px; }
.tabs button { border: 0; background: transparent; height: 34px; padding: 0 12px; border-radius: 9px; cursor: pointer; color: var(--muted); display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; font-weight: 500; }
.tabs button:hover { color: var(--text); }
.tabs button.on { background: var(--primary-100); color: var(--primary-600); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; min-height: 280px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.panel-head h3 { font-size: 17px; }
.row-item { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; cursor: pointer; }
.row-item:hover { box-shadow: var(--shadow); }
.row-item .grow { flex: 1; min-width: 0; }
.row-item .grow b { font-weight: 500; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-item .grow span { font-size: 12px; color: var(--muted); }
.ring { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: conic-gradient(var(--primary) calc(var(--p) * 1%), var(--surface-2) 0); position: relative; flex-shrink: 0; }
.ring::before { content: ""; position: absolute; inset: 4px; background: #fff; border-radius: 50%; }
.ring span { position: relative; }
.sq-ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: #fff; flex-shrink: 0; }
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--c, var(--primary)); border-radius: 12px; padding: 14px 16px; }
.stat span { font-size: 12px; color: var(--muted); }
.stat b { display: block; font-size: 26px; color: var(--c, var(--text)); font-weight: 700; }
.stat-fill { border-radius: 12px; padding: 16px; color: #fff; position: relative; }
.stat-fill span { font-size: 13px; opacity: .9; }
.stat-fill b { display: block; font-size: 26px; }
.stat-fill small { font-size: 12px; opacity: .85; }
.items-mini { display: flex; gap: 6px; font-size: 11px; flex-wrap: wrap; }
.items-mini span { background: var(--surface-2); border-radius: 6px; padding: 2px 6px; }
.month-pick { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 16px; background: var(--surface); }
.month-pick .total { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.month-pick .total b { color: var(--text); }
.coming { text-align: center; padding: 60px 20px; }
.coming .badge-ic { width: 64px; height: 64px; border-radius: 18px; background: var(--primary-50); color: var(--primary-600); display: grid; place-items: center; margin: 0 auto 14px; }
.coming h2 { font-size: 20px; margin-bottom: 6px; }
.coming p { color: var(--muted); max-width: 520px; margin: 0 auto 6px; }
.coming ul { text-align: left; display: inline-block; color: var(--text-2); margin-top: 10px; }

/* ============ Modal / toast ============ */
.modal-backdrop { position: fixed; inset: 0; background: rgba(16,18,24,.45); display: grid; place-items: center; z-index: 100; padding: 16px; animation: fade .12s ease; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 620px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: pop .14s ease; }
.modal.sm { max-width: 440px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 8px; }
.modal-head h3 { font-size: 17px; }
.modal-body { padding: 10px 22px 6px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px 18px; }
.status-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.status-pick button { height: 36px; border-radius: 10px; border: 1px solid var(--border); background: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; }
.status-pick button i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.status-pick button.on { border: 1.5px solid var(--text); font-weight: 600; }
.prio-pick { display: flex; gap: 8px; }
.prio-pick button { width: 52px; height: 48px; border-radius: 10px; border: 1px solid var(--border); background: #fff; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; }
.prio-pick button i { width: 14px; height: 14px; border-radius: 50%; display: block; }
.prio-pick button.on { border-color: var(--warn); background: var(--warn-bg); }
.toast-root { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: var(--sidebar); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 10px; animation: pop .15s ease; max-width: 360px; }
.toast .ic { color: var(--sidebar-active-text); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } }

/* ============ Checklists ============ */
.crit-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; color: var(--c); border: 1px solid var(--c); border-radius: 999px; padding: 1px 8px; white-space: nowrap; vertical-align: middle; }
.crit-tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.bar { height: 7px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; background: var(--primary); border-radius: 99px; transition: width .2s; }
/* editor */
.me-head { display: flex; justify-content: space-between; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.me-title { font-size: 22px; font-weight: 700; height: 48px; max-width: 560px; background: #fff; }
.me-setor { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); margin-bottom: 18px; }
.me-setor-head { background: var(--sidebar); color: #fff; display: flex; align-items: center; gap: 10px; padding: 12px 16px; font-weight: 700; }
.me-setor-head .input, .me-sub-head .input { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.15); color: #fff; font-weight: 700; }
.me-setor-head .icon-btn, .me-sub-head .icon-btn { color: rgba(255,255,255,.85); }
.me-setor-head .icon-btn:hover, .me-sub-head .icon-btn:hover { background: rgba(255,255,255,.1); }
.me-setor-body { padding: 16px; background: var(--surface); }
.me-label { font-weight: 600; font-size: 13px; margin-bottom: 8px; display: flex; gap: 8px; align-items: center; }
.me-label .count { background: var(--surface-2); border-radius: 99px; padding: 0 8px; font-size: 12px; color: var(--muted); }
.me-sub { background: #4A0E0E; border-radius: 12px; padding: 12px; margin-bottom: 12px; }
.me-sub-head { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; margin-bottom: 10px; }
.me-sub .me-q { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); }
.me-sub .me-q .input { background: rgba(255,255,255,.06); border-color: transparent; color: #fff; }
.me-sub .me-code, .me-sub .icon-btn { color: rgba(255,255,255,.8); }
.me-sub .me-add { color: #fff; border-color: rgba(255,255,255,.25); }
.me-q { display: grid; grid-template-columns: 64px 1fr 140px 32px 32px; gap: 8px; align-items: center; border: 1px solid var(--border); background: #fff; border-radius: 10px; padding: 6px 8px; margin-bottom: 6px; }
.me-q .input { height: 36px; background: transparent; border-color: transparent; }
.me-q .input:focus { background: #fff; border-color: var(--primary); color: var(--text); }
.me-code { font-size: 12px; font-weight: 700; color: var(--muted); }
.me-crit { height: 34px; font-size: 13px; color: var(--c); font-weight: 600; background-color: #fff; }
.me-add { width: 100%; height: 36px; border: 1px dashed var(--border-2); border-radius: 10px; background: transparent; color: var(--primary-600); cursor: pointer; font-weight: 500; display: flex; align-items: center; justify-content: center; gap: 6px; margin-bottom: 4px; }
.me-add:hover { background: rgba(33,196,93,.06); }
/* aplicação */
.ap-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 18px; margin-bottom: 14px; flex-wrap: wrap; position: sticky; top: 62px; z-index: 5; background: #fff; }
.ap-setor { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 14px; background: var(--surface); overflow: hidden; }
.ap-setor > summary { list-style: none; cursor: pointer; background: var(--sidebar); color: #fff; padding: 12px 16px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.ap-setor > summary .muted { color: rgba(255,255,255,.7); }
.ap-sub { font-weight: 700; padding: 10px 16px 4px; color: #7F1D1D; font-size: 13px; }
.ap-q { background: #fff; border-top: 1px solid var(--border); padding: 12px 16px; }
.ap-q.pede-obs { box-shadow: inset 3px 0 0 var(--warn); }
.ap-q-top { display: flex; gap: 14px; align-items: center; justify-content: space-between; }
.ap-text { flex: 1; }
.ap-text b { color: var(--muted); font-size: 12px; margin-right: 4px; }
.ap-btns { display: flex; gap: 6px; flex-shrink: 0; }
.ap-btn { width: 44px; height: 38px; border-radius: 10px; border: 1.5px solid var(--border); background: #fff; font-weight: 700; font-size: 13px; cursor: pointer; color: var(--muted); }
.ap-btn:hover { border-color: var(--c); color: var(--c); }
.ap-btn.on { background: var(--c); border-color: var(--c); color: #fff; }
.ap-extra { display: flex; gap: 16px; margin-top: 6px; }
.ap-obs { margin-top: 8px; background: var(--surface); border-radius: 8px; padding: 8px 10px; font-size: 13px; white-space: pre-wrap; }
.ap-fotos { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.ap-foto { position: relative; width: 92px; height: 92px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); display: block; }
.ap-foto img { width: 100%; height: 100%; object-fit: cover; }
.ap-foto button { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; cursor: pointer; }
.sig { width: 100%; height: 150px; border: 1.5px dashed var(--border-2); border-radius: 12px; background: #fff; touch-action: none; cursor: crosshair; }
.sig-wrap { margin-bottom: 4px; }
/* relatório */
.rel-acoes { display: flex; gap: 10px; justify-content: flex-end; margin-bottom: 16px; flex-wrap: wrap; }
.rel { max-width: 900px; margin: 0 auto; }
.rel-capa { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; }
.rel-faixa { background: var(--sidebar); height: 74px; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; }
.rel-logo { height: 48px; width: 48px; object-fit: cover; border-radius: 10px; background: #fff; }
.rel-info { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.rel-info .card { background: #fff; padding: 14px; }
.rel-info span { display: block; font-size: 12px; }
.rel-info b { font-size: 15px; }
.rel-nota { display: flex; gap: 28px; align-items: center; margin: 16px 0; background: #fff; }
.ring.big { width: 150px; height: 150px; background: conic-gradient(var(--cor) calc(var(--p) * 1%), var(--surface-2) 0); }
.ring.big::before { inset: 12px; }
.ring.big span { display: flex; flex-direction: column; align-items: center; }
.ring.big b { font-size: 32px; }
.ring.big small { font-size: 12px; color: var(--muted); font-weight: 500; }
.rel-h { font-size: 18px; margin: 26px 0 12px; }
.rel-grupo { display: flex; gap: 16px; align-items: center; border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; margin-bottom: 8px; background: #fff; }
.rel-inc-setor { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin-bottom: 12px; }
.rel-inc-h { background: var(--sidebar); color: #fff; font-weight: 700; padding: 10px 14px; }
.rel-inc-sub { background: #FDF2F2; color: #7F1D1D; font-weight: 600; padding: 8px 14px; font-size: 13px; }
.rel-inc { padding: 12px 14px; border-top: 1px solid var(--border); background: #fff; page-break-inside: avoid; }
.rel-inc .num { width: 24px; height: 24px; border-radius: 50%; background: var(--danger-bg); color: var(--danger); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.rel-obs { margin-top: 8px; font-size: 13px; color: var(--text-2); white-space: pre-wrap; }
.rel-assinaturas { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 8px; }
.rel-ass { text-align: center; }
.rel-ass img { height: 70px; max-width: 100%; object-fit: contain; }
.rel-ass .linha { border-top: 1px solid var(--text); margin: 4px 20px 6px; }
.rel-ass b { display: block; }
.rel-ass span { font-size: 12px; color: var(--muted); }
@media print {
  .sidebar, .topbar, .no-print, .toast-root { display: none !important; }
  .main-col, .app.expanded .main-col { margin: 0 !important; }
  .view { padding: 0 !important; max-width: none; }
  body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rel-grupo, .rel-inc-setor, .card { break-inside: avoid; }
}
@media (max-width: 720px) {
  .me-q { grid-template-columns: 1fr 120px 32px; }
  .me-q .me-code { grid-column: 1 / -1; }
  .me-q [data-acao="up"] { display: none; }
  .ap-q-top { flex-direction: column; align-items: stretch; }
  .ap-btns { justify-content: space-between; }
  .ap-btn { flex: 1; }
  .ap-head { top: 62px; }
  .rel-info { grid-template-columns: 1fr 1fr !important; }
  .rel-nota { flex-direction: column; align-items: flex-start; }
  .rel-assinaturas { grid-template-columns: 1fr; }
}

/* ============ Login ============ */
.login-page { display: grid; grid-template-columns: 420px 1fr; min-height: 100vh; }
.login-side { background: var(--sidebar); color: #fff; padding: 56px 44px; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.login-side h1 { font-size: 30px; }
.login-side p { color: rgba(255,255,255,.75); margin: 0; font-size: 15px; }
.login-main { display: grid; place-items: center; padding: 32px 16px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { font-size: 24px; }

/* ============ Responsive ============ */
@media (max-width: 820px) {
  .login-page { grid-template-columns: 1fr; }
  .login-side { padding: 32px 20px; }
}
.mobile-menu { display: none !important; }
@media (max-width: 1280px) {
  .dash-grid { grid-template-columns: 1fr; }
  .client-cards, .cl-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 1024px) {
  .kpis, .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .kanban { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .form-sec { grid-template-columns: 1fr; gap: 12px; }
}
@media (max-width: 720px) {
  .sidebar { width: 0; overflow: hidden; }
  .app.expanded .sidebar { width: var(--sidebar-w); }
  .main-col, .app.expanded .main-col { margin-left: 0; }
  .topbar { padding: 0 16px; }
  .mobile-menu { display: grid !important; }
  .view { padding: 18px 16px; }
  .client-cards, .cl-grid, .filters, .grid-2, .grid-3, .grid-4, .type-cards { grid-template-columns: 1fr !important; }
  .kpis, .stat-cards { grid-template-columns: 1fr 1fr; gap: 12px; }
  .kpi { min-height: 150px; padding: 16px; }
  .kpi .kpi-ic { top: 16px; left: 16px; width: 38px; height: 38px; }
  .kpi .eyebrow { font-size: 11px; letter-spacing: .04em; }
  .topbar-user .who { display: none; }
  .sb-toggle { display: none; }
}
