/* =============================================
   MeiConstrutor — style.css
   Tema Claro/Escuro + Fontes Acessíveis (18px base)
   ============================================= */

/* ── TEMA CLARO (padrão) ── */
:root,
[data-theme="light"] {
  --bg:        #F5F2EC;
  --surface:   #FFFFFF;
  --surface2:  #F0EDE6;
  --surface3:  #E8E4DC;
  --border:    #D6D0C8;
  --text:      #1A1714;
  --text-muted:#6B6460;
  --text-dim:  #A09890;
  --orange:    #D4920A;
  --orange-light:#FFF3CC;
  --green:     #1A7A3A;
  --green-dim: #D4F0DE;
  --red:       #C0392B;
  --red-dim:   #FDECEA;
  --blue:      #1A5FA8;
  --blue-dim:  #DDEEFF;
  --yellow:    #F5C518;
  --sidebar-bg:#1A1714;
  --sidebar-text:#F5F0E8;
  --sidebar-muted:#888;
  --sidebar-border:#2E2A26;
  --nav-active-bg:#F5C518;
  --nav-active-text:#111;
  --shadow:    0 2px 12px rgba(0,0,0,0.10);
  --shadow-md: 0 4px 24px rgba(0,0,0,0.12);
}

/* ── TEMA ESCURO ── */
[data-theme="dark"] {
  --bg:        #0F0F0F;
  --surface:   #181818;
  --surface2:  #222222;
  --surface3:  #2A2A2A;
  --border:    #333333;
  --text:      #F0EDE8;
  --text-muted:#888880;
  --text-dim:  #555550;
  --orange:    #F5C518;
  --orange-light:#3A2E00;
  --green:     #22C55E;
  --green-dim: #14532D;
  --red:       #EF4444;
  --red-dim:   #7F1D1D;
  --blue:      #3B82F6;
  --blue-dim:  #1E3A5F;
  --yellow:    #F5C518;
  --sidebar-bg:#111111;
  --sidebar-text:#F5F0E8;
  --sidebar-muted:#888;
  --sidebar-border:#2E2E2E;
  --nav-active-bg:#F5C518;
  --nav-active-text:#111;
  --shadow:    0 2px 12px rgba(0,0,0,0.5);
  --shadow-md: 0 4px 24px rgba(0,0,0,0.5);
}

/* ── BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 17px; }    /* base maior = tudo escala */

body {
  font-family: 'Barlow', 'DM Sans', sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}

/* ── SIDEBAR ── */
:root { --sidebar-w: 248px; --radius: 10px; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 18px;
  border-bottom: 1px solid var(--sidebar-border);
}

.brand-icon { font-size: 26px; line-height: 1; }

.brand-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900;
  font-size: 1.1rem;
  color: var(--orange);
}

.brand-sub {
  font-size: 0.65rem;
  color: var(--sidebar-muted);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 8px;
  color: var(--sidebar-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.2s;
}

.nav-item:hover {
  background: rgba(255,255,255,0.07);
  color: var(--sidebar-text);
}

.nav-item.active {
  background: var(--nav-active-bg);
  color: var(--nav-active-text);
  font-weight: 700;
}

.nav-icon { font-size: 1rem; }

.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--sidebar-border);
}

.user-info { display: flex; align-items: center; gap: 10px; }

.user-avatar {
  width: 38px; height: 38px;
  background: var(--orange);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 0.85rem;
  color: #111;
  flex-shrink: 0;
}

.user-name  { font-size: 0.85rem; font-weight: 700; color: var(--sidebar-text); }
.user-role  { font-size: 0.72rem; color: var(--sidebar-muted); }

/* ── MAIN ── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── TOPBAR ── */
.topbar {
  height: 62px;
  background: var(--surface);
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 22px;
  position: sticky;
  top: 0; z-index: 50;
  box-shadow: var(--shadow);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.3rem;
  cursor: pointer;
}

.topbar-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
  flex: 1;
  color: var(--text);
}

/* ── THEME TOGGLE BTN ── */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: all 0.2s;
  white-space: nowrap;
  font-family: 'Barlow', sans-serif;
}
.theme-toggle:hover { border-color: var(--orange); color: var(--text); }

/* ── PAGES ── */
.page { display: none; padding: 26px 22px; animation: fadeIn 0.25s ease; }
.page.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page-header { margin-bottom: 22px; }

.page-header h1 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 2rem;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.02em;
}

.page-header p {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── BUTTONS ── */
.btn-primary {
  background: var(--orange);
  color: #111;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}
.btn-primary:hover { opacity: 0.88; }
.btn-primary:active { transform: scale(0.97); }

.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 2px solid var(--border);
  padding: 9px 18px;
  border-radius: 8px;
  font-family: 'Barlow', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-secondary:hover { background: var(--surface3); }

.btn-ghost {
  background: none;
  color: var(--text-muted);
  border: none;
  padding: 9px 18px;
  border-radius: 8px;
  font-family: 'Barlow', sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  transition: color 0.2s;
}
.btn-ghost:hover { color: var(--text); }

/* ── CARDS ── */
.card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 2px solid var(--border);
  background: var(--surface2);
}

.card-header h3 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
}

.mt-20 { margin-top: 20px; }

/* ── STATS GRID ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.stat-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 5px;
  height: 100%;
}

.accent-orange::before { background: var(--orange); }
.accent-green::before  { background: var(--green);  }
.accent-red::before    { background: var(--red);    }
.accent-blue::before   { background: var(--blue);   }

.stat-icon  { font-size: 1.5rem; margin-bottom: 8px; }
.stat-value {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.6rem;
  font-weight: 900;
  margin-bottom: 4px;
  color: var(--text);
}
.stat-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; }

/* ── DASHBOARD GRID ── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.obra-list-mini { padding: 10px; }

.obra-mini-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-radius: 8px;
  margin-bottom: 6px;
  background: var(--surface2);
  cursor: pointer;
  transition: background 0.2s;
}
.obra-mini-item:hover { background: var(--surface3); }

.obra-mini-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.obra-mini-info { flex: 1; }
.obra-mini-name { font-size: 0.88rem; font-weight: 700; color: var(--text); }
.obra-mini-sub  { font-size: 0.75rem; color: var(--text-muted); }
.obra-mini-prog { font-size: 0.8rem; font-weight: 800; color: var(--orange); }

.etapas-list { padding: 10px; }

.etapa-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  background: var(--surface2);
  border-radius: 8px;
  margin-bottom: 6px;
}

.etapa-check {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
}
.etapa-check.done { background: var(--green); border-color: var(--green); }
.etapa-info  { flex: 1; }
.etapa-name  { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.etapa-obra  { font-size: 0.75rem; color: var(--text-muted); }

/* ── OBRAS GRID ── */
.obras-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.obra-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow);
}
.obra-card:hover { border-color: var(--orange); transform: translateY(-2px); box-shadow: var(--shadow-md); }

.obra-card-header {
  padding: 14px 18px 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.obra-type-icon {
  width: 40px; height: 40px;
  border-radius: 8px;
  background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.obra-card-title  { font-family: 'Barlow Condensed', sans-serif; font-size: 1rem; font-weight: 800; color: var(--text); }
.obra-card-client { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }

.obra-card-body { padding: 14px 18px; }

.obra-progress-bar  { height: 7px; background: var(--surface3); border-radius: 999px; overflow: hidden; margin-bottom: 10px; }
.obra-progress-fill { height: 100%; border-radius: 999px; background: var(--orange); transition: width 0.5s ease; }

.obra-meta   { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--text-muted); margin-bottom: 10px; }
.obra-valor  { font-family: 'Barlow Condensed', sans-serif; font-size: 1.3rem; font-weight: 900; color: var(--green); }

.obra-card-footer {
  padding: 10px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface2);
}

/* ── STATUS BADGES ── */
.status-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.status-em_andamento { background: var(--green-dim);   color: var(--green); }
.status-concluida    { background: var(--blue-dim);    color: var(--blue);  }
.status-orcamento    { background: var(--orange-light);color: var(--orange);}
.status-pausada      { background: var(--red-dim);     color: var(--red);   }
.status-pendente     { background: var(--surface3);    color: var(--text-muted); }

/* ── ACTION BUTTONS ── */
.obra-card-actions { display: flex; gap: 6px; }

.btn-action {
  background: var(--surface2);
  border: 2px solid var(--border);
  color: var(--text-muted);
  width: 32px; height: 32px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.btn-action:hover          { background: var(--orange); border-color: var(--orange); color: #111; }
.btn-action.danger:hover   { background: var(--red);    border-color: var(--red);    color: #fff; }

/* ── FILTER BAR ── */
.filter-bar { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }

.filter-btn {
  background: var(--surface);
  border: 2px solid var(--border);
  color: var(--text-muted);
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.filter-btn:hover  { border-color: var(--orange); color: var(--text); }
.filter-btn.active { background: var(--orange);   border-color: var(--orange); color: #111; }

/* ── SELECT OBRA BAR ── */
.select-obra-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.select-obra-bar label { font-size: 0.9rem; font-weight: 700; color: var(--text-muted); white-space: nowrap; }

.select-input {
  background: var(--surface);
  border: 2px solid var(--border);
  color: var(--text);
  padding: 9px 14px;
  border-radius: 8px;
  font-family: 'Barlow', sans-serif;
  font-size: 0.9rem;
  outline: none;
  min-width: 200px;
}
.select-input:focus { border-color: var(--orange); }

/* ── CRONOGRAMA ── */
.cronograma-wrapper { display: flex; flex-direction: column; gap: 10px; }

.etapa-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.etapa-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
}

.etapa-card-info  { flex: 1; }
.etapa-card-name  { font-weight: 700; font-size: 0.95rem; color: var(--text); }
.etapa-card-meta  { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.etapa-card-actions { display: flex; gap: 6px; margin-left: auto; }

/* ── GASTOS ── */
.gastos-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.gasto-stat {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.gasto-stat-label { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 4px; font-weight: 600; }
.gasto-stat-val   { font-family: 'Barlow Condensed', sans-serif; font-size: 1.5rem; font-weight: 900; color: var(--text); }

.gastos-table-wrap {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

table.data-table { width: 100%; border-collapse: collapse; }

table.data-table th {
  background: var(--surface2);
  padding: 11px 14px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
}

table.data-table td {
  padding: 11px 14px;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

table.data-table tr:last-child td { border-bottom: none; }
table.data-table tr:hover td { background: var(--surface2); }

/* ── CATEGORY BADGES ── */
.cat-badge    { font-size: 0.72rem; padding: 3px 9px; border-radius: 999px; font-weight: 700; }
.cat-material    { background: var(--blue-dim);    color: var(--blue);   }
.cat-mao_obra    { background: var(--green-dim);   color: var(--green);  }
.cat-equipamento { background: var(--orange-light);color: var(--orange); }
.cat-transporte  { background: rgba(168,85,247,.15); color: #7c3aed; }
.cat-outros      { background: var(--surface3);    color: var(--text-muted); }

/* ── FOTOS ── */
.fotos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.foto-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.foto-img {
  width: 100%; height: 160px;
  object-fit: cover;
  background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem;
  color: var(--text-dim);
}
.foto-img img { width: 100%; height: 100%; object-fit: cover; }
.foto-info    { padding: 12px; }
.foto-title   { font-weight: 700; font-size: 0.9rem; margin-bottom: 4px; color: var(--text); }
.foto-desc    { font-size: 0.78rem; color: var(--text-muted); }
.foto-date    { font-size: 0.72rem; color: var(--text-dim); margin-top: 6px; }

/* ── CLIENTES ── */
.cliente-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color 0.2s;
  box-shadow: var(--shadow);
}
.cliente-card:hover { border-color: var(--orange); }

.cliente-avatar {
  width: 50px; height: 50px;
  border-radius: 50%;
  background: var(--orange);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900;
  font-size: 1.1rem;
  color: #111;
  margin-bottom: 12px;
}

.cliente-name { font-family: 'Barlow Condensed', sans-serif; font-weight: 800; font-size: 1.1rem; margin-bottom: 4px; color: var(--text); }
.cliente-info { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 4px; }
.cliente-obras { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 0.8rem; color: var(--text-muted); }
.cliente-actions { display: flex; gap: 8px; margin-top: 12px; }

/* ── ORÇAMENTOS ── */
.orc-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s;
  box-shadow: var(--shadow);
}
.orc-card:hover { border-color: var(--orange); }

.orc-card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  background: var(--surface2);
}

.orc-card-title  { font-family: 'Barlow Condensed', sans-serif; font-weight: 800; font-size: 1rem; color: var(--text); }
.orc-card-client { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.orc-card-body   { padding: 14px 18px; }
.orc-card-total  { font-family: 'Barlow Condensed', sans-serif; font-size: 1.6rem; font-weight: 900; color: var(--green); }
.orc-card-items  { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }
.orc-card-valid  { font-size: 0.78rem; color: var(--text-dim); margin-top: 8px; }
.orc-card-footer { padding: 10px 18px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; background: var(--surface2); }

/* ── ORC TABLE ── */
.orc-itens-header { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 10px; }
.orc-itens-header h4 { font-family: 'Barlow Condensed', sans-serif; font-size: 0.9rem; font-weight: 800; color: var(--text); }

.orc-table { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
.orc-table th {
  background: var(--surface2);
  padding: 8px 10px;
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.orc-table td { padding: 6px 4px; border-bottom: 1px solid var(--border); }

.orc-input {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 9px;
  border-radius: 6px;
  font-family: 'Barlow', sans-serif;
  font-size: 0.85rem;
  width: 100%;
  outline: none;
}
.orc-input:focus { border-color: var(--orange); }

.orc-total { font-size: 0.85rem; font-weight: 700; color: var(--green); white-space: nowrap; padding: 0 10px; }

.btn-del-item { background: none; border: none; color: var(--red); cursor: pointer; font-size: 0.9rem; padding: 4px 8px; }

.orc-totais {
  background: var(--surface2);
  border-radius: 8px;
  padding: 12px 16px;
  display: flex; flex-direction: column; gap: 8px;
}

.orc-total-row { display: flex; align-items: center; justify-content: space-between; font-size: 0.9rem; color: var(--text); }
.orc-total-row input { max-width: 80px; text-align: right; }

.total-final {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900;
  font-size: 1.2rem;
  color: var(--green);
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* ── MODAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 18px;
}
.modal-overlay.active { display: flex; }

.modal {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 14px;
  width: 100%;
  max-width: 580px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-md);
  animation: modalIn 0.25s ease;
}
.modal-lg { max-width: 780px; }

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(14px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 2px solid var(--border);
  background: var(--surface2);
}

.modal-header h2 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--text);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  width: 32px; height: 32px;
  border-radius: 6px;
  transition: all 0.2s;
}
.modal-close:hover { background: var(--surface3); color: var(--text); }

.modal-body { padding: 22px; overflow-y: auto; flex: 1; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  border-top: 2px solid var(--border);
  background: var(--surface2);
}

/* ── FORMS ── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }

.form-group label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-input {
  background: var(--surface2);
  border: 2px solid var(--border);
  color: var(--text);
  padding: 10px 13px;
  border-radius: 8px;
  font-family: 'Barlow', sans-serif;
  font-size: 0.95rem;
  outline: none;
  resize: vertical;
  transition: border-color 0.2s;
}
.form-input:focus { border-color: var(--orange); }

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 24px; right: 24px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 14px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 9999;
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.3s ease;
  max-width: 320px;
  box-shadow: var(--shadow-md);
  color: var(--text);
}
.toast.show   { transform: translateY(0); opacity: 1; }
.toast.success{ border-color: var(--green);  color: var(--green);  }
.toast.error  { border-color: var(--red);    color: var(--red);    }
.toast.info   { border-color: var(--orange); color: var(--orange); }

/* ── EMPTY STATE ── */
.empty-state {
  padding: 56px 20px;
  text-align: center;
  color: var(--text-muted);
}
.empty-icon  { font-size: 3rem; margin-bottom: 12px; }
.empty-title { font-family: 'Barlow Condensed', sans-serif; font-size: 1.2rem; font-weight: 800; margin-bottom: 6px; color: var(--text); }
.empty-sub   { font-size: 0.9rem; }

/* ── GASTOS BARS ── */
.cat-bars { padding: 14px 18px; display: flex; flex-direction: column; gap: 10px; }
.cat-bar-item {}
.cat-bar-label { display: flex; justify-content: space-between; font-size: 0.82rem; margin-bottom: 4px; color: var(--text); font-weight: 600; }
.cat-bar-track { height: 8px; background: var(--surface3); border-radius: 999px; overflow: hidden; }
.cat-bar-fill  { height: 100%; border-radius: 999px; background: var(--orange); }

/* ── MEI FINANCEIRO ── */
.mei-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }

.mei-limit-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.mei-limit-label { font-size: 0.78rem; font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; }
.mei-limit-val   { font-family: 'Barlow Condensed', sans-serif; font-size: 2rem; font-weight: 900; color: var(--text); margin-bottom: 4px; }
.mei-limit-sub   { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 14px; }

.mei-bar-wrap   { height: 14px; background: var(--surface3); border-radius: 999px; overflow: hidden; margin-bottom: 6px; }
.mei-bar-fill   { height: 100%; border-radius: 999px; transition: width 0.8s ease; }
.mei-bar-ok     { background: var(--green); }
.mei-bar-warn   { background: var(--orange); }
.mei-bar-danger { background: var(--red); }
.mei-bar-pct    { font-size: 0.82rem; font-weight: 700; }

.das-table { width: 100%; border-collapse: collapse; }
.das-table th {
  background: var(--surface2);
  padding: 10px 14px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
}
.das-table td {
  padding: 11px 14px;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.das-table tr:last-child td { border-bottom: none; }
.das-table tr:hover td { background: var(--surface2); }

.das-status-ok     { background: var(--green-dim);    color: var(--green);  font-size: 0.75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.das-status-hoje   { background: var(--orange-light); color: var(--orange); font-size: 0.75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.das-status-vence  { background: var(--red-dim);      color: var(--red);    font-size: 0.75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.das-status-pago   { background: var(--green-dim);    color: var(--green);  font-size: 0.75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }

.mei-alerta {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.55;
}
.mei-alerta.danger { background: var(--red-dim);    border: 2px solid var(--red);    color: var(--red);    }
.mei-alerta.warn   { background: var(--orange-light);border: 2px solid var(--orange); color: var(--orange); }
.mei-alerta.ok     { background: var(--green-dim);  border: 2px solid var(--green);  color: var(--green);  }
.mei-alerta-icon   { font-size: 1.3rem; flex-shrink: 0; margin-top: 1px; }

/* ── SIDEBAR OVERLAY (mobile) ── */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 99; }
.sidebar-overlay.active { display: block; }

/* ── RESPONSIVE ── */
@media (max-width: 960px) {
  .stats-grid    { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid{ grid-template-columns: 1fr; }
  .gastos-summary{ grid-template-columns: 1fr 1fr; }
  .mei-grid      { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-248px); width: 248px; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .menu-toggle  { display: flex; }
  .stats-grid   { grid-template-columns: 1fr 1fr; }
  .form-grid    { grid-template-columns: 1fr; }
  .form-group.full { grid-column: 1; }
  .page { padding: 18px 14px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  html { font-size: 16px; }
}

/* ── CONTAS A PAGAR ── */
.conta-row-atrasada { background: rgba(192,57,43,0.05); }
.conta-row-vencendo { background: rgba(245,197,24,0.05); }

.ct-stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}