/* =========================================================
   DING REPAIRS — Overrides sobre /styles.css (root)
   Tabs + Canvas/History board + Job modal + Comments
   (Scoped para NO afectar el formulario, excepto .sd-nav)
   ========================================================= */

/* =========================
   TOKENS AJUSTES
========================= */
:root{
  --canvas-gap: 14px;
  --card-pad: 14px;
  --badge-radius: 999px;
}

body.ding-form .wrap{
  max-width: 1040px;
  margin: 0 auto;
}

body.ding-form .card{
  padding: 20px;
}

body.ding-form .header{
  margin-bottom: 12px;
}

body.ding-form .header-top{
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

body.ding-form .brand.brand--demo{
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 0;
  min-width: 0;
  flex: 1 1 auto;
}

body.ding-form .brand-copy{
  min-width: 0;
  flex: 1 1 auto;
}

body.ding-form .brand-copy h1{
  margin: 0;
  font-size: 15px;
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

body.ding-form .brand-copy p{
  margin: 3px 0 0;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 500;
  color: var(--muted);
  text-align: left;
}

body.ding-form .fbos-logo-slot{
  width: 64px;
  height: 64px;
  min-height: 0;
  flex: 0 0 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  padding: 0;
}

body.ding-form .fbos-logo-slot--text{
  background:
    radial-gradient(circle at 24% 20%, rgba(20, 73, 130, 0.16), transparent 40%),
    linear-gradient(135deg, #ffffff, #eef4ff);
  color: var(--fbos-blue);
  font-size: 18px;
  letter-spacing: 0.08em;
  font-weight: 800;
}

body.ding-form .intro-copy{
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

body.ding-form #fbosForm{
  display: grid;
  gap: 18px;
}

body.ding-form .field{
  display: grid;
  gap: 10px;
  margin: 0;
}

body.ding-form .field .label{
  margin: 0;
  font-size: 13px;
  line-height: 1.25;
  color: #334155;
  font-weight: 700;
}

body.ding-form .field small{
  margin-top: 0 !important;
  color: var(--subtle);
  font-size: 12px;
  line-height: 1.35;
}

body.ding-form .field input,
body.ding-form .field select,
body.ding-form .field textarea{
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 15px;
  line-height: 1.35;
  font-weight: 500;
}

body.ding-form .field textarea{
  min-height: 112px;
  resize: vertical;
}

body.ding-form .field input:focus,
body.ding-form .field select:focus,
body.ding-form .field textarea:focus{
  outline: none;
  border-color: rgba(10, 61, 98, 0.5);
  box-shadow: 0 0 0 4px rgba(10, 61, 98, 0.08);
}

body.ding-form .phone-row{
  display: grid;
  grid-template-columns: minmax(112px, 140px) minmax(0, 1fr);
  gap: 12px;
}

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

body.ding-form .seg,
body.ding-form .confirm{
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

body.ding-form .picker-btn{
  min-height: 48px;
  border-color: var(--line-strong);
  font-size: 15px;
  line-height: 1.35;
}

body.ding-form .btn{
  min-height: 48px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 800;
}

body.ding-form .footer{
  margin-top: 16px;
}

/* ✅ IMPORTANTE:
   NO tocamos .wrap global para no afectar el formulario.
   Solo ensanchamos canvas/history cuando el body tenga .fbos-board */
body.fbos-board .wrap{
  max-width: 640px;
}

/* =========================
   NAV (Intake / Canvas / History)
   (puede vivir en todas las páginas)
========================= */
.sd-nav{
  display:flex;
  gap:10px;
  margin: 6px 0 14px;
}

body.ding-form .sd-nav{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 16px;
}

.sd-nav__item{
  flex:1;
  text-align:center;
  padding:10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background:#fff;
  color: var(--text);
  text-decoration:none;
  font-weight: 900;
  font-size: 13px;
}

body.ding-form .sd-nav__item{
  padding: 14px 12px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.2;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
}

@media (max-width: 720px){
  body.ding-form .card{
    padding: 16px;
  }

  body.ding-form .sd-nav{
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  body.ding-form .sd-nav__item{
    padding: 12px 10px;
    font-size: 14px;
  }

  body.ding-form .phone-row,
  body.ding-form .segmented{
    grid-template-columns: 1fr;
  }

  body.ding-form .fbos-logo-slot{
    width: 56px;
    height: 56px;
    flex-basis: 56px;
    border-radius: 16px;
  }
}

.sd-nav__item:hover{
  border-color: rgba(10, 61, 98, 0.35);
  box-shadow: 0 0 0 4px rgba(10, 61, 98, 0.08);
}

.sd-nav__item.is-active{
  border-color: rgba(10, 61, 98, 0.30);
  background: rgba(10, 61, 98, 0.06);
  color: var(--fbos-blue);
}

/* =========================
   TOOLBAR (Canvas)
========================= */
.canvas-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom: 14px;
}

.canvas-title{
  font-weight: 800;
  letter-spacing: -0.01em;
}

.btn.btn-small{
  width: auto;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
}

/* =========================
   BOARD (Canvas)
========================= */
.board{
  display:flex;
  flex-direction:column;
  gap: 18px;
}

.state-section{
  padding-bottom: 2px;
}

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

.state-title{
  font-weight: 800;
  letter-spacing: -0.01em;
}

.state-divider{
  height: 1px;
  background: var(--line);
  margin-top: 14px;
  border-radius: 999px;
}

.state-cards{
  display:grid;
  grid-template-columns: 1fr;
  gap: var(--canvas-gap);
}

/* =========================
   ACTION CARD (Canvas)
========================= */
.action-card{
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: var(--card-pad);
  background: #fff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

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

.action-title{
  margin: 10px 0 6px;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.action-desc{
  margin: 0 0 10px;
  color: var(--muted);
  line-height: 1.35;
}

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

.action-actions{
  display:flex;
  align-items:center;
  gap: 10px;
}

/* =========================
   ACTION ID
========================= */
.action-id{
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.01em;
}

.action-id-link{
  color: var(--text);
  text-decoration: none;
}

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

/* =========================
   BADGES
========================= */
.badges{
  display:flex;
  flex-wrap:wrap;
  gap: 6px;
  justify-content:flex-end;
}

.badge{
  display:inline-flex;
  align-items:center;
  height: 24px;
  padding: 0 10px;
  border-radius: var(--badge-radius);
  font-size: 12px;
  font-weight: 800;
  border: 1px solid rgba(0,0,0,0.10);
  background: rgba(0,0,0,0.03);
}

.badge-origin{
  color: #0a3d62;
  background: rgba(10, 61, 98, 0.08);
  border-color: rgba(10, 61, 98, 0.16);
}

/* =========================
   ACTION BUTTON
========================= */
.btn-action{
  border: 1px solid rgba(0,0,0,0.14);
  background: #fff;
  color: var(--text);
  height: 36px;
  padding: 0 12px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
}

.btn-action:hover{
  border-color: rgba(10,61,98,0.35);
  box-shadow: 0 0 0 4px rgba(10,61,98,0.08);
}

/* =========================
   MODAL (Canvas Job Modal)
   ✅ Scoped: solo aplica en Canvas/History
   para NO pelearse con el modal de impresión del form.
========================= */
body.fbos-board .label-modal{
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 9999;
}

body.fbos-board .label-modal[aria-hidden="true"]{
  display: none;
}

body.fbos-board .label-card{
  width: min(560px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

body.fbos-board .label-head{
  display:flex;
  align-items:center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

body.fbos-board .label-close{
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-size: 16px;
  font-weight: 900;
}

body.fbos-board .label-close:hover{
  border-color: rgba(10, 61, 98, 0.35);
  box-shadow: 0 0 0 4px rgba(10, 61, 98, 0.08);
}

body.fbos-board .label-body{
  padding: 14px 16px 6px;
}

body.fbos-board .label-id{
  font-weight: 900;
  font-size: 18px;
}

body.fbos-board .label-meta{
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

body.fbos-board .label-grid{
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

body.fbos-board .label-desc{
  padding-top: 6px;
}

body.fbos-board .label-actions{
  display:flex;
  gap: 10px;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--line);
}

body.fbos-board .btn-secondary{
  flex: 1;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 12px 14px;
  border-radius: var(--r-md);
  font-weight: 800;
  cursor: pointer;
}

body.fbos-board .btn-secondary:hover{
  border-color: rgba(10, 61, 98, 0.35);
  box-shadow: 0 0 0 4px rgba(10, 61, 98, 0.08);
}

/* =========================
   COMMENTS (Canvas Job Modal)
========================= */
body.fbos-board .label-comments{
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

body.fbos-board .label-comments__title{
  font-weight: 800;
  margin-bottom: 12px;
}

body.fbos-board .comments-list{
  display:flex;
  flex-direction:column;
  gap: 10px;
  margin-bottom: 14px;
}

body.fbos-board .comment-item{
  background:#F8FAFC;
  border:1px solid var(--line);
  border-radius: 12px;
  padding:10px 12px;
  font-size: 14px;
}

body.fbos-board .comment-meta{
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

body.fbos-board .comments-composer{
  display:flex;
  flex-direction:column;
  gap:12px;
}

body.fbos-board .comments-textarea{
  min-height: 90px;
  resize: vertical;
}

body.fbos-board .comments-actions{
  display:flex;
  gap:10px;
  align-items:center;
}

body.fbos-board .comments-by{
  flex:1;
  height: 42px;
}

body.fbos-board .inline-msg{
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 12px;
}

body.fbos-board .inline-msg--error{
  color: #991B1B;
  background: rgba(239,68,68,0.10);
  border: 1px solid rgba(239,68,68,0.25);
}

/* =========================================================
   DING REPAIRS — Fix UI/UX picker "Damage type" + checkboxes
   Evita que /styles.css global rompa inputs tipo checkbox
   ========================================================= */

/* 1) RESET: no permitir que checkboxes hereden width:100% */
.picker input[type="checkbox"],
.field input[type="checkbox"],
.field input[type="radio"]{
  width: auto !important;
  height: auto !important;
  max-width: none !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 6px;
  accent-color: var(--fbos-blue);
}

/* =========================================
   DING REPAIRS — Damage picker (PRO UI)
   (de-duplicado: dejamos SOLO la versión PRO)
   ========================================= */

/* Botón tipo input */
.picker-btn{
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
}

.picker-btn::after{
  content: "▾";
  margin-left: auto;
  opacity: 0.55;
  font-size: 14px;
}

.picker-btn:hover{
  border-color: rgba(10, 61, 98, 0.35);
  box-shadow: 0 0 0 4px rgba(10, 61, 98, 0.08);
}

.picker-btn:focus{
  outline: none;
  border-color: rgba(10, 61, 98, 0.45);
  box-shadow: 0 0 0 4px rgba(10, 61, 98, 0.12);
}

/* Modal overlay */
.picker{
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 10000;
}

.picker[aria-hidden="true"]{
  display: none;
}

.picker-card{
  width: min(560px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 18px 60px rgba(15, 23, 42, 0.18);
}

/* Header */
.picker-head{
  display:flex;
  align-items:center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.picker-head strong{
  font-size: 14px;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.picker-close{
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-size: 16px;
  font-weight: 900;
}

.picker-close:hover{
  border-color: rgba(10, 61, 98, 0.35);
  box-shadow: 0 0 0 4px rgba(10, 61, 98, 0.08);
}

/* Body */
.picker-body{
  padding: 14px 16px 6px;
  display: grid;
  gap: 10px;
}

/* Opciones como “rows” */
.opt{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
}

.opt:hover{
  border-color: rgba(10, 61, 98, 0.22);
  background: rgba(10, 61, 98, 0.03);
}

/* Checkbox consistente */
.opt input[type="checkbox"]{
  width: 18px !important;
  height: 18px !important;
  margin: 0 !important;
  accent-color: var(--fbos-blue);
}

.opt span{
  font-weight: 800;
}

/* Other input wrapper */
#damageOtherWrap{
  margin-top: 4px;
  padding-left: 4px;
}

#damageOtherWrap .field input[type="text"]{
  width: 100%;
}

/* Footer actions */
.picker-actions{
  display:flex;
  gap: 10px;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--line);
}

.picker-actions .btn,
.picker-actions .btn-secondary{
  flex: 1;
  border-radius: 14px;
}

/* Chips dentro del botón */
.picker-btn .chips{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.picker-btn .chip{
  display: inline-flex;
  align-items:center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid rgba(0,0,0,0.10);
  background: rgba(0,0,0,0.03);
}

/* =========================
   CONFIRMATION (PRO)
   (de-duplicado: dejamos SOLO la versión PRO)
========================= */
.confirm{
  display:flex;
  gap:12px;
  align-items:flex-start;
  position: relative;

  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;

  transition: all 0.18s ease;
}

.confirm:hover{
  border-color: rgba(10, 61, 98, 0.28);
  box-shadow: 0 0 0 4px rgba(10, 61, 98, 0.06);
}

.confirm__check{
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--fbos-blue);
  flex: 0 0 auto;
}

.confirm__text{
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
  opacity: 0.95;
  flex: 1;
}

.confirm__badge{
  font-size: 11px;
  font-weight: 800;
  color: var(--fbos-blue);
  background: rgba(10,61,98,0.08);
  padding: 4px 8px;
  border-radius: 999px;
  display: none;
  align-self: center;
}

.confirm__check:checked ~ .confirm__badge{
  display: inline-flex;
}

.confirm:has(.confirm__check:checked){
  background: rgba(10,61,98,0.04);
  border-color: rgba(10,61,98,0.35);
}

.confirm:focus-within{
  border-color: rgba(10, 61, 98, 0.45);
  box-shadow: 0 0 0 4px rgba(10, 61, 98, 0.10);
}

/* =========================================================
   DING REPAIRS — Canvas UX Polish (safe overrides)
   - Reduce vertical gaps
   - Compact empty sections
   - Buttons for "Show more" + "View history"
   ========================================================= */

/* 1) Reduce extra whitespace above toolbar / logo slot */
body.fbos-board .card{
  padding-top: 12px;          /* was feeling tall */
}

body.fbos-board .fbos-logo-slot{
  margin-bottom: 10px;        /* reduce big gap under logo slot */
}

/* If your base styles add big spacing between nav and card */
body.fbos-board .sd-nav{
  margin-bottom: 10px;        /* was 14px */
}

/* 2) Toolbar tighter + aligned */
body.fbos-board .canvas-toolbar{
  margin-bottom: 10px;        /* was 14px */
}

body.fbos-board .canvas-title{
  font-size: 16px;
}

/* 3) Board spacing slightly tighter */
body.fbos-board .board{
  gap: 14px;                  /* was 18px */
}

/* 4) Compact EMPTY sections (0) */
body.fbos-board .state-empty-section{
  padding-bottom: 0;
}

body.fbos-board .state-empty-section .state-header{
  margin: 6px 2px 6px;        /* smaller header spacing */
}

body.fbos-board .state-empty-section .state-divider{
  margin-top: 8px;            /* less divider gap */
  opacity: 0.7;
}

/* 5) Make "Show more" look like a proper button */
body.fbos-board .state-footer{
  margin-top: 10px;
}

body.fbos-board .section-more-btn{
  width: 100%;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.14);
  background: #fff;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
}

body.fbos-board .section-more-btn:hover{
  border-color: rgba(10,61,98,0.35);
  box-shadow: 0 0 0 4px rgba(10,61,98,0.08);
}

/* 6) Make "View history" consistent (button-like link) */
body.fbos-board .section-history-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.14);
  background: #fff;
  font-weight: 800;
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
}

body.fbos-board .section-history-btn:hover{
  border-color: rgba(10,61,98,0.35);
  box-shadow: 0 0 0 4px rgba(10,61,98,0.08);
}

/* 7) Dual footer layout polish (Closed section) */
body.fbos-board .state-footer--dual{
  gap: 10px;
}

body.fbos-board .state-footer--dual .section-more-btn,
body.fbos-board .state-footer--dual .section-history-btn{
  flex: 1;
}

/* 8) Slightly reduce card bottom spacing */
body.fbos-board .action-card{
  padding: 12px;              /* was var(--card-pad)=14px */
}

body.fbos-board .action-title{
  margin-top: 8px;
}
