/* iPOS-style shift detail. Kept separate so report layout cannot be trapped by legacy media queries. */
dialog.shift-report-dialog {
  position: fixed;
  inset: 22px;
  width: min(1180px, calc(100vw - 44px)) !important;
  max-width: 1180px !important;
  height: auto;
  max-height: calc(100dvh - 44px) !important;
  margin: auto;
  padding: 0 !important;
  overflow: auto !important;
  border: 0;
  border-radius: 8px;
  background: #f4f6f8;
  color: #253747;
  box-shadow: 0 20px 70px rgba(15, 38, 54, .3);
}

dialog.shift-report-dialog::backdrop { background: rgba(18, 35, 48, .52); }
dialog.shift-report-dialog #shiftReportDetail { min-width: 0; }

dialog.shift-report-dialog .shift-detail-head {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 150px;
  align-items: center;
  min-height: 70px;
  padding: 10px 18px;
  border-bottom: 1px solid #dce3e8;
  background: rgba(255, 255, 255, .98);
}

dialog.shift-report-dialog .shift-detail-head > div { min-width: 0; text-align: center; }
dialog.shift-report-dialog .shift-detail-head small { display: block; color: #6d7f8c; font-size: 11px; font-weight: 700; letter-spacing: .08em; }
dialog.shift-report-dialog .shift-detail-head h2 { margin: 2px 0 0; color: #243746; font-size: 20px; line-height: 1.15; }
dialog.shift-report-dialog .shift-detail-head p { margin: 3px 0 0; overflow: hidden; color: #697b87; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
dialog.shift-report-dialog .shift-detail-head .icon-button {
  justify-self: start;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #536875;
  font-size: 30px;
  font-weight: 300;
}
dialog.shift-report-dialog .shift-detail-head .icon-button:hover { background: #eef3f6; color: #126fa4; }
dialog.shift-report-dialog .shift-detail-head .secondary-button {
  justify-self: end;
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid #1988c1;
  border-radius: 5px;
  background: #fff;
  color: #1077ad;
  font-size: 13px;
  font-weight: 700;
}

dialog.shift-report-dialog .shift-detail-grid {
  display: grid !important;
  grid-template-columns: 330px minmax(0, 1fr) !important;
  gap: 14px;
  padding: 16px 18px 14px;
}

dialog.shift-report-dialog .shift-cashbox {
  align-self: start;
  overflow: hidden;
  border: 1px solid #d7e0e6;
  border-radius: 4px;
  background: #fff;
}

dialog.shift-report-dialog .shift-cashbox-hero {
  padding: 18px 20px 14px;
  background: #3c8abe;
  color: #fff;
  text-align: center;
}
dialog.shift-report-dialog .shift-cashbox-hero b { display: block; margin-bottom: 13px; font-size: 16px; }
dialog.shift-report-dialog .shift-cashbox-hero span { display: block; color: #d9edf8; font-size: 12px; text-transform: uppercase; }
dialog.shift-report-dialog .shift-cashbox-hero strong { display: block; margin: 3px 0 12px; font-size: 27px; font-weight: 500; line-height: 1.15; }
dialog.shift-report-dialog .shift-cashbox-hero strong:last-child { margin-bottom: 0; }
dialog.shift-report-dialog .shift-cashbox dl { margin: 0; }
dialog.shift-report-dialog .shift-cashbox dl > div { display: grid !important; grid-template-columns: 44% minmax(0, 1fr) !important; border-top: 1px solid #dbe3e8; }
dialog.shift-report-dialog .shift-cashbox dt,
dialog.shift-report-dialog .shift-cashbox dd { margin: 0; padding: 9px 10px; font-size: 12px; line-height: 1.35; }
dialog.shift-report-dialog .shift-cashbox dt { background: #eaf3f8; font-weight: 700; }
dialog.shift-report-dialog .shift-cashbox dd { min-width: 0; border-left: 1px solid #dbe3e8; font-weight: 600; overflow-wrap: anywhere; }
dialog.shift-report-dialog .shift-cashbox-total dt,
dialog.shift-report-dialog .shift-cashbox-total dd { color: #096d9e; font-weight: 800; }
dialog.shift-report-dialog .shift-open { color: #138162; }

dialog.shift-report-dialog .shift-detail-cards {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 14px;
  align-content: start;
  min-width: 0;
}
dialog.shift-report-dialog .shift-detail-cards > article {
  min-width: 0;
  min-height: 214px;
  padding: 15px;
  border: 1px solid #d7e0e6;
  border-radius: 4px;
  background: #fff;
}
dialog.shift-report-dialog .shift-detail-cards h3,
dialog.shift-report-dialog .shift-invoice-list h3 { margin: 0 0 14px; color: #263846; font-size: 17px; font-weight: 600; }

dialog.shift-report-dialog .fabi-donut-wrap {
  display: grid !important;
  grid-template-columns: 128px minmax(0, 1fr) !important;
  align-items: center;
  gap: 14px;
}
dialog.shift-report-dialog .fabi-donut {
  position: relative;
  display: grid !important;
  place-items: center;
  width: 122px !important;
  height: 122px !important;
  min-width: 122px;
  min-height: 122px;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 50% !important;
}
dialog.shift-report-dialog .fabi-donut::after { content: ""; position: absolute; inset: 27%; border-radius: 50%; background: #fff; }
dialog.shift-report-dialog .fabi-donut > span { position: relative; z-index: 1; max-width: 68px; color: #385766; font-size: 10px; font-weight: 800; text-align: center; }
dialog.shift-report-dialog .fabi-donut-wrap ul { min-width: 0; margin: 0; padding: 0; list-style: none; }
dialog.shift-report-dialog .fabi-donut-wrap li { display: grid !important; grid-template-columns: 8px minmax(0, 1fr) auto !important; align-items: center; gap: 7px; padding: 5px 0; font-size: 11px; }
dialog.shift-report-dialog .fabi-donut-wrap li i { width: 8px; height: 8px; border-radius: 50%; }
dialog.shift-report-dialog .fabi-donut-wrap li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

dialog.shift-report-dialog .shift-payment-list > div { display: flex !important; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid #e7edf1; font-size: 12px; }
dialog.shift-report-dialog .shift-payment-list > div:last-child { border-bottom: 0; }
dialog.shift-report-dialog .shift-payment-list span,
dialog.shift-report-dialog .shift-payment-list small { display: block; }
dialog.shift-report-dialog .shift-payment-list small { margin-top: 3px; color: #768894; font-size: 10px; }

dialog.shift-report-dialog .shift-invoice-list {
  margin: 0 18px 18px;
  padding: 15px;
  overflow-x: auto;
  border: 1px solid #d7e0e6;
  border-radius: 4px;
  background: #fff;
}
dialog.shift-report-dialog .shift-invoice-list .orders-table-wrap { min-width: 680px; }
dialog.shift-report-dialog .shift-invoice-list table { width: 100%; border-collapse: collapse; }
dialog.shift-report-dialog .shift-invoice-list th { background: #edf2f5; color: #607583; font-size: 11px; text-transform: uppercase; }
dialog.shift-report-dialog .shift-invoice-list th,
dialog.shift-report-dialog .shift-invoice-list td { padding: 11px 12px; border-bottom: 1px solid #e2e8ec; text-align: left; }
dialog.shift-report-dialog .shift-invoice-list tbody tr[role="button"] { cursor: pointer; }
dialog.shift-report-dialog .shift-invoice-list tbody tr[role="button"]:hover { background: #eff8fd; }

@media (max-width: 800px) {
  dialog.shift-report-dialog {
    inset: 0;
    width: 100vw !important;
    max-width: none !important;
    height: 100dvh !important;
    max-height: none !important;
    border-radius: 0;
  }
  dialog.shift-report-dialog .shift-detail-head {
    grid-template-columns: 48px minmax(0, 1fr) 48px;
    min-height: 64px;
    padding: 8px 10px;
  }
  dialog.shift-report-dialog .shift-detail-head small { font-size: 10px; }
  dialog.shift-report-dialog .shift-detail-head h2 { font-size: 17px; }
  dialog.shift-report-dialog .shift-detail-head p { font-size: 11px; }
  dialog.shift-report-dialog .shift-detail-head .secondary-button {
    width: 42px;
    min-width: 42px;
    height: 42px;
    padding: 0;
    overflow: hidden;
    border: 0;
    background: #eaf4fa;
    color: transparent;
    font-size: 0;
  }
  dialog.shift-report-dialog .shift-detail-head .secondary-button::before { content: "⇩"; color: #0b78ad; font-size: 22px; }
  dialog.shift-report-dialog .shift-detail-grid { grid-template-columns: minmax(0, 1fr) !important; gap: 12px; padding: 12px; }
  dialog.shift-report-dialog .shift-cashbox-hero { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 15px 12px 5px; }
  dialog.shift-report-dialog .shift-cashbox-hero b { grid-column: 1 / -1; margin-bottom: 13px; }
  dialog.shift-report-dialog .shift-cashbox-hero span:nth-of-type(1),
  dialog.shift-report-dialog .shift-cashbox-hero strong:nth-of-type(1) { grid-column: 1; }
  dialog.shift-report-dialog .shift-cashbox-hero span:nth-of-type(2),
  dialog.shift-report-dialog .shift-cashbox-hero strong:nth-of-type(2) { grid-column: 2; }
  dialog.shift-report-dialog .shift-cashbox-hero span:nth-of-type(1),
  dialog.shift-report-dialog .shift-cashbox-hero span:nth-of-type(2) { grid-row: 2; }
  dialog.shift-report-dialog .shift-cashbox-hero strong:nth-of-type(1),
  dialog.shift-report-dialog .shift-cashbox-hero strong:nth-of-type(2) { grid-row: 3; }
  dialog.shift-report-dialog .shift-cashbox-hero span { font-size: 10px; }
  dialog.shift-report-dialog .shift-cashbox-hero strong { margin: 4px 0 12px; font-size: 21px; }
  dialog.shift-report-dialog .shift-cashbox dl > div { grid-template-columns: 43% minmax(0, 1fr) !important; }
  dialog.shift-report-dialog .shift-cashbox dt,
  dialog.shift-report-dialog .shift-cashbox dd { padding: 10px; font-size: 13px; }
  dialog.shift-report-dialog .shift-detail-cards { grid-template-columns: minmax(0, 1fr) !important; gap: 12px; }
  dialog.shift-report-dialog .shift-detail-cards > article { min-height: 0; padding: 15px; }
  dialog.shift-report-dialog .fabi-donut-wrap { grid-template-columns: 122px minmax(0, 1fr) !important; }
  dialog.shift-report-dialog .fabi-donut { width: 116px !important; height: 116px !important; min-width: 116px; min-height: 116px; }
  dialog.shift-report-dialog .shift-invoice-list { margin: 0 12px 24px; padding: 14px 12px; }
}

@media (max-width: 390px) {
  dialog.shift-report-dialog .shift-detail-head small { display: none; }
  dialog.shift-report-dialog .shift-cashbox dt,
  dialog.shift-report-dialog .shift-cashbox dd { font-size: 12px; }
  dialog.shift-report-dialog .fabi-donut-wrap { grid-template-columns: 105px minmax(0, 1fr) !important; gap: 10px; }
  dialog.shift-report-dialog .fabi-donut { width: 100px !important; height: 100px !important; min-width: 100px; min-height: 100px; }
}
