/* Reconcile.ai - Yangtzé Edition (azul profundo radial + glassmorphism + ciano vibrante) */
:root {
  /* Backgrounds em camadas */
  --bg-base: #051028;
  --bg-deep: #0A1838;
  --bg-mid: #142754;
  --bg-light: #1E3A8A;

  /* Para cards com glassmorphism */
  --glass-bg: rgba(20, 39, 84, 0.45);
  --glass-bg-hover: rgba(30, 58, 138, 0.55);
  --glass-border: rgba(103, 232, 249, 0.18);
  --glass-border-strong: rgba(103, 232, 249, 0.35);

  /* Compat com nomes antigos */
  --bg: var(--bg-base);
  --bg-elev: var(--bg-deep);
  --bg-card: var(--glass-bg);
  --bg-hover: var(--glass-bg-hover);
  --border: var(--glass-border);
  --border-strong: var(--glass-border-strong);

  /* Text */
  --text: #F1F5F9;
  --text-dim: #94A3B8;
  --text-mute: #64748B;

  /* Brand colors */
  --primary: #3B82F6;
  --primary-deep: #1E40AF;
  --cyan: #06B6D4;
  --cyan-bright: #22D3EE;
  --cyan-light: #67E8F9;
  --primary-dim: rgba(59, 130, 246, 0.15);
  --cyan-dim: rgba(6, 182, 212, 0.15);
  --cyan-glow: rgba(103, 232, 249, 0.3);

  /* Accent amarelo dourado (linha decorativa) */
  --gold: #FCD34D;
  --gold-deep: #F59E0B;
  --gold-dim: rgba(252, 211, 77, 0.15);

  /* Gradiente principal (azul → ciano) */
  --gradient-brand: linear-gradient(135deg, #1E40AF 0%, #3B82F6 35%, #06B6D4 70%, #67E8F9 100%);
  --gradient-brand-soft: linear-gradient(135deg, rgba(30,64,175,0.2) 0%, rgba(59,130,246,0.2) 35%, rgba(6,182,212,0.2) 70%, rgba(103,232,249,0.15) 100%);
  --gradient-hover: linear-gradient(135deg, #2563EB 0%, #3B82F6 35%, #0891B2 70%, #22D3EE 100%);
  --gradient-cyan: linear-gradient(135deg, #06B6D4 0%, #67E8F9 100%);

  /* Status */
  --green: #10B981;
  --green-bg: rgba(16, 185, 129, 0.15);
  --amber: #FCD34D;
  --amber-bg: rgba(252, 211, 77, 0.15);
  --red: #F87171;
  --red-bg: rgba(248, 113, 113, 0.15);
  --blue: #60A5FA;
  --blue-bg: rgba(96, 165, 250, 0.15);
  --purple: #C084FC;
  --purple-bg: rgba(192, 132, 252, 0.15);

  /* Legado (compat) */
  --accent: var(--cyan-light);
  --accent-dark: var(--cyan);
  --accent-dim: var(--cyan-dim);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg-base);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  position: relative;
}

/* Background radial GLOBAL (igual ao slide do Yangtzé) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 70% 30%, rgba(30, 58, 138, 0.6) 0%, transparent 50%),
    radial-gradient(ellipse at 30% 70%, rgba(6, 182, 212, 0.15) 0%, transparent 55%),
    radial-gradient(ellipse at 90% 90%, rgba(59, 130, 246, 0.3) 0%, transparent 50%),
    linear-gradient(135deg, #051028 0%, #0A1838 50%, #142754 100%);
  z-index: -1;
  pointer-events: none;
}

.mono { font-family: 'JetBrains Mono', 'Menlo', monospace; }

a { color: var(--cyan-light); text-decoration: none; }
a:hover { text-decoration: underline; }

/* LAYOUT */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px;
  background: rgba(10, 24, 56, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-right: 1px solid var(--glass-border);
  padding: 18px 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-brand {
  padding: 0 18px 16px;
  display: flex;
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid var(--glass-border);
}
.sidebar-brand .mark {
  width: 36px; height: 36px;
  background: var(--gradient-cyan);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900;
  font-size: 13px;
  color: var(--bg-base);
  box-shadow: 0 4px 16px rgba(103, 232, 249, 0.4), 0 0 0 1px rgba(255,255,255,0.15) inset;
  letter-spacing: -0.04em;
}
.sidebar-brand .name { font-size: 13px; font-weight: 700; color: var(--text); }
.sidebar-brand .name .gradient-text,
.sidebar-brand .name .gold {
  background: var(--gradient-cyan);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
}
.sidebar-brand .sub { font-size: 10px; color: var(--text-mute); }

.user-card {
  margin: 16px 12px;
  padding: 12px;
  background: var(--glass-bg);
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.user-card .ucr { display: flex; align-items: center; gap: 10px; }
.user-card .avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--gradient-cyan);
  color: var(--bg-base);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: 11px;
  box-shadow: 0 2px 12px rgba(103, 232, 249, 0.35);
}
.user-card .nm { font-size: 12px; font-weight: 600; }
.user-card .org { font-size: 10px; color: var(--text-dim); }

.nav-section {
  padding: 14px 18px 6px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 18px;
  color: var(--text-dim);
  cursor: pointer;
  position: relative;
  font-size: 13px;
  transition: all 0.2s;
  text-decoration: none;
}
.nav-item:hover { background: var(--glass-bg); color: var(--text); text-decoration: none; }
.nav-item.active { color: var(--text); background: var(--glass-bg); }
.nav-item.active::before {
  content: ""; position: absolute;
  left: 0; top: 6px; bottom: 6px; width: 3px;
  background: var(--gold);
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 8px var(--gold);
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-item .badge {
  margin-left: auto;
  padding: 1px 7px;
  background: var(--gradient-cyan);
  color: var(--bg-base);
  border-radius: 9px;
  font-size: 10px;
  font-weight: 800;
}

.sidebar-foot {
  margin-top: auto;
  padding: 16px 18px;
  border-top: 1px solid var(--glass-border);
  font-size: 10px;
  color: var(--text-mute);
}
.sidebar-foot .engine { display: flex; align-items: center; gap: 6px; }
.sidebar-foot .dot {
  width: 6px; height: 6px;
  background: var(--cyan-light);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--cyan-light);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.main { flex: 1; overflow-y: auto; }
.topbar {
  height: 56px;
  background: rgba(5, 16, 40, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px;
  color: var(--text-dim);
}
.breadcrumb .sep { color: var(--text-mute); }
.breadcrumb .current { color: var(--text); font-weight: 600; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.content { padding: 28px; }
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
}
.page-title { font-size: 26px; font-weight: 700; letter-spacing: -0.01em; }
.page-subtitle { font-size: 13px; color: var(--text-dim); margin-top: 4px; }

/* FORMS */
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 12px 14px;
  background: rgba(5, 16, 40, 0.6);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  transition: all 0.2s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--cyan-light);
  box-shadow: 0 0 0 3px var(--cyan-glow);
}
.field textarea { min-height: 120px; resize: vertical; line-height: 1.55; }

.btn {
  padding: 11px 18px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border-strong);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.btn:hover { background: var(--glass-bg-hover); text-decoration: none; border-color: var(--cyan-light); }
.btn-primary {
  background: var(--gradient-cyan);
  color: var(--bg-base);
  border-color: transparent;
  box-shadow: 0 4px 20px rgba(103, 232, 249, 0.35);
  font-weight: 700;
}
.btn-primary:hover {
  box-shadow: 0 6px 24px rgba(103, 232, 249, 0.55);
  transform: translateY(-1px);
}
.btn-icon { width: 14px; height: 14px; }
.btn-large { padding: 13px 26px; font-size: 14px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ============ CARDS (estilo Yangtzé com glassmorphism) ============ */
.card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  overflow: hidden;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  position: relative;
}
.card-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.card-title { font-size: 14px; font-weight: 600; }
.card-subtitle { font-size: 12px; color: var(--text-dim); margin-top: 3px; }
.card-body { padding: 18px; }

/* KPI - estilo Yangtzé com linha amarela */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}
.kpi {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 22px 22px 20px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  transition: all 0.25s;
}
.kpi:hover {
  border-color: var(--glass-border-strong);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(6, 182, 212, 0.2);
}
.kpi-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
}
.kpi-value {
  font-family: 'Inter', sans-serif;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--cyan-light);
  line-height: 1.1;
  text-shadow: 0 0 30px rgba(103, 232, 249, 0.4);
}
/* LINHA AMARELA DECORATIVA (assinatura do estilo Yangtzé) */
.kpi-value::after {
  content: "";
  display: block;
  width: 32px;
  height: 2px;
  background: var(--gold);
  margin-top: 14px;
  border-radius: 1px;
  box-shadow: 0 0 8px rgba(252, 211, 77, 0.4);
}
.kpi-delta { font-size: 12px; color: var(--text-dim); margin-top: 12px; line-height: 1.5; }
.kpi-delta.up { color: var(--green); }
.kpi-delta.down { color: var(--red); }

/* BADGE */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-amber { background: var(--amber-bg); color: var(--gold); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-blue { background: var(--blue-bg); color: var(--blue); }
.badge-cyan { background: var(--cyan-dim); color: var(--cyan-light); }
.badge-neutral { background: rgba(100, 116, 139, 0.2); color: var(--text-dim); }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* TOAST */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 18px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border-strong);
  border-radius: 10px;
  font-size: 13px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 10px;
  backdrop-filter: blur(14px);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { border-color: var(--cyan-light); }
.toast.error { border-color: var(--red); }
.toast svg { width: 16px; height: 16px; }
.toast.success svg { color: var(--cyan-light); }
.toast.error svg { color: var(--red); }

/* SCROLLBAR */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: rgba(103, 232, 249, 0.2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(103, 232, 249, 0.4); }
