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

/* ── Tokens ─────────────────────────────────────────────────────────────────── */
:root {
  color-scheme: light;

  /* brand */
  --emerald-950: #041d0e;
  --emerald-900: #0b3320;
  --emerald-800: #124f2d;
  --emerald-700: #1a6b3c;
  --emerald-500: #2d9e5f;
  --emerald-200: #a8dfbe;
  --emerald-100: #d6f0e1;
  --emerald-50:  #edf7f2;

  --gold-400:  #e8b84b;
  --gold-300:  #f0cf7a;
  --gold-100:  #fdf5dc;

  /* surfaces */
  --bg:        #f3f0e8;
  --surface:   #fdfcf8;
  --surface-2: #f7f4ec;
  --border:    #ddd9ce;
  --border-2:  #e8e4d9;

  /* text */
  --ink:       #111a14;
  --ink-2:     #3a4a3f;
  --muted:     #72837a;
  --muted-2:   #a0afa7;

  /* semantic */
  --success-bg: #dcf2e5;
  --success-fg: #0f5c2d;
  --warn-bg:    #fef4d3;
  --warn-fg:    #7a5200;
  --danger-bg:  #fde8e3;
  --danger-fg:  #9b2417;
  --info-bg:    #ddeeff;
  --info-fg:    #124f7a;

  /* radius */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 24px;

  /* shadow */
  --shadow-sm: 0 1px 3px rgba(4,29,14,.07), 0 1px 2px rgba(4,29,14,.05);
  --shadow-md: 0 4px 16px rgba(4,29,14,.09), 0 2px 6px rgba(4,29,14,.06);
  --shadow-lg: 0 12px 40px rgba(4,29,14,.12), 0 4px 12px rgba(4,29,14,.07);

  /* typography */
  --font-body: 'DM Sans', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'DM Mono', 'Fira Mono', monospace;
  --font-code: 'Fira Code', 'DM Mono', monospace;
  --font-display: 'Playfair Display', Georgia, serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --emerald-950: #020f07;
  --emerald-900: #83c9a0;
  --emerald-800: #a8ddb8;
  --emerald-700: #6ab98a;
  --emerald-500: #3dab6b;
  --emerald-200: #193d28;
  --emerald-100: #102518;
  --emerald-50:  #0c1c12;

  --gold-400:  #e8b84b;
  --gold-300:  #d4a03a;
  --gold-100:  #2a1f08;

  --bg:        #050e08;
  --surface:   #0c1a10;
  --surface-2: #0f2016;
  --border:    #1d3326;
  --border-2:  #162a1e;

  --ink:       #e4f0e8;
  --ink-2:     #b8cebf;
  --muted:     #6d8a76;
  --muted-2:   #4a6354;

  --success-bg: #0e2e1a;
  --success-fg: #5fd48e;
  --warn-bg:    #241900;
  --warn-fg:    #e8b84b;
  --danger-bg:  #2a0d08;
  --danger-fg:  #f07060;
  --info-bg:    #071828;
  --info-fg:    #60aaee;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,.35);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.45);
}

/* ── Reset ──────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* subtle grain overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: .45;
}

button, input, textarea, select { font: inherit; }
h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; }
img { display: block; max-width: 100%; }

.is-hidden { display: none !important; }

/* ── Typography helpers ───────────────────────────────────────────────────────*/
.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold-400);
}

.mono { font-family: var(--font-mono); }

/* ── Login ───────────────────────────────────────────────────────────────────*/
.login-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 56px;
  align-items: center;
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 40px 0;
}

.login-brand {
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.login-brand::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(232,184,75,.15) 0%, transparent 60%);
  pointer-events: none;
}

.login-brand img { width: 100%; }

.login-card {
  padding: 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
}

.login-card .eyebrow { margin-bottom: 10px; }

.login-card h1 {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.5vw, 38px);
  font-weight: 800;
  color: var(--emerald-900);
  line-height: 1.1;
  margin-bottom: 10px;
}

.intro { color: var(--muted); line-height: 1.6; margin-bottom: 4px; }

.login-card label {
  display: grid;
  gap: 7px;
  margin-top: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.login-card input {
  width: 100%;
  padding: 13px 15px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  font-size: 14px;
}

.login-card input:focus {
  border-color: var(--gold-400);
  box-shadow: 0 0 0 3px rgba(232,184,75,.18);
}

.login-error {
  min-height: 18px;
  margin-top: 14px;
  color: var(--danger-fg);
  font-size: 13px;
  font-weight: 600;
}

.login-card button[type="submit"] {
  width: 100%;
  margin-top: 14px;
  padding: 15px;
  background: var(--emerald-800);
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: .02em;
  transition: background .15s, transform .1s;
}

.login-card button[type="submit"]:hover { background: var(--emerald-700); }
.login-card button[type="submit"]:active { transform: scale(.98); }

.back-link {
  display: block;
  margin-top: 18px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  transition: color .15s;
}
.back-link:hover { color: var(--emerald-800); }

/* ── Dashboard shell ─────────────────────────────────────────────────────────*/
.dashboard-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

/* ── Sidebar ─────────────────────────────────────────────────────────────────*/
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  background: var(--emerald-950);
  border-right: 1px solid rgba(255,255,255,.05);
  overflow-y: auto;
}

:root[data-theme="dark"] .sidebar {
  background: #030a05;
  border-right-color: var(--border);
}

.sidebar-brand {
  margin-bottom: 28px;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
}

.sidebar-brand img { width: 100%; }

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  color: rgba(255,255,255,.55);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  transition: background .12s, color .12s;
  letter-spacing: .01em;
}

.sidebar a:hover {
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.9);
}

.sidebar a.is-active {
  background: rgba(255,255,255,.12);
  color: #fff;
  font-weight: 700;
}

.sidebar a.is-active::before {
  content: '';
  display: block;
  width: 3px;
  height: 16px;
  background: var(--gold-400);
  border-radius: 99px;
  margin-left: -4px;
  flex-shrink: 0;
}

.sidebar button[data-logout] {
  margin-top: 16px;
  padding: 11px 12px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--r-sm);
  color: rgba(255,255,255,.6);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background .12s, color .12s;
}

.sidebar button[data-logout]:hover {
  background: rgba(255,255,255,.12);
  color: #fff;
}

/* ── Content area ────────────────────────────────────────────────────────────*/
.dashboard-content {
  padding: 28px 32px;
  min-width: 0;
}

/* ── Topbar ──────────────────────────────────────────────────────────────────*/
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border-2);
}

.topbar h1 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--emerald-900);
  margin-top: 4px;
}

.topbar .eyebrow { margin-bottom: 3px; }

.operator {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
}

.operator span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.operator strong {
  font-size: 12px;
  font-weight: 700;
  color: var(--success-fg);
}

.operator::before {
  content: '';
  width: 7px;
  height: 7px;
  background: var(--emerald-500);
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(45,158,95,.25);
  animation: pulse 2.5s infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(45,158,95,.25); }
  50%       { box-shadow: 0 0 0 5px rgba(45,158,95,.08); }
}

.theme-toggle {
  padding: 9px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background .12s, border-color .12s;
}

.theme-toggle:hover {
  background: var(--surface-2);
  border-color: var(--emerald-700);
}

/* ── Metric cards ────────────────────────────────────────────────────────────*/
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.metrics-grid article {
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: box-shadow .15s, transform .15s;
}

.metrics-grid article:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.metrics-grid article::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--emerald-700), var(--gold-400));
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}

.metrics-grid span {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .02em;
}

.metrics-grid strong {
  display: block;
  margin: 10px 0 6px;
  font-family: var(--font-code);
  font-size: 26px;
  font-weight: 600;
  color: var(--emerald-900);
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}

.metrics-grid small {
  font-size: 11.5px;
  color: var(--muted-2);
  font-weight: 500;
}

/* Metric card color variants — left border replaces top gradient */
.metrics-grid article.metric-card--green,
.metrics-grid article.metric-card--gold,
.metrics-grid article.metric-card--blue,
.metrics-grid article.metric-card--emerald {
  display: flex;
  flex-direction: column;
  border-left-width: 4px;
  border-left-style: solid;
}

.metrics-grid article.metric-card--green  { border-left-color: #10B981; }
.metrics-grid article.metric-card--gold   { border-left-color: #F59E0B; }
.metrics-grid article.metric-card--blue   { border-left-color: #6366F1; }
.metrics-grid article.metric-card--emerald{ border-left-color: var(--emerald-500); }

/* Remove top gradient bar on colored cards */
.metrics-grid article.metric-card--green::before,
.metrics-grid article.metric-card--gold::before,
.metrics-grid article.metric-card--blue::before,
.metrics-grid article.metric-card--emerald::before { display: none; }

/* Metric icon — positioned top-right */
.metric-icon {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.metric-icon svg { width: 20px; height: 20px; }

.metric-icon--green  { background: rgba(16,185,129,.12); color: #10B981; }
.metric-icon--gold   { background: rgba(245,158,11,.12); color: #F59E0B; }
.metric-icon--blue   { background: rgba(99,102,241,.12); color: #6366F1; }
.metric-icon--emerald{ background: rgba(45,158,95,.12);  color: var(--emerald-500); }

/* Section title icons (h2) */
.section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-right: 6px;
  vertical-align: middle;
  color: var(--emerald-700);
  flex-shrink: 0;
}

.section-icon svg { width: 18px; height: 18px; }

/* Section subtitle icons (h4) */
.section-icon-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-right: 5px;
  vertical-align: middle;
  color: var(--emerald-700);
  flex-shrink: 0;
}

.section-icon-sm svg { width: 14px; height: 14px; }

/* Sidebar footer */
.sidebar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  margin-top: 8px;
  border-top: 1px solid rgba(255,255,255,.08);
  gap: 8px;
}

.sidebar-operator-email {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,.45);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.sidebar-version {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,255,255,.25);
  letter-spacing: .05em;
  flex-shrink: 0;
}

/* ── Panel ───────────────────────────────────────────────────────────────────*/
.panel {
  margin-bottom: 20px;
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.panel-header h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--emerald-900);
  margin-bottom: 4px;
}

.panel-header p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.panel-header input[type="search"] {
  padding: 10px 14px;
  min-width: 240px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--ink);
  outline: none;
  font-size: 13.5px;
  transition: border-color .15s, box-shadow .15s;
  flex-shrink: 0;
}

.panel-header input[type="search"]:focus {
  border-color: var(--emerald-700);
  box-shadow: 0 0 0 3px rgba(26,107,60,.14);
}

/* ── Table ───────────────────────────────────────────────────────────────────*/
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  padding: 10px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1.5px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--border-2);
  vertical-align: middle;
  white-space: nowrap;
}

td strong { font-weight: 700; color: var(--ink); }

td small {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  font-weight: 400;
}

tbody tr {
  transition: background .1s;
}

tbody tr:hover { background: var(--emerald-50); }
:root[data-theme="dark"] tbody tr:hover { background: var(--emerald-100); }

tbody tr:last-child td { border-bottom: none; }

/* ── Badges ──────────────────────────────────────────────────────────────────*/
.status, .risk {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.status::before, .risk::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status.active, .risk.low {
  background: var(--success-bg);
  color: var(--success-fg);
}

.status.active::before, .risk.low::before { background: var(--success-fg); }

.status.pending, .risk.medium {
  background: var(--warn-bg);
  color: var(--warn-fg);
}

.status.pending::before, .risk.medium::before { background: var(--warn-fg); }

.status.blocked, .risk.high {
  background: var(--danger-bg);
  color: var(--danger-fg);
}

.status.blocked::before, .risk.high::before { background: var(--danger-fg); }

/* ── Approval items ──────────────────────────────────────────────────────────*/
.approval-list, .loan-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.approval-item, .loan-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  transition: border-color .12s, box-shadow .12s;
}

.approval-item:hover, .loan-item:hover {
  border-color: var(--emerald-700);
  box-shadow: var(--shadow-sm);
}

.approval-item strong, .loan-item strong {
  font-weight: 700;
  color: var(--ink);
}

.approval-item p, .loan-item p {
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--muted);
}

.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Loan card — layout em coluna (dados expandidos) */
.loan-item {
  flex-direction: column;
  align-items: stretch;
}

.loan-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.loan-details {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--ink-2);
}

.loan-description {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--muted);
  font-style: italic;
  border-left: 3px solid var(--emerald-200);
  padding-left: 10px;
}

.loan-contacts {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--muted);
}

/* ── Action buttons ──────────────────────────────────────────────────────────*/
.action-button {
  padding: 8px 14px;
  border: none;
  border-radius: var(--r-sm);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: filter .12s, transform .1s;
  white-space: nowrap;
  background: var(--emerald-800);
  color: #fff;
}

.action-button:hover { filter: brightness(1.12); }
.action-button:active { transform: scale(.97); }

.action-button.secondary {
  background: var(--emerald-100);
  color: var(--emerald-800);
  border: 1px solid var(--emerald-200);
}

:root[data-theme="dark"] .action-button.secondary {
  background: var(--emerald-100);
  color: var(--emerald-900);
  border-color: var(--border);
}

.action-button.danger {
  background: var(--danger-bg);
  color: var(--danger-fg);
  border: 1px solid rgba(155,36,23,.2);
}

/* ── Split grid ──────────────────────────────────────────────────────────────*/
.split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 20px;
}

.credit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
}
.credit-grid > .panel {
  display: flex;
  flex-direction: column;
}
.credit-grid > .panel .loan-list,
.credit-grid > .panel .contract-requests-list,
.credit-grid > .panel .contracts-panel {
  flex: 1;
}

/* ── Contract requests list ──────────────────────────────────────────────────*/
.contract-request-item {
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  margin-bottom: 10px;
  transition: border-color .12s;
}
.contract-request-item:hover { border-color: var(--emerald-700); }
.contract-request-item .cr-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.contract-request-item .cr-name { font-weight: 700; color: var(--ink); font-size: 14px; }
.contract-request-item .cr-meta { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.contract-request-item .cr-amount { font-size: 15px; font-weight: 800; color: var(--emerald-800); }
.contract-request-item .cr-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.contract-request-item .cr-details {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 12px;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.contract-request-item .cr-description {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
  margin: 4px 0 6px;
  padding-left: 8px;
  border-left: 2px solid var(--border);
}
.contract-request-item .cr-contact { font-size: 11px; color: var(--muted-2); }

/* ── Contracts panel ─────────────────────────────────────────────────────────*/
.contract-card {
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  margin-bottom: 10px;
  transition: border-color .12s;
}
.contract-card:hover { border-color: var(--emerald-700); }
.contract-card .cc-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.contract-card .cc-name { font-weight: 700; color: var(--ink); font-size: 14px; }
.contract-card .cc-amount { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.contract-card .cc-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; align-items: center; }
.contract-card .cc-signed-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--emerald-700);
  text-decoration: none;
  padding: 4px 10px;
  border: 1px solid var(--emerald-200);
  border-radius: 20px;
  transition: background .12s;
}
.contract-card .cc-signed-link:hover { background: var(--emerald-50); }

/* ── Reports ─────────────────────────────────────────────────────────────────*/
.report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.report-grid button {
  min-height: 56px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background .12s, border-color .12s, color .12s;
}

.report-grid button:hover {
  background: var(--emerald-100);
  border-color: var(--emerald-200);
  color: var(--emerald-800);
}

:root[data-theme="dark"] .report-grid button {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--ink-2);
}

/* ── Charts grid ─────────────────────────────────────────────────────────────*/
.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.chart-panel { padding-bottom: 8px; }
.chart-wrap {
  position: relative;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chart-wrap canvas { max-height: 200px; }
@media (max-width: 900px) {
  .charts-grid { grid-template-columns: 1fr; }
}

/* ── Report status ───────────────────────────────────────────────────────────*/
.report-status {
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--emerald-50);
  border: 1px solid var(--emerald-200);
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--emerald-800);
  display: flex;
  align-items: center;
  gap: 8px;
}
.report-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--emerald-200);
  border-top-color: var(--emerald-700);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.report-grid button:disabled {
  opacity: .5;
  cursor: not-allowed;
}

/* ── KYC workspace ───────────────────────────────────────────────────────────*/
.kyc-workspace { display: grid; }

.kyc-queue-wrap {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  min-height: 520px;
  box-shadow: var(--shadow-sm);
}

/* KYC sidebar */
.kyc-queue-sidebar {
  display: flex;
  flex-direction: column;
  background: var(--surface-2);
  border-right: 1px solid var(--border);
}

:root[data-theme="dark"] .kyc-queue-sidebar {
  background: var(--surface-2);
}

.kyc-queue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
}

.kyc-queue-badge {
  background: var(--emerald-800);
  color: #fff;
  border-radius: 99px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
}

.kyc-queue-items {
  overflow-y: auto;
  flex: 1;
}

.kyc-qitem {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-2);
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: background .1s;
}

.kyc-qitem:hover { background: var(--emerald-50); }
:root[data-theme="dark"] .kyc-qitem:hover { background: var(--emerald-100); }

.kyc-qitem.is-active {
  background: var(--emerald-50);
  border-left-color: var(--emerald-700);
}

:root[data-theme="dark"] .kyc-qitem.is-active {
  background: var(--emerald-100);
}

.kyc-qavatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--emerald-100);
  color: var(--emerald-800);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
  font-family: var(--font-mono);
}

:root[data-theme="dark"] .kyc-qavatar {
  background: var(--emerald-200);
  color: var(--emerald-900);
}

.kyc-qname {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kyc-qmeta {
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted);
  display: flex;
  gap: 6px;
  align-items: center;
}

/* KYC viewer */
.kyc-viewer {
  display: flex;
  flex-direction: column;
  background: var(--surface);
}

:root[data-theme="dark"] .kyc-viewer {
  background: var(--surface);
}

.kyc-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
}

.kyc-topbar-name {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
}

.kyc-topbar-meta {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.kyc-shortcuts {
  display: flex;
  gap: 12px;
  font-size: 11.5px;
  color: var(--muted);
  align-items: center;
}

.kyc-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-2);
}

.kyc-body {
  display: flex;
  flex: 1;
  min-height: 0;
}

.kyc-docarea {
  flex: 1;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  min-width: 0;
}

.kyc-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 6px;
}

.kyc-tab {
  padding: 10px 16px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  color: var(--muted);
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  transition: color .12s, border-color .12s;
  letter-spacing: .02em;
}

.kyc-tab:hover { color: var(--ink-2); }

.kyc-tab.is-active {
  color: var(--emerald-900);
  border-bottom-color: var(--emerald-700);
}

:root[data-theme="dark"] .kyc-tab.is-active {
  color: var(--emerald-800);
  border-bottom-color: var(--emerald-700);
}

.kyc-preview {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 20px;
  min-height: 260px;
}

:root[data-theme="dark"] .kyc-preview { background: #030a05; }

.kyc-docframe {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  max-width: 300px;
  aspect-ratio: 1.58;
  overflow: hidden;
  font-size: 12.5px;
  color: var(--muted);
  box-shadow: var(--shadow-md);
}

.kyc-docframe.selfie {
  border-radius: 50%;
  width: 180px;
  height: 180px;
  aspect-ratio: unset;
  max-width: unset;
}

.kyc-docframe img { width: 100%; height: 100%; object-fit: cover; }

/* KYC info panel */
.kyc-infopanel {
  width: 200px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 14px;
  overflow-y: auto;
  background: var(--surface-2);
}

:root[data-theme="dark"] .kyc-infopanel { background: var(--surface-2); }

.kyc-iblock { display: flex; flex-direction: column; gap: 4px; }

.kyc-ilabel {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted-2);
}

.kyc-ivalue {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  word-break: break-all;
  font-family: var(--font-mono);
}

.kyc-scoretrack {
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 4px;
}

.kyc-scorefill {
  height: 100%;
  border-radius: 99px;
  transition: width .4s ease;
}

.kyc-hdivider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2px 0;
}

.kyc-note-input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: 7px 9px;
  font-size: 12px;
  resize: none;
  color: var(--ink);
  background: var(--surface);
  outline: none;
  transition: border-color .12s;
  font-family: var(--font-body);
}

.kyc-note-input:focus {
  border-color: var(--emerald-700);
}

.kyc-status {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 99px;
  background: var(--warn-bg);
  color: var(--warn-fg);
  font-size: 11px;
  font-weight: 700;
}

/* KYC action bar */
.kyc-actionbar {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  align-items: center;
}

.kyc-btn-skip {
  padding: 8px 11px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  background: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 14px;
  transition: background .12s, color .12s;
}

.kyc-btn-skip:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.kyc-btn-resubmit {
  flex: 1;
  padding: 9px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  background: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
  transition: background .12s, border-color .12s, color .12s;
}

.kyc-btn-resubmit:hover {
  background: var(--surface-2);
  border-color: var(--muted);
  color: var(--ink);
}

.kyc-btn-reject {
  flex: 1.3;
  padding: 9px 10px;
  border: 1.5px solid rgba(155,36,23,.3);
  border-radius: var(--r-sm);
  background: none;
  cursor: pointer;
  color: var(--danger-fg);
  font-size: 12.5px;
  font-weight: 700;
  transition: background .12s;
}

.kyc-btn-reject:hover { background: var(--danger-bg); }

.kyc-btn-approve {
  flex: 2;
  padding: 9px 14px;
  border: none;
  border-radius: var(--r-sm);
  background: var(--emerald-800);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .02em;
  transition: background .12s, transform .1s;
}

.kyc-btn-approve:hover { background: var(--emerald-700); }
.kyc-btn-approve:active { transform: scale(.98); }

.kyc-empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* ── Upload slots ─────────────────────────────────────────────────────────────*/
.upload-slot {
  position: relative;
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 160px;
  overflow: hidden;
  border: 1.5px dashed var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
  cursor: pointer;
  text-align: center;
  transition: border-color .15s;
}

.upload-slot:hover { border-color: var(--emerald-700); }

.upload-slot input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-slot span {
  z-index: 1;
  color: var(--emerald-800);
  font-weight: 700;
  font-size: 13px;
}

.upload-slot small {
  z-index: 1;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.upload-slot img {
  position: absolute;
  inset: 0;
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-slot img.has-image { display: block; }

.upload-slot img.has-image ~ small,
.upload-slot:has(img.has-image) span,
.upload-slot:has(img.has-image) small { display: none; }

/* ── Scrollbar ───────────────────────────────────────────────────────────────*/
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted-2); }

/* ── Mobile topbar (hidden on desktop) ───────────────────────────────────────*/
.mobile-topbar {
  display: none;
}

/* ── Responsive ──────────────────────────────────────────────────────────────*/
@media (max-width: 1100px) {
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .split-grid { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  .login-view { grid-template-columns: 1fr; }
  .login-brand { display: none; }

  /* Dashboard layout: stack vertically, sidebar becomes bottom nav */
  .dashboard-view {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    padding-bottom: 64px; /* space for bottom nav */
  }

  /* Mobile top bar: logo + operator status */
  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    background: var(--emerald-950);
    border-bottom: 1px solid rgba(255,255,255,.07);
    position: sticky;
    top: 0;
    z-index: 100;
  }

  :root[data-theme="dark"] .mobile-topbar {
    background: #030a05;
    border-bottom-color: var(--border);
  }

  .mobile-topbar-logo {
    height: 36px;
    width: auto;
    border-radius: 6px;
    background: #fff;
    padding: 2px 6px;
  }

  .mobile-topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .mobile-theme-toggle {
    padding: 7px 11px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: var(--r-sm);
    color: rgba(255,255,255,.7);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background .12s;
  }

  .mobile-theme-toggle:hover {
    background: rgba(255,255,255,.14);
    color: #fff;
  }

  .mobile-operator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 11px;
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: var(--r-sm);
  }

  .mobile-operator::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--emerald-500);
    border-radius: 50%;
    flex-shrink: 0;
    animation: pulse 2.5s infinite;
  }

  .mobile-operator span {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,.7);
  }

  /* Hide desktop sidebar entirely */
  .sidebar {
    display: none;
  }

  /* Bottom navigation bar */
  .mobile-nav {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: var(--emerald-950);
    border-top: 1px solid rgba(255,255,255,.07);
    padding: 0;
    padding-bottom: env(safe-area-inset-bottom);
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  :root[data-theme="dark"] .mobile-nav {
    background: #030a05;
    border-top-color: var(--border);
  }

  .mobile-nav::-webkit-scrollbar { display: none; }

  .mobile-nav a,
  .mobile-nav button[data-logout] {
    flex: 1;
    min-width: 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 10px 6px;
    color: rgba(255,255,255,.45);
    text-decoration: none;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .02em;
    white-space: nowrap;
    border: none;
    background: none;
    cursor: pointer;
    transition: color .12s, background .12s;
    border-top: 2px solid transparent;
    text-align: center;
  }

  .mobile-nav a:hover,
  .mobile-nav button[data-logout]:hover {
    color: rgba(255,255,255,.75);
    background: rgba(255,255,255,.05);
  }

  .mobile-nav a.is-active {
    color: var(--gold-400);
    border-top-color: var(--gold-400);
    background: rgba(232,184,75,.07);
  }

  .mobile-nav button[data-logout] {
    color: rgba(255,100,80,.6);
  }

  .mobile-nav button[data-logout]:hover {
    color: rgba(255,100,80,.9);
  }

  /* Hide desktop topbar operator + theme toggle (shown in mobile-topbar) */
  .topbar .operator,
  .topbar .theme-toggle { display: none; }

  /* Topbar compact */
  .topbar {
    padding-bottom: 14px;
    margin-bottom: 18px;
  }

  .topbar h1 { font-size: 18px; }

  /* KYC responsive */
  .kyc-queue-wrap { grid-template-columns: 1fr; }
  .kyc-queue-sidebar { border-right: none; border-bottom: 1px solid var(--border); }
  .kyc-queue-items { max-height: 180px; }
  .kyc-body { flex-direction: column; }
  .kyc-docarea { border-right: none; border-bottom: 1px solid var(--border); }
  .kyc-infopanel { width: 100%; flex-direction: row; flex-wrap: wrap; }
}

@media (max-width: 640px) {
  .dashboard-content { padding: 16px 14px; }
  .metrics-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metrics-grid strong { font-size: 20px; }
  .panel { padding: 16px; }
  .panel-header { flex-direction: column; gap: 10px; }
  .panel-header input[type="search"] { min-width: 0; width: 100%; }
  .approval-item, .loan-item { flex-direction: column; align-items: flex-start; }
  .report-grid { grid-template-columns: 1fr; }

  /* Action buttons in list items wrap nicely */
  .actions { width: 100%; }
  .action-button { flex: 1; text-align: center; justify-content: center; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   INVESTIMENTOS
   ══════════════════════════════════════════════════════════════════════════ */

/* Layout 2 colunas: formulário | lista + saques */
.invest-section {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 16px;
  margin-top: 20px;
}

.invest-right-col { display: flex; flex-direction: column; gap: 0; }

/* Formulário */
.invest-form-panel { position: sticky; top: 80px; align-self: start; }

.invest-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  margin-top: 16px;
}
.invest-full { grid-column: 1 / -1; }

.invest-label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
}

.invest-label input,
.invest-label textarea,
.invest-label select {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 13px;
  transition: border-color .12s;
  outline: none;
}
.invest-label input:focus,
.invest-label textarea:focus {
  border-color: var(--emerald-700);
}
.invest-label textarea { resize: vertical; min-height: 80px; }

.invest-active-row {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}
.invest-active-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--emerald-700); }

/* Upload de imagem */
.invest-img-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.invest-img-preview {
  width: 80px;
  height: 50px;
  object-fit: cover;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
}
.invest-img-btn {
  cursor: pointer;
  padding: 6px 12px;
  border: 1px dashed var(--border);
  border-radius: var(--r-sm);
  font-size: 12px;
  color: var(--emerald-700);
  background: var(--emerald-50);
  font-weight: 600;
  transition: background .12s;
}
.invest-img-btn:hover { background: var(--emerald-100); }
.invest-img-name { font-size: 11px; color: var(--muted); }

/* Botões do form */
.invest-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.invest-form-status {
  font-size: 12px;
  margin-top: 8px;
  min-height: 18px;
  text-align: right;
}
.invest-status-ok { color: var(--success-fg); font-weight: 600; }
.invest-status-err { color: var(--danger-fg); font-weight: 600; }

/* Lista de produtos */
.invest-product-list { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }

.invest-product-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
  transition: border-color .12s;
}
.invest-product-row:hover { border-color: var(--emerald-200); }
.invest-inactive { opacity: .55; }

.invest-product-info { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.invest-product-info > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.invest-product-info strong { font-size: 13px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.invest-product-info small { font-size: 11px; color: var(--muted); }

.invest-product-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: var(--r-sm);
  flex-shrink: 0;
}
.invest-no-img {
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  background: var(--emerald-50);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.invest-product-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.invest-rate-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 99px;
  background: var(--emerald-100);
  color: var(--emerald-700);
  font-size: 11px;
  font-weight: 700;
}

.invest-status-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 700;
}
.chip-on { background: var(--success-bg); color: var(--success-fg); }
.chip-off { background: var(--danger-bg); color: var(--danger-fg); }
.chip-warn { background: var(--warn-bg); color: var(--warn-fg); }

/* Badge numérico */
.invest-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--danger-fg);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

/* Lista de saques */
.invest-withdraw-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }

.invest-withdraw-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
}
.invest-withdraw-info { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.invest-withdraw-info strong { font-size: 13px; color: var(--ink); }
.invest-withdraw-info small { font-size: 11px; color: var(--muted); }

.invest-empty { font-size: 13px; color: var(--muted); text-align: center; padding: 20px 0; }

/* Botões tamanho pequeno */
.btn-sm { padding: 4px 10px !important; font-size: 12px !important; }

/* Modal de saque */
.invest-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.invest-modal {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  padding: 28px;
  width: min(520px, 100%);
}
.invest-modal h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 16px;
}
.invest-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--muted);
  line-height: 1;
  padding: 4px;
}
.invest-modal-close:hover { color: var(--ink); }

.invest-modal-body { margin-bottom: 20px; }

.invest-modal-grid { display: flex; flex-direction: column; gap: 8px; }
.invest-modal-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 7px 10px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-size: 13px;
  gap: 8px;
}
.invest-modal-row span { color: var(--muted); }
.invest-modal-row strong { font-weight: 700; color: var(--ink); }

.invest-warn-row { background: var(--warn-bg); }
.invest-warn-row span, .invest-warn-row strong { color: var(--warn-fg); }
.invest-ok-row { background: var(--success-bg); }
.invest-ok-row span, .invest-ok-row strong { color: var(--success-fg); }
.invest-net-row { background: var(--emerald-100); }
.invest-net-row span { color: var(--emerald-700); }
.invest-net-row strong { color: var(--emerald-700); font-size: 15px; }

.invest-modal-note {
  margin-top: 12px;
  padding: 10px 12px;
  border-left: 3px solid var(--emerald-200);
  font-style: italic;
  font-size: 13px;
  color: var(--muted);
}

.invest-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* Responsive */
@media (max-width: 960px) {
  .invest-section { grid-template-columns: 1fr; }
  .invest-form-panel { position: static; }
}
@media (max-width: 640px) {
  .invest-form-grid { grid-template-columns: 1fr; }
  .invest-product-row, .invest-withdraw-row { flex-direction: column; align-items: flex-start; }
}

/* ═══════════════════════════════════════════════════
   CARTEIRA DO CLIENTE
═══════════════════════════════════════════════════ */

.cw-search-bar {
  position: relative;
  margin-bottom: 24px;
}

.cw-search-bar input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color .2s;
  box-sizing: border-box;
}
.cw-search-bar input:focus { border-color: var(--emerald-400); }

.cw-search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  list-style: none;
  margin: 0; padding: 6px 0;
  z-index: 200;
  max-height: 280px;
  overflow-y: auto;
}
.cw-search-results.is-hidden { display: none; }

.cw-result-item {
  display: flex;
  flex-direction: column;
  padding: 10px 16px;
  cursor: pointer;
  gap: 2px;
  transition: background .15s;
}
.cw-result-item:hover { background: var(--hover, rgba(0,0,0,.04)); }
.cw-result-item strong { font-size: 14px; color: var(--text); }
.cw-result-item small { font-size: 12px; color: var(--muted); }

.cw-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 48px 20px;
  color: var(--muted);
  font-size: 14px;
}
.cw-empty-state span { font-size: 40px; }

.cw-content.is-hidden { display: none; }

.cw-client-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.cw-client-header h3 { margin: 0; font-size: 18px; }
.cw-client-header small { color: var(--muted); font-size: 13px; }
.cw-header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.btn-block {
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid #c0392b;
  background: transparent;
  color: #c0392b;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.btn-block:hover { background: #c0392b; color: #fff; }
.btn-block--blocked {
  border-color: var(--green-700, #1a7f4b);
  color: var(--green-700, #1a7f4b);
}
.btn-block--blocked:hover { background: var(--green-700, #1a7f4b); color: #fff; }

.cw-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--emerald-100, #d1fae5);
  color: var(--emerald-700, #065f46);
  font-weight: 800;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.cw-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}
@media (max-width: 960px) { .cw-summary-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .cw-summary-grid { grid-template-columns: 1fr; } }

.cw-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cw-card-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.cw-card-value { font-size: 20px; font-weight: 800; color: var(--text); font-family: var(--font-mono, monospace); }
.cw-positive { color: #1a6b3c !important; }
.cw-negative { color: #9f2417 !important; }

.cw-section { margin-bottom: 28px; }
.cw-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.cw-contact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (max-width: 640px) { .cw-contact-grid { grid-template-columns: 1fr; } }

.cw-contact-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cw-contact-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.cw-contact-value { font-size: 14px; font-weight: 600; color: var(--text); word-break: break-all; }

/* ── Documentos KYC ─────────────────────────────────────────────────────────── */
.cw-kyc-photos {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.cw-kyc-review-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  margin-bottom: 12px;
}
.cw-kyc-review-bar > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cw-kyc-review-bar small {
  color: var(--muted);
  font-size: 12px;
}
.cw-kyc-review-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.cw-kyc-photo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface);
  width: 160px;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: box-shadow .15s;
}
.cw-kyc-photo-wrap:hover { box-shadow: 0 4px 16px rgba(0,0,0,.12); }
.cw-kyc-photo-wrap:focus-visible {
  outline: 3px solid rgba(22, 101, 52, .24);
  outline-offset: 2px;
}
.cw-kyc-photo {
  width: 136px;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.cw-kyc-photo-placeholder { font-size: 40px; line-height: 100px; }
.cw-kyc-photo-label { font-size: 12px; font-weight: 600; color: var(--muted); text-align: center; }
.cw-kyc-photo-hint { font-size: 10px; font-weight: 700; color: var(--emerald-700); }
.cw-kyc-photo-missing { opacity: .5; }

/* ── Extrato de transações ───────────────────────────────────────────────────── */
.cw-transactions-list { overflow-x: auto; }
.cw-tx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.cw-tx-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.cw-tx-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.cw-tx-table tr:last-child td { border-bottom: none; }
.cw-tx-credit { color: #1a7f4b; font-weight: 600; }
.cw-tx-debit  { color: #c0392b; font-weight: 600; }

.cw-positions-list, .cw-withdrawals-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cw-list-empty { color: var(--muted); font-size: 14px; text-align: center; padding: 20px 0; }

.cw-position-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}
.cw-position-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cw-position-info { flex: 1; min-width: 0; }
.cw-position-info strong { display: block; font-size: 14px; margin-bottom: 3px; }
.cw-position-info small { font-size: 12px; color: var(--muted); }
.cw-position-values { text-align: right; flex-shrink: 0; }
.cw-val-current { display: block; font-size: 15px; font-weight: 700; font-family: var(--font-mono, monospace); }
.cw-val-earnings { display: block; font-size: 12px; font-weight: 600; }

.cw-withdrawal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}
.cw-withdrawal-info { flex: 1; min-width: 0; }
.cw-withdrawal-info strong { display: block; font-size: 14px; margin-bottom: 3px; }
.cw-withdrawal-info small { font-size: 12px; color: var(--muted); }
.cw-reject-reason { display: block; font-size: 12px; color: #9f2417; margin-top: 4px; }

/* ── Gestão de operadores ────────────────────────────────────────────────────── */
.op-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
@media (max-width: 768px) { .op-layout { grid-template-columns: 1fr; } }
.op-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 8px;
  background: var(--surface);
}
.op-info { flex: 1; min-width: 0; }
.op-info strong { display: block; font-size: 14px; }
.op-info small { font-size: 12px; color: var(--muted); }
.op-list { display: flex; flex-direction: column; }

/* ── Suporte ao cliente ───────────────────────────────────────────────────────── */
.support-layout { display: grid; grid-template-columns: 280px 1fr; gap: 0; min-height: 400px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
@media (max-width: 768px) { .support-layout { grid-template-columns: 1fr; } }
.support-queue { border-right: 1px solid var(--border); overflow-y: auto; }
.support-queue-head { padding: 14px 16px; font-weight: 700; font-size: 13px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.support-qitem { padding: 12px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .1s; }
.support-qitem:hover, .support-qitem.is-active { background: var(--surface-2, rgba(0,0,0,.04)); }
.support-qitem-name { font-size: 14px; font-weight: 600; }
.support-qitem-preview { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.support-qitem-meta { font-size: 11px; color: var(--muted); margin-top: 4px; display: flex; gap: 8px; }
.support-chat { display: flex; flex-direction: column; }
.support-chat-header { padding: 14px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.support-chat-header strong { font-size: 15px; }
.support-chat-header small { color: var(--muted); font-size: 12px; }
.support-messages { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 10px; min-height: 200px; }
.support-msg { max-width: 75%; padding: 10px 14px; border-radius: 12px; font-size: 14px; line-height: 1.5; }
.support-msg--client { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.support-msg--admin  { align-self: flex-end;  background: var(--green-800, #1a7f4b); color: #fff; border-bottom-right-radius: 4px; }
.support-msg-meta { font-size: 11px; opacity: .65; margin-top: 4px; }
.support-reply-bar { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }
.support-reply-bar textarea { flex: 1; resize: none; border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font-size: 14px; background: var(--surface); color: var(--text); font-family: inherit; }
.support-reply-bar button { padding: 8px 18px; border-radius: 8px; background: var(--green-800, #1a7f4b); color: #fff; border: none; font-weight: 600; cursor: pointer; }
.support-empty-chat { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 14px; }

/* ── Log de auditoria ────────────────────────────────────────────────────────── */
.audit-filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.audit-filters select,
.audit-filters input[type="date"] {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
}
.audit-list { overflow-x: auto; }
.audit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.audit-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.audit-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.audit-table tr:last-child td { border-bottom: none; }
.audit-table tr:hover td { background: var(--surface-2, rgba(0,0,0,.03)); }

/* ── Visualizador de foto KYC com zoom ──────────────────────────────────────── */
.photo-viewer-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  flex-direction: column;
}
.photo-viewer-overlay.is-hidden { display: none; }

.photo-viewer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: rgba(0, 0, 0, 0.6);
  flex-shrink: 0;
  gap: 12px;
}
.photo-viewer-label {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  opacity: .85;
}
.photo-viewer-controls {
  display: flex;
  gap: 8px;
}
.photo-viewer-controls button {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 14px;
  cursor: pointer;
  transition: background .15s;
}
.photo-viewer-controls button:hover { background: rgba(255,255,255,.25); }
#photo-viewer-close {
  background: rgba(200,50,50,.35);
  border-color: rgba(200,50,50,.5);
}
#photo-viewer-close:hover { background: rgba(200,50,50,.6); }

.photo-viewer-canvas {
  flex: 1;
  overflow: hidden;
  position: relative;
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-viewer-canvas.is-dragging { cursor: grabbing; }

#photo-viewer-img {
  position: absolute;
  transform-origin: center center;
  max-width: none;
  max-height: none;
  user-select: none;
  transition: none;
  border-radius: 4px;
}

/* Cursor de zoom nas fotos clicáveis */
.kyc-docframe img,
.cw-kyc-photo {
  cursor: zoom-in;
}

/* ── Card de saldo editável ──────────────────────────────────────────────────── */
.cw-card--editable { position: relative; }
.cw-edit-balance-btn {
  margin-top: 8px;
  padding: 4px 10px;
  font-size: 12px;
  font-family: inherit;
  background: transparent;
  color: var(--emerald-700);
  border: 1px solid var(--emerald-200);
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.cw-edit-balance-btn:hover { background: var(--emerald-100); color: var(--emerald-900); }

/* ── Modal genérico ──────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 29, 14, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.modal-overlay.is-hidden { display: none; }
.modal-box {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,.22);
  width: 100%;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { margin: 0; font-size: 18px; }
.modal-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--muted);
  padding: 4px 8px;
  border-radius: 6px;
}
.modal-close:hover { background: var(--surface-2); }
.modal-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.modal-warning {
  padding: 10px 14px;
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: 8px;
  font-size: 13px;
  color: #7a5000;
  margin: 0;
}
.modal-field { display: flex; flex-direction: column; gap: 5px; }
.modal-field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.modal-field input,
.modal-field textarea {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: var(--bg);
  color: var(--ink);
  resize: vertical;
}
.modal-field input:disabled { opacity: .65; cursor: not-allowed; }
.modal-field input:focus,
.modal-field textarea:focus { outline: none; border-color: var(--emerald-500); box-shadow: 0 0 0 3px rgba(45,158,95,.15); }
.modal-hint { font-size: 12px; color: var(--muted); }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--border);
}
.btn-danger {
  padding: 9px 20px;
  background: #c0392b;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s;
}
.btn-danger:hover:not(:disabled) { background: #962d22; }
.btn-danger:disabled { opacity: .6; cursor: not-allowed; }
.btn-primary {
  padding: 9px 20px;
  background: var(--emerald-700);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s;
}
.btn-primary:hover:not(:disabled) { background: var(--emerald-900); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }

/* ── Eventos & Notificações ──────────────────────────────────────────────────── */
.ev-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
  align-items: start;
}
.ad-manager-grid {
  display: grid;
  grid-template-columns: minmax(620px, .95fr) minmax(720px, 1.25fr);
  gap: 16px;
  margin-bottom: 24px;
  align-items: start;
}
.ad-card {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 12px;
  padding: 16px;
}
.ad-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.ad-card h3 {
  margin: 0 0 6px;
  font-size: 15px;
  color: var(--ink);
}
.ad-card p {
  margin: 0 0 14px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}
.ad-card--event .ev-layout--compact {
  grid-template-columns: minmax(0, 1fr) 210px;
  gap: 16px;
}
.ad-card--event .ev-section-title { margin-bottom: 10px; }
.ad-card--event .ev-field { margin-bottom: 10px; }
.ad-card--event .ev-field textarea { min-height: 58px; }
.ad-card--event #ev-detail { min-height: 82px; }
.ad-card--event .ev-image-upload-area {
  width: min(100%, 420px);
  aspect-ratio: 16 / 9;
}
.ad-card--event .ev-preview-col {
  position: sticky;
  top: 80px;
}
.ad-card--event .ev-phone-screen {
  width: 190px;
  height: 360px;
  border-radius: 24px;
  border-width: 7px;
}
.ad-card--event .ev-modal-overlay { padding: 8px; }
.ad-card--carousel .ad-invest-upload {
  width: min(100%, 860px);
  aspect-ratio: 3 / 1;
  margin-left: auto;
  min-height: 0;
}
.ad-card--carousel .ev-actions {
  align-items: center;
}
.ad-carousel-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.ad-carousel-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  padding: 8px;
}
.ad-carousel-item img {
  width: 72px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--surface-2);
}
.ad-carousel-item div { flex: 1; min-width: 0; }
.ad-carousel-item strong {
  display: block;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ad-carousel-item small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 900px) {
  .ev-layout { grid-template-columns: 1fr; }
  .ad-manager-grid { grid-template-columns: 1fr; }
  .ad-card--event .ev-layout--compact { grid-template-columns: 1fr; }
  .ad-card--event .ev-preview-col { position: static; }
  .ad-card--carousel .ad-invest-upload { margin-left: 0; }
}

.ev-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--ink-2);
  margin: 0 0 14px;
}

.ev-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.ev-field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.ev-field input,
.ev-field textarea {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: var(--bg);
  color: var(--ink);
  resize: vertical;
  transition: border-color .15s;
}
.ev-field input:focus,
.ev-field textarea:focus { outline: none; border-color: var(--emerald-500); box-shadow: 0 0 0 3px rgba(45,158,95,.15); }
.ev-hint { font-size: 11px; color: var(--muted); }

/* ── Upload de imagem do evento ──────────────────────────────────────────────── */
.ev-image-upload-area {
  width: min(100%, 960px);
  aspect-ratio: 16 / 9;
  border: 2px dashed var(--border);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  overflow: hidden;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .2s, background .2s;
  position: relative;
}
.ev-image-upload-area:hover,
.ev-image-upload-area.ev-image-drag-over {
  border-color: var(--emerald-500);
  background: rgba(45,158,95,.06);
}
.ev-image-upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  padding: 20px;
  text-align: center;
  pointer-events: none;
}
.ev-image-upload-placeholder span:first-child { font-size: 32px; }
.ev-image-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ev-image-preview.is-hidden { display: none; }
.ev-image-upload-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.ev-image-upload-name {
  font-size: 12px;
  color: var(--muted);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ev-image-upload-status {
  font-size: 12px;
  min-height: 18px;
}

.ev-toggle-label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.ev-toggle-label input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--emerald-700); cursor: pointer; }
.ev-channel-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.ev-channel-card {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-height: 66px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
}
.ev-channel-card input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--emerald-700);
}
.ev-channel-card strong {
  display: block;
  font-size: 12px;
  color: var(--ink);
}
.ev-channel-card small {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  line-height: 1.35;
  color: var(--muted);
}
.ev-channel-card--disabled {
  opacity: .62;
  cursor: not-allowed;
  background: var(--surface-2);
}
.ev-channel-card--disabled input { cursor: not-allowed; }
@media (max-width: 1200px) {
  .ev-channel-grid { grid-template-columns: 1fr; }
}

.ev-actions { display: flex; gap: 10px; margin-top: 6px; }
.ev-btn-primary {
  flex: 1;
  padding: 11px 16px;
  background: var(--emerald-700);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s;
}
.ev-btn-primary:hover:not(:disabled) { background: var(--emerald-900); }
.ev-btn-primary:disabled { opacity: .65; cursor: not-allowed; }
.ev-btn-ghost {
  padding: 11px 16px;
  background: transparent;
  color: var(--ink-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}
.ev-btn-ghost:hover { background: var(--surface-2); }

/* Lista de eventos ativos */
.ev-active-list { display: flex; flex-direction: column; gap: 8px; }
.ev-empty { font-size: 13px; color: var(--muted); margin: 0; }
.ev-active-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  gap: 10px;
}
.ev-inactive { opacity: .6; }
.ev-active-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ev-active-info strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-active-info small { font-size: 11px; color: var(--muted); }
.ev-active-badge { display: inline-block; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 99px; margin-bottom: 2px; }
.ev-badge-on  { background: #d4edda; color: #155724; }
.ev-badge-off { background: #f8d7da; color: #721c24; }
.ev-active-actions { display: flex; gap: 6px; flex-shrink: 0; }
.ev-icon-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 14px;
  transition: background .15s;
}
.ev-icon-btn:hover { background: var(--surface-2); }
.ev-icon-btn--danger:hover { background: #fde8e8; border-color: #e57373; }

/* ── Preview do celular ──────────────────────────────────────────────────────── */
.ev-preview-col { position: sticky; top: 80px; }
.ev-phone-frame {
  display: flex;
  justify-content: center;
}
.ev-phone-screen {
  position: relative;
  width: 220px;
  height: 420px;
  border-radius: 28px;
  border: 8px solid #1a1a2e;
  background: #f0f0ea;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.ev-phone-bg { padding: 12px; }
.ev-phone-topbar {
  height: 28px;
  background: var(--emerald-800);
  border-radius: 8px;
  margin-bottom: 10px;
}
.ev-phone-content-lines { display: flex; flex-direction: column; gap: 8px; }
.ev-line { height: 10px; background: #ddd; border-radius: 5px; }
.ev-line--wide { width: 100%; }
.ev-line--short { width: 60%; }

/* Overlay modal simulado */
.ev-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}
.ev-modal-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  width: 100%;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
}
.ev-modal-image-wrap { width: 100%; aspect-ratio: 16/9; overflow: hidden; background: #e8f5e9; }
.ev-modal-image-wrap img { width: 100%; height: 100%; object-fit: cover; }
.ev-modal-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  background: #e8f5e9;
  color: #aaa;
}
.ev-modal-body { padding: 10px; }
.ev-modal-title { font-size: 11px; font-weight: 800; margin: 0 0 4px; color: #111; line-height: 1.3; }
.ev-modal-text  { font-size: 9px; color: #555; margin: 0 0 8px; line-height: 1.4; }
.ev-modal-btn {
  display: block;
  width: 100%;
  padding: 7px;
  background: #0F5C2D;
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: 9px;
  font-weight: 700;
  font-family: inherit;
  cursor: default;
  margin-bottom: 4px;
}
.ev-modal-close-hint { font-size: 8px; color: #aaa; text-align: center; margin: 0; }

/* ── Focus-visible & cursor improvements ──────────────────────────────────── */
button, a, [role="button"], [tabindex] { cursor: pointer; }

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--emerald-700);
  outline-offset: 2px;
}

/* Action button focus */
.action-button:focus-visible,
.btn-primary:focus-visible,
.btn-danger:focus-visible {
  outline: 2px solid var(--emerald-500);
  outline-offset: 3px;
}

/* Sidebar link focus */
.sidebar a:focus-visible {
  outline: 2px solid var(--gold-400);
  outline-offset: 2px;
}

/* Report button icon alignment */
.report-grid button {
  display: flex;
  align-items: center;
  gap: 8px;
}

.report-grid button svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: .7;
}
