.d1-panel {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  padding: 14px 18px;
  border: 1px dashed #c5d2c8;
  border-radius: 8px;
  background: rgba(237, 245, 239, 0.65);
}

.d1-panel-copy {
  flex: 1 1 220px;
}

.d1-panel-copy strong {
  display: block;
  font-size: 12px;
  font-weight: 650;
  color: #34473d;
  margin-bottom: 4px;
}

.d1-panel-copy span {
  font-size: 11px;
  color: #70807b;
  line-height: 1.4;
}

.d1-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.d1-status {
  flex: 1 1 100%;
  margin: 0;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.4;
  background: rgba(255, 255, 255, 0.85);
  color: #556761;
}

.d1-status.is-ok {
  background: #edf5ef;
  color: #387b51;
}

.d1-status.is-error {
  background: #fdeeed;
  color: #ad4d46;
}

/* ——— Form layout (laporan, dashboard, admin) ——— */
.report-canvas {
  width: 100%;
  max-width: 1080px;
  margin-left: auto;
  margin-right: auto;
}

.cash-report-form {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-card {
  margin-bottom: 18px;
  padding: 20px 22px;
  border-radius: 14px;
  border: 1px solid #e6ece8;
  background: #fff;
  box-shadow: 0 8px 28px rgba(26, 49, 38, 0.05);
}

.form-card--meta.meta-panel {
  display: block;
  padding: 20px 22px;
  align-items: stretch;
  gap: 0;
  background: #fff;
}

.form-card--cloud {
  background: linear-gradient(180deg, #f8fbf9 0%, #fff 48%);
}

.form-card__head {
  margin-bottom: 16px;
}

.form-card__head--split {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px 20px;
}

.form-card__eyebrow {
  margin: 0 0 4px;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.16em;
  color: #2b6b54;
}

.form-card__title {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.03em;
  color: #1d2d29;
}

.form-card__desc {
  margin: 6px 0 0;
  max-width: 42ch;
  font-size: 12px;
  line-height: 1.45;
  color: #70807b;
}

.form-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.form-card__status {
  margin: 0 0 14px;
}

.form-grid {
  display: grid;
  gap: 14px 16px;
  align-items: end;
}

.form-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid--filter {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.form-grid--dash-day {
  grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr) auto;
}

.form-grid--admin {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field-group--full {
  grid-column: 1 / -1;
}

.field-group--actions {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.field-group--actions-start {
  padding-top: 4px;
}

.field-label--ghost {
  visibility: hidden;
}

.field-hint {
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
  color: #8a9a94;
}

.report-status-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: #edf5ef;
  color: #2b6b54;
}

.report-status-badge.is-checked {
  background: #e8eef5;
  color: #3d5a73;
}

.field-control,
.field-control-btn {
  width: 100%;
  min-height: 42px;
  border: 1px solid #dfe7e1;
  border-radius: 10px;
  padding: 0 12px;
  background: #fff;
  color: #1d2d29;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-card .field-control:focus,
.filter-panel .field-control:focus,
.admin-form .field-control:focus {
  border-color: #6c9d80;
  box-shadow: 0 0 0 3px rgba(65, 125, 91, 0.12);
}

.field-control-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  padding: 0 16px;
}

.button-sm {
  min-height: 34px !important;
  padding: 0 10px !important;
  font-size: 11px !important;
}

.report-history {
  margin-top: 4px;
  padding-top: 16px;
  border-top: 1px solid #e8eeea;
}

.report-history__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.report-history__head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
  color: #34473d;
}

.report-history__busy {
  font-size: 11px;
  color: #8a9a94;
}

.report-history__empty {
  margin: 0;
}

.report-history__scroll {
  overflow: auto;
  border: 1px solid #e8eeea;
  border-radius: 10px;
  background: #fbfcfb;
}

.report-history__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.report-history__table th,
.report-history__table td {
  padding: 10px 12px;
  border-bottom: 1px solid #eef2ef;
  text-align: left;
}

.report-history__table th {
  font-size: 10px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #7a8a83;
  background: #f4f7f5;
}

.report-history__table tbody tr:last-child td {
  border-bottom: none;
}

.report-history__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  white-space: nowrap;
}

.report-history__actions-head {
  width: 140px;
  text-align: right;
}

.branch-checkboxes--grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px 12px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #e8eeea;
  background: #f9fbf9;
}

.form-feedback {
  margin-bottom: 12px;
}

.save-status-pill {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #dfe6e0;
  background: #fff;
  box-shadow: 0 2px 8px rgba(26, 49, 38, 0.04);
}

.branch-field .field-label {
  margin-bottom: 2px;
}

/* ——— App shell & sidebar ——— */
body {
  background:
    radial-gradient(ellipse 120% 80% at 100% 0%, rgba(43, 107, 84, 0.08), transparent 55%),
    radial-gradient(ellipse 80% 60% at 0% 100%, rgba(201, 155, 74, 0.06), transparent 50%),
    var(--canvas, #f3f6f2);
}

.app-layout {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
}

.app-sidebar {
  position: fixed;
  z-index: 40;
  top: 0;
  left: 0;
  bottom: 0;
  width: 252px;
  display: flex;
  flex-direction: column;
  padding: 20px 14px 16px;
  background: linear-gradient(165deg, #1a3d30 0%, #234a3a 42%, #1f513f 100%);
  color: #e8f0eb;
  box-shadow: 4px 0 24px rgba(26, 49, 38, 0.12);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 6px 8px 18px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: inherit;
  text-decoration: none;
}

.sidebar-brand .brand-copy strong {
  color: #fff;
  font-size: 16px;
}

.sidebar-brand .brand-copy > span {
  color: rgba(232, 240, 235, 0.65);
  font-size: 7px;
  letter-spacing: 0.2em;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 0;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border-radius: 10px;
  color: rgba(232, 240, 235, 0.88);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.sidebar-link.is-active {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  box-shadow: inset 3px 0 0 #c99b4a;
}

.sidebar-link-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  opacity: 0.9;
}

.sidebar-link-icon svg {
  width: 20px;
  height: 20px;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 0 4px;
}

.sidebar-avatar {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.15);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.sidebar-user-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.sidebar-user-text strong {
  font-size: 12px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-text small {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(232, 240, 235, 0.55);
}

.sidebar-logout {
  width: 100%;
  justify-content: center;
  color: rgba(232, 240, 235, 0.9) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  background: rgba(0, 0, 0, 0.12) !important;
}

.sidebar-logout:hover {
  background: rgba(0, 0, 0, 0.22) !important;
}

.app-main {
  flex: 1;
  min-width: 0;
  margin-left: 252px;
  display: flex;
  flex-direction: column;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px 20px;
  padding: 16px 28px;
  background: rgba(243, 246, 242, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(33, 61, 48, 0.08);
}

.sidebar-toggle {
  display: none;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid #dfe6e0;
  border-radius: 10px;
  background: #fff;
  color: #2b6b54;
}

.sidebar-toggle svg {
  width: 22px;
  height: 22px;
}

.app-topbar-copy {
  min-width: 0;
}

.app-topbar-copy--grow {
  display: flex;
  align-items: center;
}

.app-topbar-title {
  margin: 0 0 4px;
  font-size: clamp(22px, 3vw, 28px);
  letter-spacing: -0.045em;
  font-weight: 680;
  line-height: 1.15;
}

.app-topbar-sub {
  margin: 0;
  max-width: 52ch;
}

.app-topbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.app-content {
  flex: 1;
  padding: 12px 28px 36px;
}

.app-content--flush {
  padding-top: 0;
}

.app-content--flush .report--in-shell {
  padding-top: 8px;
}

.report--in-shell {
  padding-bottom: 24px;
}

.admin-page--in-shell {
  padding-top: 4px;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(26, 49, 38, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.app-layout.sidebar-open .sidebar-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.panel-title {
  margin: 0 0 12px;
  grid-column: 1 / -1;
  font-size: 15px;
  font-weight: 650;
  color: #213d30;
}

.filter-panel--card,
.admin-form-panel--card {
  background: #fff;
  box-shadow: 0 4px 20px rgba(26, 49, 38, 0.06);
  border-color: #e8eeea;
}

.table-card {
  overflow: auto;
  border-radius: 12px;
  border: 1px solid #e8eeea;
  background: #fff;
  box-shadow: 0 4px 20px rgba(26, 49, 38, 0.05);
}

.table-card .data-table th {
  background: #f7faf8;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6a7a73;
}

.auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 440px;
}

.auth-card {
  width: 100%;
  padding: 32px 28px;
  border-radius: 16px;
  border: 1px solid rgba(33, 61, 48, 0.1);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 20px 50px rgba(26, 49, 38, 0.1);
  backdrop-filter: blur(8px);
}

.auth-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
}

.auth-brand strong {
  display: block;
  font-size: 18px;
  color: #213d30;
}

.auth-brand span {
  font-size: 12px;
  color: #70807b;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-submit {
  margin-top: 8px;
  width: 100%;
  justify-content: center;
}

.auth-error {
  margin: 0;
  font-size: 12px;
  color: #ad4d46;
}

.auth-hint {
  margin: 16px 0 0;
  font-size: 11px;
  color: #8a9a94;
  line-height: 1.4;
}

.admin-page {
  padding-bottom: 48px;
}

.filter-panel.form-card,
.admin-form-panel.form-card {
  margin-bottom: 22px;
}

.admin-form.form-grid {
  align-items: start;
}

.dashboard-grid {
  display: grid;
  gap: 20px;
}

.dashboard-overview-card {
  margin-top: 4px;
}

.dashboard-overview-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid #e8eeea;
}

.dashboard-overview-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  color: #213d30;
}

.dashboard-overview-date {
  font-size: 12px;
  font-weight: 600;
  color: #2b6b54;
  padding: 4px 10px;
  border-radius: 999px;
  background: #edf5ef;
}

.dashboard-overview-table .num-cell {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.dashboard-detail-col {
  width: 130px;
  text-align: right;
}

.dashboard-detail-btn {
  text-decoration: none;
}

.dashboard-detail-link {
  font-size: 12px;
}

.dashboard-empty {
  text-align: center;
  color: #8a9a94;
  padding: 24px !important;
}

.dashboard-card {
  padding: 18px 20px;
  border-radius: 14px;
  border: 1px solid #e8eeea;
  background: #fff;
  box-shadow: 0 6px 24px rgba(26, 49, 38, 0.06);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.dashboard-card:hover {
  box-shadow: 0 10px 32px rgba(26, 49, 38, 0.09);
}

.dashboard-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.dashboard-card-head h2 {
  margin: 0;
  font-size: 18px;
  color: #213d30;
}

.dashboard-latest {
  margin: 0 0 12px;
  font-size: 12px;
  color: #556761;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table th,
.data-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #e8eeea;
  text-align: left;
}

.data-table .is-positive {
  color: #387b51;
}

.data-table .is-negative {
  color: #ad4d46;
}

.admin-panel {
  max-width: 1080px;
  margin: 0 auto;
}

.activity-log-scroll {
  overflow-x: auto;
  border: 1px solid #e6ece8;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(26, 49, 38, 0.05);
}

.activity-log-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 12px;
}

.activity-log-table th,
.activity-log-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e8eeea;
  text-align: left;
  vertical-align: top;
}

.activity-log-table thead th {
  background: #f8fbf9;
  font-size: 10px;
  font-weight: 650;
  color: #70807b;
  letter-spacing: 0.04em;
}

.activity-log-when {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: #556761;
}

.activity-log-detail {
  max-width: 280px;
  word-break: break-word;
}

.activity-log-action {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #edf5ef;
  color: #2b6b54;
  font-size: 11px;
  font-weight: 600;
}

.activity-log-empty {
  text-align: center;
  color: #8a9690;
  padding: 24px !important;
}

.text-link {
  background: none;
  border: none;
  padding: 0;
  color: #2b6b54;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  font-size: inherit;
}

.branch-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  grid-column: 1 / -1;
}

.branch-checkboxes.compact {
  flex-direction: column;
  align-items: flex-start;
}

.branch-checkboxes label {
  font-size: 12px;
  display: flex;
  gap: 6px;
  align-items: center;
}

.users-table {
  margin-top: 0;
}

.users-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.section-heading.report-canvas {
  margin-top: 8px;
}

.count-sections.report-canvas {
  margin-top: 0;
}

@media (max-width: 960px) {
  .form-grid--filter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field-group--actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .app-topbar {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "toggle title"
      "actions actions";
  }

  .sidebar-toggle {
    grid-area: toggle;
  }

  .app-topbar-copy {
    grid-area: title;
  }

  .app-topbar-actions {
    grid-area: actions;
    width: 100%;
    justify-content: stretch;
  }

  .form-grid--2,
  .form-grid--admin {
    grid-template-columns: 1fr;
  }
  .app-sidebar {
    transform: translateX(-105%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.22s ease, visibility 0.22s ease;
  }

  .app-layout.sidebar-open .app-sidebar {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }

  .sidebar-backdrop {
    display: block;
  }

  .app-main {
    margin-left: 0;
  }

  .sidebar-toggle {
    display: inline-flex;
  }

  .app-topbar {
    padding: 14px 16px 12px;
  }

  .app-content {
    padding: 8px 10px 28px;
    overflow-x: clip;
  }

  .report--in-shell .report-canvas,
  .report--in-shell .count-sections,
  .report--in-shell .section-heading {
    max-width: 100%;
  }

  .form-card {
    padding: 16px 12px;
  }

  .count-card {
    overflow-x: visible;
  }

  .count-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
  }

  .count-table .equals-head,
  .count-table .equals-cell {
    display: none;
  }

  .count-table .number-head {
    width: 7%;
    padding-left: 4px;
  }

  .count-table .description-head {
    width: 29%;
  }

  .count-table .value-head {
    width: 21%;
  }

  .count-table .spare-head {
    width: 21%;
  }

  .count-table .total-head {
    width: 22%;
    padding-right: 4px;
  }

  .count-table .input-cell {
    padding-left: 1px !important;
    padding-right: 1px !important;
  }

  .count-table .money-entry {
    height: 27px;
    padding: 0 2px;
  }

  .count-table .input-cell .money-entry > span {
    display: none;
  }

  .count-table .money-input {
    font-size: 9px;
  }

  .count-table .description-cell {
    white-space: normal;
    line-height: 1.25;
    font-size: 10px;
  }

  .app-topbar-actions .toolbar {
    width: 100%;
    justify-content: stretch;
  }

  .app-topbar-actions .toolbar .button {
    flex: 1;
  }
}

@media print {
  .app-sidebar,
  .sidebar-backdrop,
  .app-topbar,
  .sidebar-toggle,
  .form-card--cloud {
    display: none !important;
  }

  .app-main {
    margin-left: 0 !important;
  }

  .app-content {
    padding: 0 !important;
  }

  .report-canvas {
    max-width: none;
  }

  .form-card {
    box-shadow: none;
    border-color: #ccc;
    padding: 4px 6px !important;
    margin-bottom: 4px !important;
  }

  .form-card__head {
    display: none;
  }

  .form-card--meta .form-grid--2 {
    grid-template-columns: 64px 1fr 72px 1fr;
    gap: 4px 10px;
  }

  .form-card--meta .field-group {
    display: contents;
  }

  .form-card--meta .field-label {
    font-size: 7pt;
  }

  .form-card--meta .field-control {
    height: auto;
    min-height: 0;
    border: 0;
    padding: 0;
    font-size: 8pt;
    box-shadow: none;
  }

  body {
    background: #fff !important;
  }
}
