@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600;700&family=Manrope:wght@400;500;600;700&display=swap');

:root {
  --bg: #eee7dd;
  --bg-deep: #e4d9cc;
  --surface: #fffaf4;
  --surface-soft: #f6efe7;
  --ink: #392d32;
  --muted: #7d6c6c;
  --accent: #745185;
  --accent-hover: #654474;
  --accent-soft: #eadff0;
  --accent-faint: #f5eef7;
  --brown: #9a7c69;
  --brown-soft: #d8c6b8;
  --line: #ded1c6;
  --dark: #49343f;
  --dark-soft: #5d4352;
  --heading-font: 'Cormorant Garamond', Georgia, serif;
  --body-font: 'Manrope', 'Segoe UI', sans-serif;
  font-family: var(--body-font);
}

/* Refinamentos do editor e da listagem de orçamentos */
.compact-list{gap:7px}.compact-budget-row,.compact-payment-row{padding:11px 13px}.compact-budget-row .budget-item-top,.compact-payment-row .budget-item-top{margin-bottom:8px}.compact-service-grid,.compact-payment-grid{display:grid;grid-template-columns:minmax(240px,1.6fr) minmax(150px,.7fr);gap:9px}.inline-status-form{display:grid;grid-template-columns:auto minmax(105px,1fr) auto;align-items:center;gap:6px;min-width:300px}.inline-status-form select{min-width:0;padding:6px;border:1px solid var(--line);border-radius:7px;color:var(--ink);background:var(--surface-soft);font:inherit;font-size:9px}.status-update-button{padding:7px 8px;border:0;border-radius:7px;color:#fff;background:var(--accent);font:inherit;font-size:9px;font-weight:700;cursor:pointer}@media(max-width:760px){.compact-service-grid,.compact-payment-grid{grid-template-columns:1fr}.inline-status-form{min-width:265px}}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 85% 5%, rgba(116, 81, 133, .08), transparent 28rem),
    var(--bg);
}

button,
input {
  font: inherit;
}

h1,
h2 {
  font-family: var(--heading-font);
  font-weight: 600;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.auth-shell {
  width: min(1060px, 100%);
  min-height: 620px;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  background: var(--surface);
  border: 1px solid rgba(154, 124, 105, .18);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(73, 52, 63, .16);
}

.brand-panel {
  position: relative;
  padding: 72px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(145deg, var(--dark) 0%, #533a4c 58%, #67485e 100%);
  color: #fffaf4;
}

.brand-panel::after {
  content: '';
  position: absolute;
  width: 340px;
  height: 340px;
  right: -170px;
  bottom: -180px;
  border: 1px solid rgba(238, 231, 221, .16);
  border-radius: 50%;
  box-shadow: 0 0 0 55px rgba(238, 231, 221, .035), 0 0 0 110px rgba(238, 231, 221, .025);
}

.brand-panel h1 {
  position: relative;
  margin: 10px 0 18px;
  font-size: clamp(60px, 7vw, 90px);
  line-height: .9;
  letter-spacing: -3px;
}

.brand-panel p {
  position: relative;
  max-width: 460px;
  color: #e6dce0;
  font-size: 17px;
  line-height: 1.7;
}

.eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .18em;
  color: var(--accent);
}

.brand-panel .eyebrow {
  color: #d7bccd;
}

.pipeline-mini {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 36px;
}

.pipeline-mini span {
  border: 1px solid rgba(232, 218, 226, .28);
  border-radius: 999px;
  padding: 9px 12px;
  color: #f0e7ec;
  font-size: 11px;
}

.login-card {
  padding: 72px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
  background: linear-gradient(160deg, var(--surface), #fbf4ec);
}

.login-card h2 {
  margin: 8px 0;
  color: var(--dark);
  font-size: 40px;
  line-height: 1.05;
}

.muted {
  color: var(--muted);
}

.form-stack {
  display: grid;
  gap: 18px;
}

.form-stack label {
  display: grid;
  gap: 8px;
  color: #58474c;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
}

.form-stack input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  padding: 14px 16px;
  color: var(--ink);
  background: rgba(255, 253, 249, .78);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.form-stack input:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(116, 81, 133, .11);
}

.primary-button,
.ghost-button {
  border-radius: 12px;
  padding: 14px 18px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}

.primary-button {
  border: 0;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 9px 24px rgba(116, 81, 133, .22);
}

.primary-button:hover {
  transform: translateY(-1px);
  background: var(--accent-hover);
  box-shadow: 0 12px 28px rgba(116, 81, 133, .28);
}

.ghost-button {
  width: 100%;
  border: 1px solid rgba(235, 221, 229, .27);
  color: #eee2e8;
  background: transparent;
}

.ghost-button:hover {
  border-color: rgba(235, 221, 229, .5);
  background: rgba(255, 255, 255, .07);
}

.alert {
  padding: 12px 14px;
  border: 1px solid #e8c9c4;
  border-radius: 10px;
  color: #8c3e39;
  background: #fff1ee;
}

.app-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px 1fr;
}

.sidebar {
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  color: #fffaf4;
  background: linear-gradient(180deg, var(--dark), #412f38);
  box-shadow: 12px 0 42px rgba(73, 52, 63, .09);
}

.sidebar-brand {
  margin: 0 10px 34px;
  font-family: var(--heading-font);
  font-size: 38px;
  font-weight: 600;
  letter-spacing: -1px;
}

.sidebar nav {
  display: grid;
  gap: 6px;
  flex: 1;
}

.sidebar a {
  padding: 12px 14px;
  border-radius: 10px;
  color: #d8c9cf;
  text-decoration: none;
  font-size: 13px;
  transition: color .2s ease, background .2s ease, transform .2s ease;
}

.sidebar a.active,
.sidebar a:hover {
  color: #fff;
  background: rgba(150, 105, 165, .28);
  transform: translateX(2px);
}

.content {
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  padding: 42px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

.topbar h1 {
  margin: 5px 0;
  color: var(--dark);
  font-size: 48px;
  line-height: 1;
}

.profile-chip {
  padding: 10px 14px;
  border: 1px solid #d9c6e1;
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.metric,
.panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 250, 244, .92);
  box-shadow: 0 8px 30px rgba(87, 66, 70, .055);
}

.metric {
  position: relative;
  min-height: 145px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.metric::after {
  content: '';
  position: absolute;
  width: 52px;
  height: 3px;
  right: 22px;
  top: 22px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--brown-soft), var(--accent));
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  color: var(--dark);
  font-family: var(--heading-font);
  font-size: 48px;
  font-weight: 600;
  line-height: 1;
}

.panel {
  margin-top: 18px;
  padding: 26px;
}

.panel h2 {
  margin: 4px 0 0;
  color: var(--dark);
  font-size: 32px;
}

.panel-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.pipeline {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  margin-top: 24px;
}

.pipeline div {
  min-height: 110px;
  padding: 16px;
  border: 1px solid #e5d8cf;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(145deg, var(--surface-soft), #f8f1eb);
}

.pipeline div:nth-child(even) {
  border-color: #decfe4;
  background: linear-gradient(145deg, var(--accent-faint), #f7f0f5);
}

.pipeline strong {
  color: #59424e;
  font-size: 13px;
}

.pipeline span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.pipeline b { color:var(--accent); font-family:var(--heading-font); font-size:30px; font-weight:600; }

@media (max-width: 900px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .brand-panel,
  .login-card {
    padding: 42px;
  }

  .app-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .pipeline {
    grid-template-columns: 1fr;
  }

  .content {
    padding: 24px;
  }
}

@media (max-width: 560px) {
  .auth-page {
    padding: 0;
  }

  .auth-shell {
    min-height: 100vh;
    border-radius: 0;
  }

  .brand-panel,
  .login-card {
    padding: 32px 24px;
  }

  .brand-panel h1 {
    font-size: 58px;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Clientes */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.page-header h1 {
  margin: 5px 0;
  color: var(--dark);
  font-size: clamp(42px, 5vw, 58px);
  line-height: 1;
}

.page-header p {
  margin: 8px 0 0;
}

.compact-header {
  margin-bottom: 20px;
}

.button-link,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.secondary-button {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 17px;
  color: var(--dark);
  background: var(--surface);
  font-weight: 700;
  cursor: pointer;
}

.secondary-button:hover {
  border-color: var(--brown-soft);
  background: var(--surface-soft);
}

.back-link {
  display: block;
  width: fit-content;
  margin-bottom: 22px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.filters {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 220px auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 250, 244, .78);
}

.filters.simple-filter {
  grid-template-columns: minmax(260px, 1fr) auto;
}

.filters.project-filters { grid-template-columns: minmax(230px, 1fr) 180px 200px auto; }
.check-field { display:flex; align-items:center; gap:10px; margin:0 0 20px 46px; color:var(--dark); font-size:13px; font-weight:700; }
.check-field input[type="checkbox"] { accent-color:var(--accent); width:17px; height:17px; }
.stage-badge { display:inline-flex; padding:7px 10px; border-radius:999px; color:var(--accent); background:var(--accent-soft); font-size:10px; font-weight:700; }
.stage-pausado { color:#7d6542; background:#eee3cf; }.stage-cancelado { color:#8c3e39; background:#f5dcda; }.stage-concluido { color:#476552; background:#dce9df; }
.overdue { color:#9b463f; font-weight:700; }
.project-summary { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin-bottom:16px; }
.project-summary > div { padding:18px; border:1px solid var(--line); border-radius:15px; background:var(--surface); }
.project-summary span,.project-summary strong { display:block; }.project-summary span { color:var(--muted); font-size:10px; text-transform:uppercase; letter-spacing:.08em; }.project-summary strong { margin-top:8px; color:var(--dark); font-family:var(--heading-font); font-size:21px; }
.primary-button:disabled { opacity:.45; cursor:not-allowed; transform:none; }
[hidden] { display:none !important; }
.checklist-block { margin-top:24px; padding-top:22px; border-top:1px solid var(--line); }
.checklist-block > div:first-child strong,.checklist-block > div:first-child small { display:block; }.checklist-block > div:first-child strong { color:var(--dark); font-size:13px; }.checklist-block > div:first-child small { margin-top:4px; color:var(--muted); }
.project-checklist { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:9px; margin-top:16px; }
.project-checklist label { position:relative; cursor:pointer; }.project-checklist input { position:absolute; opacity:0; }.project-checklist span { min-height:50px; padding:11px 13px; border:1px solid var(--line); border-radius:11px; display:flex; align-items:center; color:#604f53; background:#fffcf8; font-size:11px; font-weight:600; transition:.2s ease; }
.project-checklist input:checked + span { border-color:var(--accent); color:var(--accent); background:var(--accent-faint); box-shadow:inset 0 0 0 1px var(--accent); }
.project-checklist input:focus-visible + span { box-shadow:0 0 0 4px rgba(116,81,133,.12); }
.included-tags { display:flex; flex-wrap:wrap; gap:6px; }.included-tags span { padding:6px 9px; border-radius:999px; color:var(--accent); background:var(--accent-soft); font-size:10px; font-weight:700; }
@media(max-width:900px){.filters.project-filters{grid-template-columns:1fr 1fr}.project-summary{grid-template-columns:1fr 1fr}}
@media(max-width:900px){.project-checklist{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:560px){.filters.project-filters,.project-summary,.project-checklist{grid-template-columns:1fr}}

/* Estrutura responsiva compartilhada */
.app-layout { grid-template-columns:264px minmax(0,1fr); }
.sidebar { position:sticky; top:0; width:264px; height:100vh; z-index:30; }
.sidebar-brand { text-align:center; }
.sidebar nav a { display:flex; min-height:44px; align-items:center; justify-content:center; text-align:center; }
.content { min-width:0; }
.mobile-topbar,.sidebar-overlay { display:none; }
.static-field { min-height:76px; padding:12px 14px; border:1px solid var(--line); border-radius:11px; background:var(--accent-faint); }
.static-field strong { color:var(--accent); font-size:14px; }.static-field small { color:var(--muted); }

/* Kanban */
.kanban-content { max-width:none; overflow:hidden; }
.kanban-board { display:grid; grid-auto-flow:column; grid-auto-columns:minmax(280px,320px); gap:14px; padding:4px 2px 20px; overflow-x:auto; overscroll-behavior-inline:contain; scroll-snap-type:x proximity; scrollbar-color:var(--brown-soft) transparent; }
.kanban-column { min-height:570px; border:1px solid var(--line); border-radius:17px; display:flex; flex-direction:column; background:rgba(246,239,231,.82); scroll-snap-align:start; transition:border-color .2s,background .2s; }
.kanban-column.drag-over { border-color:var(--accent); background:var(--accent-faint); }
.kanban-column > header { padding:16px; border-bottom:1px solid var(--line); display:flex; align-items:center; justify-content:space-between; }
.kanban-column > header > div { display:flex; align-items:center; gap:9px; }.kanban-column h2 { margin:0; color:var(--dark); font-family:var(--body-font); font-size:12px; }.kanban-column > header b { min-width:25px; height:25px; border-radius:99px; display:grid; place-items:center; color:var(--accent); background:var(--accent-soft); font-size:10px; }
.stage-dot { width:8px; height:8px; border-radius:50%; background:var(--accent); }
.kanban-dropzone { min-height:500px; padding:10px; display:flex; flex-direction:column; gap:10px; }
.kanban-empty { margin:auto; max-width:160px; color:var(--muted); font-size:11px; line-height:1.6; text-align:center; }
.kanban-card { padding:15px; border:1px solid #e1d5cb; border-radius:13px; background:var(--surface); box-shadow:0 6px 18px rgba(73,52,63,.06); cursor:grab; transition:transform .2s,box-shadow .2s,opacity .2s; }
.kanban-card:hover { transform:translateY(-2px); box-shadow:0 10px 24px rgba(73,52,63,.11); }.kanban-card.dragging { opacity:.45; cursor:grabbing; }
.card-topline { display:flex; justify-content:space-between; align-items:center; }.card-topline span { color:var(--accent); font-size:9px; font-weight:700; letter-spacing:.07em; }.card-topline a { color:var(--accent); text-decoration:none; font-size:17px; }
.kanban-card h3 { margin:11px 0 5px; color:var(--dark); font-family:var(--heading-font); font-size:21px; line-height:1.05; }.kanban-card > p { margin:0 0 14px; color:var(--muted); font-size:11px; }
.kanban-card dl { margin:0; padding-top:12px; border-top:1px solid var(--line); display:grid; gap:8px; }.kanban-card dl div { display:flex; justify-content:space-between; gap:10px; }.kanban-card dt { color:var(--muted); font-size:9px; text-transform:uppercase; }.kanban-card dd { margin:0; color:var(--ink); font-size:10px; text-align:right; }
.card-stage-select { display:grid; gap:5px; margin-top:13px; }.card-stage-select span { color:var(--muted); font-size:9px; font-weight:700; text-transform:uppercase; }.card-stage-select select { width:100%; border:1px solid var(--line); border-radius:9px; padding:9px; color:var(--ink); background:var(--surface-soft); font:inherit; font-size:10px; }
.card-project-checklist { margin-top:13px; padding-top:12px; border-top:1px solid var(--line); }.checklist-title { display:flex; align-items:center; justify-content:space-between; margin-bottom:8px; }.checklist-title span { color:var(--muted); font-size:9px; font-weight:700; text-transform:uppercase; }.checklist-title b { padding:3px 6px; border-radius:99px; color:var(--accent); background:var(--accent-soft); font-size:9px; }.checklist-items { display:grid; gap:5px; max-height:135px; overflow-y:auto; padding-right:3px; }.checklist-items label { cursor:pointer; }.checklist-items input { position:absolute; opacity:0; }.checklist-items label > span { display:flex; align-items:center; gap:7px; color:#65565a; font-size:10px; line-height:1.3; }.checklist-items i { width:14px; height:14px; flex:0 0 14px; border:1px solid var(--brown-soft); border-radius:4px; display:grid; place-items:center; background:#fff; }.checklist-items .is-complete > span { color:var(--muted); text-decoration:line-through; }.checklist-items .is-complete i { border-color:var(--accent); background:var(--accent); }.checklist-items .is-complete i::after { content:'✓'; color:#fff; font-size:9px; font-style:normal; }.checklist-items input:focus-visible + span i { box-shadow:0 0 0 3px rgba(116,81,133,.15); }
.kanban-feedback { min-height:20px; margin-top:-18px; color:var(--accent); font-size:11px; text-align:right; }
.included-project-row { display:grid; grid-template-columns:14px minmax(72px,1fr) minmax(92px,112px); align-items:center; gap:7px; }
.included-project-name { color:#65565a; font-size:10px; line-height:1.25; }
.included-project-row select { min-width:0; width:100%; padding:6px 5px; border:1px solid var(--line); border-radius:7px; color:var(--ink); background:var(--surface-soft); font:inherit; font-size:9px; }
.completion-box { width:14px; height:14px; border:1px solid var(--brown-soft); border-radius:4px; display:grid; place-items:center; background:#fff; }
.included-project-row.is-complete .completion-box { border-color:var(--accent); background:var(--accent); }
.included-project-row.is-complete .completion-box::after { content:'✓'; color:#fff; font-size:9px; }
.included-project-row.is-complete .included-project-name { color:var(--muted); text-decoration:line-through; }
.card-notes { display:grid; gap:6px; margin-top:13px; padding-top:12px; border-top:1px solid var(--line); }
.card-notes > span { color:var(--muted); font-size:9px; font-weight:700; text-transform:uppercase; }
.card-notes textarea { width:100%; resize:vertical; min-height:58px; padding:8px; border:1px solid var(--line); border-radius:9px; color:var(--ink); background:var(--surface-soft); font:inherit; font-size:10px; line-height:1.4; }
.card-notes button { justify-self:end; padding:6px 9px; border:0; border-radius:7px; color:#fff; background:var(--accent); font:inherit; font-size:9px; font-weight:700; cursor:pointer; }
.card-notes button:disabled { opacity:.5; cursor:wait; }

/* Kanban em duas camadas: entregas técnicas e projetos gerais */
.kanban-page-header { margin-bottom:18px; }
.kanban-view-tabs { width:min(540px,100%); display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin-bottom:16px; padding:6px; border:1px solid var(--line); border-radius:16px; background:rgba(255,250,244,.72); }
.kanban-view-tabs button { min-height:66px; border:1px solid transparent; border-radius:11px; padding:10px 13px; display:grid; grid-template-columns:1fr auto; align-items:center; gap:2px 10px; color:var(--muted); background:transparent; text-align:left; cursor:pointer; transition:border-color .2s,background .2s,box-shadow .2s,color .2s; }
.kanban-view-tabs button:hover { color:var(--dark); background:var(--surface-soft); }
.kanban-view-tabs button:focus-visible { outline:3px solid rgba(116,81,133,.16); outline-offset:2px; }
.kanban-view-tabs button.is-active { border-color:#d9c6e1; color:var(--accent); background:var(--surface); box-shadow:0 5px 16px rgba(73,52,63,.07); }
.kanban-view-tabs span { font-size:12px; font-weight:800; }.kanban-view-tabs b { min-width:26px; height:26px; border-radius:99px; display:grid; place-items:center; color:var(--accent); background:var(--accent-soft); font-size:10px; }.kanban-view-tabs small { grid-column:1/-1; font-size:9px; }
.kanban-view[hidden],.kanban-filters-wrap[hidden] { display:none; }
.kanban-filters { grid-template-columns:minmax(210px,1.4fr) repeat(5,minmax(145px,1fr)); margin-bottom:12px; }
.kanban-filters .kanban-archive-filter { grid-column:1/3; min-height:40px; display:flex; align-items:center; flex-direction:row; gap:9px; padding:8px 11px; border:1px solid var(--line); border-radius:10px; background:var(--surface-soft); text-transform:none; }
.kanban-archive-filter input { width:16px; height:16px; min-height:0; padding:0; accent-color:var(--accent); }.kanban-archive-filter span { font-size:10px !important; }
.kanban-filter-actions { grid-column:6/7; display:flex; justify-content:flex-end; gap:8px; }.kanban-filter-actions .primary-button,.kanban-filter-actions .secondary-button { min-height:42px; padding:9px 13px; font-size:10px; }
.project-board-intro { margin:0 0 12px; padding:11px 14px; border:1px solid #ddcfe3; border-radius:11px; color:#66536c; background:var(--accent-faint); font-size:10px; line-height:1.5; }.project-board-intro p { margin:0; }

.kanban-column { --stage-color:#826673; --stage-bg:#f4ece8; --stage-border:#dfd0c7; border-color:var(--stage-border); background:var(--stage-bg); }
.kanban-column[data-stage="CRIACAO"],.kanban-column[data-stage="INICIAL"] { --stage-color:#8e725f; --stage-bg:#f4ebe2; --stage-border:#ddcabb; }
.kanban-column[data-stage="REVISAO"] { --stage-color:#76678e; --stage-bg:#eee9f3; --stage-border:#d7cce1; }
.kanban-column[data-stage="CORRECAO"],.kanban-column[data-stage="CANCELADO"] { --stage-color:#98666f; --stage-bg:#f3e5e7; --stage-border:#e1c8cc; }
.kanban-column[data-stage="APROVACAO"],.kanban-column[data-stage="PAUSADO"] { --stage-color:#8d794e; --stage-bg:#f3eedf; --stage-border:#dfd3b8; }
.kanban-column[data-stage="FINALIZADO"],.kanban-column[data-stage="CONCLUIDO"] { --stage-color:#647f6c; --stage-bg:#e7efe8; --stage-border:#c9d9cc; }
.kanban-column[data-stage="EM_ANDAMENTO"] { --stage-color:#696f91; --stage-bg:#e9eaf2; --stage-border:#cdd0df; }
.kanban-column[data-stage="EM_OBRA"] { --stage-color:#966e5d; --stage-bg:#f3e6df; --stage-border:#dec7bc; }
.kanban-column > header { border-color:var(--stage-border); background:rgba(255,255,255,.24); }.kanban-column .stage-dot { background:var(--stage-color); box-shadow:0 0 0 4px rgba(255,255,255,.48); }.kanban-column > header b { color:var(--stage-color); background:rgba(255,255,255,.62); }
.kanban-column.drag-over { border-color:var(--stage-color); background:var(--stage-bg); box-shadow:inset 0 0 0 2px var(--stage-color); }
.kanban-card { cursor:grab; }.kanban-card.is-locked { cursor:default; }.kanban-card.is-archived { border-style:dashed; opacity:.76; background:#f7f2ed; }.kanban-card.is-archived:hover,.kanban-card.is-locked:hover { transform:none; }
.card-badges { display:flex; align-items:center; justify-content:flex-end; gap:5px; }.card-state-badge,.included-stage-badge { border-radius:99px; padding:4px 7px; color:#67565d; background:#eee5e0; font-style:normal; font-size:8px; font-weight:800; white-space:nowrap; }
.card-state-badge.is-archived { color:#776864; background:#ebe3de; }.card-state-badge.stage-inicial,.included-stage-badge.stage-criacao { color:#775d4c; background:#eee0d4; }.card-state-badge.stage-em_andamento { color:#575f85; background:#e0e2ef; }.card-state-badge.stage-finalizado,.card-state-badge.stage-concluido,.included-stage-badge.stage-finalizado { color:#4f6e58; background:#dce9df; }.card-state-badge.stage-em_obra { color:#805b4d; background:#eddbd1; }.card-state-badge.stage-pausado,.included-stage-badge.stage-aprovacao { color:#756238; background:#eee5ca; }.card-state-badge.stage-cancelado,.included-stage-badge.stage-correcao { color:#85545d; background:#efdadd; }.included-stage-badge.stage-revisao { color:#645677; background:#e5dfea; }
.delivery-card h3 { margin-bottom:8px; }.project-identity-tag { margin-bottom:6px; padding:6px 8px; border:1px solid var(--project-tag-border,#ddcabb); border-radius:8px; display:flex; flex-direction:column; gap:2px; color:var(--project-tag-ink,#725e51); background:var(--project-tag-bg,#f3e8df); font-size:9px; line-height:1.3; }.project-identity-tag b { font-size:8px; letter-spacing:.05em; }.project-color-0 { --project-tag-bg:#eee6f1;--project-tag-border:#d7c9dd;--project-tag-ink:#6a5574; }.project-color-1 { --project-tag-bg:#e5eeea;--project-tag-border:#cadbd2;--project-tag-ink:#537061; }.project-color-2 { --project-tag-bg:#f2e7e3;--project-tag-border:#dfcbc3;--project-tag-ink:#805f53; }.project-color-3 { --project-tag-bg:#e8eaf2;--project-tag-border:#cfd3e1;--project-tag-ink:#59617e; }.project-color-4 { --project-tag-bg:#f1eadc;--project-tag-border:#dfd1b5;--project-tag-ink:#79663d; }.project-color-5 { --project-tag-bg:#f0e3e7;--project-tag-border:#dec8cf;--project-tag-ink:#7d5964; }.delivery-client { margin-bottom:14px !important; }.card-lock-note { margin:11px 0 0 !important; padding:8px 9px; border:1px solid #dfd1c8; border-radius:8px; color:#7a6263 !important; background:#f4ebe7; font-size:9px !important; line-height:1.45; }
.included-project-row { grid-template-columns:14px minmax(80px,1fr) auto; }.included-stage-badge { max-width:92px; overflow:hidden; text-overflow:ellipsis; }
.kanban-feedback.is-error { color:#8b5358; }
.card-notes textarea:disabled,.card-stage-select select:disabled { cursor:not-allowed; opacity:.68; }

@media(max-width:1250px) {
  .kanban-filters { grid-template-columns:repeat(3,minmax(160px,1fr)); }
  .kanban-filters .kanban-archive-filter { grid-column:1/3; }.kanban-filter-actions { grid-column:3/4; }
}

@media(max-width:760px) {
  .kanban-view-tabs { width:100%; }.kanban-filters { grid-template-columns:1fr 1fr; }.kanban-filters .kanban-search { grid-column:1/-1; }.kanban-filters .kanban-archive-filter { grid-column:1/-1; }.kanban-filter-actions { grid-column:1/-1; }.kanban-filter-actions > * { flex:1; }
}

@media(max-width:480px) {
  .kanban-view-tabs button { min-height:62px; padding:9px; }.kanban-filters { grid-template-columns:1fr; }.kanban-filters .kanban-search,.kanban-filters .kanban-archive-filter,.kanban-filter-actions { grid-column:auto; }
}

@media(max-width:900px) {
  body.menu-open { overflow:hidden; }
  .app-layout { display:block; min-height:100vh; }
  .mobile-topbar { position:fixed; inset:0 0 auto; height:62px; padding:0 18px; display:flex; align-items:center; gap:15px; z-index:40; color:#fff; background:var(--dark); box-shadow:0 4px 20px rgba(73,52,63,.16); }
  .mobile-topbar > a { color:#fffaf4; font-family:var(--heading-font); font-size:28px; font-weight:600; text-decoration:none; }
  .mobile-menu-toggle { width:42px; height:42px; border:0; border-radius:10px; padding:10px; display:flex; flex-direction:column; justify-content:center; gap:5px; color:#fff; background:rgba(255,255,255,.08); cursor:pointer; }
  .mobile-menu-toggle span { width:100%; height:2px; border-radius:2px; background:currentColor; transition:transform .2s,opacity .2s; }.mobile-menu-toggle.is-open span:nth-child(1){transform:translateY(7px) rotate(45deg)}.mobile-menu-toggle.is-open span:nth-child(2){opacity:0}.mobile-menu-toggle.is-open span:nth-child(3){transform:translateY(-7px) rotate(-45deg)}
  .sidebar { position:fixed; display:flex !important; inset:62px auto 0 0; width:min(82vw,280px); height:calc(100vh - 62px); padding:24px 18px; transform:translateX(-105%); transition:transform .25s ease; box-shadow:18px 0 40px rgba(40,27,34,.24); z-index:39; }.sidebar.is-open { transform:translateX(0); }.sidebar-brand { display:none; }
  .sidebar-overlay { position:fixed; inset:62px 0 0; display:block; visibility:hidden; opacity:0; z-index:38; background:rgba(44,31,38,.45); backdrop-filter:blur(2px); transition:opacity .25s,visibility .25s; }.sidebar-overlay.is-open { visibility:visible; opacity:1; }
  .content { padding:88px 20px 28px; }
  .page-header { align-items:stretch; }.page-header .primary-button { width:100%; }
  .panel-heading { align-items:flex-start; flex-direction:column; }
  .table-wrap { margin:0 -1px; }
  .kanban-content { padding-inline:16px; }.kanban-board { grid-auto-columns:min(82vw,310px); }.kanban-column { min-height:500px; }.kanban-dropzone { min-height:430px; }
}

@media(max-width:560px) {
  .content { padding:82px 14px 24px; }
  .page-header h1,.topbar h1 { font-size:40px; }
  .form-section,.detail-card,.panel { border-radius:14px; padding:18px; }
  .filters { padding:14px; }.form-actions .button-link,.form-actions button { width:100%; }
  .data-table th,.data-table td { padding:14px; }
}

/* Agenda */
.calendar-connection{margin-bottom:18px;padding:18px 20px;border:1px solid var(--line);border-radius:16px;display:flex;align-items:center;justify-content:space-between;gap:18px;background:var(--surface)}.calendar-connection>div{display:flex;align-items:center;gap:13px}.calendar-connection strong{color:var(--dark);font-size:13px}.calendar-connection p{margin:4px 0 0;color:var(--muted);font-size:11px}.google-mark{width:38px;height:38px;border-radius:10px;display:grid;place-items:center;color:#fff;background:linear-gradient(135deg,#745185,#9a7c69);font-weight:800}.calendar-connection.is-connected{border-color:#cab8d2;background:var(--accent-faint)}
.agenda-list{display:grid;gap:10px}.agenda-item{padding:17px 19px;border:1px solid var(--line);border-radius:15px;display:grid;grid-template-columns:58px minmax(0,1fr) auto;align-items:center;gap:17px;background:var(--surface);box-shadow:0 5px 18px rgba(73,52,63,.045)}.agenda-item>time{height:58px;border-radius:12px;display:flex;flex-direction:column;align-items:center;justify-content:center;color:var(--accent);background:var(--accent-soft)}.agenda-item>time strong{font-family:var(--heading-font);font-size:25px;line-height:.9}.agenda-item>time span{margin-top:4px;font-size:9px;font-weight:700;text-transform:uppercase}.agenda-item-top{display:flex;align-items:center;gap:7px}.agenda-item-body h2{margin:7px 0 4px;color:var(--dark);font-family:var(--heading-font);font-size:23px}.agenda-item-body p,.agenda-item-body small{margin:0;color:var(--muted);font-size:10px}.sync-ok,.sync-error{font-size:9px;font-weight:700}.sync-ok{color:#52705d}.sync-error{color:#9b463f}.agenda-actions{display:flex;align-items:center;gap:10px}.agenda-actions a,.agenda-actions button{border:0;padding:0;color:var(--accent);background:none;font:inherit;font-size:10px;font-weight:700;text-decoration:none;cursor:pointer}.agenda-actions button{color:#9b463f}
@media(max-width:700px){.calendar-connection{align-items:stretch;flex-direction:column}.calendar-connection .secondary-button{width:100%}.agenda-item{grid-template-columns:48px minmax(0,1fr);padding:14px}.agenda-item>time{width:48px;height:52px}.agenda-actions{grid-column:2;justify-content:flex-start}}

/* Administração da plataforma — paleta invertida */
.admin-access-link { align-self:center; color:var(--muted); font-size:11px; text-decoration:none; transition:color .2s; }
.admin-access-link:hover { color:var(--accent); text-decoration:underline; }
.admin-signature { position:relative; margin-top:12px; color:#6a4a5d; font-size:12px; font-weight:700; letter-spacing:.14em; text-transform:uppercase; }
.sidebar-brand small { display:block; margin-top:2px; font-family:var(--body-font); font-size:9px; letter-spacing:.18em; text-transform:uppercase; }
.admin-area { background:radial-gradient(circle at 85% 5%,rgba(238,231,221,.12),transparent 28rem),#4b3657; }
.admin-area .sidebar { color:#49343f; background:linear-gradient(180deg,#eee7dd,#d8c6b8); }
.admin-area .sidebar a { color:#604a55; }.admin-area .sidebar a.active,.admin-area .sidebar a:hover { color:#fff; background:#745185; }
.admin-area .sidebar .ghost-button { color:#604a55; border-color:rgba(73,52,63,.25); }
.admin-area .content > .topbar h1,.admin-area .content > .page-header h1,.admin-area .content > .page-header .muted,.admin-area .content > .topbar .muted { color:#fffaf4; }
.admin-area .profile-chip { color:#f5e9dc; border-color:rgba(255,255,255,.25); }
.admin-area .metric,.admin-area .panel,.admin-area .form-section { background:#fffaf4; }
.admin-area .admin-metrics { grid-template-columns:repeat(3,1fr); }
.admin-auth .brand-panel { color:#49343f; background:linear-gradient(145deg,#eee7dd,#d8c6b8); }
.admin-auth .login-card { background:linear-gradient(160deg,#4b3657,#654474); }
.admin-auth .login-card h2,.admin-auth .login-card label { color:#fffaf4; }
.admin-auth .login-card .muted,.admin-auth .admin-access-link { color:#e1d0db; }
.status-badge { display:inline-flex; padding:5px 9px; border-radius:99px; font-size:10px; font-weight:700; }
.status-badge.is-active { color:#42664e; background:#dfede3; }.status-badge.is-frozen { color:#855363; background:#f1dfe5; }
@media(max-width:700px){.admin-area .admin-metrics{grid-template-columns:1fr}}

.filters label,
.field {
  display: grid;
  gap: 8px;
}

.filters label > span,
.field > span {
  color: #604f53;
  font-size: 12px;
  font-weight: 700;
}

.filters input,
.filters select,
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  padding: 13px 14px;
  color: var(--ink);
  background: #fffcf8;
  font: inherit;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.filters input:focus,
.filters select:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(116, 81, 133, .1);
}

.field textarea {
  resize: vertical;
  line-height: 1.55;
}

.data-panel,
.form-section,
.detail-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 250, 244, .92);
  box-shadow: 0 8px 30px rgba(87, 66, 70, .045);
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 17px 20px;
  border-bottom: 1px solid #e8ddd4;
  text-align: left;
  white-space: nowrap;
}

.data-table th {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.data-table td {
  font-size: 13px;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover {
  background: rgba(245, 238, 247, .62);
}

.data-table td strong,
.data-table td small {
  display: block;
}

.data-table td small {
  margin-top: 4px;
  color: var(--muted);
}

.type-badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 10px;
  font-weight: 700;
}

.table-actions {
  text-align: right !important;
}

.table-actions a,
.text-link,
.detail-card a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.empty-state {
  padding: 70px 24px;
  text-align: center;
}

.empty-state h2 {
  margin: 16px 0 6px;
  color: var(--dark);
  font-size: 28px;
}

.empty-monogram {
  width: 54px;
  height: 54px;
  margin: auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--accent);
  font-family: var(--heading-font);
  font-size: 28px;
}

.client-form {
  display: grid;
  gap: 16px;
}

.form-section {
  padding: 26px;
}

.conditional-section[hidden] {
  display: none;
}

.section-heading {
  display: flex;
  gap: 14px;
  margin-bottom: 22px;
}

.section-heading > span {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 10px;
  font-weight: 700;
}

.section-heading h2 {
  margin: -3px 0 3px;
  color: var(--dark);
  font-size: 27px;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.type-selector {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.type-selector label {
  cursor: pointer;
}

.type-selector input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.type-selector label > span {
  min-height: 88px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #fffcf8;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.type-selector input:checked + span {
  border-color: var(--accent);
  background: var(--accent-faint);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.type-selector strong {
  color: var(--dark);
  font-size: 14px;
}

.type-selector small {
  margin-top: 5px;
  color: var(--muted);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.span-2 {
  grid-column: span 2;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 8px 0 30px;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.detail-card {
  padding: 25px;
}

.detail-card h2 {
  margin: 5px 0 20px;
  color: var(--dark);
  font-size: 29px;
}

.detail-card dl {
  margin: 0;
  display: grid;
  gap: 15px;
}

.detail-card dl > div {
  padding-bottom: 13px;
  border-bottom: 1px solid #eadfd6;
}

.detail-card dl > div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.detail-card dt {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.detail-card dd {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
}

.detail-notes {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.success-alert {
  margin-bottom: 16px;
  padding: 13px 16px;
  border: 1px solid #cfc0da;
  border-radius: 12px;
  color: #5e416c;
  background: #f1e8f5;
  font-size: 13px;
}

@media (max-width: 760px) {
  .page-header,
  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .filters,
  .form-grid,
  .type-selector,
  .details-grid {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .form-section {
    padding: 20px;
  }
}

/* Dashboard analítico */
.dashboard-filter-panel {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-top: 0;
}

.dashboard-filter-panel > div {
  max-width: 560px;
}

.dashboard-filter-panel h2 {
  font-size: 28px;
}

.dashboard-filter-panel p {
  margin: 8px 0 0;
  font-size: 11px;
  line-height: 1.55;
}

.dashboard-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(145px, 1fr)) auto auto;
  align-items: end;
  gap: 10px;
}

.dashboard-filters label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.dashboard-filters input {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--surface);
  outline: none;
}

.dashboard-filters input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(116, 81, 133, .1);
}

.dashboard-filters .primary-button,
.dashboard-filters .secondary-button {
  min-height: 46px;
  white-space: nowrap;
}

.dashboard-metrics {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 18px;
}

.dashboard-metrics .metric {
  min-height: 154px;
}

.dashboard-metrics .metric strong {
  font-size: clamp(37px, 3.4vw, 48px);
}

.dashboard-metrics .metric small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.dashboard-metrics .metric-revenue strong {
  color: var(--accent);
  font-family: var(--body-font);
  font-size: clamp(22px, 2vw, 31px);
  font-weight: 700;
  letter-spacing: -.04em;
}

.dashboard-chart-panel {
  overflow: hidden;
}

.dashboard-chart-heading {
  align-items: center;
}

.chart-period {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.chart-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 8px;
  margin: 24px 0 0;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-soft);
}

.chart-tab {
  min-width: 0;
  min-height: 64px;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.chart-tab span {
  overflow: hidden;
  font-size: 10px;
  font-weight: 700;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-tab strong {
  color: var(--brown);
  font-family: var(--heading-font);
  font-size: 20px;
  font-weight: 700;
  white-space: nowrap;
}

.chart-tab:hover {
  color: var(--dark);
  background: rgba(255, 250, 244, .72);
}

.chart-tab:focus-visible {
  outline: 3px solid rgba(116, 81, 133, .18);
  outline-offset: 2px;
}

.chart-tab.is-active {
  border-color: #d9c6e1;
  color: var(--accent);
  background: var(--surface);
  box-shadow: 0 5px 15px rgba(73, 52, 63, .07);
}

.chart-tab.is-active strong {
  color: var(--accent);
}

.chart-content {
  padding-top: 24px;
}

.chart-title-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 10px;
}

.chart-title-row h3 {
  margin: 0;
  color: var(--dark);
  font-family: var(--heading-font);
  font-size: 25px;
}

.chart-title-row p {
  margin: 5px 0 0;
  font-size: 11px;
}

.chart-legend {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.chart-legend i {
  width: 22px;
  height: 3px;
  border-radius: 99px;
  background: var(--accent);
}

.chart-canvas-wrap {
  position: relative;
  width: 100%;
  min-height: 350px;
}

.chart-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 350px;
}

.chart-tooltip {
  position: absolute;
  z-index: 2;
  min-width: 110px;
  border: 1px solid rgba(222, 209, 198, .88);
  border-radius: 10px;
  padding: 9px 11px;
  color: #fffaf4;
  background: rgba(73, 52, 63, .94);
  box-shadow: 0 8px 22px rgba(73, 52, 63, .18);
  font-size: 10px;
  line-height: 1.5;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 12px));
}

.chart-tooltip strong {
  display: block;
  font-size: 12px;
}

.chart-tooltip[hidden] {
  display: none;
}

.chart-empty {
  margin: -42px 0 20px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1180px) {
  .dashboard-filter-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-filters {
    grid-template-columns: repeat(2, minmax(145px, 1fr)) auto auto;
  }

  .dashboard-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .chart-tabs {
    grid-template-columns: repeat(5, minmax(150px, 1fr));
    overflow-x: auto;
  }
}

@media (max-width: 760px) {
  .dashboard-filters {
    grid-template-columns: 1fr 1fr;
  }

  .dashboard-filters .primary-button,
  .dashboard-filters .secondary-button {
    width: 100%;
  }

  .dashboard-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .dashboard-metrics .metric-revenue {
    grid-column: 1 / -1;
  }

  .chart-tabs {
    margin-inline: -6px;
  }

  .chart-title-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .chart-canvas-wrap,
  .chart-canvas-wrap canvas {
    min-height: 300px;
    height: 300px;
  }
}

@media (max-width: 480px) {
  .dashboard-filters,
  .dashboard-metrics {
    grid-template-columns: 1fr;
  }

  .dashboard-metrics .metric-revenue {
    grid-column: auto;
  }

  .dashboard-filter-panel h2 {
    font-size: 24px;
  }

  .dashboard-chart-panel {
    padding-inline: 14px;
  }
}

/* Refinamentos globais de responsividade */
html,
body {
  min-width: 320px;
}

body {
  overflow-x: hidden;
}

img,
svg,
canvas {
  max-width: 100%;
}

button,
input,
select,
textarea {
  max-width: 100%;
}

.content > *,
.page-header > *,
.topbar > *,
.panel-heading > *,
.calendar-connection > div,
.agenda-item-body {
  min-width: 0;
}

.sidebar {
  height: 100dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.page-header h1,
.topbar h1,
.detail-card h2,
.detail-card dd,
.agenda-item-body h2,
.agenda-item-body p,
.agenda-item-body small,
.data-table td,
.profile-chip {
  overflow-wrap: anywhere;
}

.profile-chip {
  max-width: min(100%, 320px);
  text-align: center;
}

.page-header .button-link,
.page-header .secondary-button,
.form-actions > * {
  flex-shrink: 0;
}

.filters button,
.primary-button,
.secondary-button,
.button-link {
  min-height: 44px;
}

.calendar-connection > div > div {
  min-width: 0;
}

.agenda-actions {
  flex-wrap: wrap;
}

@media (min-width: 901px) and (max-width: 1240px) {
  .content {
    padding: 32px 28px;
  }

  .filters:not(.kanban-filters),
  .filters.project-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filters:not(.kanban-filters) > button,
  .filters:not(.kanban-filters) > .primary-button,
  .filters:not(.kanban-filters) > .secondary-button {
    width: 100%;
  }

  .project-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .mobile-topbar {
    height: 64px;
    padding-right: max(18px, env(safe-area-inset-right));
    padding-left: max(18px, env(safe-area-inset-left));
  }

  .mobile-topbar > a {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sidebar {
    inset-block: 64px 0;
    height: calc(100dvh - 64px);
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }

  .sidebar-overlay {
    inset-block: 64px 0;
  }

  .content {
    padding-top: 88px;
  }

  .topbar,
  .page-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }

  .topbar .profile-chip,
  .page-header > .button-link,
  .page-header > .primary-button,
  .page-header > .secondary-button,
  .page-header > form,
  .page-header > form > button,
  .page-header > .budget-header-actions {
    width: 100%;
  }

  .page-header > .budget-header-actions > * {
    flex: 1 1 180px;
  }
}

@media (max-width: 760px) {
  .content {
    padding-inline: 16px;
  }

  .page-header {
    margin-bottom: 20px;
  }

  .page-header h1,
  .topbar h1 {
    font-size: clamp(36px, 12vw, 46px);
  }

  .filters,
  .filters.simple-filter,
  .filters.project-filters {
    grid-template-columns: 1fr;
  }

  .filters > button,
  .filters > .primary-button,
  .filters > .secondary-button,
  .form-actions > *,
  .form-actions .button-link,
  .form-actions button {
    width: 100%;
  }

  .check-field {
    margin-left: 0;
  }

  .section-heading {
    align-items: flex-start;
  }

  .section-heading h2 {
    font-size: 24px;
    line-height: 1.1;
  }

  .empty-state {
    padding: 46px 18px;
  }

  .responsive-table,
  .responsive-table tbody,
  .responsive-table tr,
  .responsive-table td {
    display: block;
    width: 100%;
  }

  .table-wrap {
    overflow: visible;
  }

  .responsive-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .responsive-table tbody {
    padding: 12px;
  }

  .responsive-table tbody tr {
    margin-bottom: 12px;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--surface);
    box-shadow: 0 5px 18px rgba(73, 52, 63, .045);
  }

  .responsive-table tbody tr:last-child {
    margin-bottom: 0;
  }

  .responsive-table tbody tr:hover {
    background: var(--surface);
  }

  .responsive-table td {
    min-width: 0 !important;
    padding: 10px 0;
    border-bottom: 1px solid #eadfd6 !important;
    display: grid;
    grid-template-columns: minmax(92px, .38fr) minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    white-space: normal;
    text-align: right;
  }

  .responsive-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .08em;
    text-align: left;
    text-transform: uppercase;
  }

  .responsive-table td > * {
    min-width: 0;
  }

  .responsive-table td small {
    overflow-wrap: anywhere;
  }

  .responsive-table .table-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 13px;
    border-bottom: 0 !important;
  }

  .responsive-table .table-actions::before {
    display: none;
  }

  .responsive-table .table-actions a {
    min-height: 40px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-soft);
  }

  .responsive-table .inline-status-form {
    justify-content: flex-end;
  }

  .calendar-connection {
    padding: 16px;
  }

  .calendar-connection > div {
    align-items: flex-start;
  }

  .agenda-item-body p,
  .agenda-item-body small {
    line-height: 1.5;
  }

  .dashboard-chart-panel {
    overflow: hidden;
  }

  .chart-tabs {
    padding-bottom: 4px;
    scrollbar-width: thin;
  }
}

@media (max-width: 560px) {
  .auth-page {
    align-items: flex-start;
  }

  .auth-shell {
    min-height: 100dvh;
  }

  .brand-panel {
    min-height: 150px;
    padding: 28px 24px;
  }

  .brand-panel h1 {
    font-size: 48px;
  }

  .brand-panel p {
    max-width: 30rem;
    margin-top: 10px;
  }

  .login-card {
    padding: 30px 24px max(30px, env(safe-area-inset-bottom));
  }

  .calendar-connection > div {
    align-items: center;
  }

  .agenda-item {
    gap: 12px;
  }

  .agenda-actions {
    grid-column: 1 / -1;
    padding-top: 4px;
  }

  .agenda-actions a,
  .agenda-actions button {
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
  }

  .empty-state h2 {
    font-size: 24px;
  }

  .responsive-table tbody {
    padding: 10px;
  }

  .responsive-table td {
    grid-template-columns: 1fr;
    gap: 5px;
    text-align: left;
  }

  .responsive-table .table-actions {
    justify-content: stretch;
  }

  .responsive-table .table-actions a {
    width: 100%;
  }

  .responsive-table .inline-status-form {
    justify-content: stretch;
  }
}

@media (max-width: 390px) {
  .content,
  .kanban-content {
    padding-right: 12px;
    padding-left: 12px;
  }

  .mobile-topbar {
    gap: 11px;
    padding-inline: 12px;
  }

  .mobile-topbar > a {
    font-size: 25px;
  }

  .form-section,
  .detail-card,
  .panel,
  .filters {
    padding: 15px;
  }

  .kanban-board {
    grid-auto-columns: calc(100vw - 38px);
  }
}
