/* ===== FlexiERP · tema ===== */
:root {
  --flx-green: #7ed321;
  --flx-green-bright: #a3ff3c;
  --flx-green-dark: #4caf0f;
  --flx-green-deep: #2f7d0a;
  --flx-black: #070a07;
  --flx-sidebar-bg: #0b100b;
  --flx-sidebar-bg-2: #111a10;
  --flx-sidebar-text: #e6efe3;
  --flx-sidebar-muted: #8fa38a;
  --flx-sidebar-hover: rgba(126, 211, 33, .12);
  --flx-body-bg: #f3f6f1;
  --flx-sidebar-width: 260px;

  /* Bootstrap: color primario verde */
  --bs-primary: #4caf0f;
  --bs-primary-rgb: 76, 175, 15;
  --bs-link-color: #3d8f0c;
  --bs-link-color-rgb: 61, 143, 12;
  --bs-link-hover-color: #2f7d0a;
  --bs-link-hover-color-rgb: 47, 125, 10;
  --bs-primary-bg-subtle: #e9f7dc;
  --bs-primary-text-emphasis: #2a6309;
  --bs-primary-border-subtle: #c3e8a0;
  --bs-focus-ring-color: rgba(76, 175, 15, .25);
}

body { background: var(--flx-body-bg); }

/* Botones primarios */
.btn-primary {
  --bs-btn-bg: var(--flx-green-dark);
  --bs-btn-border-color: var(--flx-green-dark);
  --bs-btn-hover-bg: var(--flx-green-deep);
  --bs-btn-hover-border-color: var(--flx-green-deep);
  --bs-btn-active-bg: #286b08;
  --bs-btn-active-border-color: #286b08;
  --bs-btn-disabled-bg: var(--flx-green-dark);
  --bs-btn-disabled-border-color: var(--flx-green-dark);
  --bs-btn-focus-shadow-rgb: 76, 175, 15;
  font-weight: 600;
}
.btn-outline-primary {
  --bs-btn-color: var(--flx-green-deep);
  --bs-btn-border-color: var(--flx-green-dark);
  --bs-btn-hover-bg: var(--flx-green-dark);
  --bs-btn-hover-border-color: var(--flx-green-dark);
  --bs-btn-active-bg: var(--flx-green-dark);
  --bs-btn-active-border-color: var(--flx-green-dark);
  --bs-btn-focus-shadow-rgb: 76, 175, 15;
}
.form-control:focus, .form-select:focus {
  border-color: #9ad75e;
  box-shadow: 0 0 0 .25rem rgba(76, 175, 15, .2);
}
.form-check-input:checked { background-color: var(--flx-green-dark); border-color: var(--flx-green-dark); }
.page-link { color: var(--flx-green-deep); }
.active > .page-link, .page-link.active { background-color: var(--flx-green-dark); border-color: var(--flx-green-dark); }

/* ===== Sidebar ===== */
.sidebar {
  background:
    radial-gradient(120% 40% at 0% 0%, rgba(126, 211, 33, .14) 0%, transparent 60%),
    linear-gradient(180deg, var(--flx-sidebar-bg-2) 0%, var(--flx-sidebar-bg) 45%, var(--flx-black) 100%);
  color: var(--flx-sidebar-text);
  border-right: 1px solid rgba(126, 211, 33, .18);
}
@media (min-width: 992px) {
  .sidebar {
    width: var(--flx-sidebar-width);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
  }
}
.sidebar.offcanvas-lg { --bs-offcanvas-bg: var(--flx-sidebar-bg); --bs-offcanvas-color: var(--flx-sidebar-text); }

.sidebar-brand {
  height: 72px;
  border-bottom: 1px solid rgba(126, 211, 33, .15);
  text-decoration: none;
}
.sidebar-brand img {
  width: 46px; height: 46px; object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(126, 211, 33, .45));
}
.brand-text { font-weight: 800; font-size: 1.35rem; letter-spacing: -.02em; line-height: 1; color: #fff; font-style: italic; }
.brand-text span { color: var(--flx-green-bright); text-shadow: 0 0 12px rgba(163, 255, 60, .35); }
.brand-tagline { display: block; font-size: .68rem; color: var(--flx-sidebar-muted); margin-top: .25rem; letter-spacing: .02em; }

.sidebar-heading {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 700;
  color: var(--flx-green); opacity: .85; padding: 1.1rem .9rem .4rem;
}
.sidebar-nav .nav-link {
  color: var(--flx-sidebar-text);
  border-radius: .6rem;
  padding: .6rem .9rem;
  display: flex; gap: .75rem; align-items: center;
  margin-bottom: 3px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}
.sidebar-nav .nav-link i { font-size: 1.1rem; color: var(--flx-green); transition: color .15s ease; }
.sidebar-nav .nav-link:hover { background: var(--flx-sidebar-hover); color: #fff; transform: translateX(2px); }
.sidebar-nav .nav-link:hover i { color: var(--flx-green-bright); }
.sidebar-nav .nav-link.active {
  background: linear-gradient(90deg, rgba(126, 211, 33, .95) 0%, rgba(76, 175, 15, .95) 100%);
  color: #071006;
  font-weight: 700;
  border-left-color: var(--flx-green-bright);
  box-shadow: 0 4px 18px rgba(126, 211, 33, .3);
}
.sidebar-nav .nav-link.active i { color: #071006; }

.sidebar-mascot {
  margin: auto .9rem 1rem;
  padding: 1rem .9rem .9rem;
  border-radius: .9rem;
  background: linear-gradient(160deg, rgba(126, 211, 33, .16), rgba(126, 211, 33, .03));
  border: 1px solid rgba(126, 211, 33, .22);
  text-align: center;
}
.sidebar-mascot img { width: 96px; filter: drop-shadow(0 4px 14px rgba(126, 211, 33, .45)); animation: flx-float 4s ease-in-out infinite; }
.sidebar-mascot p { font-size: .78rem; color: var(--flx-sidebar-muted); margin: .4rem 0 0; }
.sidebar-mascot strong { color: var(--flx-green-bright); }

@keyframes flx-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .sidebar-mascot img, .hero-mascot { animation: none !important; } }

/* ===== Topbar ===== */
.topbar {
  height: 64px; z-index: 1020;
  background: rgba(255, 255, 255, .92) !important;
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #e3eadf !important;
}
.topbar h1 { font-weight: 700; }
.topbar-brand img { height: 34px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--flx-green-bright), var(--flx-green-dark));
  color: #071006;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(76, 175, 15, .4);
}

/* ===== Hero del dashboard ===== */
.hero {
  position: relative; overflow: hidden;
  border-radius: 1rem;
  background:
    radial-gradient(80% 120% at 100% 0%, rgba(126, 211, 33, .35) 0%, transparent 55%),
    linear-gradient(120deg, #050805 0%, #0f1a0d 60%, #16300c 100%);
  color: #fff;
  padding: 1.6rem 1.8rem;
  min-height: 150px;
  box-shadow: 0 10px 30px rgba(7, 16, 6, .18);
}
.hero h2 { font-weight: 800; }
.hero h2 span { color: var(--flx-green-bright); }
.hero p { color: #b9c9b3; }
.hero-mascot {
  position: absolute; right: 1.2rem; bottom: -18px; height: 170px;
  filter: drop-shadow(0 6px 20px rgba(126, 211, 33, .5));
  animation: flx-float 4s ease-in-out infinite;
}
.hero .btn-primary { --bs-btn-bg: var(--flx-green); --bs-btn-border-color: var(--flx-green); --bs-btn-color: #071006; --bs-btn-hover-bg: var(--flx-green-bright); --bs-btn-hover-border-color: var(--flx-green-bright); --bs-btn-hover-color: #071006; }
@media (max-width: 767.98px) { .hero-mascot { height: 110px; opacity: .35; } }

/* ===== Tarjetas ===== */
.card { border: 0; box-shadow: 0 1px 3px rgba(10, 30, 5, .08); border-radius: .8rem; }
.card-header { background: #fff; border-bottom: 1px solid #e3eadf; font-weight: 600; border-radius: .8rem .8rem 0 0 !important; }
.stat-card { transition: transform .15s ease, box-shadow .15s ease; }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(10, 30, 5, .1); }
.stat-card .stat-icon {
  width: 48px; height: 48px; border-radius: .75rem; display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
}
.stat-card .stat-value { font-size: 1.5rem; font-weight: 700; line-height: 1.2; }

/* Tablas */
.table > :not(caption) > * > * { padding: .65rem .75rem; }
.table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: #5f6f5a; white-space: nowrap; }
.table-hover tbody tr:hover { background: #f6faf2; }

/* Formulario de venta */
.venta-item td { vertical-align: middle; }
.venta-total { font-size: 1.6rem; font-weight: 700; }

/* ===== Login ===== */
.login-page {
  min-height: 100vh;
  background:
    radial-gradient(60% 60% at 15% 20%, rgba(126, 211, 33, .22) 0%, transparent 60%),
    radial-gradient(50% 50% at 90% 90%, rgba(126, 211, 33, .15) 0%, transparent 60%),
    var(--flx-black);
}
.login-shell { max-width: 960px; width: 100%; border-radius: 1.25rem; overflow: hidden; box-shadow: 0 25px 60px rgba(0, 0, 0, .55); border: 1px solid rgba(126, 211, 33, .25); }
.login-visual { background: #000; display: flex; align-items: center; justify-content: center; }
.login-visual img { width: 100%; height: auto; display: block; }
.login-card { border-radius: 0; height: 100%; }
.login-mascot-sm { width: 64px; filter: drop-shadow(0 3px 10px rgba(76, 175, 15, .45)); }

/* Footer */
.app-footer { background: #fff; border-top: 1px solid #e3eadf; }
.app-footer strong span { color: var(--flx-green-dark); }

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