/* turn-crm — The Turn AI brand */
:root {
  /* Surfaces (The Turn AI brand) */
  --bg:           #0a0a0a;
  --surface-1:    #141414;
  --surface-2:    #1a1a1a;
  --surface-3:    #222;
  --surface-hover: #1f1f1f;

  /* Borders */
  --border:       #222;
  --border-strong: #333;

  /* Text */
  --text:         #e5e5e5;
  --text-muted:   #888;
  --text-dim:     #555;

  /* Brand — laranja → vermelho */
  --orange:       #f97316;
  --red:          #ef4444;
  --grad:         linear-gradient(135deg, #f97316, #ef4444);
  --accent:       #f97316;
  --accent-hover: #fb923c;
  --accent-soft:  rgba(249, 115, 22, 0.12);
  --accent-ring:  rgba(249, 115, 22, 0.35);

  /* Semantic */
  --green:        #22c55e;
  --yellow:       #eab308;
  --gold:         #eab308;
  --pink:         #ec4899;
  --violet:       #a855f7;
  --blue:         #3b82f6;

  /* Layout */
  --radius-sm:    6px;
  --radius:       8px;
  --radius-lg:    12px;
  --shadow-sm:    0 1px 2px rgba(0,0,0,0.6);
  --shadow:       0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:    0 12px 48px rgba(0,0,0,0.6);
  --shadow-orange: 0 4px 18px rgba(249, 115, 22, 0.35);
}

/* =============== RESET =============== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* =============== BUTTONS =============== */
button {
  font: inherit;
  font-weight: 500;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  padding: 8px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
button:hover {
  background: var(--surface-hover);
  border-color: var(--orange);
  color: var(--orange);
}
button:active { transform: translateY(1px); }
button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-ring);
}
button:disabled { opacity: 0.5; cursor: not-allowed; }

button.primary {
  background: var(--grad);
  border-color: transparent;
  color: white;
  font-weight: 600;
}
button.primary:hover {
  opacity: 0.92;
  border-color: transparent;
  color: white;
  box-shadow: var(--shadow-orange);
}

button.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
}
button.ghost:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: transparent;
}

button.danger {
  background: transparent;
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}
button.danger:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.5);
  color: #fca5a5;
}

/* =============== INPUTS =============== */
input, select, textarea {
  font: inherit;
  background: #111;
  color: var(--text);
  border: 1px solid var(--border-strong);
  padding: 11px 14px;
  border-radius: var(--radius);
  width: 100%;
  transition: all 0.15s;
}
input::placeholder, textarea::placeholder { color: var(--text-dim); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

label {
  display: block;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}
label > input, label > select, label > textarea {
  margin-top: 6px;
  font-weight: 400;
  color: var(--text);
}

/* =============== LOGO =============== */
.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.brand-logo .turny {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 8px rgba(249, 115, 22, 0.3));
}
.brand-name {
  font-size: 18px;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}
.brand-tag {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  background: var(--surface-2);
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

/* =============== LOGIN =============== */
.auth-bg {
  display: grid;
  place-items: center;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 70% 50% at 50% -10%, rgba(249, 115, 22, 0.18), transparent 60%),
    radial-gradient(ellipse 50% 40% at 85% 100%, rgba(239, 68, 68, 0.12), transparent 60%),
    var(--bg);
  padding: 24px;
}
.login-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  padding: 48px 40px;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 380px;
  text-align: center;
}
.login-card .brand-logo {
  justify-content: center;
  margin-bottom: 32px;
}
.login-card .brand-logo .turny { width: 56px; height: 56px; }
.login-card .brand-name { font-size: 22px; }
.login-card form > * { text-align: left; }
.login-card button[type=submit] {
  width: 100%;
  background: var(--grad);
  border-color: transparent;
  color: white;
  padding: 13px;
  margin-top: 8px;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.01em;
}
.login-card button[type=submit]:hover {
  opacity: 0.92;
  box-shadow: var(--shadow-orange);
}
.error {
  margin-top: 14px;
  padding: 10px 12px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  border-radius: var(--radius);
  font-size: 13px;
}
.footer-hint {
  margin-top: 28px;
  color: var(--text-dim);
  font-size: 12px;
  letter-spacing: 0.04em;
}

/* =============== APP SHELL =============== */
.app-bg { display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar .brand-logo { min-width: 220px; }
.topbar .brand-logo .turny { width: 32px; height: 32px; }
.topbar .brand-name { font-size: 16px; }

.tabs { display: flex; gap: 2px; flex: 1; }
.tab {
  background: transparent;
  border: 1px solid transparent;
  padding: 8px 14px;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.tab:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: transparent;
}
.tab.active {
  background: var(--accent-soft);
  color: var(--orange);
  border-color: rgba(249, 115, 22, 0.2);
}

.userbox {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
}
.userbox .avatar { width: 32px; height: 32px; font-size: 11px; }

.avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--grad);
  color: white;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.avatar.gray  { background: linear-gradient(135deg, #6b7280, #4b5563); }
.avatar.green { background: linear-gradient(135deg, #22c55e, #16a34a); }
.avatar.pink  { background: linear-gradient(135deg, #ec4899, #be185d); }
.avatar.amber { background: linear-gradient(135deg, #eab308, #b45309); }
.avatar.cyan  { background: linear-gradient(135deg, #06b6d4, #0891b2); }
.avatar.blue  { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }

/* =============== FILTER BAR =============== */
.filterbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 24px;
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
}
.filterbar input { max-width: 280px; }
.filterbar select { width: auto; min-width: 170px; }
.filterbar #newDealBtn { margin-left: auto; }

#mainView {
  flex: 1;
  overflow: auto;
  padding: 20px 24px;
  background: var(--bg);
}
.view { display: none; }
.view.active { display: block; }

/* =============== KANBAN =============== */
.kanban {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 16px;
  height: calc(100vh - 64px - 70px - 40px);
  align-items: stretch;
}
.column {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 300px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  max-height: 100%;
  overflow: hidden;
}
.column-header {
  padding: 14px 14px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}
.column-color {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(0,0,0,0.5);
}
.column-title {
  font-weight: 600;
  font-size: 13px;
  flex: 1;
  letter-spacing: -0.01em;
}
.column-count {
  background: var(--surface-3);
  color: var(--text-muted);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  min-width: 24px;
  text-align: center;
}
.column-body {
  padding: 10px;
  overflow-y: auto;
  flex: 1;
  min-height: 80px;
}

/* =============== CARD =============== */
.card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 8px;
  cursor: grab;
  transition: all 0.15s ease;
}
.card:hover {
  border-color: rgba(249, 115, 22, 0.45);
  background: var(--surface-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.card:active { cursor: grabbing; }
.card.dragging { opacity: 0.5; transform: rotate(2deg); }
.card.sortable-ghost { opacity: 0.4; background: var(--surface-3); }

.card-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}
.card-head .avatar { width: 30px; height: 30px; font-size: 11px; }
.card-name {
  flex: 1;
  font-weight: 600;
  font-size: 13px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.card-value {
  font-size: 12px;
  color: var(--green);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.card-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.card-meta-row { display: flex; align-items: center; gap: 6px; }
.card-meta-row svg, .card-meta-row .icon {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  opacity: 0.7;
}

.card-tags {
  margin-top: 10px;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

/* =============== TAG CHIPS =============== */
.tag-chip {
  display: inline-flex;
  align-items: center;
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 12px;
  color: white;
  letter-spacing: 0.01em;
  background: var(--orange);
  white-space: nowrap;
}
.tag-chip.stage {
  font-size: 11px;
  padding: 4px 10px;
}

/* =============== DRAWER =============== */
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 480px;
  max-width: calc(100vw - 40px);
  background: var(--surface-1);
  border-left: 1px solid var(--border);
  z-index: 100;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.2s ease-out;
}
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }

.drawer header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.drawer header h2 {
  font-size: 16px;
  font-weight: 600;
  flex: 1;
  letter-spacing: -0.01em;
}
.drawer header button {
  font-size: 22px;
  padding: 4px 10px;
  line-height: 1;
}
#drawerContent {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

/* =============== PANELS =============== */
.panel-section {
  background: var(--surface-1);
  border: 1px solid var(--border);
  padding: 20px;
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
}
.panel-section h3 {
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.panel-section p { color: var(--text-muted); font-size: 13px; }
.panel-section code {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--orange);
}

/* =============== TABLE =============== */
table { width: 100%; border-collapse: collapse; }
th, td {
  padding: 12px 14px;
  text-align: left;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}
th {
  color: var(--text-muted);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--surface-1);
  position: sticky;
  top: 0;
  z-index: 1;
}
tbody tr { transition: background 0.1s; }
tbody tr:hover { background: var(--surface-2); }
tbody tr[data-deal] { cursor: pointer; }

.list-empty {
  text-align: center;
  padding: 80px 40px;
  color: var(--text-dim);
  font-size: 14px;
  background: var(--surface-1);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
}
.list-empty::before {
  content: '∅';
  display: block;
  font-size: 32px;
  margin-bottom: 8px;
  color: var(--text-dim);
}

/* =============== TIMELINE =============== */
.timeline { display: flex; flex-direction: column; gap: 10px; }
.timeline-item {
  background: var(--surface-2);
  padding: 12px 14px;
  border-radius: var(--radius);
  border-left: 3px solid var(--orange);
  font-size: 13px;
}
.timeline-item-header {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 4px;
  text-transform: capitalize;
  font-weight: 500;
}
.timeline-item-body { color: var(--text); line-height: 1.4; }
.timeline-item-meta { margin-top: 4px; color: var(--text-muted); font-size: 12px; }

.timeline-item.stage_change   { border-left-color: var(--orange); }
.timeline-item.deal_created   { border-left-color: var(--green); }
.timeline-item.deal_won       { border-left-color: var(--green); background: rgba(34, 197, 94, 0.06); }
.timeline-item.deal_lost      { border-left-color: var(--red); background: rgba(239, 68, 68, 0.05); }
.timeline-item.comment        { border-left-color: var(--gold); }
.timeline-item.meta_event     { border-left-color: var(--violet); }
.timeline-item.task           { border-left-color: var(--orange); }
.timeline-item.task_done      { border-left-color: var(--green); }
.timeline-item.tag_added,
.timeline-item.tag_removed    { border-left-color: var(--pink); }
.timeline-item.whatsapp_in    { border-left-color: #25D366; }
.timeline-item.whatsapp_out   { border-left-color: #128C7E; }
.timeline-item.system         { border-left-color: var(--text-dim); }

/* =============== FORM HELPERS =============== */
.form-row { display: flex; gap: 10px; align-items: flex-end; }
.form-row label { flex: 1; margin-bottom: 0; }

textarea { resize: vertical; min-height: 80px; font-family: inherit; }

/* =============== UTILITY =============== */
.text-muted { color: var(--text-muted); }
.text-dim { color: var(--text-dim); }
.text-mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12px; }
.text-orange { color: var(--orange); }
.text-grad { background: var(--grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; font-weight: 700; }
.flex { display: flex; gap: 10px; align-items: center; }
.flex-grow { flex: 1; }
.spacer { flex: 1; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }

.kpi-row {
  display: flex;
  gap: 14px;
  margin-bottom: 16px;
}
.kpi {
  flex: 1;
  background: var(--surface-1);
  border: 1px solid var(--border);
  padding: 14px 16px;
  border-radius: var(--radius-lg);
}
.kpi-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.kpi-value {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.kpi.win .kpi-value { color: var(--green); }
.kpi.loss .kpi-value { color: var(--red); }
.kpi.brand .kpi-value { background: var(--grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* =============== CHAT (drawer) =============== */
.drawer-tabs {
  display: flex;
  gap: 4px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-1);
}
.drawer-tab {
  background: transparent;
  border: none;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  border-radius: 0;
}
.drawer-tab:hover { background: transparent; color: var(--text); border-color: transparent; }
.drawer-tab.active { color: var(--orange); border-bottom-color: var(--orange); }

.chat-pane {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  background:
    radial-gradient(circle at 25% 30%, rgba(249, 115, 22, 0.04), transparent 50%),
    radial-gradient(circle at 75% 70%, rgba(34, 197, 94, 0.03), transparent 50%),
    var(--bg);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.chat-senders {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-1);
}
.chat-sender-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 3px 10px 3px 4px;
  border-radius: 14px;
  font-size: 11px;
  color: var(--text-muted);
}
.media-attach {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.05);
  border-radius: 6px;
  margin-bottom: 6px;
  font-size: 12px;
}
.media-attach.audio audio {
  margin-top: 4px;
}
.chat-bubble.out .media-attach {
  background: rgba(255,255,255,0.1);
}

.chat-channel-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-1);
}
.chat-channel {
  display: inline-flex;
  align-items: center;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 5px 12px;
  border-radius: 16px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-weight: 500;
}
.chat-channel:hover {
  border-color: var(--orange);
  color: var(--text);
  background: rgba(249, 115, 22, 0.05);
}
.chat-channel.active {
  background: linear-gradient(135deg, rgba(249,115,22,0.15), rgba(239,68,68,0.1));
  border-color: var(--orange);
  color: var(--text);
  font-weight: 600;
}
.chat-channel.active .text-dim {
  color: var(--orange);
}

.chat-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
  font-size: 13px;
}

.chat-bubble {
  max-width: 78%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.45;
  word-wrap: break-word;
  white-space: pre-wrap;
  position: relative;
}
.chat-bubble .meta {
  font-size: 10.5px;
  margin-top: 4px;
  opacity: 0.7;
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.chat-bubble.in {
  align-self: flex-start;
  background: var(--surface-2);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.chat-bubble.out {
  align-self: flex-end;
  background: linear-gradient(135deg, #128C7E, #075E54);
  color: white;
  border-bottom-right-radius: 4px;
}
.chat-bubble.out .sender { font-weight: 600; font-size: 11px; opacity: 0.9; margin-bottom: 2px; }
.chat-bubble.out.failed { background: linear-gradient(135deg, #991b1b, #7f1d1d); }
.chat-bubble.out.queued { opacity: 0.7; }

.chat-day {
  align-self: center;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 12px;
  margin: 12px 0 4px;
  border: 1px solid var(--border);
}

.chat-input {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface-1);
  align-items: flex-end;
}
.chat-input textarea {
  flex: 1;
  min-height: 40px;
  max-height: 120px;
  padding: 9px 12px;
  font-size: 13px;
  resize: none;
  background: var(--bg);
}
.chat-input button {
  height: 40px;
  padding: 0 16px;
  background: var(--grad);
  color: white;
  border: none;
  font-weight: 600;
}
.chat-input button:hover { box-shadow: var(--shadow-orange); color: white; }
.chat-input button:disabled { opacity: 0.5; }

#dealDrawer.chat-mode #drawerContent { padding: 0; display: flex; flex-direction: column; }
#dealDrawer.chat-mode .chat-pane { flex: 1; }

pre {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--surface-2);
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow-x: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* RESPONSIVE_v1 (2026-05-17): breakpoints pra tablet/mobile */
@media (max-width: 1024px) {
  .topbar nav.tabs { gap: 4px; }
  .topbar nav.tabs .tab { padding: 6px 10px; font-size: 12px; }
  .kpi-row { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)) !important; }
  .filterbar { flex-wrap: wrap !important; gap: 6px !important; }
  .drawer { width: 65vw !important; max-width: 65vw !important; }
}

@media (max-width: 768px) {
  body { font-size: 13px; }
  .brand-tag { display: none; }
  .topbar { flex-wrap: wrap; padding: 8px 12px; }
  .topbar nav.tabs { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-top: 8px; }
  .topbar nav.tabs .tab { white-space: nowrap; }
  .kanban { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .column { min-width: 280px; max-width: 280px; }
  .drawer { width: 100vw !important; max-width: 100vw !important; right: 0 !important; }
  .filterbar { flex-direction: column; align-items: stretch; }
  .filterbar > * { width: 100%; }
  .panel-section { padding: 12px !important; }
  table { font-size: 11px; }
  .kpi { padding: 10px !important; }
  .kpi-value { font-size: 18px !important; }
}

@media (max-width: 480px) {
  .topbar { padding: 6px 8px; }
  .brand-name { font-size: 14px; }
  .topbar nav.tabs .tab { padding: 5px 8px; font-size: 11px; }
  .column { min-width: 240px; max-width: 240px; }
  .card { padding: 8px !important; }
  .card-name { font-size: 13px; }
  .card-meta { font-size: 10px; }
  h3 { font-size: 14px; }
  button.primary, button.ghost { padding: 6px 10px; font-size: 12px; }
}


/* SKELETON_v1 (2026-05-17): skeleton loaders pra primeiro paint */
@keyframes skeleton-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-card {
  height: 80px;
  margin-bottom: 8px;
  border-radius: 6px;
  background: linear-gradient(90deg, #1a1a1a 0%, #2a2a2a 50%, #1a1a1a 100%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}
.skeleton-row {
  height: 14px; margin: 4px 0;
  background: linear-gradient(90deg, #1a1a1a 0%, #2a2a2a 50%, #1a1a1a 100%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: 4px;
}
.column-body.loading .skeleton-card:nth-child(2) { opacity: 0.7; }
.column-body.loading .skeleton-card:nth-child(3) { opacity: 0.4; }


/* LOGIN_CONTRAST_v1 (2026-05-17): WCAG AA contrast */
.auth-bg input[type=email], .auth-bg input[type=password], .auth-bg input[type=text] {
  background-color: #2a2a2a !important;
  border: 1px solid #4a4a4a !important;
  color: #ffffff !important;
}
.auth-bg input::placeholder { color: #a0a0a0 !important; }


/* FILTER_CUE_v1 (2026-05-17): dot visual quando filtro ativo */
.filterbar select.has-filter {
  border-color: var(--orange) !important;
  box-shadow: 0 0 0 1px var(--orange) inset;
}
.filterbar select.has-filter::after { content: '•'; color: var(--orange); }
