:root {
  /* Backgrounds */
  --bg: #F8FAFC;
  --card-bg: #FFFFFF;

  /* Text system */
  --text: #0F172A;
  --muted: #475569;
  --subtle: #64748B;

  /* Borders */
  --line: #E5E7EB;
  --line-strong: rgba(0, 0, 0, 0.12);

  /* Status */
  --ok: #0A7C3A;
  --danger: #B91C1C;

  /* Accent */
  --fbos-blue: #0A3D62;
  --fbos-blue-soft: #0E4F7A;

  /* Type scale */
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Helvetica Neue", Helvetica;

  --fs-base: 15px;
  --fs-label: 13px;
  --fs-help: 12px;
  --fs-h1: 18px;

  /* Radius */
  --r-sm: 12px;
  --r-md: 14px;
  --r-lg: 20px;

  /* Control height */
  --ctrl-h: 48px;

  /* Shadows */
  --shadow-card: 0 10px 30px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-base);
  background: var(--bg);
  color: var(--text);
}

.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

/* =========================
   HEADER
========================= */

.header {
  padding: 8px 4px 20px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.mark{
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #E2E8F0, #CBD5E1);
  border: 1px dashed #94A3B8;
}

h1 {
  margin: 0;
  font-size: var(--fs-h1);
  letter-spacing: 0.4px;
}

.header p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

/* =========================
   CARD
========================= */

.card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

/* =========================
   LOGO SLOT
========================= */

.fbos-logo-slot {
  height: 64px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--subtle);
  border: 1px dashed #CBD5E1;
  border-radius: var(--r-md);
}

/* =========================
   FORM
========================= */

.field {
  display: block;
  margin-bottom: 14px;
}

.label {
  display: block;
  font-size: var(--fs-label);
  font-weight: 600;
  color: #334155;
  margin: 0 0 6px;
}

small {
  font-size: var(--fs-help);
  color: var(--subtle);
}

/* Base control */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
select,
textarea,
.picker-btn {
  width: 100%;
  height: var(--ctrl-h);
  border: 1px solid var(--line-strong);
  background: #FFFFFF;
  color: var(--text);
  padding: 12px 14px;
  border-radius: var(--r-md);
  outline: none;
  font-size: var(--fs-base);
  line-height: 1.2;
}

textarea {
  height: auto;
  min-height: 110px;
  resize: vertical;
  padding-top: 12px;
}

input::placeholder,
textarea::placeholder {
  color: #94A3B8;
}

input:focus,
select:focus,
textarea:focus,
.picker-btn:focus {
  border-color: rgba(10, 61, 98, 0.5);
  box-shadow: 0 0 0 4px rgba(10, 61, 98, 0.08);
}

/* =========================
   PHONE ROW
========================= */

.phone-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.phone-code {
  width: 130px;
  background: #fff;
  appearance: none;
}

.phone-row input {
  flex: 1;
}

/* =========================
   SEGMENTED
========================= */

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.seg {
  border: 1px solid rgba(0,0,0,0.18);
  border-radius: var(--r-md);
  padding: 10px 12px;
  text-align: center;
  cursor: pointer;
  user-select: none;
  background: #FFFFFF;
  min-height: var(--ctrl-h);
  display: flex;
  align-items: center;
  justify-content: center;
}

.seg input { display: none; }

.seg span {
  font-size: 14px;
  font-weight: 600;
  color: #334155;
}

/* selected */
.seg:has(input:checked) {
  border-color: var(--fbos-blue);
  background: rgba(10, 61, 98, 0.08);
}

/* =========================
   PRIMARY BUTTON
========================= */

.btn {
  width: 100%;
  margin-top: 8px;
  border: none;
  background: var(--fbos-blue);
  color: #FFFFFF;
  padding: 14px;
  border-radius: var(--r-md);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.btn:hover {
  background: var(--fbos-blue-soft);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
  padding: 12px 14px;
  border-radius: var(--r-md);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.btn-secondary:hover {
  background: rgba(10, 61, 98, 0.06);
}

/* =========================
   STATUS
========================= */

.status {
  margin-top: 12px;
  font-size: 13px;
  min-height: 18px;
}

.status.ok { color: var(--ok); }
.status.err { color: var(--danger); }

/* =========================
   FOOTER
========================= */

.footer {
  margin-top: 20px;
  text-align: center;
  color: var(--subtle);
  font-size: 12px;
}

/* =========================
   DAMAGE PICKER (modal)
========================= */

.picker-btn {
  text-align: left;
  cursor: pointer;
}

.picker {
  position: fixed;
  inset: 0;
  display: none;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  padding: 16px;
  z-index: 9999;
}

.picker[aria-hidden="false"] {
  display: flex;
}

.picker-card {
  width: 100%;
  max-width: 560px;
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.08);
}

.picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.picker-head strong {
  font-size: 14px;
}

.picker-close {
  border: none;
  background: transparent;
  font-size: 18px;
  padding: 8px;
  cursor: pointer;
}

.picker-body {
  padding: 12px 16px 16px;
}

.opt {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 14px;
}

.opt:last-child {
  border-bottom: none;
}

.picker-actions {
  display: flex;
  gap: 10px;
  padding: 12px 16px 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.picker-actions .btn,
.picker-actions .btn-secondary {
  flex: 1;
  margin-top: 0;
}

/* =========================
   LABEL MODAL (Print label)
========================= */

.label-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0,0,0,.35);
  z-index: 10000;
}

.label-modal[aria-hidden="false"] { display: flex; }

.label-card {
  width: 100%;
  max-width: 520px;
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,.08);
}

.label-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(0,0,0,.08);
}

.label-head strong {
  font-size: 14px;
}

.label-close {
  border: none;
  background: transparent;
  font-size: 18px;
  padding: 8px;
  cursor: pointer;
}

.label-body { padding: 16px; }

.label-print {
  border: 1px solid rgba(0,0,0,.18);
  border-radius: 14px;
  padding: 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 14px;
}

.label-id {
  font-weight: 800;
  font-size: 22px;
  letter-spacing: .5px;
}

.label-meta {
  font-size: 12px;
  color: var(--subtle);
  margin-top: 4px;
}

.label-qr {
  width: 110px;
  height: 110px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius: 12px;
  border: 1px dashed rgba(0,0,0,.18);
  overflow: hidden;
}

.label-actions {
  display:flex;
  gap: 10px;
  padding: 12px 16px 16px;
  border-top: 1px solid rgba(0,0,0,.08);
}

.label-actions .btn,
.label-actions .btn-secondary {
  flex: 1;
  margin-top: 0;
}

/* Print: only print the label */
@media print {
  body * { visibility: hidden !important; }
  #labelModal, #labelModal * { visibility: visible !important; }
  #labelModal {
    position: absolute !important;
    inset: 0 !important;
    background: #fff !important;
    padding: 0 !important;
  }
  .label-card {
    border: none !important;
    box-shadow: none !important;
    max-width: none !important;
    border-radius: 0 !important;
  }
  .label-head, .label-actions { display: none !important; }
  .label-body { padding: 0 !important; }
  .label-print {
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
  }
}

/* =========================================================
   CANVAS / BOARD (mantengo tu CSS, solo tipografía consistente)
========================================================= */

.canvas-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin: 6px 0 14px;
}

.canvas-title{
  font-weight: 800;
  font-size: 20px;
  color: #0b1f3a;
}

.btn-small{
  width: 100%;
  max-width: 220px;
  border-radius: 18px;
  padding: 14px 18px;
  font-weight: 800;
  font-size: 16px;
}

.board{
  display:flex;
  flex-direction:column;
  gap: 8px;
}

.state-section{
  margin-top: 6px;
}

.state-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin: 6px 0 10px;
}

.state-title{
  font-weight: 800;
  font-size: 18px;
  color: #0b1f3a;
}

.state-divider{
  margin: 14px 0 6px;
  border-top: 1px solid #e6e9ef;
}

.state-cards{
  display:flex;
  flex-direction:column;
  gap: 12px;
}

.section-more-btn{
  border: 1px solid #CBD5E1;
  background:#fff;
  color:#0b1f3a;
  border-radius: 10px;
  padding: 8px 12px;
  font-weight: 800;
  cursor:pointer;
}

.section-more-btn:hover{
  background: rgba(10, 61, 98, 0.06);
}

.state-empty{
  margin: 2px 0 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.03);
  color: #64748b;
  font-weight: 600;
  font-size: 13px;
}

.actions-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.action-card {
  background: #fff;
  border: 1px solid #e6e9ef;
  border-radius: 14px;
  padding: 14px 14px 12px;
  box-shadow: 0 6px 18px rgba(20, 33, 61, 0.06);
}

.action-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.action-id {
  font-weight: 800;
  font-size: 16px;
  color: #0b1f3a;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.badge {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid transparent;
}

/* Urgencia */
.badge-urgency-low { background: #f1f5f9; color: #334155; }
.badge-urgency-mid { background: #fff1e7; color: #a84a00; }
.badge-urgency-high { background: #ffe8ea; color: #b42318; }

.action-title {
  font-weight: 800;
  font-size: 20px;
  margin: 0 0 6px;
}

.action-desc {
  font-size: 14px;
  color: #334155;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.action-card__bottom{
  margin-top: 10px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.inline-msg{
  font-size: 13px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.inline-msg--ok{
  background:#eefdf3;
  color:#027a48;
  border-color:#b7ebc6;
}

.inline-msg--error{
  background:#ffe8ea;
  color:#b42318;
  border-color:#ffc9cf;
}

.action-actions{
  display:flex;
  gap:8px;
  justify-content:flex-end;
}

.btn-action{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  min-width: 150px;
  padding: 0 18px;
  border-radius: 16px;
  border: 0;
  background: #0b3a5b;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}

.btn-action:disabled{
  opacity: 0.55;
  cursor: not-allowed;
}

.action-id-link{
  text-decoration: none;
  color: inherit;
}
.action-id-link:hover{
  text-decoration: underline;
}






