:root {
  --green: #087a59;
  --green-2: #10a877;
  --green-soft: #e9f6f1;
  --dark: #102e27;
  --bg: #f3f6f5;
  --surface: #ffffff;
  --text: #17251f;
  --muted: #68766f;
  --line: #dfe7e3;
  --red: #c9434b;
  --red-soft: #fff0f0;
  --amber: #a66b08;
  --amber-soft: #fff8e8;
  --shadow: 0 12px 34px rgba(22, 55, 45, .08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 Arial, Helvetica, sans-serif;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
input, select, textarea { color: var(--text); }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 4px; font-size: 1.5rem; }
h2 { margin-bottom: 5px; font-size: 1.08rem; }
h3 { font-size: .9rem; }
p { color: var(--muted); }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 10;
  width: 236px;
  padding: 25px 15px 20px;
  display: flex;
  flex-direction: column;
  color: #fff;
  background: linear-gradient(180deg, #13382f 0%, #0d2822 100%);
}

.brand { display: flex; gap: 11px; align-items: center; padding: 0 9px 29px; }
.brand > span { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: var(--green-2); font-weight: 800; }
.brand div, .user div { display: flex; flex-direction: column; }
.brand strong { letter-spacing: 2px; }
.brand small, .user small { margin-top: 3px; color: #91b3a7; font-size: .76rem; }
.sidebar nav { display: grid; gap: 5px; }
.sidebar nav button { min-height: 43px; padding: 10px 11px; border: 0; border-radius: 9px; display: flex; gap: 11px; align-items: center; color: #b9d0c8; background: transparent; text-align: left; }
.sidebar nav button:hover, .sidebar nav button.active { color: #fff; background: #1d4a3e; }
.sidebar nav button > span { width: 19px; font-size: 1.05rem; text-align: center; }
.sidebar nav b { margin-left: auto; min-width: 22px; padding: 2px 6px; border-radius: 20px; color: #fff; background: #d55258; font-size: .7rem; text-align: center; }
.sidebar nav b:empty { display: none; }
.user { margin-top: auto; padding: 18px 8px 0; border-top: 1px solid #2b5147; display: flex; gap: 10px; align-items: center; font-size: .82rem; font-weight: bold; }
.user i { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: #dcefe8; color: var(--green); font-style: normal; }

main { min-height: 100vh; margin-left: 236px; }
header { min-height: 90px; padding: 18px 29px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); background: var(--surface); }
header p, .panel > p, .modal > p { margin-bottom: 0; }

.primary, .danger, .drawer-actions button, .actions button, .quick-actions button, .section-heading button, .resume-actions button {
  min-height: 39px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-weight: 700;
}
.primary { border-color: var(--green) !important; background: var(--green) !important; color: #fff !important; }
.primary:hover { background: #066b4e !important; }
.danger { border-color: #efc3c6 !important; background: var(--red-soft) !important; color: #b62f38 !important; }

.page { display: none; }
.page.active { display: block; }
.metrics { padding: 20px 28px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric { min-width: 0; padding: 16px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.metric small { color: var(--muted); font-weight: 700; }
.metric b { margin: 7px 0 3px; font-size: 1.48rem; line-height: 1.1; }
.metric span { color: #7d8a84; font-size: .78rem; }
.metric.danger-metric { border-color: #f1c5c7; background: #fffafa; }
.metric.danger-metric b { color: var(--red); }
.metric.warning-metric { border-color: #ebd4a4; background: #fffdf8; }
.metric.warning-metric b { color: var(--amber); }
.metric.success-metric { border-color: #bbdfd1; background: #fbfffd; }
.metric.success-metric b { color: var(--green); }

.filters { margin: 0 28px 14px; display: flex; gap: 9px; align-items: center; }
.filters input, .filters select, .panel-heading select { min-height: 40px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.filters input { width: 310px; }
.filters span { margin-left: auto; color: var(--muted); font-size: .8rem; }

.board { padding: 0 28px 30px; display: flex; gap: 12px; align-items: flex-start; overflow-x: auto; scroll-snap-type: x proximity; }
.column { width: 282px; min-width: 282px; min-height: 545px; padding: 9px; border-radius: 11px; background: #e8edeb; scroll-snap-align: start; }
.column-title { min-height: 51px; padding: 6px 4px 11px; display: flex; gap: 8px; align-items: flex-start; border-bottom: 1px solid #dce4e0; }
.column-title:before { content: ""; flex: 0 0 auto; width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: var(--green-2); }
.column-title div { min-width: 0; display: flex; flex-direction: column; }
.column-title b { font-size: .72rem; line-height: 1.25; text-transform: uppercase; }
.column-title small { margin-top: 3px; color: var(--muted); font-size: .67rem; }
.column-title > span { margin-left: auto; padding: 2px 7px; border-radius: 20px; background: #fff; font-size: .72rem; }
.empty-column { padding: 28px 10px; color: #89958f; font-size: .78rem; text-align: center; }
.loss-column { background: #f1e8e9; }
.loss-column .column-title { border-bottom-color: #e8d7d9; }
.loss-column .column-title:before { background: var(--red); }
.loss-column .column-title b { color: #9f3038; }
.loss-column .column-title > span { color: var(--red); }

.card { margin-top: 9px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: #fff; transition: transform .15s, border-color .15s, box-shadow .15s; }
.card:hover, .card:focus { outline: none; border-color: #86c6ae; box-shadow: 0 8px 18px rgba(18, 71, 54, .09); transform: translateY(-2px); }
.card.stalled { border-left: 4px solid var(--red); background: linear-gradient(90deg, #fff8f8 0, #fff 22%); }
.person { display: flex; gap: 9px; align-items: center; }
.person > span, .detail-title > span { flex: 0 0 auto; width: 35px; height: 35px; display: grid; place-items: center; border-radius: 9px; background: var(--green-soft); color: var(--green); font-weight: 800; }
.person div { min-width: 0; display: flex; flex-direction: column; }
.person div b, .person div small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person small { margin-top: 2px; color: var(--muted); font-size: .75rem; }
.person em { margin-left: auto; padding: 3px 7px; border-radius: 20px; background: #edf6f2; color: var(--green); font-size: .72rem; font-style: normal; font-weight: 800; }
.card > p { min-height: 39px; margin: 12px 0; font-size: .78rem; line-height: 1.5; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chips span { padding: 4px 7px; border-radius: 5px; background: #edf2ef; color: #56635e; font-size: .67rem; }
.chips .high { background: #fff0ed; color: #bd5148; }
.stage-age { margin-top: 11px; padding: 7px 9px; display: flex; justify-content: space-between; gap: 8px; border-radius: 6px; background: #f5f8f7; color: #50605a; font-size: .72rem; }
.stage-age small { color: #83908a; }
.values { margin: 11px 0; padding: 9px 0; display: grid; grid-template-columns: 1fr 1fr; border-block: 1px solid #edf0ee; }
.values div { display: flex; flex-direction: column; }
.values small, .next small, .info small { color: #83908a; font-size: .68rem; }
.values b { margin-top: 2px; font-size: .78rem; }
.warning-list { margin-bottom: 9px; display: grid; gap: 4px; }
.warning-list span, .detail-alerts span { padding: 6px 7px; border-radius: 6px; background: var(--red-soft); color: #b63e45; font-size: .7rem; font-weight: 700; }
.next { position: relative; padding-right: 74px; display: flex; flex-direction: column; }
.next b { margin-top: 3px; font-size: .74rem; }
.next span { position: absolute; right: 0; bottom: 0; color: var(--muted); font-size: .7rem; }
.card-comments { margin-top: 10px; padding-top: 8px; border-top: 1px solid #edf0ee; color: #75827c; font-size: .68rem; }
.loss-card { border-color: #ead7d9; }
.loss-card:hover, .loss-card:focus { border-color: #d99ca1; }
.loss-card .person > span { background: #fff0f0; color: var(--red); }
.loss-card .person em { background: var(--red-soft); color: var(--red); }
.loss-reason { margin-top: 13px; padding: 11px; border-radius: 8px; background: #fff6f6; }
.loss-reason small, .loss-dates small { color: #917176; font-size: .68rem; }
.loss-reason b { display: block; margin-top: 2px; color: #a8363e; font-size: .8rem; }
.loss-reason p { margin: 7px 0 0; color: #745b5e; font-size: .74rem; line-height: 1.45; }
.loss-dates { margin-top: 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.loss-dates > span { padding: 8px; display: flex; flex-direction: column; border-radius: 7px; background: #f8f5f5; }
.loss-dates b { margin-top: 3px; font-size: .7rem; }
.loss-dates .resume-due { background: var(--red-soft); color: var(--red); }

.dashboard-grid { padding: 0 28px 28px; display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; }
.panel { padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.panel > p { font-size: .86rem; }
.segments { grid-column: 1 / 3; }
.conversion #conversion { margin-top: 22px; }
.conversion-row { margin: 12px 0; display: grid; grid-template-columns: 185px 70px 1fr 42px; gap: 10px; align-items: center; }
.conversion-row > span { font-size: .82rem; font-weight: 700; }
.conversion-row > b { font-size: .78rem; }
.conversion-row > i { height: 8px; overflow: hidden; border-radius: 10px; background: #eaf0ed; }
.conversion-row > i b { display: block; height: 100%; border-radius: 10px; background: var(--green-2); }
.conversion-row small { color: var(--muted); text-align: right; }
.result { margin-top: 19px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.result div, .activity-kpis #activityKpis > div { min-width: 0; padding: 13px; display: flex; flex-direction: column; gap: 4px; border-radius: 8px; background: #f5f8f7; }
.result small, .activity-kpis small { color: var(--muted); }
.result span, .activity-kpis span { color: #7b8882; font-size: .75rem; }
.result .bad, .activity-kpis .bad { background: var(--red-soft); }
.result .bad b, .activity-kpis .bad b { color: var(--red); }
.result .ok, .activity-kpis .ok { background: var(--green-soft); }
.result .ok b, .activity-kpis .ok b { color: var(--green); }
.health-grid { margin-top: 19px; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.health-grid > div { padding: 13px; display: flex; align-items: center; gap: 9px; border-radius: 8px; background: var(--green-soft); }
.health-grid > div.attention { background: var(--red-soft); color: var(--red); }
.health-grid b { font-size: 1.2rem; }
.health-grid span { color: inherit; font-size: .78rem; }
.loss-numbers { margin-top: 19px; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.loss-numbers div { padding: 13px; display: flex; flex-direction: column; border-radius: 8px; background: #f5f8f7; }
.loss-numbers b { font-size: 1.25rem; }
.loss-numbers span { color: var(--muted); font-size: .75rem; }
.reason-list { margin-top: 12px; display: grid; gap: 6px; }
.reason-list > span { padding: 8px 9px; display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); font-size: .78rem; }
.reason-list em { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; background: #edf2ef; font-style: normal; }
.table-wrap { max-width: 100%; overflow-x: auto; }
table { width: 100%; margin-top: 18px; border-collapse: collapse; font-size: .8rem; }
th, td { padding: 11px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-size: .67rem; text-transform: uppercase; }

.activity-grid { padding: 24px 28px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; }
.attempt-title { display: flex; align-items: center; gap: 12px; }
.attempt-title > span { flex: 0 0 auto; width: 56px; height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 10px; background: var(--dark); color: #fff; font-size: 1.2rem; font-weight: 800; }
.attempt-title small { font-size: .58rem; }
.attempt-title p { margin: 0; }
.counter { margin: 42px 0 20px; display: flex; justify-content: center; align-items: center; gap: 20px; }
.counter button { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; background: #fff; font-size: 1.2rem; }
.counter strong { font-size: 3.1rem; line-height: 1; }
.counter span { color: var(--muted); }
.progress { height: 9px; overflow: hidden; border-radius: 10px; background: #e5ece9; }
.progress i { display: block; height: 100%; border-radius: 10px; background: var(--green-2); transition: width .25s; }
.batch { margin-top: 27px; display: flex; justify-content: flex-end; align-items: end; gap: 10px; }
.batch label, .modal label { display: flex; flex-direction: column; gap: 6px; font-size: .78rem; font-weight: 700; }
.batch input { width: 95px; padding: 9px; border: 1px solid var(--line); border-radius: 8px; }
.activity-kpis #activityKpis { margin-top: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.quick-actions { margin-top: 13px; display: flex; flex-wrap: wrap; gap: 8px; }
.checklist { margin: 8px 0 0; padding: 0; list-style: none; color: #43524d; line-height: 2.15; }
.checklist li:before { content: "✓"; margin-right: 9px; color: var(--green); font-weight: 800; }
.mini-summary { margin-top: 22px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.mini-summary div { padding: 14px 8px; display: flex; flex-direction: column; align-items: center; border-radius: 8px; background: #f4f7f6; }
.mini-summary b { font-size: 1.35rem; }
.mini-summary span { color: var(--muted); font-size: .72rem; }
.red-text { color: var(--red); background: var(--red-soft) !important; }

.alerts-panel, .resume-panel { margin: 0 28px 28px; }
.alert-row { width: 100%; min-height: 76px; padding: 14px; display: flex; align-items: center; gap: 12px; border: 0; border-top: 1px solid var(--line); background: #fff; text-align: left; }
.alert-row:hover { background: #fafcfb; }
.alert-row > strong { color: var(--red); }
.alert-row div { display: flex; flex-direction: column; gap: 2px; }
.alert-row div b { color: var(--red); font-size: .78rem; }
.alert-row small { color: var(--muted); }
.alert-row i { margin-left: auto; color: var(--green); font-size: .75rem; font-style: normal; }
.empty-state { padding: 42px 15px; color: var(--muted); text-align: center; }

.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.panel-heading p { margin: 0; }
.resume-row { min-height: 90px; padding: 14px 4px; display: grid; grid-template-columns: 1fr 150px auto; gap: 18px; align-items: center; border-top: 1px solid var(--line); }
.resume-row:first-of-type { margin-top: 16px; }
.resume-row.due { margin-inline: -8px; padding-inline: 12px; border-radius: 8px; background: #fff8f8; }
.resume-row > div:first-child { display: flex; flex-direction: column; gap: 3px; }
.resume-row small { color: var(--red); font-weight: 800; }
.resume-row span { color: var(--muted); font-size: .78rem; }
.resume-date { display: flex; flex-direction: column; }
.resume-date span { margin-top: 3px; }
.resume-actions { display: flex; gap: 7px; }

.admin-grid { padding: 24px 28px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.calibration-status { margin-top: 20px; padding: 13px; display: flex; flex-direction: column; border-radius: 9px; }
.calibration-status.learning { background: var(--amber-soft); color: var(--amber); }
.calibration-status.ready { background: var(--green-soft); color: var(--green); }
.calibration-status span { margin-top: 3px; color: inherit; font-size: .78rem; }
.calibration-item { margin: 20px 0; }
.calibration-item > div:first-child { margin-bottom: 8px; display: flex; justify-content: space-between; gap: 12px; }
.calibration-item span { color: var(--muted); font-size: .75rem; }
.last-review { display: block; margin: 15px 0; color: var(--muted); }
.rules-table td:nth-child(2), .rules-table td:nth-child(3) { text-align: center; }
.rules-table th:nth-child(2), .rules-table th:nth-child(3) { text-align: center; }

.overlay { display: none; position: fixed; inset: 0; z-index: 30; justify-content: flex-end; background: rgba(8, 29, 23, .55); backdrop-filter: blur(2px); }
.overlay.open { display: flex; }
.overlay.center { align-items: center; justify-content: center; }
.drawer { position: relative; width: min(570px, 100%); height: 100%; padding: 30px; overflow-y: auto; background: #fff; box-shadow: -18px 0 45px rgba(11, 40, 31, .18); }
.close { position: absolute; z-index: 2; top: 13px; right: 17px; width: 35px; height: 35px; border: 0; background: transparent; color: #71807b; font-size: 1.8rem; line-height: 1; }
.detail-title { padding-right: 35px; display: flex; gap: 11px; align-items: center; }
.detail-title > span { width: 48px; height: 48px; font-size: 1.15rem; }
.detail-title h2 { margin: 0 0 3px; }
.detail-title p { margin: 0; }
.stage-line { margin: 22px 0 12px; padding: 12px; display: flex; justify-content: space-between; gap: 10px; border-radius: 8px; background: var(--green-soft); color: var(--green); font-size: .8rem; }
.detail-alerts { margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 5px; }
.loss-detail { margin: 20px 0 0; padding: 14px; display: flex; flex-direction: column; border: 1px solid #f0c7ca; border-radius: 9px; background: var(--red-soft); }
.loss-detail b { color: var(--red); }
.loss-detail span { margin-top: 4px; font-weight: 700; }
.loss-detail p { margin: 8px 0; color: #6f4c4e; }
.loss-detail small { color: #8f6063; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 14px; }
.info { min-width: 0; padding: 9px 0; display: flex; flex-direction: column; gap: 4px; }
.info b { font-size: .82rem; overflow-wrap: anywhere; }
.drawer h3 { margin: 20px 0 6px; padding-top: 17px; border-top: 1px solid var(--line); }
.action-box { padding: 12px; display: flex; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 8px; background: #f6f8f7; }
.action-box span { color: var(--muted); }
.section-heading { margin-top: 20px; padding-top: 14px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); }
.section-heading h3 { margin: 0; padding: 0; border: 0; }
.section-heading button { min-height: 31px; padding: 5px 9px; color: var(--green); font-size: .74rem; }
.comment-heading h3 { display: flex; align-items: center; gap: 7px; }
.comment-heading h3 span { min-width: 22px; padding: 2px 6px; border-radius: 20px; background: #edf3f0; color: var(--green); font-size: .68rem; text-align: center; }
.comment-composer { margin-top: 10px; padding: 11px; border: 1px solid var(--line); border-radius: 9px; background: #f7f9f8; }
.comment-composer textarea { width: 100%; min-height: 74px; padding: 9px 10px; resize: vertical; border: 1px solid #d6dfdb; border-radius: 8px; background: #fff; color: var(--text); font: inherit; }
.comment-composer > div { margin-top: 7px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.comment-composer small { color: var(--muted); font-size: .68rem; }
.comment-composer button { min-height: 34px; padding: 7px 11px; border: 1px solid var(--green); border-radius: 7px; background: var(--green); color: #fff; font-size: .74rem; font-weight: 700; }
.comments-list { margin-top: 9px; display: grid; gap: 7px; }
.comment-row { padding: 10px; display: grid; grid-template-columns: 32px 1fr; gap: 9px; border: 1px solid #e6ece9; border-radius: 8px; background: #fff; }
.comment-avatar { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: .75rem; font-weight: 800; }
.comment-row > div:last-child { min-width: 0; }
.comment-row header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.comment-row header b { font-size: .76rem; }
.comment-row time { color: var(--muted); font-size: .66rem; }
.comment-row p { margin: 5px 0 0; color: #4e5c56; font-size: .78rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.followup-row { padding: 10px 0; display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; border-bottom: 1px solid #edf1ef; }
.followup-row.overdue { color: var(--red); }
.followup-row > div { display: flex; flex-direction: column; }
.followup-row span { color: var(--muted); font-size: .73rem; }
.followup-row em { padding: 3px 7px; border-radius: 20px; background: #edf3f0; color: #5f6d67; font-size: .67rem; font-style: normal; }
.followup-row em.status-pendente { background: var(--amber-soft); color: var(--amber); }
.followup-row em.status-concluido { background: var(--green-soft); color: var(--green); }
.followup-row button { padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--green); font-size: .7rem; }
.empty-inline { padding: 14px 0; color: var(--muted); font-size: .8rem; }
.timeline { margin-top: 5px; }
.event-row { position: relative; padding: 8px 0 10px 21px; display: flex; gap: 8px; }
.event-row:before { content: ""; position: absolute; left: 5px; top: 17px; bottom: -9px; width: 1px; background: #dce6e2; }
.event-row:last-child:before { display: none; }
.event-row > i { position: absolute; left: 1px; top: 14px; width: 9px; height: 9px; border: 2px solid #fff; border-radius: 50%; background: var(--green-2); box-shadow: 0 0 0 1px #b9d9cc; }
.event-row > div { flex: 1; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; }
.event-row span { color: var(--muted); font-size: .72rem; }
.event-row p { grid-column: 1 / 3; margin: 3px 0 0; color: #59665f; font-size: .78rem; }
.drawer-actions, .actions { margin-top: 25px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }

.modal { position: relative; width: min(760px, calc(100% - 28px)); max-height: 91vh; padding: 27px; overflow-y: auto; border-radius: 14px; background: #fff; box-shadow: var(--shadow); }
.wide-modal { width: min(850px, calc(100% - 28px)); }
.small-modal, .loss-modal { width: min(540px, calc(100% - 28px)); }
.modal fieldset { margin: 21px 0 0; padding: 16px; border: 1px solid var(--line); border-radius: 10px; }
.modal legend { padding: 0 7px; color: var(--green); font-size: .76rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.form-grid input, .form-grid select, .form-grid textarea, .small-modal > label input, .small-modal > label select, .small-modal > label textarea, .loss-modal input, .loss-modal select, .loss-modal textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid #d6dfdb;
  border-radius: 8px;
  background: #fff;
}
.form-grid textarea, .small-modal textarea, .loss-modal textarea { min-height: 78px; resize: vertical; }
.full { grid-column: 1 / 3; }
.small-modal > label, .loss-modal > label { margin-top: 15px; }
.modal label small { color: var(--muted); font-weight: 400; }
.modal input[readonly] { color: #53635c; background: #f2f5f4; }
.hidden { display: none !important; }

#toast { display: none; position: fixed; z-index: 60; left: 50%; bottom: 25px; padding: 12px 18px; border-radius: 9px; background: #173b31; color: #fff; box-shadow: var(--shadow); transform: translateX(-50%); }
#toast.show { display: block; }
#toast.error { background: #a82f37; }

@media (max-width: 1080px) {
  .metrics { grid-template-columns: 1fr 1fr; }
  .dashboard-grid, .activity-grid, .admin-grid { grid-template-columns: 1fr; }
  .segments { grid-column: auto; }
}

@media (max-width: 820px) {
  body { font-size: 14px; }
  .sidebar { inset: auto 0 0; width: 100%; height: 70px; padding: 7px 8px; display: block; }
  .brand, .user { display: none; }
  .sidebar nav { display: flex; gap: 4px; overflow-x: auto; }
  .sidebar nav button { min-width: 86px; height: 55px; padding: 5px 8px; flex-direction: column; justify-content: center; gap: 1px; font-size: .68rem; }
  .sidebar nav button > span { font-size: 1rem; }
  .sidebar nav b { position: absolute; margin: -27px 0 0 39px; }
  main { margin-left: 0; padding-bottom: 70px; }
  header { min-height: 78px; padding: 14px 16px; }
  .metrics { padding: 14px; }
  .filters { margin: 0 14px 12px; }
  .board { padding: 0 14px 24px; }
  .dashboard-grid, .activity-grid, .admin-grid { padding: 0 14px 20px; }
  .alerts-panel, .resume-panel { margin: 0 14px 20px; }
  .conversion-row { grid-template-columns: 165px 65px 1fr 38px; }
  .resume-row { grid-template-columns: 1fr auto; }
  .resume-row .resume-actions { grid-column: 1 / 3; justify-content: flex-end; }
}

@media (max-width: 560px) {
  header h1 { font-size: 1.15rem; }
  header p { display: none; }
  header .primary { padding-inline: 10px; font-size: .76rem; }
  .metrics { grid-template-columns: 1fr 1fr; gap: 8px; }
  .metric { padding: 12px; }
  .metric b { font-size: 1.15rem; }
  .filters { flex-wrap: wrap; }
  .filters input { width: 100%; }
  .filters span { margin-left: 0; }
  .panel { padding: 16px; }
  .conversion-row { grid-template-columns: 1fr 58px 70px; }
  .conversion-row small { display: none; }
  .result, .health-grid, .activity-kpis #activityKpis { grid-template-columns: 1fr; }
  .batch { align-items: stretch; flex-direction: column; }
  .batch input { width: 100%; }
  .mini-summary { grid-template-columns: 1fr 1fr 1fr; }
  .alert-row i { display: none; }
  .panel-heading { flex-direction: column; }
  .resume-row { grid-template-columns: 1fr; }
  .resume-row .resume-actions { grid-column: auto; justify-content: flex-start; }
  .form-grid, .info-grid { grid-template-columns: 1fr; }
  .full { grid-column: auto; }
  .modal fieldset { padding: 13px; }
  .drawer { padding: 25px 18px; }
  .stage-line { align-items: flex-start; flex-direction: column; }
  .followup-row { grid-template-columns: 1fr auto; }
  .followup-row button { grid-column: 1 / 3; }
  .action-box { flex-direction: column; }
}
