/* ============================================
   GesCredi — Sistema de Tema (Claro + Escuro)
   Base de variáveis reutilizada em todo o sistema
   ============================================ */

:root {
  /* ---- Tema Claro (padrão) ---- */
  --bg: #f7f8fb;
  --bg-gradient: linear-gradient(135deg, #f7f8fb 0%, #eef1f7 100%);
  --surface: #ffffff;
  --surface-2: #f1f3f8;
  --surface-hover: #eef1f7;

  --sidebar-bg: #ffffff;
  --sidebar-border: #eceef3;

  --border: #e8eaf0;
  --border-subtle: rgba(15, 23, 42, 0.06);

  --text: #0f172a;
  --text-muted: #64748b;
  --text-faint: #94a3b8;

  --primary: #10b981;
  --primary-hover: #059669;
  --primary-soft: rgba(16, 185, 129, 0.10);
  --primary-glow: 0 4px 14px rgba(16, 185, 129, 0.28);

  --accent-blue: #3b82f6;
  --accent-red: #ef4444;
  --accent-green: #10b981;
  --accent-orange: #f59e0b;
  --accent-purple: #8b5cf6;

  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.10);

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-xl: 0 20px 60px rgba(15, 23, 42, 0.12);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

[data-theme="dark"] {
  --bg: #0b1020;
  --bg-gradient: linear-gradient(135deg, #0b1020 0%, #111730 100%);
  --surface: #141a2e;
  --surface-2: #1a2138;
  --surface-hover: #1f2742;

  --sidebar-bg: #0d1325;
  --sidebar-border: rgba(255, 255, 255, 0.04);

  --border: rgba(255, 255, 255, 0.06);
  --border-subtle: rgba(255, 255, 255, 0.04);

  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-faint: #64748b;

  --primary: #10b981;
  --primary-hover: #34d399;
  --primary-soft: rgba(16, 185, 129, 0.14);
  --primary-glow: 0 4px 20px rgba(16, 185, 129, 0.35);

  --accent-blue: #60a5fa;
  --accent-red: #f87171;
  --accent-green: #34d399;
  --accent-orange: #fbbf24;
  --accent-purple: #a78bfa;

  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.12);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* ---- Reset base ---- */
*, *::before, *::after {
  box-sizing: border-box;
}
html, body {
  margin: 0;
  padding: 0;
}
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.3s ease, color 0.3s ease;
}

/* ---- Utilitários de valor (fonte bold destacada) ---- */
.value-xl { font-weight: 800; font-size: 32px; letter-spacing: -0.8px; }
.value-lg { font-weight: 700; font-size: 24px; letter-spacing: -0.4px; }
.value-md { font-weight: 700; font-size: 18px; letter-spacing: -0.2px; }

/* ---- Botões base ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}
.btn:hover { background: var(--surface-hover); }
.btn svg { width: 15px; height: 15px; }

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: var(--primary-glow);
}
.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-lg {
  padding: 14px 22px;
  font-size: 14px;
  border-radius: var(--radius);
}
.btn-block { width: 100%; }

/* ---- Toggle de tema (botão redondo) ---- */
.theme-toggle {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.theme-toggle:hover {
  color: var(--text);
  background: var(--surface-hover);
  transform: scale(1.05);
}
.theme-toggle svg { width: 18px; height: 18px; }

/* ---- Inputs base ---- */
.input-group { margin-bottom: 16px; position: relative; }
.input-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  letter-spacing: 0.2px;
}
.input, .input-icon-wrap input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  transition: all 0.15s ease;
  outline: none;
}
.input:focus, .input-icon-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.input::placeholder, .input-icon-wrap input::placeholder { color: var(--text-faint); }

.input-icon-wrap {
  position: relative;
}
.input-icon-wrap input { padding-left: 42px; }
.input-icon-wrap .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  pointer-events: none;
  display: flex;
}
.input-icon-wrap .input-icon svg { width: 16px; height: 16px; }

/* ---- Alert ---- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.alert-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid var(--danger-soft);
}

/* ---- Links ---- */
.link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}
.link:hover { color: var(--primary-hover); text-decoration: underline; }

/* ---- Checkbox customizado ---- */
.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
  user-select: none;
}
.check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 10px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }
