:root {
  --mve-guinda: #9d2449;
  --mve-guinda-dark: #7a1c39;
  --mve-accent: #d9a441;
  --mve-sidebar-w: 250px;
}

body {
  background-color: #f4f5f7;
}

/* ---------------------------------------------------------------------
 * Layout general: sidebar + topbar (basado en el diseño de referencia
 * "EM Freight - Gestión de Trámites", adaptado a la marca guinda de MVE).
 * ------------------------------------------------------------------- */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--mve-sidebar-w);
  background: var(--mve-guinda);
  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;
  text-decoration: none;
  display: block;
}

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

.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(--mve-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: 1020;
}

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

.page-content {
  padding: 1.5rem;
}

.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-mve-guinda { background: linear-gradient(135deg, var(--mve-guinda), var(--mve-guinda-dark)); }
.bg-mve-accent { background: linear-gradient(135deg, #c98a2e, var(--mve-accent)); }
.bg-mve-green  { background: linear-gradient(135deg, #2a9d8f, #52b788); }
.bg-mve-red    { background: linear-gradient(135deg, #9d0208, #d00000); }

@media (max-width: 991px) {
  .sidebar {
    position: fixed;
    left: calc(var(--mve-sidebar-w) * -1);
    z-index: 1030;
    transition: left .2s ease;
    height: 100vh;
  }
  .sidebar.show { left: 0; }
  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 1025;
  }
  .sidebar-backdrop.show { display: block; }
}

.app-navbar {
  background-color: var(--mve-guinda);
}

.app-navbar .nav-link:hover {
  color: #fff;
}

.btn-primary {
  background-color: var(--mve-guinda);
  border-color: var(--mve-guinda);
}

.btn-primary:hover, .btn-primary:focus {
  background-color: var(--mve-guinda-dark);
  border-color: var(--mve-guinda-dark);
}

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

.wizard-steps .step {
  flex: 1;
  text-align: center;
  padding: .5rem;
  border-bottom: 3px solid #dee2e6;
  color: #868e96;
  font-weight: 600;
}

.wizard-steps .step.active {
  border-color: var(--mve-guinda);
  color: var(--mve-guinda);
}

.wizard-steps .step.done {
  border-color: #198754;
  color: #198754;
}

.table-sm td, .table-sm th {
  vertical-align: middle;
}

.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--mve-guinda) 0%, #4a1424 100%);
}

.login-card {
  max-width: 420px;
  width: 100%;
}
