:root {
  --nav: #04101d;
  --nav-2: #081d34;
  --blue: #07336f;
  --blue-2: #0b58b0;
  --cyan: #5fb7d8;
  --steel: #7f91a6;
  --silver: #d8e1eb;
  --ink: #081220;
  --muted: #556273;
  --line: #cfd9e6;
  --soft: #edf2f7;
  --panel: #ffffff;
  --panel-2: #f6f8fb;
  --danger: #a12929;
  --ok: #1f6b4a;
  --radius: 8px;
  --font-text: "Segoe UI Variable Text", "Segoe UI", "Aptos", "Calibri", Arial, sans-serif;
  --font-title: "Segoe UI Variable Display", "Segoe UI", "Aptos Display", "Aptos", Arial, sans-serif;
  --font-logo-like: "Segoe UI Variable Display", "Segoe UI", "Aptos Display", "Aptos", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% 0%, rgba(95, 183, 216, 0.16), transparent 30%),
    linear-gradient(180deg, #f7f9fc 0%, var(--soft) 100%);
  color: var(--ink);
  font-family: var(--font-text);
  line-height: 1.4;
  font-weight: 400;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button,
input,
select,
textarea {
  font-family: var(--font-text);
}

button {
  appearance: none;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  display: grid;
  height: 100vh;
  grid-template-rows: auto 1fr auto;
  background:
    linear-gradient(150deg, rgba(95, 183, 216, 0.14), transparent 32%),
    linear-gradient(180deg, var(--nav), var(--nav-2));
  color: #fff;
  overflow-y: auto;
}

.brand-logo {
  display: grid;
  gap: 10px;
  padding: 28px 24px 24px;
  border-bottom: 1px solid rgba(216, 225, 235, 0.10);
  color: #fff;
}

.brand-logo:hover {
  text-decoration: none;
}

.brand-logo img {
  display: block;
  width: min(214px, 100%);
  height: auto;
  object-fit: contain;
}

.brand-logo small {
  color: #d7e7f3;
  font-family: var(--font-text);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
}

.side-nav {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 22px 16px;
}

.nav-title {
  padding: 0 10px 8px;
  color: #9eb4c9;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0;
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  border-radius: 6px;
  padding: 0 12px;
  color: #dceaf6;
  font-weight: 600;
}

.side-nav a.active,
.side-nav a:hover {
  background: linear-gradient(135deg, #0b315d, #0f4c91);
  color: #fff;
  text-decoration: none;
  box-shadow: inset 3px 0 0 var(--cyan);
}

.nav-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid #355173;
  border-radius: 6px;
  color: #dce8f7;
  font-size: 0.78rem;
  font-weight: 700;
}

.side-footer {
  display: grid;
  gap: 6px;
  margin: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  color: #95a3b7;
  font-size: 0.85rem;
  text-align: center;
}

.workspace {
  min-width: 0;
  overflow-x: hidden;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 82px;
  padding: 16px 30px;
  background: rgba(250, 252, 255, 0.95);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.page-title {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 14px;
}

.page-title h1,
.page-title p {
  margin: 0;
}

.page-title h1 {
  font-family: var(--font-title);
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  font-weight: 700;
  line-height: 1.15;
  color: #06101e;
}

.page-title p {
  margin-top: 4px;
  color: #52647a;
  font-size: 0.84rem;
  font-weight: 500;
}

.shield-mark {
  display: block;
  width: 32px;
  height: 32px;
  border: 2px solid var(--blue);
  border-radius: 8px;
  background: linear-gradient(135deg, #eff5ff, #ffffff);
}

.account {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 260px;
}

.account strong,
.account small {
  display: block;
}

.account small {
  color: var(--muted);
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 34%, #172235 0 16%, transparent 17%),
    radial-gradient(circle at 50% 82%, #172235 0 28%, transparent 29%),
    #dce2ea;
}

.logout-link {
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 700;
}

.menu-button {
  display: none;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.content {
  width: min(calc(100% - 48px), 1480px);
  margin: 24px auto 42px;
}

.page-stack {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.section-head h2 {
  margin: 2px 0 0;
  font-family: var(--font-title);
  font-size: 1.35rem;
  font-weight: 700;
  color: #06101e;
}

.eyebrow,
dt {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
}

.date-box {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 14px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}

.panel,
.metric-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 12px 28px rgba(8, 18, 32, 0.06);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric-card {
  display: grid;
  min-height: 132px;
  grid-template-rows: auto minmax(42px, auto) auto;
  gap: 8px;
  padding: 18px;
  overflow: hidden;
}

.metric-card span {
  color: #53667c;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: var(--ink);
  font-size: clamp(1.55rem, 2.4vw, 2rem);
  font-family: var(--font-title);
  font-weight: 700;
  line-height: 1.12;
  text-overflow: ellipsis;
}

.metric-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.chart-card,
.table-panel,
.request-panel,
.compact-panel,
.detail-card,
.status-panel {
  padding: 18px;
}

.chart-card {
  display: grid;
  min-height: 300px;
  align-content: start;
  gap: 18px;
}

.chart-card h2,
.table-head h2,
.compact-panel h2,
.status-panel h2,
.detail-card h2 {
  margin: 0;
  font-family: var(--font-title);
  font-size: 1.06rem;
  font-weight: 700;
  color: #06101e;
}

.bar-chart {
  display: grid;
  grid-template-columns: repeat(5, minmax(42px, 1fr));
  gap: 12px;
  min-height: 220px;
  padding-top: 6px;
}

.bar-item {
  display: grid;
  grid-template-rows: 24px 1fr 22px;
  gap: 8px;
  min-width: 0;
  text-align: center;
}

.bar-value,
.bar-name {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-value {
  color: var(--ink);
  font-weight: 800;
}

.bar-track {
  display: flex;
  align-items: end;
  justify-content: center;
  min-height: 150px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, var(--panel-2));
}

.bar {
  width: min(34px, 70%);
  min-height: 4px;
  border-radius: 4px 4px 0 0;
  background: var(--blue);
}

.reason-list,
.trend-list {
  display: grid;
  gap: 14px;
}

.reason-row,
.trend-list div {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 10px;
}

.trend-list div {
  grid-template-columns: 56px minmax(0, 1fr) 64px;
}

.reason-row p,
.trend-list span,
.trend-list strong {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reason-row p,
.trend-list span {
  color: var(--muted);
  font-size: 0.88rem;
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--blue);
}

.reason-2 {
  background: #315f9e;
}

.reason-3 {
  background: #7c8796;
}

.progress {
  height: 7px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7edf5;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 6px;
  padding: 0 14px;
  font-family: var(--font-title);
  font-weight: 600;
  cursor: pointer;
}

.primary-button {
  border: 1px solid #05295d;
  background: linear-gradient(135deg, #05295d, #0b58b0);
  color: #fff;
  box-shadow: 0 8px 18px rgba(7, 51, 111, 0.18);
}

.secondary-button {
  border: 1px solid #b6c5d5;
  background: linear-gradient(180deg, #ffffff, #f3f7fb);
  color: #102033;
}

.filters,
.request-form,
.user-form {
  display: grid;
  gap: 12px;
}

.is-hidden {
  display: none !important;
}

.request-panel-inline {
  scroll-margin-top: 96px;
}

.filters {
  grid-template-columns: minmax(220px, 1fr) 220px auto;
  align-items: end;
  margin-bottom: 14px;
}

.request-form {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.request-submit {
  justify-self: start;
  align-self: end;
  width: auto;
  min-width: 158px;
  min-height: 36px;
  padding: 0 16px;
}

.user-form {
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  margin-top: 14px;
}

.system-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  align-items: end;
  gap: 12px;
  margin-top: 14px;
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  color: #1b2738;
}

.check-row input {
  width: auto;
  min-height: auto;
}

.form-message {
  margin-top: 12px;
  border-radius: 6px;
  padding: 10px 12px;
  font-weight: 600;
}

.form-message-error {
  border: 1px solid #efc7c7;
  background: #fff0f0;
  color: var(--danger);
}

.form-message-ok {
  border: 1px solid #b8ddca;
  background: #e8f6ef;
  color: var(--ok);
}

.full-field {
  grid-column: span 3;
}

label {
  display: grid;
  gap: 6px;
  color: #455569;
  font-size: 0.88rem;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid #bdcad9;
  border-radius: 6px;
  background: #fbfdff;
  color: var(--ink);
  padding: 8px 10px;
  font-weight: 400;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(10, 58, 130, 0.12);
  outline: none;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
}

.small-table table {
  min-width: 640px;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  background: linear-gradient(180deg, #f9fbfe, #eef3f8);
  color: #142338;
  font-family: var(--font-title);
  font-size: 0.84rem;
  font-weight: 600;
}

.actions-heading {
  min-width: 150px;
}

td {
  color: #1b2738;
  font-family: var(--font-text);
  font-size: 0.9rem;
  font-weight: 400;
}

.code-link {
  color: var(--blue);
}

.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 82px;
  min-height: 24px;
  border-radius: 5px;
  padding: 3px 9px;
  background: #dceafd;
  color: #082f69;
  font-size: 0.78rem;
  font-family: var(--font-title);
  font-weight: 600;
}

.status-completada {
  background: #dff1e8;
  color: var(--ok);
}

.status-listo {
  background: #e3efff;
  color: #0a3a82;
}

.status-entregado {
  background: #dff1e8;
  color: var(--ok);
}

.status-en_proceso {
  background: #eef2f8;
  color: #344257;
}

.status-cancelada {
  background: #f8dddd;
  color: var(--danger);
}

.row-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  width: 132px;
  min-width: 132px;
}

.row-actions form,
.delivery-actions form {
  margin: 0;
}

.status-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  min-height: 32px;
  border: 2px solid #9eb9dc;
  border-radius: 999px;
  background:
    linear-gradient(#ffffff, #f8fbff) padding-box,
    linear-gradient(135deg, #5fb7d8, #07336f) border-box;
  color: #0e2034;
  padding: 0 12px;
  font-size: 0.78rem;
  font-family: var(--font-title);
  font-weight: 600;
  cursor: pointer;
  box-shadow: inset 0 0 0 3px #f5f8fc, 0 1px 2px rgba(7, 21, 39, 0.08);
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}

.status-button:hover,
.delivery-button:hover {
  transform: translateY(-1px);
}

.status-button:hover {
  border-color: var(--blue);
  box-shadow: inset 0 0 0 3px #eef5ff, 0 5px 12px rgba(10, 58, 130, 0.14);
}

.button-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
}

.status-button-en_proceso {
  border-color: #c9d5e5;
  background: #ffffff;
  color: #344257;
}

.status-button-listo {
  border-color: #8fb2e4;
  background: linear-gradient(180deg, #ffffff, #eef6ff);
  color: var(--blue);
}

.status-button-entregado {
  border-color: #95cdae;
  background: linear-gradient(180deg, #ffffff, #eef9f3);
  color: var(--ok);
}

.delivery-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 0 14px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.delivery-button.status-button-en_proceso {
  box-shadow: inset 0 0 0 1px #d8e0ea;
}

.delivery-button.status-button-listo {
  box-shadow: inset 0 0 0 1px #bfd2ed;
}

.delivery-button.status-button-entregado {
  box-shadow: inset 0 0 0 1px #b7dfca;
}

.empty-row {
  height: 90px;
  color: var(--muted);
  text-align: center;
}

.code-grid,
.settings-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.code-grid article,
.settings-grid article {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px;
  background: var(--panel-2);
}

.code-grid span,
.settings-grid span {
  color: var(--muted);
}

.settings-grid strong {
  overflow-wrap: anywhere;
}

.share-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 16px;
  padding: 18px;
}

.share-url {
  margin: 8px 0 0;
  border: 1px solid #b8c8da;
  border-radius: 6px;
  background: #f8fbff;
  color: #081220;
  padding: 12px 14px;
  font-family: "Consolas", "Segoe UI Mono", monospace;
  font-size: clamp(0.92rem, 2vw, 1.05rem);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.share-alert {
  display: grid;
  gap: 3px;
  margin-top: 10px;
  border: 1px solid #f0d5a4;
  border-radius: 6px;
  background: #fff8e8;
  color: #6f4a10;
  padding: 10px 12px;
}

.share-alert strong,
.share-alert span {
  display: block;
}

.share-alert-ok {
  border-color: #b8ddca;
  background: #e8f6ef;
  color: var(--ok);
}

.share-copy {
  min-width: 130px;
}

.detail-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
}

.back-link {
  display: inline-flex;
  margin-bottom: 14px;
  font-weight: 800;
}

.detail-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.detail-grid div,
.notes,
.history article {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 13px;
  background: var(--panel-2);
}

dd {
  margin: 5px 0 0;
  overflow-wrap: anywhere;
}

.notes {
  margin-top: 14px;
}

.notes h3,
.notes p {
  margin: 0;
}

.notes p {
  margin-top: 8px;
  color: var(--muted);
}

.status-panel {
  display: grid;
  align-content: start;
  gap: 20px;
}

.status-panel form,
.history {
  display: grid;
  gap: 12px;
}

.delivery-actions {
  display: grid;
  gap: 14px;
}

.muted-copy {
  margin: 0;
  color: var(--muted);
}

.small-action {
  min-height: 30px;
  padding: 0 10px;
  font-size: 0.82rem;
}

.history strong,
.history span {
  display: block;
}

.history span,
.history p {
  color: var(--muted);
}

.history p {
  margin: 6px 0 0;
}

.login-body {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 16%, rgba(95, 183, 216, 0.24), transparent 28%),
    radial-gradient(circle at 84% 80%, rgba(11, 88, 176, 0.22), transparent 30%),
    linear-gradient(135deg, #030a13, #071a31 58%, #04101d);
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(300px, 420px);
  width: min(900px, 100%);
  overflow: hidden;
  border: 1px solid rgba(216, 225, 235, 0.18);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.30);
}

.login-brand {
  display: grid;
  align-content: center;
  gap: 14px;
  min-height: 460px;
  padding: 42px;
  background:
    linear-gradient(145deg, rgba(95, 183, 216, 0.16), transparent 42%),
    linear-gradient(180deg, #05101d, #08213d);
  color: #fff;
}

.login-logo {
  display: block;
  width: min(330px, 100%);
  height: auto;
  object-fit: contain;
}

.login-brand h1,
.login-brand p,
.login-card h2 {
  margin: 0;
}

.login-brand h1,
.login-card h2 {
  font-family: var(--font-title);
  font-weight: 700;
}

.login-brand h1 {
  max-width: 340px;
  font-family: var(--font-title);
  font-size: clamp(1.85rem, 3.2vw, 2.55rem);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.18;
  color: #f8fbff;
  text-transform: none;
  text-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.login-brand p {
  color: #d5e7f2;
  max-width: 360px;
  font-family: var(--font-text);
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.45;
}

.login-card {
  display: grid;
  align-content: center;
  gap: 18px;
  padding: 42px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 253, 0.98));
}

.login-card h2 {
  color: #06101e;
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.15;
}

.login-card form {
  display: grid;
  gap: 14px;
}

.login-error {
  border: 1px solid #efc7c7;
  border-radius: 6px;
  padding: 10px;
  background: #fff0f0;
  color: var(--danger);
  font-weight: 700;
}

.demo-users {
  display: grid;
  gap: 6px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  color: var(--muted);
  font-size: 0.88rem;
}

.demo-users p {
  margin: 0;
}

@media (max-width: 1180px) {
  .metric-grid,
  .chart-grid,
  .code-grid,
  .settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    z-index: 50;
    width: min(280px, 84vw);
    transform: translateX(-105%);
    transition: transform 160ms ease;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .topbar {
    min-height: 72px;
    padding: 12px 16px;
  }

  .account {
    min-width: auto;
  }

  .account small,
  .avatar {
    display: none;
  }

  .detail-page,
  .request-form,
  .user-form,
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-brand {
    min-height: auto;
  }

  .full-field {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  .content {
    width: min(calc(100% - 20px), 1480px);
    margin-top: 14px;
  }

  .section-head,
  .table-head {
    align-items: stretch;
    flex-direction: column;
  }

  .page-title h1 {
    font-size: 1rem;
  }

  .page-title p,
  .shield-mark {
    display: none;
  }

  .metric-grid,
  .chart-grid,
  .filters,
  .detail-grid,
  .code-grid,
  .settings-grid,
  .share-panel,
  .system-form {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: 118px;
  }

  .login-card,
  .login-brand {
    padding: 28px;
  }
}
