:root {
  --navy: #000b2a;
  --blue: #126ee6;
  --ice: #edf5ff;
  --ink: #14223d;
  --muted: #66758d;
  --line: #e2eaf3;
  --good: #008b74;
  --warn: #c97c05;
  --bad: #c94747;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: Arial, sans-serif;
  color: var(--ink);
  background: #f5f8fc;
}
h1,
h2,
h3 {
  font-family: Georgia, serif;
}
.hidden {
  display: none !important;
}
.brand {
  font: bold 30px Arial;
  color: var(--navy);
  letter-spacing: -2px;
}
.brand span {
  color: var(--blue);
}
button,
.btn {
  border: 0;
  border-radius: 6px;
  padding: 10px 14px;
  background: var(--navy);
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  text-decoration: none;
}
.btn.alt {
  background: #fff;
  color: var(--navy);
  border: 1px solid #c5d2e1;
}
.login {
  min-height: 100vh;
  background: linear-gradient(130deg, #eaf4ff, #fff 65%);
  display: grid;
  place-items: center;
  padding: 25px;
}
.login-card {
  width: min(500px, 100%);
  padding: 30px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 15px 35px #0d25461a;
}
.login-card .brand {
  display: block;
  margin-bottom: 35px;
}
.tag {
  color: var(--blue);
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 1.4px;
}
.tabs {
  display: flex;
  gap: 8px;
  margin: 20px 0;
}
.tabs button {
  background: #edf3fc;
  color: var(--ink);
  flex: 1;
}
.tabs button.active {
  background: var(--navy);
  color: #fff;
}
label {
  display: block;
  font-size: 12px;
  font-weight: bold;
  margin-top: 12px;
}
input,
select,
textarea {
  display: block;
  width: 100%;
  margin-top: 5px;
  border: 1px solid #cbd8e6;
  border-radius: 5px;
  padding: 10px;
  font: 14px Arial;
}
textarea {
  min-height: 70px;
}
small {
  color: var(--muted);
  line-height: 1.5;
}
.shell {
  display: flex;
  min-height: 100vh;
}
.side {
  width: 250px;
  background: var(--navy);
  padding: 25px 14px;
  color: #b9cae5;
  display: flex;
  flex-direction: column;
}
.side .brand {
  color: #fff;
  margin: 0 10px 36px;
}
.side .brand span {
  color: #74adff;
}
.side p {
  font-size: 10px;
  letter-spacing: 1.3px;
  margin: 0 10px 10px;
}
.side button {
  background: none;
  color: #c4d3e9;
  text-align: left;
  padding: 11px;
  border-radius: 5px;
}
.side button:hover,
.side button.active {
  background: #172857;
  color: #fff;
}
.side .bottom {
  margin-top: auto;
}
.main {
  width: calc(100% - 250px);
  padding: 35px;
}
.top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 25px;
}
.top h1 {
  margin: 5px 0;
}
.grid4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 13px;
}
.metric,
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 18px;
  box-shadow: 0 7px 17px #10233f0a;
}
.metric small {
  display: block;
}
.metric b {
  display: block;
  margin-top: 7px;
  font: 700 28px Georgia;
}
.layout2 {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 14px;
  margin-top: 14px;
}
.bar-row {
  display: grid;
  grid-template-columns: 90px 1fr 50px;
  gap: 10px;
  align-items: center;
  margin: 13px 0;
  font-size: 12px;
}
.bar {
  height: 12px;
  background: #edf3fb;
  border-radius: 10px;
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), #72aaf3);
  border-radius: 10px;
}
.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 13px;
}
.toolbar input,
.toolbar select {
  width: auto;
  min-width: 180px;
  margin: 0;
}
.toolbar .right {
  margin-left: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th,
td {
  text-align: left;
  padding: 11px;
  border-bottom: 1px solid var(--line);
}
th {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.5px;
}
td button {
  padding: 5px 7px;
  font-size: 11px;
  margin-right: 3px;
}
.pill {
  font-size: 11px;
  border-radius: 12px;
  padding: 5px 8px;
  background: #eef3fb;
  color: #355477;
  white-space: nowrap;
}
.pill.good {
  background: #e4faf5;
  color: var(--good);
}
.pill.warn {
  background: #fff3de;
  color: var(--warn);
}
.pill.bad {
  background: #fff0f0;
  color: var(--bad);
}
dialog {
  border: 0;
  border-radius: 10px;
  width: min(560px, calc(100% - 24px));
  box-shadow: 0 20px 60px #05162d66;
  padding: 25px;
}
dialog::backdrop {
  background: #00102a88;
}
.close {
  float: right;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 24px;
  padding: 0;
}
.actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}
.notice {
  padding: 11px;
  background: var(--ice);
  border-radius: 6px;
  color: #45607f;
  font-size: 13px;
}
.empty {
  padding: 30px;
  text-align: center;
  color: var(--muted);
}
@media (max-width: 850px) {
  .shell {
    display: block;
  }
  .side {
    width: 100%;
    height: auto;
  }
  .side .brand {
    margin-bottom: 12px;
  }
  .side button {
    display: inline-block;
  }
  .main {
    width: 100%;
    padding: 24px;
  }
  .grid4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .layout2 {
    grid-template-columns: 1fr;
  }
  .side .bottom {
    margin-top: 10px;
  }
  .top {
    gap: 10px;
  }
}
@media (max-width: 430px) {
  .grid4 {
    grid-template-columns: 1fr;
  }
  .top {
    display: block;
  }
  .top .btn {
    margin-top: 12px;
  }
  .toolbar .right {
    margin-left: 0;
  }
}

.category-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}
.category-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.category-row input {
  flex: 1;
}
.scroll {
  overflow-x: auto;
}
.inventory-table {
  margin-top: 16px;
}
.inventory-table table {
  min-width: 900px;
}
.inventory-table th {
  background: #f6f9fd;
  position: sticky;
  top: 0;
}
.inventory-table td:first-child {
  min-width: 260px;
  font-weight: 700;
  line-height: 1.45;
}
.inventory-table td:nth-child(3),
.inventory-table td:nth-child(4),
.inventory-table td:nth-child(5) {
  white-space: nowrap;
}
.inventory-table td:last-child {
  min-width: 230px;
  white-space: nowrap;
}
.inventory-table tr:hover td {
  background: #fafcff;
}

/* Tarjetas de usuarios */
.user-card {
  margin: 12px 0;
  padding: 18px 20px;
}
.user-card-head,
.user-identity,
.user-status,
.user-actions {
  display: flex;
  align-items: center;
}
.user-card-head {
  justify-content: space-between;
  gap: 18px;
}
.user-identity {
  gap: 12px;
  min-width: 0;
}
.user-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 50%;
  background: #e8f2ff;
  color: #1167d6;
  font-weight: 800;
}
.user-identity h3 {
  margin: 0 0 3px;
  color: var(--ink);
  font-size: 16px;
}
.user-identity a {
  color: #54729a;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.user-status {
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.user-active,
.user-disabled {
  padding: 5px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}
.user-active {
  background: #e4faf5;
  color: var(--good);
}
.user-disabled {
  background: #fff0f0;
  color: var(--bad);
}
.user-permissions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.user-permissions > span {
  flex: 0 0 145px;
  color: #647b98;
  font-size: 12px;
  font-weight: 700;
}
.user-permissions > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.access-tag {
  padding: 5px 8px;
  border: 1px solid #d7e6f7;
  border-radius: 6px;
  background: #f5f9ff;
  color: #315b8b;
  font-size: 12px;
}
.store-access {
  background: #f6f7fb;
  color: #65738a;
}
.user-actions {
  justify-content: flex-end;
  gap: 9px;
  margin-top: 15px;
}
.user-actions .btn {
  min-width: 145px;
}
@media (max-width: 650px) {
  .user-card {
    padding: 16px;
  }
  .user-card-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .user-status {
    justify-content: flex-start;
  }
  .user-permissions {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .user-permissions > span {
    flex-basis: auto;
  }
  .user-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .user-actions .btn {
    width: 100%;
  }
}

/* Colores por rol de usuario */
.user-role {
  border: 1px solid transparent;
  font-weight: 700;
}
.user-role.role-administrador {
  background: #eee5ff;
  border-color: #dfccff;
  color: #6541a5;
}
.user-role.role-supervisor {
  background: #e1f3ff;
  border-color: #bfe5fa;
  color: #0d6799;
}
.user-role.role-empleado {
  background: #e5f8ed;
  border-color: #c5ead4;
  color: #197547;
}
.user-role.role-cliente {
  background: #fff3dc;
  border-color: #f9dfae;
  color: #a25f00;
}

.product-attributes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.product-attributes label {
  margin: 0;
}
@media (max-width: 600px) {
  .product-attributes {
    grid-template-columns: 1fr;
  }
}

/* Dashboard de reportes */
.report-dashboard {
  padding-bottom: 22px;
}
.report-heading,
.report-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.report-heading {
  margin-bottom: 16px;
}
.report-heading h2 {
  margin: 3px 0;
  color: var(--ink);
  font:
    700 25px Georgia,
    serif;
}
.report-heading small,
.report-card-head small {
  color: #6c809b;
}
.report-metric {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 16px;
}
.report-metric > span {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  border-radius: 10px;
  font-size: 19px;
}
.report-metric.sales > span {
  background: #e5f1ff;
  color: #1877f2;
}
.report-metric.orders > span {
  background: #e1f8f2;
  color: #159b83;
}
.report-metric.clients > span {
  background: #f0eaff;
  color: #8256c5;
}
.report-metric.products > span {
  background: #fff4d8;
  color: #b77a00;
}
.report-metric b {
  margin-top: 2px;
  font:
    700 23px Georgia,
    serif;
}
.report-metric em {
  display: block;
  margin-top: 3px;
  color: #6a819d;
  font-size: 11px;
  font-style: normal;
}
.report-grid {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}
.main-report-grid {
  grid-template-columns: 1.25fr 0.75fr;
}
.secondary-report-grid {
  grid-template-columns: 1fr 1fr;
}
.report-card {
  padding: 18px;
}
.report-card h3 {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 17px;
}
.report-legend {
  color: #1877f2;
  font-size: 12px;
}
.sales-trend {
  margin-top: 12px;
}
.sales-trend svg {
  display: block;
  width: 100%;
  height: 178px;
  overflow: visible;
}
.trend-grid {
  stroke: #e8eff8;
  stroke-width: 1;
  stroke-dasharray: 3 4;
}
.trend-labels {
  display: flex;
  justify-content: space-between;
  color: #7690b0;
  font-size: 11px;
}
.category-report {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 185px;
}
.donut {
  display: grid;
  width: 135px;
  height: 135px;
  flex: 0 0 135px;
  place-items: center;
  border-radius: 50%;
}
.donut::before {
  content: "";
  position: absolute;
  width: 87px;
  height: 87px;
  border-radius: 50%;
  background: #fff;
}
.donut span {
  z-index: 1;
  color: var(--ink);
  font-weight: 800;
  text-align: center;
}
.donut small {
  display: block;
  margin-top: 2px;
  color: #7187a2;
  font-size: 9px;
  font-weight: 500;
}
.category-list {
  flex: 1;
}
.category-list p {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 7px;
  align-items: center;
  margin: 8px 0;
  color: #536d8d;
  font-size: 12px;
}
.category-list i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.category-list b {
  color: var(--ink);
}
.status-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin: 12px 0;
}
.status-line > div {
  display: flex;
  align-items: center;
  gap: 7px;
}
.status-line small {
  color: #7187a2;
  font-size: 11px;
}
.status-line strong {
  color: #526c8c;
  font-size: 12px;
}
.status-line i {
  grid-column: 1 / -1;
  height: 6px;
  overflow: hidden;
  border-radius: 8px;
  background: #edf3fa;
}
.status-line i em {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #1877f2;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f0b22e;
}
.status-dot.en-camino {
  background: #43a6e8;
}
.status-dot.entregado {
  background: #25a96b;
}
.status-dot.cancelado {
  background: #e55e6f;
}
.report-alert {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 0;
  border-bottom: 1px solid #edf2f8;
}
.report-alert:last-child {
  border-bottom: 0;
}
.report-alert b,
.report-alert small {
  display: block;
}
.report-alert b {
  color: var(--ink);
  font-size: 13px;
}
.report-alert small {
  margin-top: 3px;
  color: #7085a0;
  font-size: 12px;
}
.report-empty {
  margin: 22px 0;
  color: #23865a;
}
.activity-report {
  margin-top: 14px;
}
.activity-table td {
  padding: 11px 8px;
  font-size: 13px;
}
.activity-ok {
  padding: 4px 7px;
  border-radius: 10px;
  background: #e7f8ef;
  color: #178354;
  font-size: 11px;
}
@media (max-width: 980px) {
  .main-report-grid,
  .secondary-report-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 560px) {
  .report-heading {
    align-items: stretch;
    flex-direction: column;
  }
  .category-report {
    align-items: flex-start;
    flex-direction: column;
  }
  .report-heading .btn {
    width: 100%;
  }
}

/* Tarjetas operativas de ventas */
.admin-sale-card {
  margin: 12px 0;
  padding: 19px 20px;
}
.admin-sale-head,
.admin-sale-footer,
.sale-actions {
  display: flex;
  align-items: center;
}
.admin-sale-head {
  justify-content: space-between;
  gap: 14px;
}
.sale-label {
  color: #7186a2;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.admin-sale-head h3 {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: 19px;
}
.admin-sale-head .pill {
  padding: 7px 10px;
  font-weight: 700;
}
.admin-sale-info {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
  margin: 16px 0;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.admin-sale-info span,
.sale-total span {
  display: block;
  margin-bottom: 5px;
  color: #7085a0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.admin-sale-info b {
  color: #26466e;
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.admin-sale-footer {
  justify-content: space-between;
  gap: 18px;
}
.sale-total {
  padding: 9px 12px;
  border-radius: 8px;
  background: #eef6ff;
}
.sale-total b {
  color: var(--ink);
  font:
    700 19px Georgia,
    serif;
}
.sale-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}
.sale-actions .btn {
  min-width: 111px;
}
@media (max-width: 760px) {
  .admin-sale-info {
    grid-template-columns: 1fr;
    gap: 11px;
  }
  .admin-sale-footer {
    align-items: stretch;
    flex-direction: column;
  }
  .sale-actions {
    justify-content: stretch;
  }
  .sale-actions .btn {
    flex: 1;
  }
}
@media (max-width: 440px) {
  .admin-sale-card {
    padding: 16px;
  }
  .sale-actions {
    flex-direction: column;
  }
  .sale-actions .btn {
    width: 100%;
  }
}

/* Centro de reportes */
.reports-hub {
  max-width: 1180px;
}
.reports-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  margin-bottom: 16px;
  padding: 24px 28px;
  border: 1px solid #d9eaf9;
  border-radius: 14px;
  background: linear-gradient(120deg, #eef8ff, #f8fcff 60%, #edf9f7);
}
.reports-banner h2 {
  margin: 5px 0 8px;
  color: var(--ink);
  font:
    700 28px Georgia,
    serif;
}
.reports-banner p:not(.tag) {
  max-width: 620px;
  margin: 0;
  color: #607a9c;
}
.reports-banner-icon {
  display: grid;
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  place-items: center;
  border-radius: 18px;
  background: #1877f2;
  color: #fff;
  font-size: 34px;
  box-shadow: 0 10px 20px #1877f250;
}
.report-download-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
}
.report-download-card {
  display: flex;
  min-height: 335px;
  flex-direction: column;
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 21px #10233f0a;
}
.report-file-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 11px;
  font-size: 22px;
}
.inventory-report .report-file-icon {
  background: #e3f1ff;
  color: #1473d2;
}
.sales-report .report-file-icon {
  background: #e1f8f1;
  color: #14936b;
}
.users-report .report-file-icon {
  background: #f1eafe;
  color: #8056c7;
}
.report-type {
  margin: 17px 0 4px;
  color: #7489a5;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.09em;
}
.report-download-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 19px;
}
.report-download-card > p:not(.report-type) {
  margin: 10px 0;
  color: #617a9a;
  font-size: 13px;
  line-height: 1.5;
}
.report-download-card ul {
  margin: 4px 0 18px;
  padding: 0;
  list-style: none;
}
.report-download-card li {
  margin: 7px 0;
  color: #3f5d82;
  font-size: 12px;
}
.report-download-card li::before {
  content: "✓";
  margin-right: 7px;
  color: #1ca36b;
  font-weight: 800;
}
.report-download-card .btn {
  width: 100%;
  margin-top: auto;
}
.reports-help {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-top: 16px;
  padding: 16px 18px;
  background: #f8fbff;
}
.reports-help > span {
  color: #1877f2;
  font-size: 21px;
}
.reports-help b {
  color: var(--ink);
}
.reports-help p {
  margin: 5px 0 0;
  color: #6e83a0;
  font-size: 13px;
}
@media (max-width: 920px) {
  .report-download-grid {
    grid-template-columns: 1fr;
  }
  .report-download-card {
    min-height: 0;
  }
}
@media (max-width: 560px) {
  .reports-banner {
    align-items: flex-start;
    padding: 20px;
  }
  .reports-banner-icon {
    display: none;
  }
  .reports-banner h2 {
    font-size: 24px;
  }
}

/* Filtros de ventas y dashboard */
.dashboard-filters {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
  padding: 13px 15px;
  border: 1px solid #dce9f6;
  border-radius: 10px;
  background: #f8fbff;
}
.dashboard-filters > span {
  margin-right: 4px;
  color: #527195;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.dashboard-filters label,
.toolbar-date {
  display: grid;
  gap: 4px;
  color: #5c7492;
  font-size: 11px;
  font-weight: 700;
}
.dashboard-filters input,
.dashboard-filters select,
.toolbar-date input {
  height: 35px;
  padding: 0 8px;
  border: 1px solid #cbdced;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font:
    13px Arial,
    sans-serif;
}
.dashboard-filters .btn {
  height: 35px;
  margin-left: auto;
}
.toolbar-date {
  min-width: 130px;
}
.toolbar-date input {
  width: 100%;
}
@media (max-width: 760px) {
  .dashboard-filters {
    align-items: stretch;
    flex-direction: column;
  }
  .dashboard-filters label,
  .toolbar-date {
    width: 100%;
  }
  .dashboard-filters .btn {
    margin-left: 0;
  }
  .toolbar-date input {
    width: 100%;
  }
}

.color-variant-field { grid-column: 1 / -1; display: grid; gap: 10px; }
.field-label { font-weight: 700; }
.color-variant-list { display: grid; gap: 10px; }
.color-variant-row { display: grid; grid-template-columns: minmax(130px,.7fr) minmax(110px,.45fr) minmax(220px,1.35fr) auto; gap: 10px; padding: 12px; border: 1px solid #d9e4f2; border-radius: 12px; background: #f8fbff; align-items: end; }
.variant-summary { grid-column: 1 / 4; color: #607a9c; font-size: 13px; }
.variant-remove { border: 0; background: #fff0f2; color: #b42336; border-radius: 8px; padding: 10px 12px; cursor: pointer; }
.color-add { justify-self: start; }
@media (max-width: 700px) { .color-variant-row { grid-template-columns: 1fr; } .variant-summary { grid-column: 1; } }