/* Ruta Verde Dashboard — Shared Stylesheet */

:root {
  --rv-green:      #2e7d32;
  --rv-green-lt:   #4caf50;
  --rv-green-bg:   #e8f5e9;
  --rv-teal:       #00695c;
  --rv-amber:      #f57c00;
  --rv-red:        #c62828;
  --rv-blue:       #1565c0;
  --rv-dark:       #1a1a2e;
  --rv-text:       #212121;
  --rv-muted:      #757575;
  --rv-border:     #e0e0e0;
  --rv-surface:    #ffffff;
  --rv-bg:         #f5f7f5;
  --rv-sidebar:    #1b5e20;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,.10);

  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--rv-bg); color: var(--rv-text); min-height: 100vh; }
a { color: var(--rv-green); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ─────────────────────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 220px;
  background: var(--rv-sidebar);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 100;
}
.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.sidebar-logo .logo-line1 { font-size: 11px; opacity: .65; letter-spacing: .08em; text-transform: uppercase; }
.sidebar-logo .logo-line2 { font-size: 18px; font-weight: 700; color: #a5d6a7; margin-top: 2px; }

.sidebar nav { flex: 1; padding: 16px 0; }
.sidebar nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px;
  color: rgba(255,255,255,.8);
  font-size: 13px; font-weight: 500;
  transition: background .15s;
  border-left: 3px solid transparent;
}
.sidebar nav a:hover, .sidebar nav a.active {
  background: rgba(255,255,255,.10);
  color: #fff;
  border-left-color: #a5d6a7;
  text-decoration: none;
}
.sidebar-footer {
  padding: 16px 20px;
  font-size: 11px;
  opacity: .5;
  border-top: 1px solid rgba(255,255,255,.12);
}

.main { margin-left: 220px; flex: 1; }

.topbar {
  background: var(--rv-surface);
  border-bottom: 1px solid var(--rv-border);
  padding: 16px 32px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow-sm);
}
.topbar-title { font-size: 16px; font-weight: 600; }
.topbar-meta { font-size: 12px; color: var(--rv-muted); }

.content { padding: 28px 32px; }

/* ── Cards ───────────────────────────────────────────────────────────── */
.card {
  background: var(--rv-surface);
  border-radius: 10px;
  border: 1px solid var(--rv-border);
  box-shadow: var(--shadow-sm);
  padding: 24px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--rv-surface);
  border-radius: 10px;
  border: 1px solid var(--rv-border);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.stat-card .label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--rv-muted); }
.stat-card .value { font-size: 28px; font-weight: 700; color: var(--rv-green); margin-top: 4px; }
.stat-card .sub   { font-size: 11px; color: var(--rv-muted); margin-top: 2px; }

.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}
.chart-card {
  background: var(--rv-surface);
  border-radius: 10px;
  border: 1px solid var(--rv-border);
  padding: 20px;
}
.chart-card h3 { font-size: 13px; font-weight: 600; margin-bottom: 16px; color: var(--rv-dark); }

/* ── Table / Grid ────────────────────────────────────────────────────── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.section-header h2 { font-size: 15px; font-weight: 600; }

/* Grid.js overrides */
.gridjs-container { font-size: 13px; }
.gridjs-th { background: var(--rv-bg) !important; font-size: 12px !important; }
.gridjs-tr:hover td { background: var(--rv-green-bg) !important; }
.gridjs-pagination { margin-top: 12px; }

/* ── Badges ──────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px; font-weight: 600;
}
.badge-green  { background: #c8e6c9; color: #1b5e20; }
.badge-amber  { background: #ffe0b2; color: #e65100; }
.badge-red    { background: #ffcdd2; color: #b71c1c; }
.badge-blue   { background: #bbdefb; color: #0d47a1; }
.badge-teal   { background: #b2dfdb; color: #004d40; }
.badge-gray   { background: #f5f5f5; color: #616161; }

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px; font-weight: 500;
  cursor: pointer; border: none; transition: background .15s;
}
.btn-primary { background: var(--rv-green); color: #fff; }
.btn-primary:hover { background: #1b5e20; }
.btn-outline { background: transparent; color: var(--rv-green); border: 1px solid var(--rv-green); }
.btn-outline:hover { background: var(--rv-green-bg); }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .content { padding: 16px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Investors page ──────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #1b5e20 0%, #2e7d32 60%, #00695c 100%);
  color: #fff;
  padding: 48px 40px;
  border-radius: 12px;
  margin-bottom: 32px;
}
.hero h1 { font-size: 28px; font-weight: 800; line-height: 1.2; }
.hero p { margin-top: 12px; opacity: .85; font-size: 15px; max-width: 600px; }
.hero .kpi-row { display: flex; gap: 32px; margin-top: 28px; flex-wrap: wrap; }
.hero .kpi { }
.hero .kpi .n { font-size: 36px; font-weight: 800; color: #a5d6a7; }
.hero .kpi .l { font-size: 12px; opacity: .75; margin-top: 2px; }

/* ── No-sidebar pages (investors) ────────────────────────────────────── */
.page-investors { max-width: 1100px; margin: 0 auto; padding: 40px 24px; }
.page-investors .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.page-investors .grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 24px; }
@media (max-width: 768px) {
  .page-investors .grid-2, .page-investors .grid-3 { grid-template-columns: 1fr; }
}
