:root {
  --gz-navy: #003762;
  --gz-blue: #009DFF;
  --gz-blue-dark: #007ACC;
  --gz-orange: #FF6600;
  --gz-bg: #f4f6f9;
  --sidebar-w: 250px;
}

body { background: var(--gz-bg); font-size: .925rem; }

.app-shell { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: #fff;
  border-right: 1px solid #e3e7ee;
}
@media (min-width: 992px) {
  .sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; flex-shrink: 0; }
}
.sidebar-logo { padding: 1rem; text-align: center; border-bottom: 1px solid #eef1f5; }
.sidebar-logo img { max-width: 100%; max-height: 80px; }
.sidebar-nav { padding: .5rem 0 5rem; }
.side-group {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .06em;
  color: #8a94a6; padding: .9rem 1.25rem .3rem;
}
.side-link {
  display: flex; align-items: center; gap: .65rem;
  padding: .45rem 1.25rem; color: #2b3445; text-decoration: none;
  border-left: 3px solid transparent;
}
.side-link:hover { background: #f1f6fb; color: var(--gz-navy); }
.side-link.active { background: #e8f4ff; color: var(--gz-navy); border-left-color: var(--gz-blue); font-weight: 600; }
.side-link i { width: 1.1rem; text-align: center; }

/* Contenido */
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 1rem;
  background: #fff; border-bottom: 1px solid #e3e7ee; padding: .6rem 1.25rem;
}
.brand { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { color: var(--gz-navy); font-weight: 800; font-size: 1.35rem; letter-spacing: .04em; }
.brand-sub { color: var(--gz-navy); font-size: .8rem; opacity: .8; }
.page { padding: 1.25rem; flex: 1; padding-bottom: 5rem; }
.page-title { font-size: 1.4rem; color: var(--gz-navy); margin-bottom: 1rem; font-weight: 700; }

.card { border: 1px solid #e3e7ee; border-radius: .6rem; }
.card-header { background: #fff; font-weight: 600; color: var(--gz-navy); }

/* Tarjetas de métricas */
.metric { background: #fff; border: 1px solid #e3e7ee; border-radius: .6rem; padding: .9rem 1rem; height: 100%; }
.metric .label { color: #6b7385; font-size: .8rem; }
.metric .value { font-size: 1.35rem; font-weight: 700; color: #1d2433; font-variant-numeric: tabular-nums; }
.metric .sub { font-size: .78rem; color: #6b7385; }
.metric.pos .value { color: #198754; }
.metric.neg .value { color: #dc3545; }
.metric.warn { border-color: #ffc107; background: #fffaf0; }

/* Obras */
.obra-card { border-radius: .6rem; padding: .8rem 1rem; height: 100%; border: 1px solid transparent; }
.obra-card.pos { background: #d4edda; border-color: #b9dfc3; }
.obra-card.neg { background: #f8d7da; border-color: #efc2c6; }
.obra-card h3 { font-size: .95rem; font-weight: 700; margin-bottom: .4rem; }
.obra-card p { margin: 0; font-size: .85rem; font-variant-numeric: tabular-nums; }

/* Tablas */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid #e3e7ee; border-radius: .6rem; }
.table-wrap.scroll { max-height: 65vh; overflow-y: auto; }
.table-wrap table { margin: 0; }
.table thead th {
  background: #f1f4f8; color: #3a4457; font-weight: 600; font-size: .78rem;
  text-transform: uppercase; letter-spacing: .02em; white-space: nowrap;
  position: sticky; top: 0; z-index: 1;
}
.table td { vertical-align: middle; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tfoot td { font-weight: 700; background: #f8f9fb; }
.folio { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .75rem; }
.nowrap { white-space: nowrap; }

.form-label { font-size: .8rem; color: #4a5468; margin-bottom: .2rem; }
.filters { background: #fff; border: 1px solid #e3e7ee; border-radius: .6rem; padding: .75rem 1rem; margin-bottom: 1rem; }

.bulk-bar {
  background: var(--gz-navy); color: #fff; border-radius: .6rem; padding: .6rem 1rem;
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
}

/* Footer como en la versión anterior */
.footer-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 10;
  display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: center; text-align: center;
  background: var(--gz-blue); color: #fff; padding: 6px; font-size: 12px;
  transition: background-color .3s ease;
}
.footer-bar:hover { background: var(--gz-blue-dark); }
@media (max-width: 576px) { .footer-bar { grid-template-columns: 1fr; } .footer-bar > div:first-child { display: none; } }

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem;
  background: linear-gradient(135deg, #e8f4ff 0%, #f4f6f9 60%); }
.login-card { width: 100%; max-width: 380px; }

.btn-primary { background: var(--gz-navy); border-color: var(--gz-navy); }
.btn-primary:hover { background: #00284a; border-color: #00284a; }

.chart-box { position: relative; height: 340px; }
.chart-box.sm { height: 280px; }

@media print {
  .sidebar, .topbar, .footer-bar, .filters, .btn, form .bulk-bar { display: none !important; }
  .page { padding: 0; }
}

@media (max-width: 576px) {
  .metric .value { font-size: 1.1rem; }
  .page { padding: .9rem; }
  .brand-sub { font-size: .7rem; }
}
