/* ============================================================
   POST AI — Estilos Globais
   ============================================================ */

/* ── Reset e base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand:          #1a56a0;
  --brand-dark:     #0d3d6b;
  --brand-light:    #e8f1fb;
  --accent:         #f0a500;
  --surface:        #ffffff;
  --bg:             #f3f6fb;
  --bg2:            #eef1f8;
  --text:           #1a1f2e;
  --text-muted:     #6b7280;
  --text-light:     #9ca3af;
  --border:         #dde3ee;
  --border-light:   #eef1f8;
  --success:        #22c55e;
  --success-bg:     #f0fdf4;
  --success-border: #bbf7d0;
  --warning:        #f0a500;
  --warning-bg:     #fffbeb;
  --warning-border: #fde68a;
  --danger:         #ef4444;
  --danger-bg:      #fef2f2;
  --danger-border:  #fecaca;
  --info:           #3b82f6;
  --info-bg:        #eff6ff;
  --info-border:    #bfdbfe;
  --radius:         8px;
  --radius-lg:      12px;
  --shadow:         0 2px 12px rgba(26,86,160,.08);
  --shadow-md:      0 4px 24px rgba(26,86,160,.12);
  --sidebar-w:      228px;
  --header-h:       60px;
  --font:           'DM Sans', sans-serif;
}

html { font-size: 15px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================================
   LAYOUT PRINCIPAL
   ============================================================ */
body.layout-main {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  transition: transform .25s ease;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-light);
  text-decoration: none;
}
.sidebar-logo-icon {
  width: 32px; height: 32px;
  background: var(--brand-dark);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.sidebar-logo-name {
  font-family: 'DM Serif Display', serif;
  font-size: 18px;
  color: var(--text);
  letter-spacing: -.2px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
}
.sidebar-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-light);
  padding: 10px 10px 4px;
  display: block;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 400;
  text-decoration: none;
  position: relative;
  transition: background .12s, color .12s;
}
.sidebar-link:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.sidebar-link.active { background: var(--brand-light); color: var(--brand); font-weight: 500; }
.sidebar-link svg { flex-shrink: 0; }

.sidebar-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 20px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border-light);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--brand-light);
  color: var(--brand);
  font-size: 14px;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sidebar-user-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}
.sidebar-user-role {
  font-size: 11px;
  color: var(--text-light);
  display: block;
}
.sidebar-logout {
  width: 100%;
  padding: 7px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: background .12s;
  font-family: var(--font);
}
.sidebar-logout:hover { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 99;
}

/* ── Main wrapper ── */
.main-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Header ── */
.main-header {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
}
.header-title {
  font-size: 17px;
  font-weight: 500;
  color: var(--text);
  flex: 1;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius);
  color: var(--text-muted);
  transition: background .12s, color .12s;
  text-decoration: none;
  position: relative;
}
.header-btn:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.header-badge {
  position: absolute;
  top: 2px; right: 2px;
  background: var(--danger);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 10px;
  min-width: 16px;
  text-align: center;
}
.header-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.header-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--brand-light);
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.header-user-name { font-size: 13px; color: var(--text); }

/* ── Conteúdo principal ── */
.main-content {
  flex: 1;
  padding: 28px 28px 48px;
  width: 100%;
}

/* ── Flash banner ── */
.flash-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  font-size: 14px;
  gap: 12px;
}
.flash-success { background: var(--success-bg); color: #15803d; border-bottom: 1px solid var(--success-border); }
.flash-error   { background: var(--danger-bg);  color: #b91c1c; border-bottom: 1px solid var(--danger-border); }
.flash-info    { background: var(--info-bg);    color: var(--brand); border-bottom: 1px solid var(--info-border); }
.flash-close {
  background: none; border: none; cursor: pointer;
  font-size: 18px; color: inherit; opacity: .6; line-height: 1;
}
.flash-close:hover { opacity: 1; }

/* ── Barra de alertas ── */
.alerts-bar { background: var(--warning-bg); border-bottom: 1px solid var(--warning-border); }
.alerts-bar-inner {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 12px 24px;
  flex-wrap: wrap;
}
.alerts-bar-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #92400e;
  white-space: nowrap;
  padding-top: 2px;
}
.alerts-list { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.alert-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 13px;
}
.alert-info    { background: var(--info-bg);    border-color: var(--info-border); }
.alert-success { background: var(--success-bg); border-color: var(--success-border); }
.alert-warning { background: var(--warning-bg); border-color: var(--warning-border); }
.alert-danger  { background: var(--danger-bg);  border-color: var(--danger-border); }
.alert-icon { font-size: 14px; flex-shrink: 0; margin-top: 1px; }
.alert-body { flex: 1; }
.alert-title { font-weight: 600; display: block; }
.alert-msg   { color: var(--text-muted); font-size: 12px; }
.alert-dismiss {
  background: none; border: none; cursor: pointer;
  font-size: 16px; color: var(--text-muted); line-height: 1;
  padding: 0 4px; flex-shrink: 0;
}
.alert-dismiss:hover { color: var(--text); }
.alert-severity-badge {
  background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 600;
  padding: 2px 6px; border-radius: 20px;
  flex-shrink: 0;
}
.alerts-see-all { font-size: 12px; color: var(--brand); white-space: nowrap; }
.alerts-bar-close {
  background: none; border: none; cursor: pointer;
  font-size: 20px; color: var(--text-muted); line-height: 1;
  flex-shrink: 0;
}

/* ============================================================
   COMPONENTES REUTILIZÁVEIS
   ============================================================ */

/* ── Botões ── */
.btn-back {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; color: var(--text-muted); text-decoration: none;
  padding: 6px 0; white-space: nowrap;
}
.btn-back:hover { color: var(--text); text-decoration: none; }

.btn-primary-sm {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  background: var(--brand); color: #fff;
  border: none; border-radius: var(--radius);
  font-family: var(--font); font-size: 13px; font-weight: 500;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .12s;
}
.btn-primary-sm:hover { background: var(--brand-dark); color: #fff; text-decoration: none; }

.btn-outline {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  background: var(--surface); color: var(--text-muted);
  border: 1px solid var(--border); border-radius: var(--radius);
  font-family: var(--font); font-size: 13px; cursor: pointer;
  text-decoration: none; white-space: nowrap;
  transition: background .12s, color .12s;
}
.btn-outline:hover { background: var(--bg); color: var(--text); text-decoration: none; }

.btn-sm {
  display: inline-flex; align-items: center;
  padding: 6px 12px;
  background: var(--brand-light); color: var(--brand);
  border: 1px solid var(--info-border); border-radius: var(--radius);
  font-size: 12px; font-weight: 500; cursor: pointer;
  text-decoration: none; font-family: var(--font);
  transition: background .12s;
}
.btn-sm:hover { background: var(--brand); color: #fff; text-decoration: none; }

.btn-xs {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); font-size: 13px; cursor: pointer;
  font-family: var(--font); transition: background .12s;
}
.btn-accept { border-color: var(--success-border); color: #15803d; background: var(--success-bg); }
.btn-accept:hover { background: var(--success); color: #fff; }
.btn-ignore { border-color: var(--danger-border); color: #b91c1c; background: var(--danger-bg); }
.btn-ignore:hover { background: var(--danger); color: #fff; }
.btn-danger-sm {
  padding: 7px 14px; background: var(--danger-bg); color: var(--danger);
  border: 1px solid var(--danger-border); border-radius: var(--radius);
  font-size: 13px; cursor: pointer; font-family: var(--font);
  transition: background .12s;
}
.btn-danger-sm:hover { background: var(--danger); color: #fff; }
.btn-danger-xs {
  color: var(--danger); background: var(--danger-bg); border-color: var(--danger-border);
}

/* ── Pills de status e funil ── */
.status-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  text-transform: capitalize;
}
.status-ideia    { background: #f1f5f9; color: #64748b; }
.status-roteiro  { background: #fffbeb; color: #92400e; }
.status-gravado  { background: #f5f3ff; color: #7c3aed; }
.status-editado  { background: #eff6ff; color: #1d4ed8; }
.status-agendado { background: #fff7ed; color: #c2410c; }
.status-postado  { background: #f0fdf4; color: #15803d; }

.dash-post-type {
  display: inline-block;
  padding: 2px 8px;
  background: var(--bg2);
  color: var(--text-muted);
  border-radius: 20px;
  font-size: 11px;
  text-transform: capitalize;
}
.dash-funnel-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  text-transform: capitalize;
}
.funnel-topo  { background: #fef9c3; color: #854d0e; }
.funnel-meio  { background: #e0f2fe; color: #0369a1; }
.funnel-fundo { background: #dcfce7; color: #15803d; }
.funnel-todos { background: var(--bg2); color: var(--text-muted); }

/* ── Tags ── */
.dash-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  background: var(--bg2); color: var(--text-muted);
  border: 1px solid var(--border);
}
.dash-tag-success { background: var(--success-bg); color: #15803d; border-color: var(--success-border); }
.dash-tag-warning { background: var(--warning-bg); color: #92400e; border-color: var(--warning-border); }
.dash-tag-info    { background: var(--info-bg);    color: #1d4ed8; border-color: var(--info-border); }
.dash-tag-group   { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; align-items: center; }
.dash-tag-label   { font-size: 12px; color: var(--text-muted); font-weight: 500; }

/* ── Formulários ── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: 13px; font-weight: 500;
  color: var(--text); margin-bottom: 5px;
}
.req { color: var(--danger); }
.form-input {
  width: 100%; padding: 9px 12px;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  font-family: var(--font); font-size: 14px; color: var(--text);
  background: var(--surface); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.form-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(26,86,160,.1);
}
.form-input::placeholder { color: #b0b7c3; }
.form-textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
.form-hint { font-size: 11.5px; color: var(--text-light); margin-top: 4px; display: block; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.form-col { display: flex; flex-direction: column; gap: 0; }
.form-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 16px; }
.form-section-title {
  font-size: 13px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .05em;
  margin-bottom: 16px; display: flex; align-items: center; gap: 8px;
}
.form-section-icon { font-size: 15px; }
.form-section-tag {
  font-size: 10px; padding: 2px 7px;
  background: var(--brand-light); color: var(--brand);
  border-radius: 20px; font-weight: 600;
  text-transform: none; letter-spacing: 0;
}
.form-actions {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 12px; padding-top: 20px;
  border-top: 1px solid var(--border); margin-top: 8px;
}
.form-page-header {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 24px; flex-wrap: wrap;
}
.form-page-title { font-size: 20px; font-weight: 500; flex: 1; }
.form-page-sub   { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* ── Dashboard ── */
.dash-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.dash-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex; flex-direction: column; gap: 4px;
}
.dash-card-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.dash-card-value { font-size: 28px; font-weight: 600; color: var(--text); line-height: 1.1; }
.dash-card-sub   { font-size: 12px; color: var(--text-light); }

.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }

.dash-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}
.dash-section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.dash-section-title { font-size: 14px; font-weight: 600; color: var(--text); }
.dash-section-link  { font-size: 12px; color: var(--brand); text-decoration: none; }
.dash-section-link:hover { text-decoration: underline; }

.dash-post-list { display: flex; flex-direction: column; gap: 2px; }
.dash-post-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius);
  text-decoration: none; color: var(--text);
  transition: background .1s;
}
.dash-post-item:hover { background: var(--bg); text-decoration: none; }
.dash-post-info { flex: 1; min-width: 0; }
.dash-post-title { font-size: 13px; font-weight: 500; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-post-meta  { display: flex; align-items: center; gap: 6px; margin-top: 3px; flex-wrap: wrap; }
.dash-post-date  { font-size: 11px; color: var(--text-light); }
.dash-post-score { font-size: 16px; font-weight: 600; flex-shrink: 0; }
.dash-rank       { font-size: 13px; font-weight: 700; color: var(--text-light); width: 18px; text-align: center; flex-shrink: 0; }

.dash-suggestion-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px; border-radius: var(--radius);
  border: 1px solid var(--border); margin-bottom: 6px;
}
.dash-suggestion-actions { display: flex; gap: 6px; flex-shrink: 0; }

.dash-analysis-summary { font-size: 13px; color: var(--text); }
.dash-analysis-date    { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.dash-analysis-text    { font-size: 13px; color: var(--text-muted); line-height: 1.5; margin-top: 8px; }

.dash-empty { text-align: center; padding: 24px 16px; color: var(--text-muted); font-size: 13px; }
.dash-empty p { margin-bottom: 10px; }

.info-banner {
  background: var(--info-bg); border: 1px solid var(--info-border);
  border-radius: var(--radius); padding: 10px 16px;
  font-size: 13px; color: var(--brand); margin-bottom: 20px;
}

/* ── Seções de show ── */
.show-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 24px; flex-wrap: wrap;
}
.show-header-left  { display: flex; align-items: flex-start; gap: 14px; flex: 1; }
.show-header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.show-title { font-size: 20px; font-weight: 500; margin-bottom: 6px; }
.show-meta  { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.show-date  { font-size: 12px; color: var(--text-muted); }
.show-grid  { display: grid; grid-template-columns: 1fr 1.4fr; gap: 24px; }
.show-col   { display: flex; flex-direction: column; gap: 16px; }

.show-score-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px; text-align: center;
}
.show-score-number { font-size: 48px; font-weight: 700; line-height: 1; }
.show-score-label  { font-size: 14px; font-weight: 500; color: var(--text-muted); margin-top: 4px; }
.show-score-sub    { font-size: 12px; color: var(--text-light); margin-top: 6px; }
.show-no-score {
  background: var(--bg); border: 1px dashed var(--border);
  border-radius: var(--radius-lg); padding: 20px; text-align: center;
  font-size: 13px; color: var(--text-muted);
}

.show-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px;
}
.show-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.show-section-title  { font-size: 13px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 12px; }

.show-dl { display: flex; flex-direction: column; gap: 0; }
.show-dl-row { display: grid; grid-template-columns: 120px 1fr; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--border-light); font-size: 13px; }
.show-dl-row:last-child { border-bottom: none; }
.show-dl-row dt { color: var(--text-muted); font-weight: 500; }
.show-dl-row dd { color: var(--text); }

.show-text-block {
  font-size: 13.5px; color: var(--text); line-height: 1.7;
  background: var(--bg); border-radius: var(--radius);
  padding: 14px; white-space: pre-wrap;
}
.show-caption { border-left: 3px solid var(--accent); }

.show-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
}
.show-metric-card {
  background: var(--bg); border-radius: var(--radius);
  padding: 12px 8px; text-align: center;
  display: flex; flex-direction: column; gap: 4px;
}
.show-metric-icon  { font-size: 16px; }
.show-metric-value { font-size: 18px; font-weight: 700; color: var(--text); line-height: 1; }
.show-metric-label { font-size: 10px; color: var(--text-muted); }

/* ── Histórico de métricas ── */
.history-totals { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 16px; }
.history-totals-title { font-size: 13px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 14px; }
.history-score-bar {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px;
}
.history-score-label { font-size: 13px; color: var(--text-muted); }
.history-score-value { font-size: 24px; font-weight: 700; }
.history-score-tag   { font-size: 12px; color: var(--text-muted); }
.history-table-wrap  { overflow-x: auto; }
.history-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.history-table th {
  background: var(--bg); padding: 9px 12px; text-align: left;
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .05em;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.history-table td { padding: 9px 12px; border-bottom: 1px solid var(--border-light); vertical-align: middle; }
.history-table tr:last-child td { border-bottom: none; }
.history-table tr:hover td { background: var(--bg); }
.history-notes-row td { background: var(--bg); font-size: 12px; color: var(--text-muted); padding: 6px 12px; }
.history-note-label { font-weight: 600; }

/* ── Relatórios ── */
.reports-filters {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px 20px; margin-bottom: 20px;
}
.filter-row { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.filter-row .form-group { margin-bottom: 0; min-width: 140px; }
.reports-summary { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }
.reports-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.reports-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.report-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.report-table th { padding: 8px 10px; text-align: left; font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; border-bottom: 1px solid var(--border); }
.report-table td { padding: 8px 10px; border-bottom: 1px solid var(--border-light); }
.report-table tr:last-child td { border-bottom: none; }
.chart-wrap { position: relative; padding: 8px 0; }

/* ── IA ── */
.ai-analyze-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
  margin-bottom: 24px;
}
.ai-analyze-title  { font-size: 18px; font-weight: 600; margin-bottom: 6px; }
.ai-analyze-desc   { font-size: 13.5px; color: var(--text-muted); line-height: 1.6; margin-bottom: 12px; }
.ai-no-data        { font-size: 13px; color: var(--warning); background: var(--warning-bg); padding: 8px 12px; border-radius: var(--radius); }
.ai-data-count     { font-size: 13px; color: #15803d; }
.ai-analyze-form   { margin-top: 16px; }
.ai-form-row       { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.ai-form-row .form-group { margin-bottom: 0; min-width: 160px; }
.btn-ai-run {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 24px;
  background: var(--brand); color: #fff;
  border: none; border-radius: var(--radius);
  font-family: var(--font); font-size: 15px; font-weight: 500;
  cursor: pointer; transition: background .12s;
}
.btn-ai-run:hover    { background: var(--brand-dark); }
.btn-ai-run:disabled { opacity: .7; cursor: not-allowed; }

.ai-alert-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: var(--radius);
  border: 1px solid transparent; margin-bottom: 6px;
}
.ai-alert-info    { background: var(--info-bg);    border-color: var(--info-border); }
.ai-alert-warning { background: var(--warning-bg); border-color: var(--warning-border); }
.ai-alert-danger  { background: var(--danger-bg);  border-color: var(--danger-border); }
.ai-alert-body    { flex: 1; }
.ai-alert-header  { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.ai-alert-severity { font-size: 10px; font-weight: 600; padding: 1px 6px; background: rgba(0,0,0,.08); border-radius: 20px; text-transform: capitalize; }
.ai-alert-time    { font-size: 11px; color: var(--text-light); margin-left: auto; }
.ai-alert-msg     { font-size: 13px; color: var(--text-muted); }
.ai-alert-item.unread { border-left: 3px solid var(--brand); }

.ai-suggestions-list { display: flex; flex-direction: column; gap: 8px; }
.ai-suggestion-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface);
}
.ai-suggestion-info      { flex: 1; }
.ai-suggestion-title     { font-size: 13.5px; font-weight: 500; display: block; margin-bottom: 4px; }
.ai-suggestion-rationale { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.ai-suggestion-actions   { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }

.ai-history-list { display: flex; flex-direction: column; gap: 4px; }
.ai-history-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: var(--radius);
  border: 1px solid var(--border); text-decoration: none; color: var(--text);
  transition: background .1s;
}
.ai-history-item:hover { background: var(--bg); text-decoration: none; }
.ai-history-info  { flex: 1; }
.ai-history-date  { font-size: 13px; font-weight: 500; display: block; margin-bottom: 4px; }
.ai-history-arrow { color: var(--text-muted); }

/* ── Resultado da IA ── */
.ai-result-summary {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 22px; margin-bottom: 20px;
}
.ai-result-section-title {
  font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; margin-bottom: 14px;
}
.ai-result-icon { font-size: 18px; }
.ai-result-text { font-size: 14px; color: var(--text); line-height: 1.7; white-space: pre-wrap; }
.ai-result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.ai-result-col  { display: flex; flex-direction: column; gap: 14px; }
.ai-result-block {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px;
}
.ai-block-success { border-left: 4px solid var(--success); }
.ai-block-warning { border-left: 4px solid var(--warning); }
.ai-block-danger  { border-left: 4px solid var(--danger); }
.ai-result-block-title { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.ai-result-block-desc  { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.ai-result-block p     { font-size: 13.5px; line-height: 1.65; color: var(--text); }
.ai-tag-list           { display: flex; flex-wrap: wrap; gap: 6px; }

.ai-result-suggestions { margin-bottom: 24px; }
.ai-suggestions-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px; margin-top: 14px;
}
.ai-suggestion-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.ai-suggestion-card-header {}
.ai-suggestion-card-title { font-size: 14px; font-weight: 500; display: block; margin-bottom: 4px; }
.ai-suggestion-dl { display: flex; flex-direction: column; gap: 0; }
.ai-suggestion-dl .show-dl-row { font-size: 12.5px; }
.ai-suggestion-card-footer { display: flex; align-items: center; gap: 8px; padding-top: 8px; border-top: 1px solid var(--border-light); }
.ai-suggestion-accepted { font-size: 12px; font-weight: 500; color: #15803d; }

/* ============================================================
   RESPONSIVO
   ============================================================ */
@media (max-width: 1024px) {
  .form-grid       { grid-template-columns: 1fr; }
  .show-grid       { grid-template-columns: 1fr; }
  .dash-cards      { grid-template-columns: repeat(2, 1fr); }
  .reports-grid-3  { grid-template-columns: 1fr; }
  .ai-result-grid  { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay.open { display: block; }
  .main-wrapper { margin-left: 0; }
  .main-content { padding: 16px; }
  .header-menu-btn { display: flex; }
  .header-user-name { display: none; }
  .dash-grid       { grid-template-columns: 1fr; }
  .reports-grid-2  { grid-template-columns: 1fr; }
  .form-row        { grid-template-columns: 1fr; }
  .dash-cards      { grid-template-columns: 1fr 1fr; }
  .ai-form-row     { flex-direction: column; }
}