:root {
  --em-primary: #0d3b66;
  --em-accent: #f4a261;
  --em-sidebar-w: 250px;
}

body {
  background-color: #f4f6f9;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

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

.sidebar {
  width: var(--em-sidebar-w);
  background: var(--em-primary);
  color: #fff;
  flex-shrink: 0;
  min-height: 100vh;
  position: sticky;
  top: 0;
  align-self: flex-start;
  overflow-y: auto;
  max-height: 100vh;
}

.sidebar-brand {
  padding: 1.1rem 1.25rem;
  font-size: 1.15rem;
  font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,.15);
  color: #fff;
}

.sidebar .nav-section {
  display: block;
  padding: .5rem 1.25rem .25rem;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: rgba(255,255,255,.5);
}

.sidebar .nav-link {
  color: rgba(255,255,255,.85);
  padding: .55rem 1.25rem;
  font-size: .92rem;
  border-left: 3px solid transparent;
}

.sidebar .nav-link i {
  width: 1.3rem;
  display: inline-block;
}

.sidebar .nav-link:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}

.sidebar .nav-link.active {
  background: rgba(255,255,255,.12);
  border-left-color: var(--em-accent);
  color: #fff;
  font-weight: 600;
}

.main-content {
  flex-grow: 1;
  min-width: 0;
}

.topbar {
  background: #fff;
  border-bottom: 1px solid #e3e6ea;
  padding: .85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 10;
}

.page-title {
  font-size: 1.25rem;
  margin: 0;
  color: var(--em-primary);
  font-weight: 600;
}

.page-content {
  padding: 1.5rem;
}

.card {
  border: none;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

.kpi-card {
  border-radius: .6rem;
  color: #fff;
  padding: 1.1rem 1.3rem;
}

.kpi-card .kpi-value {
  font-size: 1.8rem;
  font-weight: 700;
}

.kpi-card .kpi-label {
  font-size: .8rem;
  opacity: .9;
}

.bg-em-blue { background: linear-gradient(135deg, #0d3b66, #1d5b9b); }
.bg-em-orange { background: linear-gradient(135deg, #e76f51, #f4a261); }
.bg-em-green { background: linear-gradient(135deg, #2a9d8f, #52b788); }
.bg-em-red { background: linear-gradient(135deg, #9d0208, #d00000); }

.table thead th {
  background: #eef1f5;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: #556;
  white-space: nowrap;
}

.badge-vencido { background: #d00000; }
.badge-por-vencer { background: #f4a261; color: #212529; }
.badge-vigente { background: #2a9d8f; }

.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0d3b66, #1d5b9b);
}

.login-card {
  width: 100%;
  max-width: 380px;
  border-radius: .75rem;
  overflow: hidden;
}

.foto-thumb {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: .4rem;
  border: 1px solid #dee2e6;
}

@media (max-width: 991px) {
  .sidebar {
    position: fixed;
    left: -260px;
    z-index: 1030;
    transition: left .2s ease;
    height: 100vh;
  }
  .sidebar.show { left: 0; }
}
