/* Paleta de marca VíaNova Entregas (logo) */
:root {
  --brand: #6f2da8;
  --brand-light: #8b4bc7;
  --brand-soft: #c084fc;
  --brand-deep: #4e1e7a;
  --brand-rgb: 111, 45, 168;

  --ink: #111111;
  --ink-soft: #5c5c5c;
  --paper: #f7f5fa;
  --surface: #ffffff;
  --line: #e2d9ec;
  --muted: #d1d3d4;

  --accent: var(--brand);
  --accent-deep: var(--brand-deep);
  --focus: var(--brand);

  --ok: #1f8a5f;
  --err: #c0392b;

  --shadow: 0 18px 50px rgba(17, 17, 17, 0.1);
  --shadow-brand: 0 10px 24px rgba(var(--brand-rgb), 0.28);
  --radius: 18px;
  --font: "Sora", system-ui, sans-serif;
  --display: "Space Grotesk", "Sora", sans-serif;
  --sidebar-w: 280px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--brand);
}

a:hover {
  color: var(--brand-deep);
}

button,
input,
select,
textarea {
  font: inherit;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 0;
  border-radius: 12px;
  padding: 0.85rem 1.15rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand-light), var(--brand-deep));
  color: #fff;
  box-shadow: var(--shadow-brand);
}

.btn-primary:hover {
  filter: brightness(1.06);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
}

.btn-block {
  width: 100%;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field span,
.field > label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  background: var(--surface);
  color: var(--ink);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(var(--brand-rgb), 0.14);
}

.toast {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 1000;
  padding: 0.9rem 1.1rem;
  border-radius: 12px;
  color: #fff;
  font-weight: 500;
  box-shadow: var(--shadow);
  animation: toast-in 0.35s ease;
}

.toast-success {
  background: var(--ok);
}

.toast-error {
  background: var(--err);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  background: linear-gradient(165deg, #0d0614 0%, #2a1248 48%, var(--brand) 135%);
  color: #f3eef8;
  padding: 1.5rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar__brand small {
  display: block;
  opacity: 0.72;
  margin-top: 0.25rem;
  font-size: 0.78rem;
  color: var(--brand-soft);
}

.sidebar__logo {
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.sidebar__logo span {
  color: var(--brand-soft);
}

.sidebar__entregas {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
  opacity: 0.92;
  margin: 0;
  line-height: 1;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  color: #e6d9f5;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-item:hover,
.nav-item.is-active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-soft);
  box-shadow: 0 0 0 4px rgba(var(--brand-rgb), 0.28);
}

.nav-section-label {
  margin-top: 1rem;
  padding: 0 0.9rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.55;
}

.nav-placeholder {
  margin: 0.35rem 0.9rem 0;
  font-size: 0.85rem;
  opacity: 0.65;
}

.sidebar__footer {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.user-chip {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 0.85rem 1rem;
}

.user-chip strong {
  display: block;
}

.user-chip span {
  font-size: 0.82rem;
  opacity: 0.75;
  text-transform: capitalize;
  color: var(--brand-soft);
}

.app-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 1.75rem 0.5rem;
}

.topbar h1 {
  margin: 0.15rem 0 0;
  font-family: var(--display);
  font-size: clamp(1.6rem, 2.5vw, 2.1rem);
  letter-spacing: -0.02em;
  color: var(--ink);
}

.eyebrow {
  margin: 0;
  color: var(--brand);
  font-size: 0.85rem;
  font-weight: 600;
}

.sidebar-toggle {
  display: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--brand);
  border-radius: 10px;
  width: 42px;
  height: 42px;
  cursor: pointer;
}

.content {
  padding: 1rem 1.75rem 2rem;
}

.welcome-block {
  background:
    linear-gradient(120deg, rgba(var(--brand-rgb), 0.1), transparent 42%),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.6rem;
  box-shadow: var(--shadow);
  animation: rise 0.5s ease;
}

.welcome-block h2 {
  margin: 0 0 0.45rem;
  font-family: var(--display);
  color: var(--ink);
}

.welcome-block p {
  margin: 0;
  color: var(--ink-soft);
  max-width: 52ch;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.1rem 1.2rem;
  animation: rise 0.55s ease both;
  border-top: 3px solid var(--brand);
}

.stat:nth-child(2) {
  animation-delay: 0.08s;
}

.stat:nth-child(3) {
  animation-delay: 0.16s;
}

.stat span {
  display: block;
  color: var(--ink-soft);
  font-size: 0.82rem;
  margin-bottom: 0.35rem;
}

.stat strong {
  font-family: var(--display);
  font-size: 1.25rem;
  color: var(--ink);
}

.home-modules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

@media (max-width: 900px) {
  .home-modules {
    grid-template-columns: 1fr;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(86vw, var(--sidebar-w));
    z-index: 50;
    transform: translateX(-105%);
    transition: transform 0.28s ease;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .stat-row {
    grid-template-columns: 1fr;
  }

  .topbar,
  .content {
    padding-left: 1.1rem;
    padding-right: 1.1rem;
  }
}

