#overtime {
  --ot-ink: #102d2b;
  --ot-muted: #6e817f;
  --ot-line: #d9e5e2;
  --ot-teal: #0e877a;
  --ot-teal-dark: #09685f;
  --ot-teal-soft: #e4f5f1;
  --ot-amber: #a66400;
  --ot-amber-soft: #fff3d9;
  --ot-rose: #a93e3e;
  --ot-rose-soft: #fff0ef;
  color: var(--ot-ink);
}

#overtime *, #overtime *::before, #overtime *::after { box-sizing: border-box; }
#overtime button, #overtime input, #overtime select, #overtime textarea { font: inherit; }
#overtime button { cursor: pointer; }
#overtime button:disabled { cursor: not-allowed; opacity: .55; }

.ot-tabs {
  width: fit-content;
  max-width: 100%;
  margin: 0 0 18px;
  padding: 6px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  border-radius: 14px;
  background: #e7f0ed;
}

.ot-tabs button {
  min-height: 42px;
  padding: 0 17px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 10px;
  color: #687d79;
  font-weight: 800;
  background: transparent;
}

.ot-tabs button.active { color: var(--ot-teal-dark); background: #fff; box-shadow: 0 3px 10px rgba(29, 68, 63, .08); }
.ot-tabs button span { min-width: 20px; height: 20px; margin-left: 5px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 999px; color: #fff; background: var(--ot-teal); font-size: 11px; }

.ot-summary-grid { margin-bottom: 16px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.ot-summary-grid-four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ot-summary-card { min-height: 104px; padding: 20px; border: 1px solid var(--ot-line); border-radius: 17px; background: #fff; box-shadow: 0 12px 28px rgba(25, 73, 66, .05); }
.ot-summary-card > span { color: var(--ot-muted); font-size: 13px; font-weight: 800; }
.ot-summary-card strong { margin-top: 8px; display: block; font-size: 27px; letter-spacing: -1px; }
.ot-summary-card.teal { border-top: 3px solid var(--ot-teal); }
.ot-summary-card.amber { border-top: 3px solid #e0a236; }

.ot-two-column { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr); gap: 16px; align-items: start; }
.ot-panel { border: 1px solid var(--ot-line); border-radius: 18px; overflow: hidden; background: #fff; box-shadow: 0 15px 35px rgba(25, 73, 66, .055); }
.ot-panel-head { min-height: 104px; padding: 22px 24px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; border-bottom: 1px solid #e4ecea; }
.ot-panel-head.compact { min-height: 88px; }
.ot-panel-head span { display: block; margin-bottom: 5px; color: var(--ot-teal); font-size: 11px; font-weight: 900; }
.ot-panel-head h3 { margin: 0; font-size: 21px; letter-spacing: -.6px; }
.ot-panel-head p { margin: 7px 0 0; color: var(--ot-muted); font-size: 13px; }
.ot-day-chip { min-width: 48px; padding: 7px 10px; border-radius: 999px; color: #337166; background: var(--ot-teal-soft); text-align: center; font-size: 12px; }
.ot-day-chip.holiday { color: var(--ot-amber); background: var(--ot-amber-soft); }

.ot-form { padding: 24px; }
.ot-field { display: grid; gap: 8px; }
.ot-field > span { color: #4b6763; font-size: 12px; font-weight: 800; }
.ot-field > span small { margin-left: 6px; color: var(--ot-muted); font-weight: 500; }
.ot-field input, .ot-field select, .ot-field textarea { width: 100%; border: 1px solid #cddedb; border-radius: 11px; outline: none; color: var(--ot-ink); background: #fff; }
.ot-field input, .ot-field select { min-height: 44px; padding: 0 13px; }
.ot-field textarea { padding: 12px 13px; resize: vertical; }
.ot-field input:focus, .ot-field select:focus, .ot-field textarea:focus { border-color: var(--ot-teal); box-shadow: 0 0 0 3px rgba(14, 135, 122, .12); }
.ot-field-grid { margin-top: 17px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ot-time-preview { margin: 17px 0; padding: 15px 17px; display: grid; grid-template-columns: 1fr auto; align-items: center; border: 1px solid #cce3de; border-radius: 13px; background: #f1faf8; }
.ot-time-preview span { font-size: 13px; font-weight: 800; }
.ot-time-preview strong { color: var(--ot-teal-dark); font-size: 21px; }

.ot-button { min-height: 42px; padding: 0 16px; border: 1px solid #cadbd8; border-radius: 11px; color: #365d58; font-weight: 800; background: #fff; }
.ot-button.primary { border-color: transparent; color: #fff; background: var(--ot-teal); box-shadow: 0 7px 16px rgba(14, 135, 122, .18); }
.ot-button.reject { border-color: #efcece; color: var(--ot-rose); background: #fffafa; }
.ot-button.wide { width: 100%; min-height: 49px; margin-top: 18px; }

.ot-request-list { max-height: 510px; overflow: auto; }
.ot-request-item { padding: 18px 22px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; border-bottom: 1px solid #e7eeec; }
.ot-request-item:last-child { border-bottom: 0; }
.ot-request-item small { color: #526e69; font-weight: 800; }
.ot-request-item strong { margin-top: 4px; display: block; font-size: 18px; }
.ot-request-item p { margin: 5px 0; color: #334e4a; font-size: 13px; overflow-wrap: anywhere; }
.ot-request-item em { color: var(--ot-muted); font-size: 12px; font-style: normal; }
.ot-status { height: fit-content; padding: 6px 9px; border-radius: 999px; color: #58706c; background: #edf3f1; white-space: nowrap; font-size: 11px; font-weight: 900; }
.ot-status.pending_stage1, .ot-status.pending_stage2 { color: var(--ot-amber); background: var(--ot-amber-soft); }
.ot-status.approved { color: #087164; background: var(--ot-teal-soft); }
.ot-status.rejected { color: var(--ot-rose); background: var(--ot-rose-soft); }
.ot-status.muted { color: #72817f; background: #edf1f0; }
.ot-empty { min-height: 160px; padding: 34px; display: grid; place-content: center; color: #80918e; text-align: center; }

.ot-approval-route { margin-top: 18px; padding: 16px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; border: 1px solid #d9e8e5; border-radius: 14px; background: #f6faf9; }
.ot-route-stage { min-width: 0; }
.ot-route-stage span { color: var(--ot-muted); font-size: 11px; font-weight: 800; }
.ot-route-stage strong { margin-top: 5px; display: block; overflow-wrap: anywhere; font-size: 14px; }
.ot-route-stage small { margin-top: 4px; display: block; color: var(--ot-muted); font-size: 11px; }
.ot-route-arrow { color: var(--ot-teal); font-weight: 900; }
.ot-form-warning { margin: 14px 0 0; color: var(--ot-rose); font-size: 12px; font-weight: 700; }
.ot-use-mode{margin:0 24px 18px;padding:5px;display:grid;grid-template-columns:1fr 1fr;gap:5px;border-radius:13px;background:#edf4f2}.ot-use-mode button{min-height:64px;display:grid;place-content:center;gap:3px;border:1px solid transparent;border-radius:10px;background:transparent;color:#607672}.ot-use-mode button.active{border-color:#d4e3e0;background:#fff;color:var(--ot-teal);box-shadow:0 3px 12px rgba(25,79,70,.08)}.ot-use-mode small{font-size:11px;font-weight:500}

.ot-approval-list, .ot-audit-list { padding: 8px 24px 20px; }
.ot-approval-item { min-height: 126px; padding: 20px 0; display: grid; grid-template-columns: 1.1fr .9fr .8fr auto; align-items: center; gap: 24px; border-bottom: 1px solid #e4ecea; }
.ot-approval-item:last-child { border-bottom: 0; }
.ot-approval-item.not-assigned { opacity: .65; }
.ot-approval-item > div > small, .ot-stage small { color: var(--ot-muted); font-size: 11px; font-weight: 800; }
.ot-approval-item > div > strong, .ot-stage strong { margin-top: 5px; display: block; }
.ot-approval-item p { margin: 5px 0 0; color: var(--ot-muted); font-size: 12px; }
.ot-person { display: flex; align-items: center; gap: 12px; }
.ot-person > span { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: #fff; font-weight: 900; background: var(--ot-teal); }
.ot-stage { padding: 12px 14px; border-radius: 11px; background: #f4f8f7; }
.ot-actions { display: flex; gap: 8px; }
.ot-audit-panel { margin-top: 16px; }
.ot-audit-item { position: relative; min-height: 68px; padding: 15px 0 15px 28px; border-bottom: 1px solid #e7eeec; }
.ot-audit-item:last-child { border-bottom: 0; }
.ot-audit-item i { position: absolute; left: 4px; top: 21px; width: 10px; height: 10px; border: 3px solid #c7e5df; border-radius: 50%; background: var(--ot-teal); }
.ot-audit-item strong { font-size: 14px; }
.ot-audit-item p { margin: 5px 0 0; color: var(--ot-muted); font-size: 12px; }

.ot-settings-panel { max-width: 920px; }
.ot-settings-form { padding: 24px; display: grid; gap: 20px; }
.ot-department-field { max-width: 320px; }
.ot-settings-form fieldset { margin: 0; padding: 18px; border: 1px solid #d8e5e2; border-radius: 14px; }
.ot-settings-form legend { padding: 0 8px; font-weight: 900; }
.ot-settings-form legend small { margin-left: 6px; color: var(--ot-muted); font-weight: 500; }
.ot-approver-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ot-approver-options > label { min-height: 58px; padding: 10px 12px; display: flex; align-items: center; gap: 10px; border: 1px solid #d6e3e0; border-radius: 11px; background: #fbfdfc; cursor: pointer; }
.ot-approver-options > label:has(input:checked) { border-color: var(--ot-teal); background: var(--ot-teal-soft); }
.ot-approver-options input { width: 18px; height: 18px; accent-color: var(--ot-teal); }
.ot-approver-options label span { display: grid; gap: 3px; }
.ot-approver-options label small { color: var(--ot-muted); }
.ot-unlinked { max-width: 720px; }
.ot-overview-filters { padding: 18px 24px; display: grid; grid-template-columns: minmax(240px, 1fr) minmax(180px, 280px); gap: 12px; border-bottom: 1px solid #e4ecea; background: #fbfdfc; }
.ot-overview-filters.single { grid-template-columns: minmax(240px, 520px); }
.ot-overview-count { padding: 16px 24px 10px; color: var(--ot-muted); font-size: 12px; font-weight: 800; }
.ot-overview-table-wrap { width: 100%; overflow-x: auto; }
.ot-overview-table { width: 100%; min-width: 790px; border-collapse: collapse; }
.ot-overview-table th, .ot-overview-table td { padding: 15px 18px; border-top: 1px solid #e7eeec; text-align: left; white-space: nowrap; }
.ot-overview-table th { color: #5d7470; background: #f6faf9; font-size: 12px; }
.ot-overview-table td { color: #314e49; font-size: 13px; }
.ot-overview-table td:first-child { min-width: 190px; }
.ot-overview-table td strong { display: block; color: var(--ot-ink); font-size: 14px; }
.ot-overview-table td small { margin-top: 4px; display: block; color: var(--ot-muted); }
.ot-overview-table .ot-emphasis-teal { color: var(--ot-teal-dark); font-weight: 900; }
.ot-overview-table .ot-emphasis-amber { color: var(--ot-amber); font-weight: 900; }

@media (max-width: 980px) {
  .ot-two-column { grid-template-columns: 1fr; }
  .ot-summary-grid-four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ot-approval-item { grid-template-columns: 1fr 1fr; }
  .ot-actions { justify-content: flex-end; }
}

@media (max-width: 720px) {
  #overtime .section-head { margin-bottom: 14px; }
  .ot-tabs { width: 100%; }
  .ot-summary-grid { grid-template-columns: 1fr; gap: 10px; }
  .ot-summary-card { min-height: 86px; padding: 16px 18px; }
  .ot-summary-card strong { font-size: 23px; }
  .ot-panel-head, .ot-form { padding: 18px; }
  .ot-field-grid { grid-template-columns: 1fr 1fr; }
  .ot-field-grid .ot-field:last-child { grid-column: 1 / -1; }
  .ot-request-item { padding: 16px 18px; }
  .ot-approval-route { grid-template-columns: 1fr; }
  .ot-route-arrow { justify-self: center; transform: rotate(90deg); }
  .ot-approval-list, .ot-audit-list { padding-inline: 18px; }
  .ot-approval-item { grid-template-columns: 1fr; gap: 14px; }
  .ot-actions { justify-content: stretch; }
  .ot-actions .ot-button { flex: 1; }
  .ot-approver-options { grid-template-columns: 1fr; }
  .ot-settings-form { padding: 18px; }
  .ot-use-mode{margin:0 18px 16px}.ot-use-mode button{min-height:58px;padding:7px}
  .ot-overview-filters { padding: 16px 18px; grid-template-columns: 1fr; }
  .ot-overview-count { padding-inline: 18px; }
}

@media (max-width: 420px) {
  .ot-tabs button { padding-inline: 13px; }
  .ot-field-grid { grid-template-columns: 1fr; }
  .ot-field-grid .ot-field:last-child { grid-column: auto; }
  .ot-request-item { grid-template-columns: 1fr; }
  .ot-status { width: fit-content; }
}
