/* SGC Calidad — tema compartido */
:root {
  --sgc-primary: #1b5e20;
  --sgc-primary-light: #2e7d32;
  --sgc-primary-soft: #e8f5e9;
  --sgc-secondary: #455a64;
  --sgc-accent: #6ead3b;
  --sgc-dark: #212529;
  --sgc-bg: #f0f4f2;
  --sgc-card: #ffffff;
  --sgc-error: #d32f2f;
  --sgc-radius: 12px;
  --sgc-shadow: 0 4px 24px rgba(27, 94, 32, 0.08);
  --sgc-shadow-hover: 0 12px 32px rgba(27, 94, 32, 0.14);
  --sgc-transition: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
}

body.sgc-body,
body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}

/* Navbar */
nav.navbar.sgc-navbar,
nav.navbar {
  background: linear-gradient(135deg, #1a1d21 0%, var(--sgc-dark) 55%, #1b3d1f 100%) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  transition: box-shadow var(--sgc-transition);
}

.nav-brand-container {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.status-container {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

#net-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  transition: background var(--sgc-transition), color var(--sgc-transition), transform 0.2s ease;
}

#net-status.net-checking {
  background: rgba(255, 255, 255, 0.12);
  color: #cfd8dc;
}

#net-status.net-online {
  background: rgba(46, 204, 113, 0.2);
  color: #a5f0b8;
  border: 1px solid rgba(46, 204, 113, 0.35);
}

#net-status.net-offline {
  background: rgba(231, 76, 60, 0.2);
  color: #ffb4a9;
  border: 1px solid rgba(231, 76, 60, 0.35);
  animation: sgc-pulse-offline 2s ease-in-out infinite;
}

@keyframes sgc-pulse-offline {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.75; }
}

#usuario {
  border-radius: 8px !important;
  font-size: 0.85rem !important;
}

.navbar a[href*="index"] {
  opacity: 0.9;
  transition: transform var(--sgc-transition), opacity var(--sgc-transition);
}

.navbar a[href*="index"]:hover {
  opacity: 1;
  transform: scale(1.08);
}

/* Cards y contenido */
.container {
  animation: sgc-fade-in 0.45s ease-out;
}

@keyframes sgc-fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card,
.card-sgc {
  background: var(--sgc-card);
  border-radius: var(--sgc-radius);
  box-shadow: var(--sgc-shadow);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(27, 94, 32, 0.06);
  transition: box-shadow var(--sgc-transition), transform var(--sgc-transition);
}

.card:hover,
.card-sgc:hover {
  box-shadow: var(--sgc-shadow-hover);
}

.page-title {
  color: var(--sgc-primary);
  margin: 0 0 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--sgc-primary-soft);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-title i {
  opacity: 0.85;
}

/* Formularios */
.field label {
  letter-spacing: 0.04em;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--sgc-primary-light) !important;
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.15) !important;
  transition: box-shadow var(--sgc-transition), border-color var(--sgc-transition);
}

.btn,
.btn-action {
  transition: transform var(--sgc-transition), box-shadow var(--sgc-transition), background var(--sgc-transition) !important;
}

.btn:hover:not(:disabled),
.btn-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.btn-save {
  background: linear-gradient(135deg, var(--sgc-primary) 0%, var(--sgc-primary-light) 100%) !important;
  border-radius: 10px !important;
  letter-spacing: 0.03em;
}

.btn-add {
  border-radius: 8px !important;
}

/* Index — menú */
.menu-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--sgc-secondary);
  margin: 1.75rem 0 0.75rem;
  padding-left: 4px;
  clear: both;
  width: 100%;
}

.menu-section-title:first-of-type {
  margin-top: 0.5rem;
}

.menu-grid {
  margin-left: -0.5rem;
  margin-right: -0.5rem;
}

.menu-grid > [class*="col-"] {
  display: flex;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.menu-grid .card-menu,
.menu-grid .btn-sync {
  width: 100%;
}

.card-menu {
  position: relative;
  overflow: hidden;
}

.card-menu::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.12) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.card-menu:hover::before {
  transform: translateX(100%);
}

.card-menu .menu-icon {
  font-size: 1.75rem;
  margin-bottom: 0.35rem;
  display: block;
  opacity: 0.95;
}

/* Tablas */
table.dataTable thead th,
table thead th {
  font-weight: 700;
  letter-spacing: 0.04em;
}

.table-responsive {
  border-radius: var(--sgc-radius);
  overflow: hidden;
}

/* Filtros reportes */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 1.25rem;
  padding: 1rem;
  background: var(--sgc-primary-soft);
  border-radius: var(--sgc-radius);
  border: 1px solid rgba(27, 94, 32, 0.1);
}

.filter-bar label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--sgc-secondary);
  text-transform: uppercase;
  display: block;
  margin-bottom: 4px;
}

.filter-bar input[type="date"] {
  padding: 10px 12px;
  border: 1px solid #ced4da;
  border-radius: 8px;
  min-width: 160px;
}

.btn-filter {
  background: var(--sgc-primary) !important;
  color: #fff !important;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
