/* ──────────────────────────────────────────────────────────────
   Ferretería — Hoja de estilos principal
   ────────────────────────────────────────────────────────────── */

:root {
  --sidebar-width: 260px;
  --sidebar-bg: #1a2035;
  --sidebar-text: #c8d0e0;
  --sidebar-active: #ffc107;
  --topbar-height: 56px;
  --brand-color: #ffc107;
  --primary: #2563eb;
  --success: #16a34a;
  --danger: #dc2626;
}

/* ─── Layout base ───────────────────────────────────────────── */
body { background: #f1f5f9; font-family: 'Segoe UI', system-ui, sans-serif; }

.wrapper { min-height: 100vh; }

/* ─── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  transition: width .25s ease;
  position: sticky;
  top: 0;
  flex-shrink: 0;
}

.sidebar-brand { font-size: 1.1rem; color: #fff; border-bottom: 1px solid rgba(255,255,255,.08); }

.sidebar .nav-link {
  color: var(--sidebar-text);
  border-radius: 8px;
  padding: .5rem .75rem;
  font-size: .875rem;
  transition: background .15s, color .15s;
}
.sidebar .nav-link:hover  { background: rgba(255,255,255,.07); color: #fff; }
.sidebar .nav-link.active { background: rgba(255,193,7,.15); color: var(--sidebar-active); font-weight: 600; }
.sidebar .nav-link.active i { color: var(--sidebar-active); }

.nav-section-title { font-size: .65rem; letter-spacing: .08em; margin-top: .5rem; }

/* Avatar círculo */
.avatar-circle {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .8rem; flex-shrink: 0;
}

.tiny { font-size: .7rem; }

/* ─── Topbar ────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-height);
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 100;
}

/* ─── Contenido ─────────────────────────────────────────────── */
.main-content { min-width: 0; }
.page-content { padding-top: 1.25rem; }

/* ─── Tarjetas de estadística ───────────────────────────────── */
.stat-card {
  border: none;
  border-radius: 12px;
  transition: transform .2s, box-shadow .2s;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.1); }
.stat-icon {
  width: 52px; height: 52px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
}

/* ─── Tablas ────────────────────────────────────────────────── */
.table-card { border: none; border-radius: 12px; overflow: hidden; }
.table thead th { background: #f8fafc; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: #64748b; border-bottom: 2px solid #e2e8f0; }
.table tbody tr:hover { background: #f8fafc; }

/* ─── Badges stock ──────────────────────────────────────────── */
.badge-stock-low  { background: #fee2e2; color: #dc2626; }
.badge-stock-ok   { background: #dcfce7; color: #16a34a; }
.badge-stock-warn { background: #fef3c7; color: #d97706; }

/* ─── Auth page ─────────────────────────────────────────────── */
.auth-body {
  background: linear-gradient(135deg, #1a2035 0%, #2d3f6e 100%);
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
}
.auth-card {
  width: 100%; max-width: 420px;
  border: none; border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.auth-logo { font-size: 2.5rem; color: var(--brand-color); }

/* ─── Print ticket ──────────────────────────────────────────── */
@media print {
  .sidebar, .topbar, .btn, footer { display: none !important; }
  .main-content { margin: 0 !important; }
  .ticket { font-family: monospace; font-size: 11px; }
}

/* ─── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { position: fixed; left: -260px; z-index: 1000; transition: left .3s; }
  .sidebar.open { left: 0; }
}
