/* Basic layout and status styling for the MVP */
/* Cache-bust marker: 2026-01-22 */
:root {
  --bg: #edf1f6;
  --ink: #1f2937;
  --muted: #6b7280;
  --brand: #f97316;
  --accent: #1d4ed8;
  --card: #ffffff;
  --border: #e5e7eb;
  --danger: #b42318;
  --ok: #027a48;
  --warn: #b54708;
  --info: #175cd3;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "SF Pro Text", "Helvetica Neue", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}

header {
  padding: 16px 20px;
  background: #1f2a3a;
  color: #f9fafb;
}

header h1 {
  margin: 0;
  font-size: 20px;
}

nav {
  margin-top: 8px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

nav a {
  color: #d1d5db;
  text-decoration: none;
  font-size: 14px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.two {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

input,
select,
textarea {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 14px;
  background: #f9fafb;
}

button {
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 600;
}

button.secondary {
  background: #2d2d2d;
}

button.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--ink);
}

button:disabled,
button.secondary:disabled {
  background: #bdbdbd;
  cursor: not-allowed;
}

button.ghost:disabled {
  border-color: #d0d0d0;
  color: #9a9a9a;
  cursor: not-allowed;
}

.btn-mini {
  padding: 2px 6px;
  font-size: 10px!important;
  line-height: 1.1;
  border-radius: 4px;
}

.btn-mini.edit {
  background: #8f8009!important;
  color: #fff;
}

.item-editor {
  margin-top: 10px;
  padding: 10px;
  border: 1px dashed var(--border);
  border-radius: 6px;
  background: #fafafa;
}

.item-editor input {
  flex: 1;
  min-width: 160px;
}

.item-edit-list {
  margin-top: 8px;
  display: grid;
  gap: 6px;
}

.item-edit-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.status-pill {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  text-transform: uppercase;
}

.status-CREADA { background: #d7ebff; color: #175cd3; }
.status-LISTA_PARA_ENVIO { background: #fff4cc; color: #b54708; }
.status-EN_TRANSITO { background: #ffe2c3; color: #b54708; }
.status-ALMACENADA { background: #d3f8df; color: #027a48; }
.status-SOLICITADA_DEVOLUCION { background: #e0e7ff; color: #3538cd; }
.status-DEVUELTA { background: #e2e2e2; color: #4b4b4b; }

.muted {
  color: var(--muted);
  font-size: 13px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th,
.table td {
  text-align: left;
  padding: 10px;
  border-bottom: 1px solid var(--border);
}

.badge {
  background: #f0f0f0;
  color: #333;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
}

.qr-box {
  width: 140px;
  height: 140px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}

.notice {
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  font-size: 13px;
}

.inline-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.send-select {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  color: var(--ink);
}

.send-select input {
  width: auto;
  margin: 0;
}

.send-select input:disabled {
  accent-color: #bdbdbd;
}

.send-select.disabled {
  color: #9a9a9a;
}

.box-checks {
  margin-top: 10px;
  margin-bottom: 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}

.box-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.box-title-row h3 {
  margin: 0;
}

.big-select {
  font-size: 14px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  width: 100%;
}

.big-select input {
  width: 16px;
  height: 16px;
}

.send-select.big-select {
  justify-content: flex-start;
  font-weight: 600;
  border: none;
  box-shadow: 0 10px 16px rgba(15, 23, 42, 0.12);
}

.send-select.big-select input {
  accent-color: #16a34a;
}

.send-select.big-select.return {
  background: #dbeafe;
  color: #1d4ed8;
}

.send-select.big-select.return input {
  accent-color: #2563eb;
}

.send-select.big-select.send {
  background: #dcfce7;
  color: #15803d;
}

.send-select.big-select.send input {
  accent-color: #16a34a;
}

.send-select.big-select.disabled {
  background: #f1f5f9;
  color: #94a3b8;
  box-shadow: none;
}

.send-select.big-select.disabled input {
  accent-color: #94a3b8;
}

[data-items-list] li {
  background: #ffffff;
  border-radius: 8px;
  padding: 6px 10px;
  box-shadow: 0 8px 14px rgba(15, 23, 42, 0.08);
  border: 1px solid #e5e7eb;
}

[data-items-list] li + li {
  margin-top: 6px;
}

.footer {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  padding: 20px;
}

/* Dashboard layout inspired by reference */

.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #f97316;
  color: #fff;
  font-size: 12px;
  letter-spacing: 0.6px;
}

.brand-name {
  font-size: 14px;
  letter-spacing: 0.3px;
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.top-nav a {
  color: #d1d5db;
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.2px;
}

.top-nav a:hover {
  color: #fff;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #e5e7eb;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.user-avatar {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #f97316;
  display: inline-block;
}

body[data-page="dashboard"] .container {
  max-width: 1200px;
}

.dashboard {
  padding-top: 24px;
  padding-bottom: 40px;
}

.dashboard-header {
  margin-bottom: 16px;
}

.dashboard-header h2 {
  margin: 6px 0 8px;
  font-size: 24px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: start;
}

.column-left,
.column-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.column-center {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

body[data-page="dashboard"] .card {
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.card-head h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.card-head .muted {
  margin: 0;
}

.eyebrow {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 1px;
  color: #6b7280;
  margin: 0;
}

.stats-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  gap: 10px;
}

.stats-list li {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #4b5563;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 8px 10px;
}

.stats-list strong {
  font-size: 14px;
  color: #111827;
}

.stat-icon {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid #e5e7eb;
  color: #f97316;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.stat-icon svg {
  width: 12px;
  height: 12px;
}

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

.stat-foot .label {
  margin: 0;
  font-size: 11px;
  text-transform: uppercase;
  color: #6b7280;
}

.stat-foot .value {
  margin: 4px 0 0;
  font-weight: 700;
  font-size: 15px;
  color: #111827;
}

.mini-card .label {
  margin: 0;
  font-size: 11px;
  text-transform: uppercase;
  color: #6b7280;
}

.mini-card .value {
  margin: 6px 0 0;
  font-size: 16px;
  font-weight: 700;
}

.list-card #boxes .card {
  margin-bottom: 12px;
  box-shadow: none;
  border-color: #e5e7eb;
}

.list-scroll {
  max-height: 620px;
  overflow: auto;
  padding-right: 4px;
  scroll-behavior: smooth;
}

.list-scroll .card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.list-scroll .card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 18px rgba(15, 23, 42, 0.12);
}

.action-card .inline-actions {
  margin-top: 12px;
}

.primary-action {
  background: #fff7ed;
  border-color: #fed7aa;
}

.action-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  background: #f97316;
  color: #fff;
  padding: 14px 16px;
  border-radius: 10px;
  font-weight: 600;
  margin-top: 12px;
}

.action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.2);
}

.action-icon svg {
  width: 16px;
  height: 16px;
}

.hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: #6b7280;
}

.note-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  gap: 8px;
  color: #4b5563;
  font-size: 13px;
}

body[data-page="dashboard"] button {
  background: #f97316;
  border-radius: 6px;
  font-weight: 600;
}

body[data-page="dashboard"] button.secondary {
  background: #111827;
}

body[data-page="dashboard"] button.ghost {
  border: 1px solid #d1d5db;
  color: #1f2937;
}

body[data-page="dashboard"] button:disabled,
body[data-page="dashboard"] button.secondary:disabled {
  background: #cbd5e1;
  color: #64748b;
}

body[data-page="dashboard"] button.ghost:disabled {
  border-color: #e5e7eb;
  color: #9ca3af;
}

.btn-quick {
  background: #f97316;
}

@media (max-width: 1100px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .topbar-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .list-scroll {
    max-height: none;
  }
}

@media (max-width: 680px) {
  .dashboard-header h2 {
    font-size: 20px;
  }

  .top-nav {
    gap: 10px;
  }

  .top-nav a {
    font-size: 12px;
  }
}
