/* Reduce the date-navigation footprint on the mobile-first Placement page. */
.app-page-content > .panel > .tabs > button[data-placement-date] {
  min-height: 0;
  padding: .55rem .45rem;
  font-size: .82rem;
  line-height: 1.15;
}
.app-page-content > .panel > .tabs > button[data-placement-date] small {
  display: inline-block;
  margin-top: .15rem;
  font-size: .72rem;
  line-height: 1.1;
}
.app-page-content > .panel > .tabs .edit-date-picker {
  gap: .4rem;
  padding: .55rem;
}
.app-page-content > .panel > .tabs .edit-date-picker label {
  font-size: .78rem;
}
.app-page-content > .panel > .tabs .edit-date-picker input,
.app-page-content > .panel > .tabs .edit-date-picker button {
  min-height: 2.45rem;
  padding-block: .45rem;
}

/* Placement only: arrange the three date shortcuts plus History and the two
   custom-date controls in an even three-column, two-row grid. */
.app-page-content > .panel > .tabs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(2.1rem, auto));
  gap: .35rem;
  padding: .35rem;
  align-items: stretch;
}
.app-page-content > .panel > .tabs > button[data-placement-date] {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 2.1rem;
  padding: .22rem .2rem;
  font-size: .76rem;
  line-height: 1.08;
  text-align: center;
}
.app-page-content > .panel > .tabs > button[data-placement-date] > .placement-date-title,
.app-page-content > .panel > .tabs > button[data-placement-date] > small {
  display: block;
  width: 100%;
  text-align: center;
}
.app-page-content > .panel > .tabs > button[data-placement-date] small {
  margin-top: .08rem;
  font-size: 0;
  line-height: 1.05;
}
.app-page-content > .panel > .tabs > button[data-placement-date] small::after {
  content: attr(data-compact-date);
  display: inline-block;
  font-size: .62rem;
  line-height: 1.05;
}
.app-page-content > .panel > .tabs > button[data-placement-label="Kemarin"] { grid-area: 1 / 1; }
.app-page-content > .panel > .tabs > button[data-placement-label="Hari Ini"] { grid-area: 1 / 2; }
.app-page-content > .panel > .tabs > button[data-placement-label="Besok"] { grid-area: 1 / 3; }
.app-page-content > .panel > .tabs > button[data-placement-label="Lusa"] { display: none !important; }
.app-page-content > .panel > .tabs > button[data-open-history] {
  grid-area: 2 / 1;
  min-height: 2.1rem;
  padding: .22rem .2rem;
  font-size: .76rem;
  line-height: 1.08;
}
.app-page-content > .panel > .tabs .edit-date-picker {
  display: contents;
}
.app-page-content > .panel > .tabs .edit-date-picker > label {
  grid-area: 2 / 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .08rem;
  box-sizing: border-box;
  min-width: 0;
  padding: .15rem .2rem;
  font-size: 0;
  line-height: 0;
}
.app-page-content > .panel > .tabs .edit-date-picker > label > input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 1.65rem;
  height: 1.65rem;
  padding: .12rem .2rem;
  font-size: .72rem;
  line-height: 1.1;
}
.app-page-content > .panel > .tabs .edit-date-picker > button {
  grid-area: 2 / 3;
  min-width: 0;
  min-height: 2.1rem;
  padding: .2rem .16rem;
  font-size: .72rem;
  line-height: 1.05;
  white-space: normal;
}
@media (max-width: 360px) {
  .app-page-content > .panel > .tabs { gap: .35rem; }
  .app-page-content > .panel > .tabs > button[data-placement-date],
  .app-page-content > .panel > .tabs > button[data-open-history],
  .app-page-content > .panel > .tabs .edit-date-picker > button { font-size: .78rem; }
  .app-page-content > .panel > .tabs .edit-date-picker > label > input { font-size: .68rem; }
}

@media (max-width: 800px) {
  .app-page-content > .panel:has(> .tabs [data-placement-date]) .team-actions {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: .4rem;
  }
  .app-page-content > .panel:has(> .tabs [data-placement-date]) .team-actions > button {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 2.7rem;
    padding: .35rem .2rem;
    font-size: .76rem;
    line-height: 1.1;
    text-align: center;
    white-space: normal;
  }
}

/* Penempatan only: compact outlet rows to approximately the height of the
   "Hari Ini" shortcut while preserving legible values and column widths. */
@media (max-width: 800px) {
  .app-page-content > .panel:has(> .tabs [data-placement-date]) .placement-guide-table td {
    padding-block: 1px !important;
  }
  .app-page-content > .panel:has(> .tabs [data-placement-date]) .placement-guide-table input,
  .app-page-content > .panel:has(> .tabs [data-placement-date]) .placement-guide-table select {
    box-sizing: border-box;
    height: 30px !important;
    min-height: 30px !important;
    padding-block: 2px;
    font-size: 12px !important;
    line-height: 1.1;
  }
}

/* Placement only: reclaim unused mobile table width, while reserving extra
   room for the longest current note ("Pengganti otomatis"). */
@media (max-width: 600px) {
  .app-page-content > .panel:has(> .tabs [data-placement-date]) .placement-guide-table {
    width: 623px !important;
    min-width: 623px !important;
    table-layout: fixed !important;
  }
  .app-page-content > .panel:has(> .tabs [data-placement-date]) .placement-guide-table th:nth-child(1),
  .app-page-content > .panel:has(> .tabs [data-placement-date]) .placement-guide-table td:nth-child(1) { width: 49px !important; padding-inline: 1px !important; font-size: 10px !important; white-space: nowrap; }
  .app-page-content > .panel:has(> .tabs [data-placement-date]) .placement-guide-table th:nth-child(2),
  .app-page-content > .panel:has(> .tabs [data-placement-date]) .placement-guide-table td:nth-child(2) { width: 88px !important; }
  .app-page-content > .panel:has(> .tabs [data-placement-date]) .placement-guide-table th:nth-child(2) { width: 88px !important; }
  .app-page-content > .panel:has(> .tabs [data-placement-date]) .placement-guide-table th:nth-child(3),
  .app-page-content > .panel:has(> .tabs [data-placement-date]) .placement-guide-table td:nth-child(3) { width: 88px !important; }
  .app-page-content > .panel:has(> .tabs [data-placement-date]) .placement-guide-table th:nth-child(3) { width: 88px !important; }
  .app-page-content > .panel:has(> .tabs [data-placement-date]) .placement-guide-table th:nth-child(4),
  .app-page-content > .panel:has(> .tabs [data-placement-date]) .placement-guide-table td:nth-child(4) { width: 81.4px !important; }
  .app-page-content > .panel:has(> .tabs [data-placement-date]) .placement-guide-table th:nth-child(5),
  .app-page-content > .panel:has(> .tabs [data-placement-date]) .placement-guide-table td:nth-child(5) { width: 88px !important; }
  .app-page-content > .panel:has(> .tabs [data-placement-date]) .placement-guide-table th:nth-child(5) { width: 88px !important; }
  .app-page-content > .panel:has(> .tabs [data-placement-date]) .placement-guide-table th:nth-child(6),
  .app-page-content > .panel:has(> .tabs [data-placement-date]) .placement-guide-table td:nth-child(6) { width: 81.4px !important; }
  .app-page-content > .panel:has(> .tabs [data-placement-date]) .placement-guide-table th:nth-child(7),
  .app-page-content > .panel:has(> .tabs [data-placement-date]) .placement-guide-table td:nth-child(7) { width: 145px !important; }
}

/* Match the mobile coordinator controls to the compact Placement table. */
@media (max-width: 800px) {
  .app-page-content > .panel:has(> .tabs [data-placement-date]) h3:has(.team-name) {
    margin-block: .75rem .35rem !important;
    font-size: .9rem !important;
    line-height: 1.2;
  }
  .app-page-content > .panel:has(> .tabs [data-placement-date]) h3:has(.team-name) .team-name {
    box-sizing: border-box;
    height: 2.25rem !important;
    min-height: 2.25rem !important;
    margin: .3rem 0 .45rem !important;
    padding: .35rem .55rem !important;
    font-size: 12px !important;
    line-height: 1.2;
  }
  .app-page-content > .panel:has(> .tabs [data-placement-date]) .team-actions > button {
    min-height: 2.5rem !important;
    padding-block: .35rem;
    font-size: 12px !important;
    line-height: 1.1;
  }
}

/* Placement only: keep the date shortcuts, coordinator actions, and table
   aligned to one compact mobile spacing rhythm. */
@media (max-width: 800px) {
  .app-page-content > .panel:has(> .tabs [data-placement-date]) > .tabs {
    margin-block: .35rem !important;
  }
  .app-page-content > .panel:has(> .tabs [data-placement-date]) h3:has(.team-name) {
    margin-top: .35rem !important;
  }
  .app-page-content > .panel:has(> .tabs [data-placement-date]) .team-actions {
    box-sizing: border-box;
    gap: .35rem !important;
    margin-top: .35rem !important;
    padding-inline: .35rem;
  }
  .app-page-content > .panel:has(> .tabs [data-placement-date]) .team-actions + .table-scroll {
    margin-top: .35rem !important;
  }
}

/* Report date controls: keep the shortcut grid and custom-date picker side by side. */
.app-page-content .report-date-picker.report-date-picker--match-placement {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: .65rem;
  align-items: stretch;
}
.app-page-content .report-date-picker.report-date-picker--match-placement .report-date-shortcuts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(3.2rem, auto));
  gap: .55rem;
}
.app-page-content .report-date-picker.report-date-picker--match-placement .report-date-shortcut {
  min-width: 0;
  padding: .5rem .35rem;
  font-size: .9rem;
  line-height: 1.2;
}
.app-page-content .report-date-picker.report-date-picker--match-placement .report-date-shortcut small {
  display: block;
  margin-top: .15rem;
  font-size: .76rem;
}
.app-page-content .report-date-picker.report-date-picker--match-placement .report-date-custom {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .45rem;
  min-width: 0;
  padding: .6rem;
}
.app-page-content .report-date-picker.report-date-picker--match-placement .report-date-label {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  min-width: 0;
  font-size: .85rem;
}
.app-page-content .report-date-picker.report-date-picker--match-placement .report-date-label input,
.app-page-content .report-date-picker.report-date-picker--match-placement .report-date-open {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 2.8rem;
  padding: .45rem;
  font-size: .9rem;
}
@media (max-width: 360px) {
  .app-page-content .report-date-picker.report-date-picker--match-placement { gap: .4rem; }
  .app-page-content .report-date-picker.report-date-picker--match-placement .report-date-shortcuts { gap: .35rem; }
  .app-page-content .report-date-picker.report-date-picker--match-placement .report-date-custom { padding: .4rem; }
  .app-page-content .report-date-picker.report-date-picker--match-placement .report-date-shortcut,
  .app-page-content .report-date-picker.report-date-picker--match-placement .report-date-label input,
  .app-page-content .report-date-picker.report-date-picker--match-placement .report-date-open { font-size: .8rem; }
}

/* Reports only: use the same compact date grid and mobile rhythm as Placement. */
.app-page-content > .panel:has(> .report-head) .report-head > div:first-child {
  display: none !important;
}
@media (max-width: 800px) {
  .app-page-content > .panel:has(> .report-head) .report-head {
    gap: .35rem !important;
    margin: 0 0 .35rem !important;
    padding-bottom: 0 !important;
  }
  .app-page-content > .panel:has(> .report-head) .report-date-picker.report-date-picker--match-placement {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(2.1rem, auto));
    gap: .35rem;
    padding: .35rem;
    align-items: stretch;
  }
  .app-page-content > .panel:has(> .report-head) .report-date-picker.report-date-picker--match-placement .report-date-shortcuts,
  .app-page-content > .panel:has(> .report-head) .report-date-picker.report-date-picker--match-placement .report-date-custom {
    display: contents;
  }
  .app-page-content > .panel:has(> .report-head) .report-date-picker.report-date-picker--match-placement .report-date-shortcut {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-width: 0;
    min-height: 2.1rem;
    padding: .22rem .2rem;
    gap: 0 !important;
    font-size: .76rem;
    line-height: 1.08;
    text-align: center;
    white-space: normal;
  }
  .app-page-content > .panel:has(> .report-head) .report-date-picker.report-date-picker--match-placement [data-report-shift="-1"] { grid-area: 1 / 1; }
  .app-page-content > .panel:has(> .report-head) .report-date-picker.report-date-picker--match-placement [data-report-today] { grid-area: 1 / 2; }
  .app-page-content > .panel:has(> .report-head) .report-date-picker.report-date-picker--match-placement [data-report-shift="1"] { grid-area: 1 / 3; }
  .app-page-content > .panel:has(> .report-head) .report-date-picker.report-date-picker--match-placement [data-report-history-toggle] { grid-area: 2 / 1; }
  .app-page-content > .panel:has(> .report-head) .report-date-picker.report-date-picker--match-placement .report-date-shortcut small {
    display: block;
    margin-top: .08rem;
    font-size: .62rem;
    line-height: 1.05;
  }
  .app-page-content > .panel:has(> .report-head) .report-date-picker.report-date-picker--match-placement .report-date-label {
    grid-area: 2 / 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: .08rem;
    box-sizing: border-box;
    min-width: 0;
    padding: .15rem .2rem;
    font-size: 0;
    line-height: 0;
  }
  .app-page-content > .panel:has(> .report-head) .report-date-picker.report-date-picker--match-placement .report-date-label input {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 1.65rem;
    height: 1.65rem;
    padding: .12rem .2rem;
    font-size: .72rem;
    line-height: 1.1;
  }
  .app-page-content > .panel:has(> .report-head) .report-date-picker.report-date-picker--match-placement .report-date-open {
    grid-area: 2 / 3;
    box-sizing: border-box;
    min-width: 0;
    min-height: 2.1rem;
    padding: .2rem .16rem;
    font-size: .72rem;
    line-height: 1.05;
    white-space: normal;
  }
  .app-page-content > .panel:has(> .report-head) .report-summary {
    gap: .35rem;
    margin-block: .35rem !important;
  }
  .app-page-content > .panel:has(> .report-head) .report-legend {
    gap: .35rem;
    margin-block: .35rem !important;
  }
  .app-page-content > .panel:has(> .report-head) .report-team {
    box-sizing: border-box;
    margin-block: .35rem !important;
    padding: .35rem !important;
  }
  .app-page-content > .panel:has(> .report-head) .report-team .team-heading {
    margin: -.35rem -.35rem .35rem !important;
    padding: .35rem !important;
  }
  .app-page-content > .panel:has(> .report-head) .report-team .team-heading h3 {
    font-size: .9rem !important;
    line-height: 1.2;
  }
  .app-page-content > .panel:has(> .report-head) .report-team .team-heading p {
    margin-block: .15rem 0 !important;
    font-size: .72rem !important;
    line-height: 1.1;
  }
  .app-page-content > .panel:has(> .report-head) .team-heading-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: .35rem;
  }
  .app-page-content > .panel:has(> .report-head) .report-team-total {
    grid-column: 1 / -1;
    gap: .35rem;
    padding: .35rem;
  }
  .app-page-content > .panel:has(> .report-head) .report-team-total > span {
    min-width: 0;
    padding: .2rem .25rem;
    font-size: .7rem;
    line-height: 1.1;
    text-align: center;
  }
  .app-page-content > .panel:has(> .report-head) .report-team-total > span b {
    font-size: .9rem;
  }
  .app-page-content > .panel:has(> .report-head) .team-heading-actions > button {
    box-sizing: border-box;
    grid-column: auto !important;
    width: 100%;
    min-width: 0;
    min-height: 2.5rem !important;
    padding: .35rem .2rem !important;
    font-size: 12px !important;
    line-height: 1.1;
    text-align: center;
    white-space: normal;
  }
  .app-page-content > .panel:has(> .report-head) .report-team .table-scroll {
    width: 100%;
    margin: 0;
  }
  .app-page-content > .panel:has(> .report-head) .report-team .table-scroll::before {
    display: block !important;
    padding: 6px 10px;
    font-size: 11px;
  }
  .app-page-content > .panel:has(> .report-head) .report-team .report-table th {
    padding: 5px 6px;
    font-size: 10.5px;
    line-height: 1.2;
  }
  .app-page-content > .panel:has(> .report-head) .report-team .report-table td {
    padding: 1px 6px;
    font-size: 12px;
    line-height: 1.1;
  }
  .app-page-content > .panel:has(> .report-head) .report-team .report-table input {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    height: 30px !important;
    min-height: 30px !important;
    padding: 2px 6px;
    font-size: 12px !important;
    line-height: 1.1;
  }
}
