:root {
  --background: #f4f6f8;
  --foreground: #17202a;
  --muted: #667085;
  --line: #d9e1e8;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --nav: #111827;
  --accent: #0f766e;
  --accent-dark: #0b5f59;
  --warn: #b45309;
  --danger: #b42318;
  --blue: #2563eb;
  --shadow: 0 16px 38px rgba(17, 24, 39, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--background);
}

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 18px;
  background: var(--nav);
  color: #f9fafb;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  margin-bottom: 28px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: var(--accent);
  font-weight: 800;
}

.sidebar nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  display: block;
  padding: 11px 12px;
  border-radius: 6px;
  color: #cbd5e1;
  text-decoration: none;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.workspace {
  min-width: 0;
  padding: 26px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.eyebrow,
.panel-kicker {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.02;
}

h2 {
  margin-bottom: 14px;
  font-size: 20px;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(86px, 1fr));
  gap: 8px;
  min-width: min(100%, 510px);
}

.summary-strip span {
  display: grid;
  gap: 1px;
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.04);
}

.summary-strip strong {
  color: var(--foreground);
  font-size: 20px;
}

.agenda-layout {
  display: grid;
  grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.entry-panel,
.board-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.entry-panel {
  position: sticky;
  top: 22px;
  display: grid;
  gap: 14px;
  padding: 18px;
}

label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid #cfd8e3;
  border-radius: 6px;
  background: #ffffff;
  color: var(--foreground);
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.file-drop {
  align-content: center;
  min-height: 88px;
  padding: 14px;
  border: 1px dashed #9fb1c1;
  border-radius: 8px;
  background: var(--panel-soft);
}

.file-drop small {
  color: var(--muted);
  font-weight: 500;
}

.file-drop input {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
}

.shipping-details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.shipping-details summary {
  padding: 12px 14px;
  color: #344054;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.shipping-fields {
  display: grid;
  gap: 12px;
  padding: 0 14px 14px;
}

.shipping-file {
  padding-top: 12px;
  border-top: 2px dotted #7c8794;
}

.shipping-file input {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
}

.file-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
}

.file-list span,
.file-list em {
  max-width: 100%;
  padding: 5px 8px;
  overflow-wrap: anywhere;
  border-radius: 999px;
  background: #e7f4f2;
  color: var(--accent-dark);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.file-list em {
  background: #fff7ed;
  color: var(--warn);
}

.primary-action {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  font-weight: 800;
}

.primary-action:hover {
  background: var(--accent-dark);
}

.form-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.secondary-action {
  min-height: 40px;
  border: 1px solid #cfd8e3;
  border-radius: 6px;
  background: #ffffff;
  color: #344054;
  font-weight: 800;
}

.secondary-action:hover {
  background: #f2f6f8;
}

.secondary-action[hidden] {
  display: none;
}

.board-panel {
  min-width: 0;
  padding: 16px;
}

.clients-panel,
.providers-panel {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.section-heading {
  margin-bottom: 12px;
}

.clients-table {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-x: auto;
  background: #ffffff;
}

.clients-head,
.client-row {
  display: grid;
  grid-template-columns: 1.3fr 120px 1fr 1.2fr 80px 120px;
  min-width: 840px;
  align-items: center;
}

.clients-head {
  min-height: 42px;
  border-bottom: 1px solid var(--line);
  background: #f2f6f8;
  color: #344054;
  font-size: 12px;
  font-weight: 900;
}

.client-row {
  min-height: 46px;
  border-bottom: 1px solid #e1e8ef;
  color: #263442;
  font-size: 13px;
}

.client-row:last-child {
  border-bottom: 0;
}

.clients-head span,
.client-row span {
  min-width: 0;
  padding: 9px 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.providers-toolbar {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.providers-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.provider-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.provider-card-head {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 9px;
  align-items: center;
}

.provider-card-head span {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 999px;
  background: #e7f4f2;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
}

.provider-card h3 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 16px;
}

.provider-brands {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.provider-brands span,
.provider-brands em {
  padding: 5px 8px;
  border-radius: 999px;
  background: #eef2f6;
  color: #344054;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.provider-card p {
  margin: 0;
  color: #4b5563;
  font-size: 13px;
  line-height: 1.45;
}

.provider-card ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
  color: #344054;
  font-size: 13px;
}

.provider-card a {
  color: var(--accent-dark);
  font-weight: 800;
  text-decoration: none;
}

.provider-card a:hover {
  text-decoration: underline;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(180px, 240px) minmax(220px, 280px);
  gap: 12px;
  margin-bottom: 14px;
}

.status-board {
  display: block;
  overflow-x: auto;
  padding-bottom: 8px;
}

.multi-filter {
  position: relative;
  align-self: end;
}

.multi-filter summary {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid #cfd8e3;
  border-radius: 6px;
  background: #ffffff;
  color: #344054;
  cursor: pointer;
  list-style: none;
}

.multi-filter summary::-webkit-details-marker {
  display: none;
}

.multi-filter summary span {
  font-size: 13px;
  font-weight: 800;
}

.multi-filter summary strong {
  color: var(--accent-dark);
  font-size: 12px;
}

.multi-filter[open] summary {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.filter-menu {
  position: absolute;
  z-index: 10;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  width: min(320px, 90vw);
  max-height: 320px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.check-option {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px;
  border-radius: 6px;
  color: #263442;
  font-weight: 700;
}

.check-option:hover {
  background: #f2f6f8;
}

.check-option input {
  min-height: auto;
}

.records-table {
  min-width: 1540px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}

.records-head,
.record-row {
  display: grid;
  grid-template-columns: 1.12fr 96px 106px 104px 1.02fr 0.82fr 0.88fr 1.04fr 1.08fr 92px 136px 134px;
  align-items: center;
}

.records-head {
  min-height: 44px;
  border-bottom: 1px solid var(--line);
  background: #f2f6f8;
  color: #344054;
  font-size: 12px;
  font-weight: 900;
}

.records-head span,
.record-row > span,
.record-row > label {
  min-width: 0;
  padding: 9px 10px;
}

.record-row {
  min-height: 50px;
  border-bottom: 1px solid #e1e8ef;
  color: #263442;
  font-size: 13px;
}

.record-row:last-child {
  border-bottom: 0;
}

.record-row > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.strong-cell {
  color: #17202a;
  font-weight: 800;
}

.table-status {
  gap: 0;
}

.table-status select {
  min-height: 34px;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 800;
}

.pdf-cell {
  display: flex;
  gap: 5px;
}

.pdf-link,
.pdf-missing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 30px;
  min-height: 30px;
  padding: 2px;
  border-radius: 5px;
  background: #ffffff;
  color: #667085;
  font-size: 11px;
  font-weight: 900;
  text-decoration: none;
}

.pdf-link:hover {
  background: #fee2e2;
}

.pdf-missing {
  opacity: 0.82;
}

.pdf-link img,
.pdf-missing img {
  width: 24px;
  height: 28px;
  object-fit: contain;
  flex: 0 0 auto;
}

.row-actions {
  display: flex;
  gap: 6px;
}

.icon-action {
  min-height: 30px;
  padding: 5px 8px;
  border: 1px solid #cfd8e3;
  border-radius: 6px;
  background: #ffffff;
  color: #344054;
  font-size: 12px;
  font-weight: 800;
}

.edit-action:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.trash-action:hover {
  border-color: #fca5a5;
  color: var(--danger);
}

.table-empty {
  min-height: 120px;
  border-bottom: 0;
}

.status-column {
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.status-column header {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.status-column h3 {
  margin: 0;
  font-size: 14px;
  line-height: 1.2;
}

.status-column header strong {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 999px;
  background: #e5e7eb;
  color: #374151;
  font-size: 12px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #94a3b8;
}

.borrador { background: #64748b; }
.agendado { background: var(--blue); }
.factura-anticipada { background: #7c3aed; }
.facturado { background: #0891b2; }
.enviado { background: #16a34a; }
.pendiente { background: var(--warn); }
.cancelado { background: var(--danger); }

.cards-stack {
  display: grid;
  gap: 0;
  padding: 0 10px 10px;
}

.empty-state {
  display: grid;
  min-height: 58px;
  margin: 0;
  place-items: center;
  border-bottom: 1px dashed #cbd5e1;
  color: #7c8794;
  font-size: 13px;
}

.order-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.1fr) minmax(220px, 1.8fr) minmax(138px, 0.8fr);
  gap: 10px;
  align-items: center;
  min-height: 68px;
  padding: 10px 0;
  border-bottom: 1px solid #dbe3ec;
  background: #ffffff;
}

.order-row:last-child {
  border-bottom: 0;
}

.row-main,
.row-details {
  min-width: 0;
}

.row-main {
  display: grid;
  gap: 3px;
}

.row-main strong {
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.2;
}

.row-main span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.row-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 10px;
  color: #263442;
  font-size: 12px;
}

.row-details span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-details b {
  color: #667085;
  font-weight: 800;
}

.row-status {
  gap: 0;
}

.row-status select {
  min-height: 34px;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 700;
}

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

  .sidebar {
    position: static;
    height: auto;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 12px 16px;
  }

  .brand-mark {
    margin-bottom: 0;
  }

  .sidebar nav {
    display: flex;
    overflow-x: auto;
  }

  .nav-item {
    white-space: nowrap;
  }

  .agenda-layout {
    grid-template-columns: 1fr;
  }

  .entry-panel {
    position: static;
  }
}

@media (max-width: 760px) {
  .workspace {
    padding: 16px;
  }

  .topbar {
    display: grid;
  }

  .order-row {
    grid-template-columns: 1fr;
  }

  .row-details {
    grid-template-columns: 1fr;
  }

  .toolbar,
  .providers-toolbar,
  .two-col {
    grid-template-columns: 1fr;
  }

  .filter-menu {
    left: 0;
    right: auto;
  }

  .summary-strip {
    display: none;
  }

  h1 {
    font-size: 34px;
  }

  .status-column {
    min-height: 420px;
  }
}
