:root {
  --orange: #e8590c;
  --orange-dark: #c94a06;
  --orange-light: #fdeade;
  --graphite: #2b2b30;
  --graphite-light: #45454e;
  --bg: #f6f5f3;
  --surface-alt: #faf9f7;
  --card: #ffffff;
  --border: #e6e4e0;
  --border-strong: #d6d4cf;
  --text: #26252a;
  --text-muted: #74727a;
  --green: #2f9e44;
  --green-light: #e6f7e9;
  --red: #e03131;
  --red-light: #fdeaea;
  --dept-comercial: var(--orange);
  --dept-marketing: var(--orange);
  --dept-operacional: var(--orange);
  --dept-financeiro: var(--orange);
  --dept-administrativo: var(--orange);
  --radius: 10px;
  --radius-lg: 14px;
  --radius-sm: 6px;
  --shadow-xs: 0 1px 2px rgba(20, 19, 22, .05);
  --shadow-sm: 0 1px 3px rgba(20, 19, 22, .06), 0 4px 10px rgba(20, 19, 22, .04);
  --shadow-md: 0 6px 20px rgba(20, 19, 22, .09), 0 2px 6px rgba(20, 19, 22, .05);
  --shadow-lg: 0 24px 64px rgba(15, 14, 17, .3);
  --focus-ring: 0 0 0 3px rgba(232, 89, 12, .18);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  height: 100%;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font-family: inherit; font-size: 14px; }

a { color: var(--orange-dark); }

.hidden { display: none !important; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 20px; border: 2px solid var(--bg); background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #c3c1bc; background-clip: padding-box; }

/* ---------- Login ---------- */
#login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background:
    radial-gradient(circle at 15% 15%, rgba(232, 89, 12, .16), transparent 45%),
    linear-gradient(135deg, var(--graphite) 0%, #17171a 100%);
}
.login-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 20px;
  text-align: center;
  color: rgba(255, 255, 255, .38);
  font-size: 11px;
  letter-spacing: .02em;
}

.login-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 44px 40px;
  width: 380px;
  box-shadow: var(--shadow-lg);
}

.login-card h1 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.005em;
  margin: 0 0 22px;
  color: var(--graphite);
  text-align: center;
}

.login-card .brand-block {
  margin-bottom: 28px;
  text-align: center;
}
.login-card .brand-logo {
  display: block;
  max-width: 175px;
  height: auto;
  margin: 0 auto 18px;
}
.login-card .brand-tag {
  display: block;
  color: var(--orange);
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-size: 11px;
}
.version-badge {
  display: inline-block;
  margin-top: 10px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--orange-dark);
  background: var(--orange-light);
  padding: 3px 11px;
  border-radius: 999px;
}

.login-card .hint-text {
  text-align: center;
  margin-top: 14px;
}

.field { margin-bottom: 15px; }
.field label { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: var(--focus-ring);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: .01em;
  cursor: pointer;
  background: var(--graphite);
  color: #fff;
  text-decoration: none;
  box-shadow: var(--shadow-xs);
  transition: background .15s ease, box-shadow .15s ease, transform .05s ease;
}
.btn:hover { background: var(--graphite-light); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn-primary { background: var(--orange); box-shadow: 0 1px 2px rgba(201, 74, 6, .18), 0 4px 12px rgba(232, 89, 12, .2); }
.btn-primary:hover { background: var(--orange-dark); box-shadow: 0 4px 16px rgba(232, 89, 12, .3); }
.btn-ghost { background: transparent; color: var(--graphite); border: 1px solid var(--border-strong); box-shadow: none; }
.btn-ghost:hover { background: var(--surface-alt); border-color: var(--graphite-light); }
.btn-danger { background: transparent; color: var(--red); border: 1px solid #f3c2c2; box-shadow: none; }
.btn-danger:hover { background: var(--red-light); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 6px; }

.error-text { color: var(--red); font-size: 13px; margin-top: 8px; }
.hint-text { color: var(--text-muted); font-size: 12px; margin-top: 12px; line-height: 1.5; }

/* ---------- App shell (navegação por departamentos, Fase 1.54) ---------- */
#app-screen { display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  background: linear-gradient(180deg, var(--graphite) 0%, #19191c 100%);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  flex-shrink: 0;
}
.topbar-brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.topbar-logo { display: block; max-width: 118px; height: auto; }
.topbar-brand-text { line-height: 1.25; }
.topbar-cia-name { font-size: 15px; font-weight: 800; letter-spacing: .08em; color: var(--orange); }
.topbar-cia-tag { font-size: 9px; letter-spacing: .04em; text-transform: uppercase; color: #a9a8ae; }

.nav-toggle-btn {
  display: none;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .15);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  padding: 7px 11px;
  border-radius: 7px;
  cursor: pointer;
  flex-shrink: 0;
}

.global-search { position: relative; flex: 1; max-width: 380px; }
.global-search .search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); opacity: .55; color: #fff; pointer-events: none; }
.global-search input {
  width: 100%;
  padding: 8px 10px 8px 32px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .07);
  color: #fff;
  font-size: 13px;
  box-sizing: border-box;
  transition: border-color .15s ease, background .15s ease;
}
.global-search input::placeholder { color: #9c9ba1; }
.global-search input:focus { outline: none; border-color: var(--orange); background: rgba(255, 255, 255, .12); }
.global-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  width: 320px;
  margin-top: 4px;
  background: #fff;
  color: var(--graphite);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  max-height: 60vh;
  overflow-y: auto;
  z-index: 200;
}
.global-search-results .gsr-group-label {
  padding: 9px 12px 4px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--graphite-light);
  font-weight: 700;
}
.global-search-results .gsr-item {
  padding: 9px 12px;
  cursor: pointer;
  font-size: 13px;
  border-top: 1px solid var(--border);
}
.global-search-results .gsr-item:hover, .global-search-results .gsr-item.active { background: var(--surface-alt); }
.global-search-results .gsr-item .gsr-sub { color: #8a8a90; font-size: 11.5px; margin-top: 1px; }
.global-search-results .gsr-empty, .global-search-results .gsr-loading { padding: 14px 12px; color: #8a8a90; font-size: 13px; }

.topbar-spacer { flex: 1; }

.topbar-icon-btn {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .13);
  color: #d8d7db;
  border-radius: 9px;
  cursor: pointer;
  flex-shrink: 0;
}
.topbar-icon-btn:hover { background: rgba(255, 255, 255, .13); color: #fff; }
.topbar-icon-btn.active { background: var(--orange); border-color: var(--orange); color: #fff; }
.topbar-icon-btn .nav-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 16px; height: 16px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  font-size: 10px;
  line-height: 1;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-weight: 700;
  border: 2px solid var(--graphite);
}
.topbar-icon-btn[data-route="pomodoro"] .nav-badge { background: var(--orange); }

.topbar-user {
  display: flex; align-items: center; gap: 9px;
  padding-left: 12px;
  border-left: 1px solid rgba(255, 255, 255, .12);
  flex-shrink: 0;
}
.topbar-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--orange);
  color: #fff; font-weight: 700; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.topbar-user-info { line-height: 1.3; }
.topbar-user-info .name { color: #fff; font-weight: 600; font-size: 12.5px; }
.topbar-user-info .meta { display: flex; align-items: center; gap: 6px; }
.topbar-user-info .role-badge {
  color: var(--orange);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: none;
  padding: 0;
}
.topbar-user-info #user-email { color: #a9a7a2; font-size: 10.5px; }
.topbar-user .logout-link {
  color: #cfcdc8; font-size: 11px; text-decoration: none;
  border-left: 1px solid rgba(255, 255, 255, .14);
  padding-left: 10px; margin-left: 2px; white-space: nowrap;
}
.topbar-user .logout-link:hover { color: #fff; }

.version-strip {
  background: var(--graphite);
  padding: 0 20px 8px;
  flex-shrink: 0;
}
.version-strip .version-tag {
  font-size: 9.5px;
  letter-spacing: .03em;
  color: rgba(255, 255, 255, .45);
}

.dept-rail {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  overflow-x: auto;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.dept-tile {
  flex: 0 0 auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px;
  width: 92px;
  min-height: 72px;
  padding: 10px 6px;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border-strong);
  background: var(--card);
  color: var(--graphite);
  cursor: pointer;
  transition: transform .12s ease, background .12s ease, color .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.dept-tile .dept-icon { width: 20px; height: 20px; }
.dept-tile .dept-label { font-size: 11.5px; font-weight: 700; text-align: center; line-height: 1.2; }
.dept-tile:hover { border-color: var(--orange); box-shadow: var(--shadow-xs); transform: translateY(-1px); }
.dept-tile.active { background: var(--orange); border-color: var(--orange); color: #fff; box-shadow: var(--shadow-sm); }

.workspace { flex: 1; display: flex; align-items: flex-start; min-height: 0; }

.side-panel {
  flex: 0 0 240px;
  background: var(--card);
  border-right: 1px solid var(--border);
  align-self: stretch;
  overflow-y: auto;
}
.side-panel .sp-head {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
}
.side-panel .sp-eyebrow {
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
  color: var(--orange-dark);
  margin-bottom: 3px;
}
.side-panel .sp-head h3 { margin: 0; font-size: 15px; font-weight: 800; color: var(--graphite); }

.sidebar-footer {
  padding: 14px 16px 18px;
  margin-top: 8px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 10.5px;
  letter-spacing: .02em;
}
.side-panel .sp-search { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.side-panel .sp-search input {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12.5px;
  background: var(--bg);
  color: var(--text);
}
.side-panel .sp-search input:focus { outline: none; border-color: var(--orange); }

#nav-menu { padding: 6px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 8px;
  border-left: 3px solid transparent;
  color: var(--graphite);
  cursor: pointer;
  margin-bottom: 1px;
  font-size: 13.5px;
  font-weight: 500;
  transition: background .12s ease, color .12s ease;
}
.nav-item .nav-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border-strong); flex-shrink: 0; }
.nav-item.sp-filtered-out { display: none; }
.nav-item:hover { background: var(--surface-alt); }
.nav-item.active { background: var(--orange-light); border-left-color: var(--orange); color: var(--graphite); font-weight: 700; }
.nav-item.active .nav-dot { background: var(--orange); }
.nav-badge.badge-fx { background: var(--surface-alt); color: var(--text-muted); border: 1px solid var(--border-strong); }
.nav-badge {
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 7px;
  line-height: 1.5;
}

.main {
  flex: 1;
  padding: 30px 34px;
  max-width: 1240px;
  overflow-y: auto;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.page-header h2 { margin: 0; font-size: 23px; font-weight: 800; letter-spacing: -.01em; color: var(--graphite); }
.page-header p { margin: 3px 0 0; color: var(--text-muted); font-size: 13px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.card h3 { font-weight: 700; letter-spacing: -.005em; }
.card.clickable { cursor: pointer; transition: box-shadow .15s ease, transform .12s ease, border-color .15s ease; }
.card.clickable:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); transform: translateY(-1px); }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: left;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 10px 12px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
}
th:first-child { border-top-left-radius: 8px; }
th:last-child { border-top-right-radius: 8px; }
td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: none; }
tr.clickable { cursor: pointer; transition: background .1s ease; }
tr.clickable:hover { background: var(--surface-alt); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.badge-gray { background: #eeedeb; color: var(--text-muted); }
.badge-orange { background: var(--orange-light); color: var(--orange-dark); }
.badge-green { background: var(--green-light); color: var(--green); }
.badge-red { background: var(--red-light); color: var(--red); }
.badge-dark { background: var(--graphite); color: #fff; }
.badge-ai { background: #eef1fb; color: #3b4a9c; }
.badge-ai::before { display: none; }

/* ---------- Projetos: workspace (abas, colaboradores, histórico) ---------- */
.project-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-alt); border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px 4px 4px; font-size: 12.5px; font-weight: 600; margin: 0 6px 6px 0; }
.chip .chip-avatar { width: 20px; height: 20px; border-radius: 50%; background: var(--orange); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; }
.chip .chip-remove { cursor: pointer; color: var(--text-muted); font-weight: 700; margin-left: 2px; }
.chip .chip-remove:hover { color: var(--red); }
.checklist { max-height: 180px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px; background: var(--surface-alt); }
.checklist label { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-weight: 400; font-size: 13.5px; text-transform: none; letter-spacing: normal; color: var(--text); cursor: pointer; }
.checklist label input[type="checkbox"] { width: auto; flex: 0 0 auto; }
.timeline { margin-top: 4px; }
.timeline-item { position: relative; padding: 0 0 18px 18px; border-left: 2px solid var(--border); }
.timeline-item:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline-item::before { content: ""; position: absolute; left: -6px; top: 3px; width: 10px; height: 10px; border-radius: 50%; background: var(--orange); border: 2px solid var(--card); }
.timeline-item .timeline-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 3px; }
.timeline-item .timeline-content { white-space: pre-wrap; }
.ia-placeholder { text-align: center; padding: 46px 20px; color: var(--text-muted); }
.ia-placeholder .ia-icon { font-size: 30px; margin-bottom: 10px; opacity: .5; }

/* ---------- Relatórios: stat tiles e barras ---------- */
.stat-tile { }
.stat-tile .stat-label { color: var(--text-muted); font-size: 12px; margin-bottom: 4px; }
.stat-tile .stat-value { font-size: 27px; font-weight: 800; letter-spacing: -.01em; color: var(--graphite); font-variant-numeric: tabular-nums; }
.stat-tile .stat-sub { color: var(--text-muted); font-size: 12px; margin-top: 4px; }

.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.bar-row:last-child { margin-bottom: 0; }
.bar-row .bar-label { width: 150px; flex-shrink: 0; font-size: 13px; color: var(--text); text-align: right; }
.bar-row .bar-track { flex: 1; background: var(--surface-alt); border: 1px solid var(--border); border-radius: 5px; height: 22px; position: relative; overflow: hidden; }
.bar-row .bar-fill { height: 100%; border-radius: 4px; min-width: 3px; transition: width .3s ease; }
.bar-row .bar-value { width: 90px; flex-shrink: 0; font-size: 13px; font-weight: 700; color: var(--graphite); font-variant-numeric: tabular-nums; }

.bar-fill-green { background: var(--green); }
.bar-fill-red { background: var(--red); }
.bar-fill-orange { background: var(--orange); }
.bar-fill-gray { background: #a5a3ac; }

.col-chart { display: flex; align-items: flex-end; gap: 10px; height: 140px; padding: 10px 4px 0; }
.col-chart .col-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.col-chart .col-bar { width: 100%; max-width: 34px; background: var(--orange); border-radius: 4px 4px 0 0; min-height: 2px; }
.col-chart .col-value { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.col-chart .col-label { font-size: 11px; color: var(--text-muted); margin-top: 6px; text-align: center; }

.chart-legend { display: flex; gap: 18px; justify-content: center; margin-bottom: 8px; font-size: 12px; color: var(--text-muted); }
.chart-legend .legend-dot { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.col-bar-pair { display: flex; align-items: flex-end; justify-content: center; gap: 3px; width: 100%; height: 100%; }
.col-bar-pair .col-bar { max-width: 16px; }
.col-chart .col-bar.col-bar-green { background: var(--green); }
.col-chart .col-bar.col-bar-red { background: var(--red); }

.pipeline { display: grid; grid-template-columns: repeat(6, minmax(180px, 1fr)); gap: 12px; overflow-x: auto; }
.pipeline-col { background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 10px; min-height: 200px; transition: background .15s ease, outline .15s ease; outline: 2px dashed transparent; outline-offset: -2px; }
.pipeline-col.drag-over { background: var(--orange-light); outline-color: var(--orange); }
.pipeline-col h4 { margin: 4px 6px 10px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.pipeline-col-body { min-height: 40px; }
.deal-card {
  background: #fff;
  border-radius: 9px;
  padding: 11px 13px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  cursor: grab;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-xs);
  transition: opacity .15s ease, box-shadow .15s ease, border-color .15s ease, transform .1s ease;
}
.deal-card:hover { border-color: var(--orange); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.deal-card.dragging { opacity: .35; cursor: grabbing; }
.deal-card .val { color: var(--orange-dark); font-weight: 700; margin-top: 4px; font-size: 12.5px; }
.deal-card .client { color: var(--text-muted); font-size: 12px; }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 14, 17, .55);
  backdrop-filter: blur(1px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px; overflow-y: auto; z-index: 50;
}
.modal {
  background: #fff; border-radius: var(--radius-lg); width: 560px; max-width: 100%;
  padding: 26px 28px; box-shadow: var(--shadow-lg);
}
.modal h3 { margin: 0 0 16px; font-size: 18px; font-weight: 800; letter-spacing: -.01em; color: var(--graphite); }
.modal .modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.modal-wide { width: 760px; }

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.toolbar input[type=text], .toolbar input[type=search] { min-width: 220px; }

.items-table input, .items-table select { padding: 5px 7px; font-size: 12.5px; }
.items-table td { padding: 5px 6px; }
.total-row td { font-weight: 700; border-top: 2px solid var(--border); }

.quote-share-box {
  background: #fff7ef; border: 1px dashed var(--orange); border-radius: 8px;
  padding: 12px 14px; font-size: 13px; margin-top: 10px;
}
.quote-share-box code { background: #fff; padding: 2px 6px; border-radius: 4px; word-break: break-all; }

.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }

.top-actions { display: flex; gap: 8px; }

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

/* ---------- Modo celular ---------- */
@media (max-width: 720px) {
  html, body { overflow-x: hidden; }

  #app-screen { min-height: 0; }

  .topbar { flex-wrap: wrap; padding: 10px 14px; gap: 8px; position: sticky; top: 0; z-index: 100; }
  .topbar-logo { max-width: 90px; }
  .topbar-cia-name { font-size: 13px; }
  .topbar-cia-tag { font-size: 8px; }
  /* No celular só o essencial fica visível no topo — avatar/nome/e-mail/papel do usuário somem,
     mas o link "Sair" continua sempre alcançável (antes ficava escondido junto com o menu fechado). */
  .topbar-user { gap: 0; padding-left: 0; border-left: none; }
  .topbar-avatar, .topbar-user-info { display: none; }
  .topbar-user .logout-link { padding-left: 8px; border-left: 1px solid rgba(255, 255, 255, .14); margin-left: 0; }
  .nav-toggle-btn { display: block; }

  .global-search { order: 3; flex: 1 1 100%; max-width: 100%; }
  .global-search-results { width: calc(100vw - 28px); max-width: 360px; }

  .version-strip { padding: 0 14px 6px; }
  .dept-rail { padding: 10px 14px; position: sticky; top: 61px; z-index: 90; }

  .workspace { flex-direction: column; position: relative; }
  .side-panel {
    display: none;
    width: 100%;
    flex: 1 1 auto;
    max-height: 50vh;
  }
  .workspace.nav-open .side-panel { display: block; }

  .main { padding: 16px; max-width: 100%; }
  .page-header { flex-wrap: wrap; gap: 8px; }

  .row-2, .row-3 { grid-template-columns: 1fr; }

  .modal-backdrop { padding: 0; align-items: stretch; }
  .modal, .modal-wide { width: 100%; max-width: 100%; min-height: 100vh; border-radius: 0; }

  .toolbar input[type=text], .toolbar input[type=search] { min-width: 0; width: 100%; }

  table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }

  .bar-row { flex-wrap: wrap; }
  .bar-row .bar-label { width: 100%; text-align: left; }
  .bar-row .bar-value { width: auto; }
}

/* ---------- Pomodoro ---------- */
@keyframes pomodoro-pulse {
  0% { box-shadow: 0 0 0 0 rgba(232, 89, 12, .45); }
  70% { box-shadow: 0 0 0 14px rgba(232, 89, 12, 0); }
  100% { box-shadow: 0 0 0 0 rgba(232, 89, 12, 0); }
}

#pomodoro-fab { position: fixed; right: 20px; bottom: 20px; z-index: 45; font-family: inherit; }

.pomodoro-btn {
  display: flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, var(--orange), var(--orange-dark));
  color: #fff; border: none; border-radius: 999px;
  padding: 12px 18px; font-size: 14px; font-weight: 700;
  box-shadow: var(--shadow-lg); cursor: pointer;
  animation: pomodoro-pulse 2.4s infinite;
}
.pomodoro-btn:hover { animation: none; transform: translateY(-1px); }
.pomodoro-btn.is-running { animation: none; background: linear-gradient(135deg, var(--graphite), var(--graphite-light)); }
.pomodoro-btn.is-break { animation: none; background: linear-gradient(135deg, var(--green), #237a35); }
.pomodoro-btn .pomodoro-state-label { font-size: 13px; font-weight: 700; line-height: 1; }
.pomodoro-btn .pomodoro-timer { font-variant-numeric: tabular-nums; font-size: 15px; }

.pomodoro-panel {
  position: absolute; right: 0; bottom: calc(100% + 12px);
  width: 300px; max-width: calc(100vw - 40px);
  background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: 18px; border: 1px solid var(--border);
}
.pomodoro-panel h4 { margin: 0 0 2px; font-size: 15px; font-weight: 800; color: var(--graphite); }
.pomodoro-panel .hint-text { margin: 0 0 12px; }
.pomodoro-close { position: absolute; top: 10px; right: 12px; background: none; border: none; color: var(--text-muted); font-size: 16px; cursor: pointer; line-height: 1; }
.pomodoro-clock { font-size: 40px; font-weight: 800; text-align: center; color: var(--graphite); font-variant-numeric: tabular-nums; margin: 4px 0 2px; }
.pomodoro-phase-label { text-align: center; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--orange); margin-bottom: 10px; }
.pomodoro-phase-label.is-break { color: var(--green); }
.pomodoro-linked { text-align: center; font-size: 12.5px; color: var(--text-muted); margin-bottom: 12px; word-break: break-word; }
.pomodoro-actions-row { display: flex; gap: 8px; margin-top: 4px; }
.pomodoro-actions-row .btn { flex: 1; }
.pomodoro-field { margin-bottom: 10px; }
.pomodoro-field label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); margin-bottom: 4px; }
.pomodoro-field select, .pomodoro-field input { width: 100%; }

.pomodoro-quickstart { background: none; border: 1px solid transparent; cursor: pointer; font-size: 14px; padding: 4px 7px; line-height: 1; border-radius: 6px; vertical-align: middle; }
.pomodoro-quickstart:hover { background: var(--orange-light); border-color: var(--orange); }

/* ---------- Seletor de ferramenta de IA (Projetos) ---------- */
.ai-tool-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-tool-option {
  display: flex; align-items: center; gap: 6px;
  background: #fff; border: 1.5px solid var(--border-strong); border-radius: 999px;
  padding: 7px 14px; font-size: 13px; font-weight: 600; color: var(--text);
  cursor: pointer; transition: border-color .15s, background .15s, color .15s;
}
.ai-tool-option:hover { border-color: var(--orange); }
.ai-tool-option.selected { border-color: var(--orange); background: var(--orange-light); color: var(--orange-dark); }
.ai-tool-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }

/* ---------- Relatório do projeto ---------- */
.progress-ring {
  width: 108px; height: 108px; border-radius: 50%; flex-shrink: 0;
  background: conic-gradient(var(--orange) calc(var(--pct) * 1%), #eceae6 0);
  display: flex; align-items: center; justify-content: center;
}
.progress-ring-inner {
  width: 80px; height: 80px; border-radius: 50%; background: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.progress-ring-value { font-size: 21px; font-weight: 800; color: var(--graphite); line-height: 1; }
.progress-ring-label { font-size: 9.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; margin-top: 3px; }

.print-only { display: none; }

@media print {
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body * { visibility: hidden; }
  .print-area, .print-area * { visibility: visible; }
  .print-area { position: absolute; left: 0; top: 0; width: 100%; padding: 16px; }
  .print-only { display: block; }
  .btn, .topbar, .version-strip, .dept-rail, .side-panel, #pomodoro-fab, .modal-backdrop, .project-tabs { display: none !important; }
}

@media (max-width: 720px) {
  #pomodoro-fab { right: 12px; bottom: 12px; }
  .pomodoro-panel { width: calc(100vw - 24px); right: -8px; }
}
