/* =========================================================
   Modelo Central · sistema visual (tema claro + sidebar ametista escuro)
   Fontes oficiais SB: Awesome Serif (display) + DM Sans (UI)
   ========================================================= */

@font-face {
  font-family: 'Awesome Serif';
  src: url('../assets/fonts/AwesomeSerif-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Awesome Serif';
  src: url('../assets/fonts/AwesomeSerif-MediumRegular.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Awesome Serif';
  src: url('../assets/fonts/AwesomeSerif-SemiBoldRegular.otf') format('opentype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Awesome Serif';
  src: url('../assets/fonts/AwesomeSerif-BoldRegular.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Awesome Serif';
  src: url('../assets/fonts/AwesomeSerifItalic-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  /* Backgrounds claros · área de conteúdo */
  --bg-app:        #FFFFFF;   /* branco puro · regra SB 02/07 */
  --bg-surface:    #FFFFFF;
  --bg-muted:      #F0EAFE;   /* hover/fundos secundários */
  --bg-elevated:   #FFFFFF;

  /* Sidebar escura · tom ametista profundo (estilo Ploomes) */
  --bg-sidebar:        #1F1240;
  --bg-sidebar-hover:  #2D1B5E;
  --bg-sidebar-active: #6D28D9;
  --sidebar-text:        #F5F3FF;
  --sidebar-text-muted:  #A89BD9;
  --sidebar-text-soft:   #7C70A8;
  --sidebar-border:      rgba(168, 155, 217, 0.12);

  /* Textos · área de conteúdo */
  --text-strong:   #1F1240;   /* texto forte = mesma família ametista (substitui o marrom) */
  --text-default:  #2D1B5E;
  --text-muted:    #6B6195;
  --text-soft:     #9C92BD;
  --text-invert:   #F5F3FF;

  /* Marca · paleta Ametista */
  --ametista:        #6D28D9;
  --ametista-soft:   #8B5CF6;
  --ametista-strong: #5B21B6;
  --ametista-bg:     #F0EAFE;
  --ametista-tint:   #DCD0FB;

  /* Acento secundário · Terracota (Claude) */
  --primary:       #C45A32;
  --primary-soft:  #D76A42;
  --primary-bg:    #FBEDE4;
  --primary-tint:  #F7DDCB;

  --gold:          #C5A55A;
  --gold-bg:       #F8F0DC;

  /* Estados */
  --success:       #10B981;
  --success-bg:    #DCFCE7;
  --warning:       #F59E0B;
  --warning-bg:    #FEF3C7;
  --danger:        #DC2626;
  --danger-bg:     #FEE2E2;
  --info:          #3B82F6;
  --info-bg:       #DBEAFE;

  /* Bordas e sombras (sombras ametista-tinged) */
  --border:        #E8E1F3;
  --border-strong: #D1C6E8;
  --shadow-sm:     0 1px 2px rgba(31, 18, 64, 0.04);
  --shadow:        0 2px 8px rgba(31, 18, 64, 0.06);
  --shadow-md:     0 8px 24px rgba(31, 18, 64, 0.08);
  --shadow-lg:     0 16px 40px rgba(31, 18, 64, 0.12);

  /* Geometria */
  --radius-sm:     6px;
  --radius:        10px;
  --radius-lg:     14px;
  --radius-xl:     20px;

  /* Layout */
  --sidebar-w:     244px;
  --header-h:      64px;

  /* Tipografia · OFICIAL SB */
  --font-display:  'Awesome Serif', Georgia, serif;
  --font-numeric:  'Awesome Serif', Georgia, serif; /* números grandes de KPI/valor · elegância SB */
  --font-ui:       'DM Sans', 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-default);
  background: var(--bg-app);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text-strong);
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.015em;
}

h1 { font-size: 30px; }
h2 { font-size: 24px; }
h3 { font-size: 19px; }
h4 { font-size: 16px; font-family: var(--font-ui); font-weight: 600; }

a { color: var(--ametista); text-decoration: none; }
a:hover { color: var(--ametista-soft); }

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

code { font-family: 'SF Mono', Menlo, Consolas, monospace; }

/* =========================================================
   LAYOUT BASE · sidebar dark ametista + main claro
   ========================================================= */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--sidebar-border);
  padding: 22px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
  color: var(--sidebar-text);
}

.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(168, 155, 217, 0.2); border-radius: 3px; }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 16px;
  border-bottom: 1px solid var(--sidebar-border);
}
.sidebar-brand .logo-mark {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--ametista-soft), var(--ametista));
  border-radius: 9px;
  display: grid; place-items: center;
  color: white; font-family: var(--font-display); font-weight: 600; font-size: 17px;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}
.sidebar-brand .brand-logo {
  height: 32px;
  width: auto;
  display: block;
  flex: 0 0 auto;
}
.sidebar-brand .brand-text {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  color: var(--sidebar-text);
  letter-spacing: -0.01em;
}
.sidebar-brand .brand-text small {
  display: block;
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 10px;
  color: var(--sidebar-text-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 2px;
}

.nav-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--sidebar-text-soft);
  padding: 6px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: var(--radius);
  color: var(--sidebar-text-muted);
  font-weight: 500;
  font-size: 14px;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover {
  background: var(--bg-sidebar-hover);
  color: var(--sidebar-text);
}
.nav-item.active {
  background: var(--bg-sidebar-active);
  color: #FFFFFF;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(109, 40, 217, 0.4);
}
.nav-item .icon {
  width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.nav-item .badge {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.15);
  color: #FFF;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 600;
}

.sidebar-user {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-user .avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ametista-soft), var(--primary));
  color: white;
  display: grid; place-items: center;
  font-weight: 600;
  font-size: 13px;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
}
.sidebar-user .info {
  flex: 1; min-width: 0;
}
.sidebar-user .info .name {
  font-weight: 600;
  color: var(--sidebar-text);
  font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user .info .role {
  font-size: 11px;
  color: var(--sidebar-text-soft);
}
.sidebar-user button {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--sidebar-text-muted);
}
.sidebar-user button:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #FFF;
}

/* =========================================================
   MAIN · header + content
   ========================================================= */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.header {
  height: var(--header-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}
.header h1 {
  font-size: 22px;
  margin: 0;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.content {
  padding: 28px;
  flex: 1;
  width: 100%;
}

/* =========================================================
   KPIs
   ========================================================= */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.15s;
}
.kpi:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.kpi-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.kpi-value {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  color: var(--text-strong);
  letter-spacing: -0.02em;
}
.kpi-delta {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 500;
}
.kpi-delta.up { color: var(--success); }
.kpi-delta.down { color: var(--danger); }

.kpi-accent-primary { border-top: 3px solid var(--primary); }
.kpi-accent-ametista { border-top: 3px solid var(--ametista); }
.kpi-accent-gold { border-top: 3px solid var(--gold); }
.kpi-accent-success { border-top: 3px solid var(--success); }

/* KPI grande tintado */
.kpi-hero {
  position: relative;
  background: linear-gradient(135deg, #F0EAFE 0%, #DCD0FB 100%);
  border-color: #C8B4F7;
  overflow: hidden;
}
.kpi-hero .kpi-label { color: #5B3F9E; }
.kpi-hero .kpi-value { color: #3D2873; font-size: 34px; }
.kpi-hero .kpi-icon {
  position: absolute; top: 18px; right: 18px;
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(109, 40, 217, 0.18); color: var(--ametista);
  display: grid; place-items: center;
}
.kpi-hero-ametista {
  background: linear-gradient(135deg, #F0EAFE 0%, #DCD0FB 100%);
  border-color: #C8B4F7;
}
.kpi-hero-ametista .kpi-label { color: #5B3F9E; }
.kpi-hero-ametista .kpi-value { color: #3D2873; }
.kpi-hero-ametista .kpi-icon { background: rgba(109, 40, 217, 0.18); color: var(--ametista); }

.kpi-hero-primary {
  background: linear-gradient(135deg, #FBEDE4 0%, #F7DDCB 100%);
  border-color: #F0CFB7;
}
.kpi-hero-primary .kpi-label { color: #8C5232; }
.kpi-hero-primary .kpi-value { color: #5A2E18; }
.kpi-hero-primary .kpi-icon { background: rgba(196, 90, 50, 0.18); color: var(--primary); }

.kpi-hero-success {
  background: linear-gradient(135deg, #DCFCE7 0%, #BBF7D0 100%);
  border-color: #86EFAC;
}
.kpi-hero-success .kpi-label { color: #166534; }
.kpi-hero-success .kpi-value { color: #14532D; }
.kpi-hero-success .kpi-icon { background: rgba(16, 185, 129, 0.18); color: #047857; }

.kpi-hero-danger {
  background: linear-gradient(135deg, #FEE2E2 0%, #FECACA 100%);
  border-color: #FCA5A5;
}
.kpi-hero-danger .kpi-label { color: #991B1B; }
.kpi-hero-danger .kpi-value { color: #7F1D1D; }
.kpi-hero-danger .kpi-icon { background: rgba(220, 38, 38, 0.18); color: #B91C1C; }

/* Card */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
  color: var(--text-strong);
}

/* Botões · primary agora é AMETISTA */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 13px;
  border: 1px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-primary {
  background: var(--ametista);
  color: white;
  box-shadow: 0 2px 8px rgba(109, 40, 217, 0.25);
}
.btn-primary:hover { background: var(--ametista-strong); }
.btn-ghost {
  background: var(--bg-surface);
  color: var(--text-default);
  border-color: var(--border-strong);
}
.btn-ghost:hover { border-color: var(--ametista); background: var(--bg-muted); color: var(--ametista); }
.btn-terracota {
  background: var(--primary);
  color: white;
}
.btn-terracota:hover { background: var(--primary-soft); }
.btn-novo {
  background: var(--bg-surface);
  color: var(--ametista);
  border: 1.5px solid var(--ametista-tint);
  font-size: 14px;
  padding: 9px 18px;
}
.btn-novo:hover {
  border-color: var(--ametista);
  background: var(--ametista-bg);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-muted);
  color: var(--text-default);
}
.badge-primary { background: var(--primary-bg); color: var(--primary); }
.badge-ametista { background: var(--ametista-bg); color: var(--ametista); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-info { background: var(--info-bg); color: var(--info); }

/* =========================================================
   KANBAN · estilo Ploomes (colunas suaves + cards limpos)
   ========================================================= */
.kanban {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 16px;
  scroll-snap-type: x proximity;
}
.kanban-coluna {
  min-width: 300px;
  max-width: 300px;
  background: transparent;
  border: none;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  scroll-snap-align: start;
}
.kanban-coluna-header {
  padding: 6px 14px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.kanban-coluna-header .dot {
  width: 8px; height: 8px; border-radius: 50%;
}
.kanban-coluna-header .title-wrap { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.kanban-coluna-header .title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-strong);
  letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kanban-coluna-header .subtitle {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}
.kanban-coluna-body {
  padding: 4px 4px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 120px;
  max-height: calc(100vh - 220px);
  overflow-y: auto;
}
.kanban-coluna-body::-webkit-scrollbar { width: 6px; }
.kanban-coluna-body::-webkit-scrollbar-thumb { background: rgba(109, 40, 217, 0.15); border-radius: 3px; }

.kanban-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  cursor: grab;
  transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
}
.kanban-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  border-color: var(--ametista-tint);
}
.kanban-card:active { cursor: grabbing; }
.kanban-card .card-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin-bottom: 4px;
}
.kanban-card .card-title-text {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-strong);
  flex: 1;
  min-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kanban-card .card-trilha {
  background: var(--ametista-bg);
  color: var(--ametista);
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.kanban-card .card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.kanban-card .card-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ametista-soft), var(--ametista));
  color: white;
  display: grid; place-items: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.kanban-card .card-valor {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-strong);
}
.kanban-card .card-tag-tempo {
  background: var(--bg-muted);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
}

/* SortableJS states */
.sortable-ghost {
  opacity: 0.35;
  background: var(--ametista-bg) !important;
  border: 2px dashed var(--ametista) !important;
}
.sortable-chosen { cursor: grabbing !important; }
.sortable-drag { box-shadow: var(--shadow-lg) !important; opacity: 0.9; }

.kanban-coluna-body.dragging-over { background: rgba(109, 40, 217, 0.04); border-radius: var(--radius-lg); }

/* =========================================================
   TABELA
   ========================================================= */
.table-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
table.sb {
  width: 100%;
  border-collapse: collapse;
}
table.sb thead {
  background: var(--bg-muted);
}
table.sb th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 12px 16px;
  white-space: nowrap;
}
table.sb td {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-default);
}
table.sb tbody tr:hover { background: var(--bg-muted); }

/* =========================================================
   LOGIN
   ========================================================= */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 20% 30%, rgba(109, 40, 217, 0.08), transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(196, 90, 50, 0.05), transparent 50%),
    var(--bg-app);
  padding: 20px;
}
.login-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px 32px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}
.login-card h1 {
  font-size: 26px;
  margin-bottom: 4px;
  text-align: center;
}
.login-card p.sub {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 28px;
  font-size: 13px;
}
.login-card .logo-sb {
  height: 52px;
  width: auto;
  display: block;
  margin: 0 auto 20px;
}
.login-card .logo-mark {
  width: 60px; height: 60px;
  background: linear-gradient(135deg, var(--ametista-soft), var(--ametista));
  border-radius: 15px;
  margin: 0 auto 20px;
  display: grid; place-items: center;
  color: white;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 26px;
  box-shadow: 0 8px 24px rgba(109, 40, 217, 0.35);
}
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-default);
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-surface);
  color: var(--text-strong);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus {
  outline: none;
  border-color: var(--ametista);
  box-shadow: 0 0 0 3px var(--ametista-bg);
}
.btn-block { width: 100%; justify-content: center; padding: 11px 16px; }

.alert {
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 14px;
}
.alert-error { background: var(--danger-bg); color: var(--danger); }

/* =========================================================
   EMPTY
   ========================================================= */
.empty-state {
  background: var(--bg-surface);
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 60px 30px;
  text-align: center;
  color: var(--text-muted);
}
.empty-state .icon {
  width: 56px; height: 56px;
  margin: 0 auto 16px;
  background: var(--ametista-bg);
  color: var(--ametista);
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 24px;
}
.empty-state h3 { color: var(--text-strong); margin-bottom: 8px; }
.empty-state p { margin: 0 auto; max-width: 380px; line-height: 1.55; }

/* =========================================================
   DASHBOARD CAMPANHA · helpers usados em dashboard.html
   ========================================================= */
.dash-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 2fr;
  gap: 16px;
  margin-bottom: 16px;
}
.dash-grid-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr;
  gap: 16px;
}
@media (max-width: 1100px) {
  .dash-grid, .dash-grid-bottom { grid-template-columns: 1fr; }
}

.chart-wrap { position: relative; height: 280px; }

.select-pill {
  appearance: none;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  color: var(--text-default);
  padding: 8px 30px 8px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B6195' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}
.select-pill:hover { border-color: var(--ametista); }

/* =========================================================
   UTILS
   ========================================================= */
.muted { color: var(--text-muted); }
.flex { display: flex; }
.row { display: flex; gap: 12px; align-items: center; }
.col { display: flex; flex-direction: column; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.text-strong { color: var(--text-strong); }
.text-muted { color: var(--text-muted); }
.fw-600 { font-weight: 600; }
.text-right { text-align: right; }

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

/* =========================================================
   MOBILE · sidebar vira drawer + header flexível (04/07)
   ========================================================= */
.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-strong);
  cursor: pointer;
}
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(31, 18, 64, 0.45);
  z-index: 90;
}

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

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(300px, 84vw);
    height: 100dvh;
    z-index: 100;
    transform: translateX(-105%);
    transition: transform 0.25s ease;
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 12px 0 40px rgba(31, 18, 64, 0.35);
  }
  .sidebar-backdrop.show { display: block; }

  .menu-toggle { display: flex; }

  .header {
    height: auto;
    min-height: var(--header-h);
    flex-wrap: wrap;
    gap: 10px 12px;
    padding: 12px 16px;
  }
  .header h1 { font-size: 19px; }
  .header-actions { flex-wrap: wrap; gap: 8px; width: 100%; }
  .header-actions .select-pill { flex: 1 1 40%; min-width: 0; }
  .header-actions .btn { flex: 1 1 auto; min-height: 40px; }

  .content { padding: 16px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .chart-wrap { height: 240px; }

  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* =========================================================
   MODAL + FORM-GRID globais (04/07 · promovidos de mentoradas.html
   para uso por Clientes/Financeiro/Campanhas/etc)
   ========================================================= */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(31, 18, 64, 0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(2px);
  padding: 16px;
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 640px;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
}
.modal h2 { font-size: 22px; margin: 0 0 4px; }
.modal-sub { color: var(--text-muted); font-size: 13px; margin: 0 0 22px; }
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}
.form-grid .full { grid-column: 1 / -1; }
.form-grid label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-strong);
  margin-bottom: 5px;
}
.form-grid input, .form-grid select, .form-grid textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-surface);
  color: var(--text-default);
  font-size: 13px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-grid textarea { resize: vertical; min-height: 72px; }
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus {
  border-color: var(--ametista);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}
.modal-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.modal-actions .space { flex: 1; }
@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
  .modal { padding: 20px; }
}

/* Ações inline em linha de tabela */
.row-actions { display: inline-flex; gap: 6px; }
.icon-btn {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.icon-btn:hover { background: var(--bg-muted); color: var(--text-strong); border-color: var(--border-strong); }
.icon-btn.danger:hover { color: var(--danger, #B00020); border-color: var(--danger, #B00020); background: rgba(176, 0, 32, 0.06); }
