@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=Playfair+Display:ital,wght@1,400;1,600&display=swap');

/* ════════════════════════════════════════════
   DESIGN TOKENS
   ════════════════════════════════════════════ */
:root {
  /* Verde — único acento */
  --green-700: #16a34a;
  --green-600: #15803d;

  /* Aliases semânticos */
  --green-900: #111111;
  --green-950: #000000;
  --cream:     #ffffff;
  --lime-400:  #16a34a;
  --lime-50:   #f0fdf4;
  --gradient-4: linear-gradient(180deg, #111111 0%, #000000 100%);

  /* Ink — escala preto/branco */
  --ink-900: #000000;
  --ink-700: #111111;
  --ink-500: #333333;
  --ink-400: #666666;
  --ink-300: #999999;
  --ink-200: #cccccc;
  --ink-100: #eeeeee;

  /* Superfícies */
  --surface:   #f8f8f8;
  --surface-2: #f2f2f2;
  --surface-3: #e8e8e8;
  --card:      #ffffff;
  --line:      #e0e0e0;
  --line-soft: #efefef;

  /* Status */
  --danger:    #EF4444;
  --danger-bg: #FEE2E2;
  --warn:      #555555;
  --warn-bg:   #e8e8e8;
  --ok:        #16a34a;
  --ok-bg:     #f0fdf4;

  --font-ui:   "Plus Jakarta Sans", system-ui, sans-serif;
  --font-mono: var(--font-ui);

  --r-sm: 10px;
  --r-md: 16px;
  --r-card: 22px;
  --r-lg: 26px;
  --r-xl: 36px;

  --shadow-sm: 0 2px 6px rgba(0,0,0,.05), 0 6px 20px rgba(0,0,0,.04);
  --shadow-md: 0 3px 8px rgba(0,0,0,.08), 0 12px 40px rgba(0,0,0,.07);
  --shadow-lg: 0 6px 16px rgba(0,0,0,.11), 0 24px 64px rgba(0,0,0,.10);
}

/* ════════════════════════════════════════════
   BASE
   ════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font-ui);
  background: var(--surface);
  color: var(--ink-900);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; color: inherit; }
a { text-decoration: none; color: inherit; }
.mono { font-family: var(--font-ui); }
.playfair { font-family: 'Playfair Display', Georgia, serif; font-style: italic; }

/* ════════════════════════════════════════════
   LAYOUT
   ════════════════════════════════════════════ */
#app { height: 100%; }

.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}
.main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
}
.scroll {
  overflow-y: auto;
  flex: 1;
  padding: 6px 32px 64px;
}

/* ════════════════════════════════════════════
   HEADER / NAV
   ════════════════════════════════════════════ */
.crm-header {
  margin: 10px 15px 0;
  background: transparent;
  border-radius: 0;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 10px;
  z-index: 50;
}
.brand-logo {
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex-shrink: 0;
}
.brand-logo .name {
  font-weight: 800;
  font-size: 34px;
  color: var(--green-700);
  letter-spacing: -0.5px;
  line-height: 1;
}
.brand-logo .tag {
  font-weight: 200;
  font-size: 16px;
  color: var(--ink-500);
  letter-spacing: 0.05em;
}


/* View zoom wrapper */
.view-zoom { zoom: 1.3; }

/* Tab bar */
.tabbar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 38px;
  padding: 6px;
  flex: 1;
  max-width: 560px;
  margin: 0 auto;
}
.tab-indicator {
  position: absolute;
  top: 6px;
  height: calc(100% - 12px);
  background: #111;
  border-radius: 30px;
  pointer-events: none;
  z-index: 0;
  will-change: left, width;
}
.tab-btn {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1;
  height: 44px;
  border-radius: 30px;
  border: none;
  background: transparent;
  color: var(--ink-900);
  font-size: 13px;
  font-weight: 700;
  transition: color 200ms;
  cursor: pointer;
  padding: 0 14px;
}
.tab-btn:hover { color: var(--ink-900); }
.tab-btn.active { color: #fff; }
.tab-btn .tab-badge {
  font-size: 11px;
  padding: 1px 5px;
  border-radius: 999px;
  font-weight: 800;
  line-height: 1.4;
}
.tab-btn.active .tab-badge { background: rgba(255,255,255,.2); color: #fff; }
.tab-btn:not(.active) .tab-badge { background: var(--danger); color: #fff; }

/* Header right */
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.notif-btn {
  position: relative;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-700);
  display: grid; place-items: center;
  cursor: pointer;
  transition: all 150ms;
  flex-shrink: 0;
}
.notif-btn:hover, .notif-btn.open { background: #000; border-color: #000; color: #fff; }
.notif-badge {
  position: absolute;
  top: -6px; right: -6px;
  min-width: 18px; height: 18px;
  background: var(--lime-400);
  color: var(--green-950);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--card);
}
.notif-panel {
  position: absolute;
  right: 0; top: 52px;
  width: 320px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  overflow: hidden;
}
.notif-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
}
.notif-item {
  display: flex;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  transition: background 120ms;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--surface); }
.notif-item.read { opacity: .55; }
.notif-icon {
  width: 32px; height: 32px;
  border-radius: 10px;
  border: 1px solid var(--ok-bg);
  background: var(--ok-bg);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.notif-item.read .notif-icon { background: var(--surface-2); border-color: var(--line); }

.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 4px 12px 4px 4px;
}
.user-av {
  width: 32px; height: 32px;
  border-radius: 10px;
  background: var(--green-700);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 11px;
}
.logout-btn {
  width: 40px; height: 40px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-500);
  display: grid; place-items: center;
  cursor: pointer;
  transition: all 150ms;
}
.logout-btn:hover { border-color: rgba(239,68,68,.4); background: #fef2f2; color: #dc2626; }

.user-av-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.25);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: grid; place-items: center;
  flex-shrink: 0;
  transition: opacity 150ms, box-shadow 150ms;
  font-family: inherit;
  letter-spacing: .02em;
}
.user-av-btn:hover { opacity: .85; box-shadow: 0 0 0 3px rgba(0,0,0,.12); }

/* ════════════════════════════════════════════
   BUTTONS
   ════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-900);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 120ms;
  font-family: inherit;
}
.btn:hover { background: var(--surface-2); border-color: var(--ink-300); }
.btn.primary { background: var(--green-900); border-color: var(--green-900); color: #fff; border-radius: 999px; }
.btn.primary:hover { background: var(--green-700); border-color: var(--green-700); }
.btn.sm { padding: 5px 10px; font-size: 12px; gap: 5px; }
.icon-btn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-700);
  cursor: pointer;
  transition: background 120ms;
}
.icon-btn:hover { background: var(--surface-2); }

/* ════════════════════════════════════════════
   CARDS
   ════════════════════════════════════════════ */
.card {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-md);
  outline: 1px solid rgba(255,255,255,.55);
  outline-offset: -1px;
  transition: box-shadow 220ms ease, transform 220ms ease;
}
.card:not(.flat):hover {
  box-shadow: 0 6px 16px rgba(0,0,0,.10), 0 20px 56px rgba(0,0,0,.12);
  transform: translateY(-3px);
}
.card.flat {
  box-shadow: var(--shadow-sm);
  outline: none;
  transition: none;
}
.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.card-header h3 { margin: 0; font-size: 15px; font-weight: 600; color: var(--green-900); }
.card-header .sub { font-size: 12px; color: var(--ink-500); }

/* ════════════════════════════════════════════
   KPI GRID
   ════════════════════════════════════════════ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
@media (max-width: 900px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .kpi-grid { grid-template-columns: 1fr; } }

.kpi {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 22px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  outline: 1px solid rgba(255,255,255,.55);
  outline-offset: -1px;
  transition: box-shadow 220ms ease, transform 220ms ease;
}
.kpi:hover {
  box-shadow: 0 6px 16px rgba(0,0,0,.10), 0 20px 56px rgba(0,0,0,.12);
  transform: translateY(-3px);
}
.kpi .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--ink-500);
  font-weight: 600;
}
.kpi .value {
  font-weight: 600;
  font-size: 34px;
  line-height: 1;
  color: var(--green-900);
  margin-top: 14px;
  letter-spacing: -1px;
}
.kpi .foot {
  margin-top: 12px;
  font-size: 12px;
  color: var(--ink-500);
  display: flex;
  align-items: center;
  gap: 6px;
}
.kpi.accent { background: var(--green-900); color: #fff; }
.kpi.accent .label { color: rgba(255,255,255,.65); }
.kpi.accent .value { color: #fff; }
.kpi.accent .foot { color: rgba(255,255,255,.8); }

/* ════════════════════════════════════════════
   PILLS / BADGES
   ════════════════════════════════════════════ */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  background: var(--surface-2);
  color: var(--ink-700);
  border: 1px solid transparent;
  white-space: nowrap;
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.pill.ok      { background: var(--ok-bg); color: var(--green-600); }
.pill.warn    { background: var(--warn-bg); color: var(--ink-700); }
.pill.danger  { background: var(--danger-bg); color: var(--danger); }
.pill.neutral { background: var(--ink-100); color: var(--ink-700); }

/* ════════════════════════════════════════════
   TABLE
   ════════════════════════════════════════════ */
.tbl {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.tbl th {
  text-align: left;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-500);
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  position: sticky;
  top: 0;
  z-index: 1;
}
.tbl td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
.tbl tr:hover td { background: var(--surface-2); cursor: pointer; }
.tbl tr.selected td { background: var(--surface-3); }
.cell-primary { display: flex; align-items: center; gap: 10px; }
.cell-primary .name { color: var(--ink-900); font-weight: 500; }
.cell-primary .sub { color: var(--ink-500); font-size: 11px; }

/* ════════════════════════════════════════════
   INPUTS
   ════════════════════════════════════════════ */
.input, .select, .textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
  font-size: 13px;
  color: var(--ink-900);
  outline: none;
  transition: border 120ms, box-shadow 120ms;
  font-family: inherit;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--green-600);
  box-shadow: 0 0 0 3px rgba(0,0,0,.12);
}
.input.with-icon { padding-left: 36px; }
.input-wrap { position: relative; }
.input-wrap .ic {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--ink-500); pointer-events: none;
}
.field-label {
  display: block;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-500);
  margin-bottom: 6px;
  font-weight: 500;
}
.textarea { resize: vertical; }

/* ════════════════════════════════════════════
   AVATAR
   ════════════════════════════════════════════ */
.av {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
  background: var(--green-600);
  letter-spacing: .2px;
}
.av.sm { width: 28px; height: 28px; font-size: 11px; }
.av.lg { width: 48px; height: 48px; font-size: 17px; }

/* ════════════════════════════════════════════
   MODAL
   ════════════════════════════════════════════ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(3px);
  display: grid; place-items: center;
  z-index: 100;
  padding: 24px;
}
.modal {
  background: var(--card);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow: auto;
  box-shadow: var(--shadow-lg);
  animation: scaleUp 200ms ease;
}
.modal.dark {
  background: var(--green-950);
  color: var(--lime-50);
  border: 1px solid var(--green-900);
}
@keyframes scaleUp {
  from { transform: scale(.95); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
.modal-head {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.modal.dark .modal-head { border-color: var(--green-900); }
.modal-head h3 { margin: 0; font-size: 17px; font-weight: 600; color: var(--green-900); }
.modal.dark .modal-head h3 { color: var(--cream); }
.modal-body { padding: 18px 22px; }
.modal-foot {
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: flex-end; gap: 8px;
}
.modal.dark .modal-foot { border-color: var(--green-900); }

/* ════════════════════════════════════════════
   TIMELINE
   ════════════════════════════════════════════ */
.timeline { display: flex; flex-direction: column; }
.tl-item {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  padding: 10px 0;
  position: relative;
}
.tl-item::before {
  content: '';
  position: absolute;
  left: 16px; top: 30px; bottom: -10px;
  width: 1px; background: var(--line);
}
.tl-item:last-child::before { display: none; }
.tl-dot {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  color: var(--ink-500);
  z-index: 1;
  flex-shrink: 0;
}
.tl-dot.ok      { background: var(--ok-bg);   color: var(--green-700); border-color: transparent; }
.tl-dot.warn    { background: var(--warn-bg);  color: var(--ink-700);   border-color: transparent; }
.tl-dot.neutral { background: var(--ink-100);  color: var(--ink-500);   border-color: transparent; }
.tl-meta  { font-size: 11px; font-weight: 500; color: var(--ink-500); }
.tl-title { font-size: 13px; color: var(--ink-900); }

/* ════════════════════════════════════════════
   SECTION HEADER
   ════════════════════════════════════════════ */
.section-head {
  display: flex; align-items: flex-end; gap: 14px; margin-bottom: 14px;
}
.section-head h2 {
  font-weight: 700;
  font-size: 30px;
  color: var(--green-900);
  margin: 0;
  letter-spacing: -.4px;
  line-height: 1;
}
.section-head .sub { color: var(--ink-500); font-size: 13px; }
.section-head .right { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.eyebrow {
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-500);
  display: block;
  margin-bottom: 4px;
}

/* ════════════════════════════════════════════
   TABS (filter tabs)
   ════════════════════════════════════════════ */
.tabs {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--card);
  padding: 4px;
  gap: 2px;
  box-shadow: var(--shadow-sm);
}
.tabs .tab {
  padding: 6px 14px;
  font-size: 13px;
  border-radius: var(--r-md);
  background: transparent;
  border: none;
  color: var(--ink-700);
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background 120ms, color 120ms;
}
.tabs .tab.active { background: var(--green-900); color: #fff; border-radius: 999px; }
.tabs .tab:not(.active):hover { background: var(--surface-2); }

/* ════════════════════════════════════════════
   FILTER BAR
   ════════════════════════════════════════════ */
.filterbar {
  display: flex; gap: 8px; align-items: center;
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 12px 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}
.filterbar .input-wrap { flex: 1; min-width: 200px; max-width: 360px; }

/* ════════════════════════════════════════════
   CRM SPLIT LAYOUT
   ════════════════════════════════════════════ */
.crm-split {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 18px;
  align-items: start;
}
@media (max-width: 900px) { .crm-split { grid-template-columns: 1fr; } }

.grid-main {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
}
@media (max-width: 1100px) { .grid-main { grid-template-columns: 1fr; } }

/* ════════════════════════════════════════════
   DETAIL PANEL
   ════════════════════════════════════════════ */
.detail {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-md);
  outline: 1px solid rgba(255,255,255,.55);
  outline-offset: -1px;
}
.divider { height: 1px; background: var(--line-soft); margin: 12px 0; }

/* ════════════════════════════════════════════
   SCROLLBAR
   ════════════════════════════════════════════ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--ink-200); border-radius: 6px; border: 2px solid var(--surface); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-300); }
::-webkit-scrollbar-track { background: transparent; }

/* ════════════════════════════════════════════
   LOGIN PAGE
   ════════════════════════════════════════════ */
.login-wrap {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}
.login-left {
  width: 42%;
  background: var(--ok);
  color: #fff;
  padding: 64px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid rgba(0,0,0,.1);
  flex-shrink: 0;
}
@media (max-width: 768px) { .login-left { display: none; } }
.login-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
  overflow-y: auto;
}
.login-card { width: 100%; max-width: 420px; }

.profile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1.5px solid #e5e7eb;
  background: rgba(255,255,255,.4);
  cursor: pointer;
  transition: all 150ms;
  margin-bottom: 10px;
  user-select: none;
}
.profile-row:hover { background: rgba(255,255,255,.6); }
.profile-row.active { border-color: #09090B; background: rgba(255,255,255,.75); box-shadow: 0 2px 8px rgba(0,0,0,.06); }

.profile-av {
  width: 40px; height: 40px;
  border-radius: 50%;
  color: #fff;
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}
.check-circle {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--green-700);
  color: #fff;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.soon-badge {
  font-size: 11px;
  font-weight: 700;
  color: rgba(113,113,122,.8);
  text-transform: uppercase;
  letter-spacing: .12em;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(113,113,122,.3);
}
.profile-disabled {
  opacity: .4;
  cursor: not-allowed;
  pointer-events: none;
  filter: grayscale(.5);
}

/* ════════════════════════════════════════════
   UTILITIES
   ════════════════════════════════════════════ */
.flex   { display: flex; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.grid   { display: grid; }
.block  { display: block; }
.inline-flex { display: inline-flex; }
.hidden { display: none !important; }

.items-center  { align-items: center; }
.items-start   { align-items: flex-start; }
.items-end     { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.justify-end     { justify-content: flex-end; }
.shrink-0 { flex-shrink: 0; }
.min-w-0  { min-width: 0; }
.ml-auto  { margin-left: auto; }
.mr-auto  { margin-right: auto; }
.mx-auto  { margin-left: auto; margin-right: auto; }
.mt-auto  { margin-top: auto; }

.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }
.gap-6 { gap: 24px; }
.gap-8 { gap: 32px; }
.gap-x-4 { column-gap: 16px; }

.w-full  { width: 100%; }
.h-full  { height: 100%; }
.w-screen { width: 100vw; }
.h-screen { height: 100vh; }
.max-w-md { max-width: 440px; }
.max-w-lg { max-width: 560px; }
.max-w-full { max-width: 100%; }

.p-0 { padding: 0; }
.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.p-5 { padding: 20px; }
.p-6 { padding: 24px; }
.px-2 { padding-left: 8px; padding-right: 8px; }
.px-3 { padding-left: 12px; padding-right: 12px; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.px-6 { padding-left: 24px; padding-right: 24px; }
.py-1 { padding-top: 4px; padding-bottom: 4px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-3 { padding-top: 12px; padding-bottom: 12px; }
.pt-1 { padding-top: 4px; }
.pt-2 { padding-top: 8px; }
.pt-3 { padding-top: 12px; }
.pt-4 { padding-top: 16px; }
.pb-2 { padding-bottom: 8px; }
.pb-3 { padding-bottom: 12px; }
.pl-2 { padding-left: 8px; }
.pl-9 { padding-left: 36px; }
.pr-1 { padding-right: 4px; }
.pr-2 { padding-right: 8px; }

.m-0  { margin: 0; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }

.text-xs   { font-size: 11px; }
.text-sm   { font-size: 13px; }
.text-base { font-size: 14px; }
.text-lg   { font-size: 18px; }
.text-xl   { font-size: 20px; }
.text-2xl  { font-size: 24px; }
.text-3xl  { font-size: 30px; }
.text-4xl  { font-size: 36px; }

.font-normal   { font-weight: 400; }
.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }
.font-extrabold{ font-weight: 800; }
.font-black    { font-weight: 900; }

.text-white   { color: #fff; }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-left    { text-align: left; }
.uppercase    { text-transform: uppercase; }
.lowercase    { text-transform: lowercase; }
.italic       { font-style: italic; }
.not-italic   { font-style: normal; }
.truncate     { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leading-none { line-height: 1; }
.leading-tight { line-height: 1.25; }
.leading-relaxed { line-height: 1.625; }
.tracking-tight  { letter-spacing: -.015em; }
.tracking-wide   { letter-spacing: .025em; }
.tracking-wider  { letter-spacing: .05em; }
.tracking-widest { letter-spacing: .1em; }
.whitespace-nowrap { white-space: nowrap; }
.whitespace-pre-wrap { white-space: pre-wrap; }
.break-words { word-break: break-word; }

.relative { position: relative; }
.absolute { position: absolute; }
.fixed    { position: fixed; }
.sticky   { position: sticky; }
.inset-0  { inset: 0; }
.top-0    { top: 0; }
.z-10     { z-index: 10; }
.z-50     { z-index: 50; }

.overflow-hidden  { overflow: hidden; }
.overflow-auto    { overflow: auto; }
.overflow-y-auto  { overflow-y: auto; }
.overflow-x-auto  { overflow-x: auto; }

.rounded    { border-radius: 8px; }
.rounded-lg { border-radius: 14px; }
.rounded-xl { border-radius: 20px; }
.rounded-2xl{ border-radius: 28px; }
.rounded-full { border-radius: 9999px; }

.border   { border: 1px solid var(--line); }
.border-0 { border: none; }
.border-b { border-bottom: 1px solid var(--line); }
.border-t { border-top: 1px solid var(--line); }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

.cursor-pointer     { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }
.select-none        { user-select: none; }

.opacity-50  { opacity: .5; }
.opacity-60  { opacity: .6; }
.opacity-70  { opacity: .7; }
.opacity-90  { opacity: .9; }

.space-y-1 > * + * { margin-top: 4px; }
.space-y-2 > * + * { margin-top: 8px; }
.space-y-3 > * + * { margin-top: 12px; }
.space-y-4 > * + * { margin-top: 16px; }
.space-y-5 > * + * { margin-top: 20px; }
.space-y-6 > * + * { margin-top: 24px; }
.space-x-1 > * + * { margin-left: 4px; }
.space-x-2 > * + * { margin-left: 8px; }

.grid-cols-2 { grid-template-columns: repeat(2,1fr); }
.grid-cols-3 { grid-template-columns: repeat(3,1fr); }
.grid-cols-4 { grid-template-columns: repeat(4,1fr); }

.max-h-36  { max-height: 144px; }
.max-h-48  { max-height: 192px; }
.max-h-56  { max-height: 224px; }
.min-w-850 { min-width: 850px; }

/* ════════════════════════════════════════════
   HEADER CLOCK
   ════════════════════════════════════════════ */
.header-clock {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-500);
  letter-spacing: .04em;
  padding: 5px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  flex-shrink: 0;
}

/* ════════════════════════════════════════════
   GLOBAL SEARCH
   ════════════════════════════════════════════ */
.global-search-wrap { position: relative; }
.global-search-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  width: 340px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  overflow: hidden;
  max-height: 360px;
  overflow-y: auto;
}
.gs-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--ink-400);
  padding: 8px 14px 4px;
  background: var(--surface);
  border-bottom: 1px solid var(--line-soft);
}
.gs-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--line-soft);
  transition: background 100ms;
  color: var(--ink-900);
}
.gs-item:last-child { border-bottom: none; }
.gs-item:hover { background: var(--surface-2); }

/* ════════════════════════════════════════════
   ANIMATIONS
   ════════════════════════════════════════════ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-fade-in { animation: fadeIn 200ms ease; }

@keyframes riseIn {
  0%   { opacity: 0; transform: translateY(18px); }
  100% { opacity: 1; transform: translateY(0); }
}

.tab-anim-right .stagger-block,
.tab-anim-left  .stagger-block {
  animation: riseIn 400ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--i, 0) * 90ms);
}

/* Bar chart rise */
@keyframes barRise {
  from { transform: scaleY(0); }
  to   { transform: scaleY(1); }
}
.tab-anim-right .chart-bar,
.tab-anim-left  .chart-bar {
  transform-box: fill-box;
  transform-origin: center bottom;
  animation: barRise 480ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--bd, 490ms);
}

/* Sparkline draw left → right */
@keyframes lineDraw {
  from { stroke-dashoffset: 1; }
  to   { stroke-dashoffset: 0; }
}
@keyframes fillReveal {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0% 0 0); }
}
.tab-anim-right .sparkline-draw,
.tab-anim-left  .sparkline-draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: lineDraw 700ms cubic-bezier(0.4, 0, 0.2, 1) both;
  animation-delay: 580ms;
}
.tab-anim-right .sparkline-fill,
.tab-anim-left  .sparkline-fill {
  animation: fillReveal 700ms cubic-bezier(0.4, 0, 0.2, 1) both;
  animation-delay: 580ms;
}

/* ════════════════════════════════════════════
   FOCUS (acessibilidade por teclado)
   ════════════════════════════════════════════ */
:focus-visible {
  outline: 2px solid var(--green-700);
  outline-offset: 2px;
}

/* ════════════════════════════════════════════
   EMPTY STATE
   ════════════════════════════════════════════ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  gap: 8px;
}
.empty-state-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--ink-300);
  display: grid; place-items: center;
  margin-bottom: 4px;
}
.empty-state-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-700);
}
.empty-state-hint {
  font-size: 12px;
  color: var(--ink-400);
  max-width: 280px;
  line-height: 1.5;
}

/* ════════════════════════════════════════════
   TOAST
   ════════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: #111;
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  z-index: 9999;
  opacity: 0;
  transition: opacity 200ms, transform 200ms;
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.ok { background: var(--green-700); }
.toast.danger { background: var(--danger); }

/* ════════════════════════════════════════════
   FORM VALIDATION
   ════════════════════════════════════════════ */
.input.input-error,
.select.input-error,
.textarea.input-error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239,68,68,.15);
}
.field-error {
  display: block;
  font-size: 11px;
  color: var(--danger);
  margin-top: 4px;
  font-weight: 500;
}
