/* Condoport V3 — LVF Plantões R1: camada final, estritamente escopada. */
.shift-p6-shell .shift-p6-open-card{
  min-height:0;
  padding:12px;
  gap:16px;
  border-color:#dbe3ec;
  border-radius:12px;
}

.shift-p6-shell .shift-p6-actions{
  gap:8px;
}

.shift-p6-shell .shift-p6-actions .shift-p6-action-btn,
.shift-p6-dialog .shift-p6-dialog-footer .btn,
.shift-p6-dialog .shift-p6-modal-form .form-actions .btn{
  display:inline-flex;
  min-height:38px;
  height:38px;
  align-items:center;
  justify-content:center;
  gap:6px;
  padding:0 12px;
  box-sizing:border-box;
  border-radius:9px;
  font-size:.76rem;
  font-weight:800;
  line-height:1;
  white-space:nowrap;
}

.shift-p6-shell .shift-p6-actions .shift-p6-action-btn{
  border-color:#cbd7e4;
  background:var(--cp-white);
  color:var(--cp-navy-900);
}

.shift-p6-shell .shift-p6-actions .shift-p6-action-btn:hover,
.shift-p6-dialog .shift-p6-dialog-footer .btn-secondary:hover,
.shift-p6-dialog .shift-p6-modal-form .form-actions .btn-secondary:hover{
  border-color:#9eb6d0;
  background:#f6f9fc;
}

.shift-p6-shell .shift-p6-actions .shift-p6-action-btn--danger{
  border-color:#e8b9b4;
  background:var(--cp-white);
  color:#b42318;
}

.shift-p6-shell .shift-p6-actions .shift-p6-action-btn--danger:hover{
  border-color:#cf5c52;
  background:#fff7f6;
}

.shift-p6-shell .shift-p6-actions .shift-p6-action-btn svg{
  width:15px;
  height:15px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.9;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.shift-p6-shell .shift-p6-history-head{
  min-height:38px;
  padding-inline:14px;
}

.shift-p6-shell .shift-p6-history-row{
  min-height:52px;
  padding:7px 14px;
}

.shift-p6-shell .shift-p6-history-action .btn{
  min-height:38px;
  height:38px;
  padding-inline:12px;
  border-color:#cbd7e4;
  border-radius:9px;
  background:var(--cp-white);
  color:var(--cp-navy-900);
  font-size:.74rem;
  font-weight:800;
}

.shift-p6-dialog{
  width:min(92vw,720px);
  max-height:min(88vh,820px);
  border-radius:14px;
}

.shift-p6-dialog .shift-p6-dialog-card{
  padding:18px;
  border-radius:14px;
}

.shift-p6-dialog .shift-p6-dialog-scroll{
  gap:8px;
  max-height:min(62vh,650px);
}

.shift-p6-dialog .shift-p6-dialog-footer{
  justify-content:flex-start;
  padding-top:12px;
  margin-top:10px;
}

.shift-p6-dialog .shift-p6-dialog-footer--split,
.shift-p6-dialog .shift-p6-dialog-footer--split > div{
  justify-content:flex-start;
}

.shift-p6-dialog .shift-p6-dialog-footer .btn-danger{
  border-color:#cc4d45;
  background:#cf4b43;
  color:#fff;
}

.shift-p6-dialog .shift-p6-modal-form,
.shift-p6-dialog .shift-p6-modal-form .form-grid{
  padding:0;
  border:0;
  background:transparent;
  box-shadow:none;
}

.shift-p6-dialog .shift-p6-modal-form .field{
  margin-top:9px;
}

.shift-p6-dialog .shift-p6-modal-form .field:first-child,
.shift-p6-dialog .shift-p6-modal-form .form-grid .field{
  margin-top:0;
}

.shift-p6-dialog .shift-p6-modal-form input,
.shift-p6-dialog .shift-p6-modal-form select{
  min-height:38px;
  height:38px;
}

.shift-p6-dialog .shift-p6-modal-form textarea{
  min-height:72px;
  resize:vertical;
}

.shift-p6-dialog .shift-p6-modal-form .form-actions{
  display:flex;
  align-items:center;
  gap:8px;
  min-height:50px;
  margin-top:12px;
  padding-top:10px;
}

.shift-p6-dialog .shift-p6-modal-form .form-actions .btn-primary{
  border-color:var(--cp-navy-900);
  background:var(--cp-navy-900);
  color:#fff;
}

.shift-p6-dialog .shift-p6-modal-form .form-actions .btn-secondary{
  border-color:#cbd7e4;
  background:var(--cp-white);
  color:var(--cp-navy-900);
}

.shift-p6-dialog .shift-p6-modal-form .form-actions .btn-danger{
  border-color:#cc4d45;
  background:#cf4b43;
  color:#fff;
}

.shift-p6-dialog .shift-p6-close-summary{
  gap:8px;
  margin-bottom:12px;
}

.shift-p6-dialog .shift-p6-close-summary > div{
  min-height:62px;
  justify-content:center;
  padding:10px;
  border:1px solid #e5eaf0;
  border-radius:10px;
  background:#f8fafc;
}

@media (max-width:1024px){
  .shift-p6-shell .shift-p6-open-card{
    align-items:stretch;
    flex-direction:column;
  }

  .shift-p6-shell .shift-p6-open-main{
    width:100%;
    align-items:flex-start;
    flex-direction:column;
    gap:10px;
  }

  .shift-p6-shell .shift-p6-open-info{
    width:100%;
    grid-template-columns:minmax(0,1.2fr) minmax(0,.8fr);
    gap:10px 14px;
  }

  .shift-p6-shell .shift-p6-actions{
    justify-content:flex-end;
  }
}

@media (max-width:760px){
  .shift-p6-shell .shift-p6-open-card{
    padding:12px;
  }

  .shift-p6-shell .shift-p6-code{
    width:100%;
    flex-direction:row;
    align-items:center;
    justify-content:space-between;
  }

  .shift-p6-shell .shift-p6-code > strong{
    font-size:.86rem;
  }

  .shift-p6-shell .shift-p6-open-info span:nth-child(2) strong{
    font-size:.68rem;
  }

  .shift-p6-shell .shift-p6-actions{
    display:grid;
    width:100%;
    grid-template-columns:repeat(3,minmax(0,1fr));
    justify-content:stretch;
  }

  .shift-p6-shell .shift-p6-actions .shift-p6-action-btn{
    width:100%;
    padding-inline:8px;
    font-size:.72rem;
  }

  html:root:root body main .shift-p6-shell .shift-p6-history-table{
    gap:8px;
  }

  html:root:root body main .shift-p6-shell .shift-p6-history-row{
    grid-template-columns:minmax(0,1.2fr) minmax(0,.8fr);
    grid-template-areas:
      "date status"
      "porter shift"
      "action action";
    gap:9px 12px;
    min-height:0;
    padding:12px;
    border-color:#dfe6ed;
    border-radius:11px;
  }

  html:root:root body main .shift-p6-shell .shift-p6-history-row > [role="cell"]:nth-child(1){
    align-items:flex-start;
    color:#26364b;
    font-size:.8rem;
    font-weight:800;
  }

  html:root:root body main .shift-p6-shell .shift-p6-history-row > [role="cell"]:nth-child(2),
  html:root:root body main .shift-p6-shell .shift-p6-history-row > [role="cell"]:nth-child(3){
    min-height:38px;
    gap:3px;
    color:#2f3d52;
    font-size:.76rem;
    font-weight:750;
  }

  html:root:root body main .shift-p6-shell .shift-p6-history-row > [role="cell"]:nth-child(2)::before,
  html:root:root body main .shift-p6-shell .shift-p6-history-row > [role="cell"]:nth-child(3)::before{
    color:#7c8898;
    font-size:.6rem;
  }

  html:root:root body main .shift-p6-shell .shift-p6-history-row > [role="cell"]:nth-child(5){
    align-items:stretch;
    justify-content:stretch;
    min-height:38px;
  }

  html:root:root body main .shift-p6-shell .shift-p6-history-action .btn{
    width:100%;
    justify-content:center;
  }

  .shift-p6-shell .shift-p6-pagination{
    gap:8px;
    padding-top:8px;
    font-size:.7rem;
  }

  .shift-p6-dialog{
    width:calc(100vw - 24px);
    max-height:calc(100dvh - 24px);
  }

  .shift-p6-dialog .shift-p6-dialog-card{
    padding:14px;
  }

  .shift-p6-dialog .shift-p6-dialog-scroll{
    max-height:calc(100dvh - 152px);
  }

  .shift-p6-dialog .shift-p6-close-summary{
    grid-template-columns:1fr;
    gap:7px;
  }

  .shift-p6-dialog .shift-p6-close-summary > div{
    min-height:0;
    padding:9px 10px;
  }

  .shift-p6-dialog .shift-p6-modal-form .form-actions{
    align-items:stretch;
    flex-direction:column;
  }

  .shift-p6-dialog .shift-p6-modal-form .form-actions .btn{
    width:100%;
  }
}

@media (max-width:480px){
  html:root:root body main .shift-p6-shell .shift-p6-history-row{
    grid-template-columns:minmax(0,1.2fr) minmax(0,.8fr);
  }
}

@media (max-width:360px){
  .shift-p6-shell .shift-p6-actions{
    grid-template-columns:1fr;
  }
}

/* Tema escuro: reutiliza os tokens de superfície e borda da aplicação. */
html[data-theme="dark"] .shift-p6-shell .shift-p6-open-card,
html[data-theme="dark"] .shift-p6-shell .shift-p6-history-table,
html[data-theme="dark"] .shift-p6-shell .shift-p6-history-row,
html[data-theme="dark"] .shift-p6-dialog .shift-p6-dialog-card{
  border-color:var(--cp-border);
  background:var(--cp-surface);
  color:inherit;
}

html[data-theme="dark"] .shift-p6-shell .shift-p6-section-head h2,
html[data-theme="dark"] .shift-p6-shell .shift-p6-open-card strong,
html[data-theme="dark"] .shift-p6-shell .shift-p6-history-row,
html[data-theme="dark"] .shift-p6-shell .shift-p6-history-row > [role="cell"],
html[data-theme="dark"] .shift-p6-shell .shift-p6-history-row .shift-p6-ellipsis,
html[data-theme="dark"] .shift-p6-dialog .shift-p6-dialog-card > h2,
html[data-theme="dark"] .shift-p6-dialog .shift-p6-dialog-card > small{
  color:inherit;
}

html[data-theme="dark"] .shift-p6-shell .shift-p6-pagination a{
  color:inherit;
}

/* O legado usa html:root:root body main:has(...); preserva o contraste escuro. */
html:root:root[data-theme="dark"] body main .shift-p6-shell .shift-p6-history-row > [role="cell"],
html:root:root[data-theme="dark"] body main .shift-p6-shell .shift-p6-history-row .shift-p6-ellipsis{
  color:inherit !important;
}

html[data-theme="dark"] .shift-p6-shell .shift-p6-history-head,
html[data-theme="dark"] .shift-p6-shell .shift-p6-history-action .btn,
html[data-theme="dark"] .shift-p6-shell .shift-p6-actions .shift-p6-action-btn,
html[data-theme="dark"] .shift-p6-dialog .shift-p6-dialog-footer .btn-secondary,
html[data-theme="dark"] .shift-p6-dialog .shift-p6-modal-form .form-actions .btn-secondary,
html[data-theme="dark"] .shift-p6-dialog .shift-p6-close-summary > div{
  border-color:var(--cp-border);
  background:var(--cp-surface);
  color:inherit;
}

html[data-theme="dark"] .shift-p6-dialog .shift-p6-detail-group,
html[data-theme="dark"] .shift-p6-dialog .shift-p6-detail-grid > div,
html[data-theme="dark"] .shift-p6-dialog .shift-p6-detail-note{
  border-color:var(--cp-border);
  background:transparent;
  color:inherit;
}
