:root {
  --primary: #0a0b2e;
  --primary-soft: #1d234d;
  --accent: #e30613;
  --accent-dark: #b9020e;
  --accent-soft: rgba(227, 6, 19, 0.09);
  --bg: #edf1f5;
  --surface: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  font-family: 'Inter', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
}

body {
  background-image: linear-gradient(rgba(237, 241, 245, 0.82), rgba(237, 241, 245, 0.82)), url('/Imagen/fondocl.jpeg');
  background-size: cover;
  background-position: center;
}

img {
  max-width: 100%;
  display: block;
}

button, a {
  transition: all 0.2s ease;
}

.dashboard-wrapper {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 280px;
  min-width: 280px;
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-soft) 100%);
  display: flex;
  flex-direction: column;
  box-shadow: 18px 0 32px rgba(10, 11, 46, 0.15);
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-header {
  padding: 1.2rem 1rem 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.logo-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.logo-main {
  color: #fff;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.logo-sub {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 0.85rem 0.7rem;
  overflow-y: auto;
}

.sidebar-nav::-webkit-scrollbar {
  width: 5px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 10px;
}

.nav-section-label {
  color: rgba(255, 255, 255, 0.38);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.9rem 0.6rem 0.4rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  border-radius: 12px;
  padding: 0.72rem 0.85rem;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  font-weight: 600;
  margin-bottom: 0.25rem;
  border: 1px solid transparent;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  text-decoration: none;
}

.nav-item.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px rgba(227, 6, 19, 0.2);
}

.nav-icon {
  width: 18px;
  text-align: center;
  color: inherit;
}

.nav-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.nav-group {
  margin-bottom: 0.25rem;
}

.nav-group-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  border-radius: 12px;
  padding: 0.72rem 0.85rem;
  color: rgba(255, 255, 255, 0.75);
  background: transparent;
  border: 1px solid transparent;
  font-weight: 600;
  font-family: inherit;
  font-size: 0.92rem;
  cursor: pointer;
}

.nav-group-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.nav-group-toggle.active {
  color: #fff;
}

.nav-group-caret {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.45);
  transition: transform 0.2s ease;
}

.nav-group-toggle[aria-expanded="true"] .nav-group-caret {
  transform: rotate(180deg);
}

.nav-group-items {
  padding-left: 1.1rem;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  margin-left: 1.35rem;
}

.nav-item-child {
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
  font-size: 0.88rem;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 0.85rem 1.1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-details {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-name {
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.68rem;
}

.btn-logout {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.76);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.04);
}

.btn-logout:hover {
  background: rgba(227, 6, 19, 0.18);
  color: #fff;
}

.main-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 74px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.4rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 10;
}

.sidebar-toggle {
  border: none;
  background: rgba(10, 11, 46, 0.04);
  color: var(--primary);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: none;
  cursor: pointer;
}

.topbar-breadcrumb {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.topbar-greeting {
  color: var(--muted);
  font-size: 0.82rem;
}

.topbar-greeting strong {
  color: var(--primary);
}

.btn-topbar {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.8rem;
}

.btn-topbar:hover {
  background: var(--accent-dark);
  color: #fff;
  text-decoration: none;
}

.page-content {
  flex: 1;
  padding: 1.5rem;
}

.auth-shell {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background-image: linear-gradient(rgba(10, 11, 46, 0.55), rgba(10, 11, 46, 0.55)), url('/Imagen/Dashboard.jpg');
  background-size: cover;
  background-position: center;
}

.auth-card {
  width: min(460px, 100%);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 2rem;
}

.auth-logo {
  width: 72px;
  height: 72px;
  margin: 0 auto 1rem;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  font-size: 2rem;
  font-weight: 800;
}

.auth-card h1 {
  text-align: center;
  font-weight: 800;
  font-size: clamp(2rem, 4vw, 2.6rem);
  color: var(--primary);
  margin-bottom: 0.4rem;
}

.auth-card p {
  text-align: center;
  color: var(--muted);
  margin-bottom: 1.4rem;
}

.form-control {
  height: 48px;
  border-radius: 12px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  padding: 0.75rem 0.9rem;
}

.form-control:focus {
  border-color: rgba(227, 6, 19, 0.55);
  box-shadow: 0 0 0 0.2rem rgba(227, 6, 19, 0.12);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border: 0;
  border-radius: 12px;
  height: 48px;
  font-weight: 700;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
}

.validation-summary {
  background: rgba(227, 6, 19, 0.08);
  color: var(--accent-dark);
  border: 1px solid rgba(227, 6, 19, 0.12);
  border-radius: 12px;
  padding: 0.8rem 1rem;
  margin-bottom: 1rem;
}

.page-header {
  margin-bottom: 1.2rem;
}

.page-header h1 {
  margin: 0 0 0.35rem;
  color: var(--primary);
  font-weight: 800;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
}

.page-header p {
  margin: 0;
  color: var(--muted);
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.report-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 180px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(17, 24, 39, 0.07);
  border-radius: 18px;
  padding: 1.1rem;
  box-shadow: 0 14px 28px rgba(17, 24, 39, 0.04);
  text-decoration: none;
  color: var(--text);
}

.report-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(17, 24, 39, 0.08);
  text-decoration: none;
  color: var(--text);
}

.report-card .tag {
  display: inline-flex;
  align-self: flex-start;
  background: rgba(227, 6, 19, 0.12);
  color: var(--accent-dark);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 700;
}

.report-card h3 {
  margin: 0.8rem 0 0.5rem;
  font-size: 1.14rem;
  color: var(--primary);
}

.report-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.report-frame {
  width: 100%;
  min-height: 78vh;
  border: 0;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

@media (max-width: 980px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .topbar {
    padding-left: 1rem;
  }
}

@media (max-width: 576px) {
  .topbar {
    height: auto;
    padding: 0.8rem 1rem;
    flex-wrap: wrap;
  }

  .topbar-right {
    width: 100%;
    justify-content: space-between;
  }

  .page-content {
    padding: 1rem;
  }

  .auth-card {
    padding: 1.5rem 1rem;
  }
}