:root {
  --sidebar-width: 240px;
  --sidebar-bg: #1a1f2e;
  --sidebar-text: #a8b2c8;
  --sidebar-active: #ffffff;
  --sidebar-active-bg: rgba(255,255,255,0.1);
  --topbar-h: 56px;
  --brand-color: #8b5e3c;
}

/* ── Layout ────────────────────────────────────── */
body { background: #f4f6fb; margin: 0; }

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

/* ── Sidebar ────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 1000;
  transition: transform 0.25s ease;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  min-height: var(--topbar-h);
}

.brand-text {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 1px;
}

.sidebar-nav {
  list-style: none;
  padding: 12px 0;
  margin: 0;
  flex: 1;
}

.nav-section {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(168,178,200,0.5);
  padding: 12px 18px 4px;
  font-weight: 600;
}

.nav-item .nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13.5px;
  border-radius: 0;
  transition: all 0.15s;
}

.nav-item .nav-link:hover {
  color: var(--sidebar-active);
  background: var(--sidebar-active-bg);
}

.nav-item .nav-link.active {
  color: var(--sidebar-active);
  background: rgba(255,255,255,0.13);
  border-left: 3px solid var(--brand-color);
  padding-left: 15px;
}

.nav-item .nav-link i { font-size: 15px; width: 18px; text-align: center; }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--brand-color);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  flex-shrink: 0;
}

.user-name { font-size: 13px; color: #fff; font-weight: 500; line-height: 1.2; }
.user-role { font-size: 11px; color: var(--sidebar-text); }

.btn-logout {
  margin-left: auto;
  color: var(--sidebar-text);
  font-size: 18px;
  text-decoration: none;
  transition: color 0.15s;
}
.btn-logout:hover { color: #ff6b6b; }

/* ── Main content ────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid #e8eaf0;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.btn-toggle {
  background: none;
  border: none;
  font-size: 20px;
  color: #666;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  display: none;
}

.topbar-right { margin-left: auto; }

.page-content { padding: 24px; flex: 1; }

.page-header { margin-bottom: 20px; }
.page-title { font-size: 20px; font-weight: 600; margin: 0; color: #1a1f2e; }
.page-subtitle { font-size: 13px; margin: 2px 0 0; }

/* ── Stat cards ─────────────────────────────────── */
.stat-card {
  background: #fff;
  border: 1px solid #e8eaf0;
  border-radius: 10px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.stat-icon {
  width: 48px; height: 48px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.bg-primary-soft  { background: #e8f0fe; }
.bg-success-soft  { background: #e6f4ea; }
.bg-warning-soft  { background: #fff8e1; }
.bg-danger-soft   { background: #fce8e6; }

.stat-value { font-size: 24px; font-weight: 700; color: #1a1f2e; line-height: 1; }
.stat-label { font-size: 12px; color: #6c757d; margin-top: 3px; }

/* ── Login ──────────────────────────────────────── */
.login-body {
  background: linear-gradient(135deg, #1a1f2e 0%, #2d3550 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-wrapper { width: 100%; max-width: 400px; }

.login-card {
  background: #fff;
  border-radius: 14px;
  padding: 36px 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-logo { text-align: center; margin-bottom: 16px; }
.login-title { font-size: 14px; text-align: center; color: #333; font-weight: 600; margin-bottom: 4px; }
.login-subtitle { font-size: 12px; text-align: center; color: #999; margin-bottom: 24px; }

.btn-login {
  background: var(--brand-color);
  border-color: var(--brand-color);
  font-weight: 500;
  padding: 10px;
}
.btn-login:hover { background: #7a5232; border-color: #7a5232; }

.login-footer { text-align: center; font-size: 11px; color: #bbb; margin-top: 20px; margin-bottom: 0; }

/* ── Cards genéricas ────────────────────────────── */
.card { border: 1px solid #e8eaf0; border-radius: 10px; }
.card-header { background: #fff; border-bottom: 1px solid #e8eaf0; padding: 14px 18px; }

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .btn-toggle { display: block; }
}
