:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --ink: #17202a;
  --muted: #5d6b78;
  --line: #d9e0e7;
  --accent: #1769aa;
  --accent-dark: #0f4f82;
  --danger: #b42318;
  --danger-bg: #fff1f0;
  --ok: #176b3a;
  --ok-bg: #eaf7ef;
  --warn: #8a5a00;
  --warn-bg: #fff6d8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
}

.app-shell {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 12px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 4px 12px;
}

.top-actions {
  display: flex;
  align-items: stretch;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 8px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 22px;
  letter-spacing: 0;
}

h2 {
  font-size: 18px;
}

.topbar p,
#productoDescripcion,
.eyebrow,
.item-meta,
#ubicacionesCount,
#pendientesCount,
.user-text {
  color: var(--muted);
}

.user-text {
  margin-top: 5px;
  font-weight: 700;
}

.lab-badge {
  border: 2px solid var(--danger);
  color: var(--danger);
  padding: 7px 9px;
  font-size: 12px;
  text-align: center;
  background: #fff;
}

.logout-btn {
  min-height: 38px;
  padding: 7px 9px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

label {
  font-weight: 700;
  font-size: 14px;
}

input,
select,
button {
  width: 100%;
  min-height: 46px;
  border-radius: 6px;
  font: inherit;
}

input,
select {
  border: 1px solid #aeb8c2;
  background: #fff;
  padding: 10px 12px;
}

button {
  border: 0;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.primary-btn {
  background: var(--accent);
  color: #fff;
}

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

.secondary-btn {
  background: #203040;
  color: #fff;
}

.danger-btn {
  background: var(--danger);
  color: #fff;
}

.ghost-btn {
  background: #edf1f5;
  color: var(--ink);
}

.full {
  width: 100%;
}

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

.section-head button {
  width: auto;
  min-width: 158px;
}

.section-head.compact {
  align-items: center;
  margin-bottom: 10px;
}

.eyebrow {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.list {
  display: grid;
  gap: 8px;
}

.item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.item-main {
  min-width: 0;
}

.item-title {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.item-meta {
  margin-top: 3px;
  font-size: 14px;
}

.item button {
  width: auto;
  min-width: 92px;
  min-height: 40px;
}

.pending-delete {
  background: var(--danger-bg);
  border-color: #f1b4ae;
}

.pending-add {
  background: var(--ok-bg);
  border-color: #a9d8bb;
}

.message {
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  background: #fff;
  font-weight: 700;
}

.message.error {
  color: var(--danger);
  background: var(--danger-bg);
  border-color: #f1b4ae;
}

.message.ok {
  color: var(--ok);
  background: var(--ok-bg);
  border-color: #a9d8bb;
}

.message.warn {
  color: var(--warn);
  background: var(--warn-bg);
  border-color: #f0d46a;
}

.add-panel {
  border-color: #aeb8c2;
}

@media (min-width: 680px) {
  .search-panel {
    display: grid;
    grid-template-columns: 1.4fr 0.8fr 1.8fr auto;
    align-items: end;
    gap: 12px;
  }

  .search-panel .field {
    margin-bottom: 0;
  }

  .search-panel button {
    width: 130px;
  }
}

@media (max-width: 520px) {
  .topbar {
    flex-direction: column;
  }

  .lab-badge {
    width: 100%;
  }

  .top-actions {
    width: 100%;
  }

  .section-head {
    flex-direction: column;
  }

  .section-head button {
    width: 100%;
  }

  .item {
    align-items: stretch;
    flex-direction: column;
  }

  .item button {
    width: 100%;
  }
}
