/* ═══════════════════════════════════════════════════════════════════
   FlyAlerts CRM v3.0 — Design System
   Baseado em: Design Squad (Atomic Design + WCAG AA) + Brand Squad
   Paleta: Azul profundo + Laranja ação + Superfícies brancas
   ═══════════════════════════════════════════════════════════════════ */

/* ── DESIGN TOKENS ─────────────────────────────────────────────── */
:root {
  /* Brand Colors */
  --brand-primary:     #0a2463;
  --brand-primary-700: #0d2d7a;
  --brand-primary-600: #1035a0;
  --brand-primary-100: #e8edf8;
  --brand-primary-50:  #f0f4fc;
  --brand-accent:      #ff6b35;
  --brand-accent-700:  #e55a25;
  --brand-accent-100:  #fff0ea;

  /* Neutral Scale */
  --gray-900: #0f172a;
  --gray-800: #1e293b;
  --gray-700: #334155;
  --gray-600: #475569;
  --gray-500: #64748b;
  --gray-400: #94a3b8;
  --gray-300: #cbd5e1;
  --gray-200: #e2e8f0;
  --gray-100: #f1f5f9;
  --gray-50:  #f8fafc;
  --white:    #ffffff;

  /* Semantic Colors */
  --color-success:     #10b981;
  --color-success-bg:  #ecfdf5;
  --color-warning:     #f59e0b;
  --color-warning-bg:  #fffbeb;
  --color-error:       #ef4444;
  --color-error-bg:    #fef2f2;
  --color-info:        #3b82f6;
  --color-info-bg:     #eff6ff;

  /* Alias Tokens */
  --color-text:        var(--gray-900);
  --color-text-muted:  var(--gray-500);
  --color-text-subtle: var(--gray-400);
  --color-bg:          var(--gray-50);
  --color-surface:     var(--white);
  --color-surface-2:   var(--gray-100);
  --color-border:      var(--gray-200);
  --color-border-focus:var(--brand-primary);

  /* Typography */
  --font-family: 'DM Sans', 'Inter', system-ui, -apple-system, sans-serif;
  --font-size-xs:   11px;
  --font-size-sm:   13px;
  --font-size-base: 14px;
  --font-size-md:   15px;
  --font-size-lg:   18px;
  --font-size-xl:   22px;
  --font-size-2xl:  28px;
  --font-size-3xl:  36px;

  /* Spacing (base 4px) */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Border Radius */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  14px;
  --radius-xl:  20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,.05);
  --shadow-sm: 0 2px 8px rgba(0,0,0,.07);
  --shadow-md: 0 4px 16px rgba(0,0,0,.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.12);
  --shadow-xl: 0 16px 48px rgba(0,0,0,.15);

  /* Motion */
  --duration-fast:   150ms;
  --duration-normal: 250ms;
  --ease-default:    cubic-bezier(.4,0,.2,1);

  /* Z-index */
  --z-dropdown: 1000;
  --z-sticky:   1100;
  --z-overlay:  1200;
  --z-modal:    1300;
  --z-toast:    1500;

  /* Layout */
  --sidebar-width: 240px;
  --header-height: 60px;
}

/* ── RESET & BASE ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body, #root {
  height: 100%;
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body { overflow: hidden; }

button, input, select, textarea { font-family: inherit; font-size: inherit; }
a { color: var(--brand-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── SHELL LAYOUT ──────────────────────────────────────────────── */
.shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── SIDEBAR ───────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--brand-primary);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: var(--z-sticky);
  box-shadow: 2px 0 12px rgba(0,0,0,.15);
}

.sidebar-logo {
  height: var(--header-height);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0 var(--space-5);
  border-bottom: 1px solid rgba(255,255,255,.1);
  flex-shrink: 0;
}

.sidebar-logo-icon {
  width: 32px; height: 32px;
  background: var(--brand-accent);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800; color: #fff;
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-size: var(--font-size-md);
  font-weight: 700;
  color: #fff;
  letter-spacing: -.3px;
}

.sidebar-logo-sub {
  font-size: var(--font-size-xs);
  color: rgba(255,255,255,.5);
  font-weight: 400;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4) 0;
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255,255,255,.35);
  padding: var(--space-4) var(--space-5) var(--space-2);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-5);
  margin: 1px var(--space-3);
  border-radius: var(--radius-md);
  color: rgba(255,255,255,.7);
  font-size: var(--font-size-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-default);
  border: none;
  background: none;
  width: calc(100% - var(--space-6));
  text-align: left;
}

.nav-item:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
  transform: none;
}

.nav-item.active {
  background: var(--brand-accent);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(255,107,53,.4);
}

.nav-item-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }

.sidebar-footer {
  padding: var(--space-4);
  border-top: 1px solid rgba(255,255,255,.1);
  flex-shrink: 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--duration-fast);
}

.sidebar-user:hover { background: rgba(255,255,255,.08); }

.sidebar-avatar {
  width: 32px; height: 32px;
  background: var(--brand-accent);
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--font-size-sm); font-weight: 700; color: #fff;
  flex-shrink: 0;
}

.sidebar-user-name { font-size: var(--font-size-sm); font-weight: 600; color: #fff; }
.sidebar-user-role { font-size: var(--font-size-xs); color: rgba(255,255,255,.5); }

/* ── MAIN CONTENT AREA ─────────────────────────────────────────── */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.topbar {
  height: var(--header-height);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  flex-shrink: 0;
  gap: var(--space-4);
}

.topbar-title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -.3px;
}

.topbar-actions { display: flex; align-items: center; gap: var(--space-3); }

.page-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-6);
  background: var(--color-bg);
}

/* ── BUTTONS ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0 var(--space-4);
  height: 36px;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--duration-fast) var(--ease-default);
  white-space: nowrap;
  line-height: 1;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--brand-accent-700);
  color: var(--gray-900);
  box-shadow: 0 2px 8px rgba(255,107,53,.3);
}
.btn-primary:hover { background: var(--brand-accent-700); box-shadow: 0 4px 12px rgba(255,107,53,.4); }

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover { background: var(--gray-50); border-color: var(--gray-300); }

.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
  border: 1px solid transparent;
}
.btn-ghost:hover { background: var(--gray-100); color: var(--color-text); }

.btn-danger {
  background: var(--color-error);
  color: #fff;
}
.btn-danger:hover { background: #dc2626; }

.btn-sm { height: 30px; padding: 0 var(--space-3); font-size: var(--font-size-xs); }
.btn-lg { height: 44px; padding: 0 var(--space-6); font-size: var(--font-size-md); }
.btn-icon { width: 36px; padding: 0; }
.btn-icon.btn-sm { width: 30px; }

/* ── FORM ELEMENTS ─────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: var(--space-1); }

.form-label {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: .5px;
}

.form-label.required::after { content: ' *'; color: var(--color-error); }

.form-control {
  height: 38px;
  padding: 0 var(--space-3);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: var(--font-size-sm);
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
  width: 100%;
}

.form-control:focus {
  outline: none;
  border-color: var(--color-border-focus);
  box-shadow: 0 0 0 3px rgba(10,36,99,.12);
}

.form-control::placeholder { color: var(--color-text-subtle); }
.form-control:disabled { background: var(--gray-100); cursor: not-allowed; opacity: .7; }

textarea.form-control {
  height: auto;
  min-height: 80px;
  padding: var(--space-2) var(--space-3);
  resize: vertical;
}

select.form-control { cursor: pointer; }

.form-hint { font-size: var(--font-size-xs); color: var(--color-text-muted); }
.form-error { font-size: var(--font-size-xs); color: var(--color-error); }
.form-control.has-error { border-color: var(--color-error); }

.form-row { display: grid; gap: var(--space-4); }
.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-row-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

/* ── CARDS ─────────────────────────────────────────────────────── */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-border);
  gap: var(--space-4);
}

.card-title {
  font-size: var(--font-size-md);
  font-weight: 700;
  color: var(--color-text);
}

.card-body { padding: var(--space-5); }
.card-footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--color-border);
  background: var(--gray-50);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ── KPI CARDS ─────────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.kpi-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition: box-shadow var(--duration-fast), transform var(--duration-fast);
}

.kpi-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.kpi-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.kpi-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.kpi-icon.blue   { background: var(--brand-primary-100); }
.kpi-icon.orange { background: var(--brand-accent-100); }
.kpi-icon.green  { background: var(--color-success-bg); }
.kpi-icon.yellow { background: var(--color-warning-bg); }
.kpi-icon.red    { background: var(--color-error-bg); }

.kpi-label {
  font-size: var(--font-size-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}

.kpi-value {
  font-size: var(--font-size-2xl);
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -1px;
  line-height: 1;
}

.kpi-sub {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.kpi-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: var(--font-size-xs);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.kpi-badge.up   { background: var(--color-success-bg); color: var(--color-success); }
.kpi-badge.down { background: var(--color-error-bg);   color: var(--color-error); }

/* ── DATA TABLE ────────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface);
  font-size: var(--font-size-sm);
}

.data-table thead th {
  background: var(--gray-50);
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-size: var(--font-size-xs);
  font-weight: 700;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}

.data-table thead th.sortable { cursor: pointer; user-select: none; }
.data-table thead th.sortable:hover { color: var(--brand-primary); }

.data-table tbody tr {
  border-bottom: 1px solid var(--gray-100);
  transition: background var(--duration-fast);
}

.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: var(--brand-primary-50); }

.data-table td {
  padding: var(--space-3) var(--space-4);
  color: var(--color-text);
  vertical-align: middle;
}

.data-table td.muted { color: var(--color-text-muted); }
.data-table td.mono  { font-family: 'Courier New', monospace; font-size: var(--font-size-xs); }

/* ── BADGES / STATUS ───────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
  white-space: nowrap;
}

.badge-success { background: var(--color-success-bg); color: #059669; }
.badge-warning { background: var(--color-warning-bg); color: #d97706; }
.badge-error   { background: var(--color-error-bg);   color: #dc2626; }
.badge-info    { background: var(--color-info-bg);     color: #2563eb; }
.badge-neutral { background: var(--gray-100);          color: var(--gray-600); }
.badge-primary { background: var(--brand-primary-100); color: var(--brand-primary); }
.badge-accent  { background: var(--brand-accent-100);  color: var(--brand-accent-700); }

/* ── MODAL ─────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.5);
  backdrop-filter: blur(4px);
  z-index: var(--z-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  animation: fadeIn var(--duration-fast) var(--ease-default);
}

.modal {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: slideUp var(--duration-normal) var(--ease-default);
}

.modal-lg { max-width: 900px; }
.modal-xl { max-width: 1100px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.modal-title { font-size: var(--font-size-lg); font-weight: 700; }

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-6);
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--color-border);
  background: var(--gray-50);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  flex-shrink: 0;
}

@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin    { to { transform: rotate(360deg); } }

/* ── FILTER BAR ────────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 360px;
}

.search-input-wrap .search-icon {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-subtle);
  pointer-events: none;
  font-size: 14px;
}

.search-input-wrap .form-control { padding-left: 34px; }

/* ── TABS ──────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: var(--space-5);
}

.tab-btn {
  padding: var(--space-2) var(--space-4);
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all var(--duration-fast);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.tab-btn:hover { color: var(--brand-primary); background: var(--brand-primary-50); transform: none; }
.tab-btn.active { color: var(--brand-primary); border-bottom-color: var(--brand-accent); }

/* ── PAGINATION ────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--color-border);
  background: var(--gray-50);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.pagination-btns { display: flex; gap: var(--space-1); }

/* ── EMPTY STATE ───────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) var(--space-6);
  text-align: center;
  color: var(--color-text-muted);
}

.empty-state-icon { font-size: 48px; margin-bottom: var(--space-4); opacity: .4; }
.empty-state-title { font-size: var(--font-size-lg); font-weight: 700; color: var(--color-text); margin-bottom: var(--space-2); }
.empty-state-desc  { font-size: var(--font-size-sm); max-width: 360px; line-height: 1.6; }

/* ── LOADING ───────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2.5px solid var(--color-border);
  border-top-color: var(--brand-accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-12);
  flex-direction: column;
  gap: var(--space-4);
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

/* ── TOAST NOTIFICATIONS ───────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--gray-900);
  color: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  font-size: var(--font-size-sm);
  font-weight: 500;
  min-width: 280px;
  max-width: 400px;
  pointer-events: all;
  animation: slideUp var(--duration-normal) var(--ease-default);
}

.toast.success { background: #064e3b; border-left: 3px solid var(--color-success); }
.toast.error   { background: #7f1d1d; border-left: 3px solid var(--color-error); }
.toast.warning { background: #78350f; border-left: 3px solid var(--color-warning); }

/* ── LOGIN PAGE ────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--brand-primary) 0%, #1a3a8f 100%);
  padding: var(--space-4);
}

.login-card {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: var(--space-10);
  width: 100%;
  max-width: 420px;
}

.login-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
}

.login-logo-icon {
  width: 48px; height: 48px;
  background: var(--brand-accent);
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800; color: #fff;
}

.login-logo-text { font-size: var(--font-size-xl); font-weight: 800; color: var(--brand-primary); }
.login-logo-sub  { font-size: var(--font-size-sm); color: var(--color-text-muted); }

.login-title { font-size: var(--font-size-xl); font-weight: 700; margin-bottom: var(--space-2); }
.login-sub   { font-size: var(--font-size-sm); color: var(--color-text-muted); margin-bottom: var(--space-6); }

/* ── SECTION HEADER ────────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
  gap: var(--space-4);
}

.section-title { font-size: var(--font-size-xl); font-weight: 700; letter-spacing: -.3px; }
.section-sub   { font-size: var(--font-size-sm); color: var(--color-text-muted); margin-top: 2px; }

/* ── DETAIL PANEL ──────────────────────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-4);
}

.detail-item { display: flex; flex-direction: column; gap: 3px; }
.detail-label { font-size: var(--font-size-xs); font-weight: 600; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .5px; }
.detail-value { font-size: var(--font-size-sm); color: var(--color-text); font-weight: 500; }

/* ── RESPONSIVE ────────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-width: 0px; }
  .sidebar { display: none; }
  .form-row-2, .form-row-3, .form-row-4 { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .page-body { padding: var(--space-4); }
  .topbar { padding: 0 var(--space-4); }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
}

/* ── UTILITIES ─────────────────────────────────────────────────── */
.flex         { display: flex; }
.flex-col     { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.mt-4  { margin-top: var(--space-4); }
.mt-6  { margin-top: var(--space-6); }
.mb-4  { margin-bottom: var(--space-4); }
.mb-6  { margin-bottom: var(--space-6); }
.text-muted  { color: var(--color-text-muted); }
.text-sm     { font-size: var(--font-size-sm); }
.text-xs     { font-size: var(--font-size-xs); }
.font-bold   { font-weight: 700; }
.truncate    { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-full      { width: 100%; }
.text-right  { text-align: right; }
.text-center { text-align: center; }
.divider     { height: 1px; background: var(--color-border); margin: var(--space-4) 0; }

/* ── KANBAN PIPELINE BOARD ───────────────────────────────────────── */
.pipeline-board {
  display: flex;
  gap: var(--space-4);
  overflow-x: auto;
  padding-bottom: var(--space-4);
  min-height: 580px;
  align-items: flex-start;
}

.pipeline-column {
  flex: 1;
  min-width: 250px;
  max-width: 320px;
  background: var(--gray-100);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-height: 75vh;
  overflow-y: auto;
  transition: all var(--duration-fast) var(--ease-default);
}

.pipeline-column.drag-over {
  background: var(--brand-primary-100);
  border-color: var(--brand-primary-600);
}

.pipeline-column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--color-text);
  padding-bottom: var(--space-2);
  border-bottom: 2px solid var(--color-border);
}

.pipeline-column-count {
  background: var(--color-border);
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.pipeline-card {
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  box-shadow: var(--shadow-xs);
  cursor: grab;
  transition: all var(--duration-fast) var(--ease-default);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  user-select: none;
}

.pipeline-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  border-color: var(--brand-primary-600);
}

.pipeline-card:active {
  cursor: grabbing;
}

.pipeline-card-title {
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.4;
}

.pipeline-card-meta {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pipeline-card-price {
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--brand-primary);
}

/* ── SPREADSHEET BOARDS (MILHAS & CARTÕES) ──────────────────────── */
.spreadsheet-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}

.spreadsheet-table td {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
}

.spreadsheet-table input,
.spreadsheet-table select,
.spreadsheet-table textarea {
  width: 100%;
  border: none;
  background: transparent;
  padding: 4px;
  outline: none;
  color: var(--color-text);
  font-family: inherit;
}

.spreadsheet-table input:focus,
.spreadsheet-table select:focus,
.spreadsheet-table textarea:focus {
  background: var(--brand-primary-50);
}

.spreadsheet-table tr.selected {
  background: var(--brand-primary-100) !important;
}

/* ── TODO & CENTRAL DE TAREFAS ──────────────────────────────────── */
.todo-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.6fr);
  gap: var(--space-5);
}

.todo-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.todo-item {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  transition: all var(--duration-fast);
}

.todo-item.done {
  background: var(--gray-50);
  opacity: .75;
}

.todo-item.done .todo-title {
  text-decoration: line-through;
  color: var(--color-text-muted);
}

.todo-checkbox {
  width: 24px; height: 24px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--color-border);
  background: var(--color-surface-2);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  color: var(--color-success);
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--duration-fast);
}

.todo-checkbox.checked {
  background: var(--color-success-bg);
  border-color: var(--color-success);
}

.todo-content {
  flex: 1;
  min-width: 0;
}

.todo-title {
  font-size: var(--font-size-md);
  font-weight: 700;
  color: var(--color-text);
}

.todo-desc {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.todo-meta {
  font-size: var(--font-size-xs);
  color: var(--color-text-subtle);
  margin-top: 4px;
}

/* ── PREMIUM CLASSY EFFECTS ──────────────────────────────────────── */
.glass-effect {
  background: rgba(255, 255, 255, 0.7) !important;
  backdrop-filter: blur(10px) saturate(180%);
  -webkit-backdrop-filter: blur(10px) saturate(180%);
  border: 1px solid rgba(209, 213, 219, 0.3) !important;
}

.fade-in {
  animation: fadeIn var(--duration-normal) var(--ease-default);
}

