:root {
  --ink: #173532;
  --muted: #778985;
  --line: #e5ece9;
  --paper: #ffffff;
  --canvas: #f6f8f6;
  --green: #246e62;
  --green-dark: #173f3a;
  --mint: #69bea6;
  --mint-pale: #e3f4ee;
  --blue: #668ebf;
  --blue-pale: #e8eff8;
  --amber: #dda257;
  --amber-pale: #fff1dc;
  --coral: #d9806c;
  --coral-pale: #fbe9e5;
  --shadow: 0 14px 44px rgba(24, 55, 50, .07);
  font-family: "DM Sans", "Noto Sans SC", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--canvas); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ambient { position: fixed; width: 360px; height: 360px; border-radius: 50%; filter: blur(100px); opacity: .16; pointer-events: none; }
.ambient-one { background: #66c7a8; top: -160px; left: 35%; }
.ambient-two { background: #e7b16b; right: -200px; bottom: -200px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px 1fr; }
.sidebar { position: fixed; z-index: 20; inset: 0 auto 0 0; width: 248px; padding: 36px 24px 26px; color: #e9f6f2; background: linear-gradient(175deg, #173f3a 0%, #102c2a 70%, #0c2422 100%); display: flex; flex-direction: column; }
.brand { display: flex; gap: 13px; align-items: center; color: inherit; text-decoration: none; padding: 0 8px; }
.brand-mark { width: 43px; height: 43px; display: grid; place-items: center; color: #6ac4aa; }
.brand-mark svg { width: 43px; height: 43px; stroke: none; }
.brand strong { display: block; font-size: 21px; letter-spacing: .12em; }
.brand small { display: block; margin-top: 2px; color: #8ba8a2; font-size: 10px; letter-spacing: .16em; }
.nav { margin-top: 62px; display: grid; gap: 10px; }
.nav-item { display: flex; align-items: center; gap: 14px; border: 0; border-radius: 12px; padding: 13px 14px; background: transparent; color: #8facab; font-size: 14px; text-align: left; transition: .2s ease; }
.nav-item:hover { color: white; background: rgba(255,255,255,.06); }
.nav-item.active { color: white; background: rgba(109, 199, 173, .17); box-shadow: inset 3px 0 #76cbb1; }
.nav-icon { display: grid; place-items: center; }
.nav-icon svg { width: 19px; height: 19px; }
.sidebar-bottom { margin-top: auto; }
.cutoff-card { border: 1px solid rgba(255,255,255,.09); border-radius: 13px; padding: 13px 12px; display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.035); }
.cutoff-dot { width: 8px; height: 8px; border-radius: 50%; background: #f4bd71; box-shadow: 0 0 0 5px rgba(244,189,113,.1); }
.cutoff-card small, .cutoff-card strong { display: block; }
.cutoff-card small { font-size: 10px; color: #7f9d98; margin-bottom: 3px; }
.cutoff-card strong { font-size: 11px; font-weight: 600; color: #c5dad5; }
.sidebar-bottom > p { color: #57746f; font-size: 9px; text-align: center; margin: 14px 0 0; }

.main { grid-column: 2; min-width: 0; padding: 34px 44px 50px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 31px; }
.eyebrow { margin: 0 0 7px; color: #94a39f; font-size: 10px; line-height: 1; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.topbar h1 { margin: 0; font-size: 25px; letter-spacing: -.04em; font-weight: 700; }
.top-actions { position: relative; display: flex; align-items: center; gap: 10px; }
.month-control { height: 42px; min-width: 178px; padding: 0 13px; display: flex; gap: 9px; align-items: center; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.8); box-shadow: 0 4px 16px rgba(23,53,50,.03); }
.month-control svg { width: 17px; color: var(--green); }
.month-control input { border: 0; outline: 0; background: transparent; font-size: 13px; font-weight: 600; width: 124px; }
.icon-button { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 11px; background: white; }
.icon-button svg { width: 19px; }
.data-menu { display: none; position: absolute; z-index: 30; top: 48px; right: 0; width: 152px; padding: 7px; border: 1px solid var(--line); border-radius: 11px; background: white; box-shadow: var(--shadow); }
.data-menu.open { display: grid; }
.data-menu button { padding: 9px 10px; border: 0; border-radius: 7px; background: white; text-align: left; font-size: 12px; }
.data-menu button:hover { background: var(--canvas); }
.danger-text { color: #c15f51 !important; }

.view { display: none; animation: fadeIn .28s ease; }
.view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } }
.summary-grid { display: grid; grid-template-columns: 1.35fr repeat(3, 1fr); gap: 14px; }
.summary-card, .panel { border: 1px solid rgba(222,231,228,.9); border-radius: 17px; background: rgba(255,255,255,.91); box-shadow: var(--shadow); }
.summary-card { min-height: 156px; padding: 19px 20px 15px; }
.summary-head { display: flex; gap: 9px; align-items: center; color: #627773; font-size: 12px; font-weight: 600; }
.summary-icon { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 9px; }
.summary-icon svg { width: 16px; height: 16px; stroke-width: 2.2; }
.summary-icon.mint { color: var(--green); background: var(--mint-pale); }
.summary-icon.blue { color: var(--blue); background: var(--blue-pale); }
.summary-icon.amber { color: var(--amber); background: var(--amber-pale); }
.summary-icon.coral { color: var(--coral); background: var(--coral-pale); }
.metric { display: flex; align-items: baseline; gap: 7px; margin-top: 14px; }
.metric strong { font-size: 31px; line-height: 1; letter-spacing: -.04em; }
.metric span { color: #91a09c; font-size: 12px; }
.metric b { font-weight: 500; }
.progress-track { height: 5px; margin: 14px 0 8px; background: #e9efed; border-radius: 9px; overflow: hidden; }
.progress-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green), #70c6ab); transition: width .4s ease; }
.card-foot, .split-stat { color: #98a5a2; font-size: 10px; display: flex; justify-content: space-between; }
.card-foot button { border: 0; padding: 0; color: var(--green); background: none; font-size: 10px; }
.split-stat { margin-top: 17px; padding-top: 10px; border-top: 1px solid #eef2f0; }
.split-stat b { color: #596e69; font-weight: 600; }

.work-grid { margin-top: 17px; display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(280px, .75fr); gap: 17px; }
.panel { padding: 24px; }
.panel-title-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 19px; }
.panel-title-row h2 { margin: 0; font-size: 18px; letter-spacing: -.025em; }
.date-control { color: #80908d; font-size: 10px; display: flex; align-items: center; gap: 9px; }
.date-control input { padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: #fafcfb; font-size: 11px; outline: 0; }
.category-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 10px; background: #f1f5f3; overflow-x: auto; }
.category-tabs button { flex: 1; white-space: nowrap; padding: 8px 10px; border: 0; border-radius: 7px; background: transparent; color: #899894; font-size: 11px; }
.category-tabs button.active { background: white; color: var(--green-dark); font-weight: 600; box-shadow: 0 2px 8px rgba(20,52,47,.06); }
.quick-list { display: grid; margin-top: 14px; }
.quick-row { display: grid; grid-template-columns: 41px 1fr auto; align-items: center; gap: 12px; min-height: 63px; border-bottom: 1px solid #edf1ef; }
.quick-row:last-child { border-bottom: 0; }
.quick-row-icon { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 10px; color: var(--green); background: var(--mint-pale); font-size: 13px; font-weight: 700; }
.quick-row:nth-child(2n) .quick-row-icon { color: var(--blue); background: var(--blue-pale); }
.quick-row-info strong, .quick-row-info small { display: block; }
.quick-row-info strong { font-size: 12px; margin-bottom: 4px; }
.quick-row-info small { color: #9ba8a5; font-size: 9px; }
.quick-action { display: flex; align-items: center; gap: 7px; }
.quick-action input { width: 47px; height: 31px; border: 1px solid var(--line); border-radius: 8px; background: #fafcfb; text-align: center; font-size: 11px; outline: 0; }
.quick-action button { min-width: 54px; height: 31px; padding: 0 11px; border: 0; border-radius: 8px; background: var(--green); color: white; font-size: 10px; font-weight: 600; box-shadow: 0 4px 10px rgba(36,110,98,.16); }
.add-detail-button { width: 100%; margin-top: 13px; padding: 12px 14px; border: 1px dashed #c9d8d4; border-radius: 11px; background: #fafcfb; display: grid; grid-template-columns: 29px 1fr auto; align-items: center; gap: 10px; text-align: left; color: var(--green); }
.add-detail-button > span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: white; background: var(--green); font-size: 17px; }
.add-detail-button strong, .add-detail-button small { display: block; }
.add-detail-button strong { color: #506a65; font-size: 11px; }
.add-detail-button small { margin-top: 2px; color: #9aa9a5; font-size: 9px; }
.add-detail-button > b { font-weight: 400; }
.activity-panel { display: flex; flex-direction: column; }
.panel-title-row.compact { margin-bottom: 10px; }
.count-pill { padding: 4px 8px; border-radius: 20px; color: var(--green); background: var(--mint-pale); font-size: 9px; font-weight: 600; }
.activity-list { flex: 1; min-height: 286px; }
.activity-item { position: relative; display: grid; grid-template-columns: 34px 1fr; gap: 10px; padding: 11px 0; }
.activity-item:not(:last-child)::before { content: ""; position: absolute; left: 16px; top: 42px; bottom: -4px; border-left: 1px dashed #dbe5e2; }
.activity-bullet { z-index: 1; width: 34px; height: 34px; border: 4px solid white; border-radius: 50%; display: grid; place-items: center; color: var(--green); background: var(--mint-pale); font-size: 9px; font-weight: 700; box-shadow: 0 0 0 1px #e3ece9; }
.activity-info strong { display: block; margin-top: 2px; font-size: 11px; }
.activity-info small { color: #9aa8a5; font-size: 9px; }
.no-activity { height: 230px; display: grid; place-content: center; text-align: center; color: #99a7a4; }
.no-activity span { width: 52px; height: 52px; margin: 0 auto 10px; display: grid; place-items: center; border-radius: 50%; color: var(--green); background: var(--mint-pale); font-size: 20px; }
.no-activity p { margin: 0; font-size: 10px; }
.next-cutoff { margin-top: 15px; padding: 13px; border-radius: 11px; display: flex; gap: 10px; align-items: center; color: #896329; background: #fff7e9; }
.next-cutoff svg { width: 20px; }
.next-cutoff small, .next-cutoff strong { display: block; }
.next-cutoff small { font-size: 9px; opacity: .7; margin-bottom: 3px; }
.next-cutoff strong { font-size: 11px; }

.records-panel { min-height: 640px; }
.records-heading > div:first-child { display: grid; grid-template-columns: auto auto; align-items: end; column-gap: 12px; }
.records-heading .eyebrow { grid-column: 1 / -1; }
.records-heading span { color: #93a29e; font-size: 10px; padding-bottom: 2px; }
.record-tools { display: flex; gap: 8px; }
.record-tools select { padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: white; font-size: 11px; outline: 0; }
.primary-button, .secondary-button { display: inline-flex; justify-content: center; align-items: center; gap: 7px; border-radius: 9px; padding: 10px 16px; font-size: 11px; font-weight: 600; }
.primary-button { color: white; border: 1px solid var(--green); background: var(--green); box-shadow: 0 5px 12px rgba(36,110,98,.14); }
.secondary-button { border: 1px solid var(--line); background: white; color: #677b76; }
.record-table { width: 100%; border-collapse: collapse; }
.record-table th { padding: 12px 10px; color: #97a5a2; border-bottom: 1px solid var(--line); background: #f9fbfa; font-size: 9px; font-weight: 600; text-align: left; }
.record-table td { padding: 14px 10px; border-bottom: 1px solid #edf1ef; font-size: 11px; }
.record-table td:nth-child(6) { color: #8a9995; max-width: 230px; }
.type-tag { display: inline-flex; padding: 4px 8px; border-radius: 20px; color: var(--green); background: var(--mint-pale); font-size: 9px; font-weight: 600; }
.type-tag.validation { color: #557dab; background: var(--blue-pale); }
.type-tag.imaging_qc, .type-tag.accelerator_qc { color: #a46d25; background: var(--amber-pale); }
.type-tag.overtime, .type-tag.leave { color: #ad5e4e; background: var(--coral-pale); }
.row-actions { display: flex; justify-content: flex-end; gap: 3px; }
.row-actions button { width: 28px; height: 28px; border: 0; border-radius: 7px; color: #81928e; background: transparent; font-size: 13px; }
.row-actions button:hover { background: #f0f4f2; }
.empty-state { display: none; padding: 95px 20px; text-align: center; color: #97a5a2; }
.empty-state.show { display: block; }
.empty-state span { font-size: 28px; color: var(--mint); }
.empty-state h3 { margin: 10px 0 6px; color: #59706b; font-size: 14px; }
.empty-state p { margin: 0; font-size: 10px; }

.report-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .7fr); gap: 17px; }
.report-paper { min-height: 630px; padding: 29px; }
.report-heading { display: flex; justify-content: space-between; align-items: flex-start; }
.report-heading h2 { margin: 0; font-size: 21px; }
.status-badge { padding: 6px 10px; border-radius: 20px; color: var(--green); background: var(--mint-pale); font-size: 9px; font-weight: 600; }
.status-badge i { display: inline-block; width: 6px; height: 6px; margin-right: 4px; border-radius: 50%; background: var(--mint); }
#reportText { width: 100%; min-height: 480px; margin-top: 24px; padding: 24px; resize: vertical; border: 1px solid #e3ebe8; border-radius: 13px; outline: 0; background: #fbfcfb; color: #38514d; font-family: "Noto Sans SC", sans-serif; font-size: 13px; line-height: 2.05; }
#reportText:focus { border-color: #9ccabc; }
.report-actions { display: flex; gap: 9px; margin-top: 16px; }
.report-actions svg { width: 15px; height: 15px; }
.report-side { display: grid; align-content: start; gap: 17px; }
.insight-card h3 { margin: 0; font-size: 16px; }
.donut-wrap { display: flex; align-items: center; gap: 21px; margin: 25px 0; }
.donut { width: 91px; height: 91px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--mint) 0%, #e9efed 0); position: relative; }
.donut::after { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: white; }
.donut span { z-index: 1; font-size: 13px; font-weight: 700; }
.donut-wrap > div:last-child strong, .donut-wrap > div:last-child small { display: block; }
.donut-wrap > div:last-child strong { font-size: 27px; }
.donut-wrap > div:last-child small { color: #91a09c; font-size: 9px; }
.legend { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 10px; }
.legend span { color: #7b8e89; }
.legend i { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; }
.mint-dot { background: var(--mint); }.blue-dot { background: var(--blue); }.amber-dot { background: var(--amber); }
.settlement-card { display: flex; gap: 13px; align-items: flex-start; background: linear-gradient(145deg, #244f49, #173a36); color: white; }
.settlement-icon { flex: 0 0 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: rgba(255,255,255,.1); color: #8bd0bb; }
.settlement-icon svg { width: 21px; }
.settlement-card small, .settlement-card strong { display: block; }
.settlement-card small { color: #93ada8; font-size: 9px; margin-bottom: 4px; }
.settlement-card strong { font-size: 13px; }
.settlement-card p { color: #8ea8a2; font-size: 9px; line-height: 1.6; margin: 10px 0 0; }

.entry-dialog { width: min(620px, calc(100vw - 28px)); padding: 0; border: 0; border-radius: 18px; color: var(--ink); box-shadow: 0 24px 80px rgba(8,31,28,.22); }
.entry-dialog::backdrop { background: rgba(11,38,34,.44); backdrop-filter: blur(4px); }
.entry-dialog form { padding: 27px; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; }
.dialog-head h2 { margin: 0; font-size: 20px; }
.close-button { width: 32px; height: 32px; border: 0; border-radius: 8px; color: #84938f; background: #f2f5f4; font-size: 20px; line-height: 1; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 25px; }
.form-grid label { display: grid; gap: 7px; }
.form-grid label > span { color: #6c817c; font-size: 10px; font-weight: 600; }
.form-grid input, .form-grid select { width: 100%; height: 41px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; outline: 0; background: #fafcfb; font-size: 11px; }
.form-grid input:focus, .form-grid select:focus { border-color: #8dc4b4; box-shadow: 0 0 0 3px rgba(105,190,166,.1); }
.full-width { grid-column: 1 / -1; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 25px; }
.hidden { display: none !important; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 28px; display: flex; gap: 8px; align-items: center; padding: 11px 16px; border-radius: 10px; color: white; background: #173f3a; box-shadow: 0 12px 30px rgba(12,43,39,.2); font-size: 11px; transform: translate(-50%, 100px); opacity: 0; transition: .25s ease; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast span { color: #85d2ba; }

@media (max-width: 1080px) {
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .work-grid, .report-layout { grid-template-columns: 1fr; }
  .activity-list { min-height: auto; }
}
@media (max-width: 760px) {
  .app-shell { display: block; padding-bottom: 72px; }
  .sidebar { position: fixed; z-index: 50; top: auto; right: 0; width: auto; height: 66px; padding: 7px 12px; display: block; }
  .brand, .sidebar-bottom { display: none; }
  .nav { height: 100%; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
  .nav-item { justify-content: center; flex-direction: column; gap: 3px; padding: 5px; border-radius: 9px; font-size: 9px; }
  .nav-item.active { box-shadow: none; }
  .nav-icon svg { width: 17px; height: 17px; }
  .main { padding: 22px 15px 30px; }
  .topbar { align-items: flex-start; margin-bottom: 22px; }
  .topbar h1 { font-size: 20px; }
  .month-control { min-width: 144px; }
  .month-control input { width: 94px; }
  .summary-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .summary-card { min-height: 145px; padding: 15px; }
  .plan-card { grid-column: 1 / -1; }
  .work-grid { margin-top: 10px; }
  .panel { padding: 17px; }
  .category-tabs button { font-size: 9px; }
  .record-table { min-width: 700px; }
  .record-table-wrap { overflow-x: auto; }
  .records-heading { align-items: flex-start; }
  .record-tools { flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
  .full-width { grid-column: auto; }
}
@media (max-width: 460px) {
  .summary-grid { grid-template-columns: 1fr; }
  .plan-card { grid-column: auto; }
  .topbar { gap: 10px; }
  .topbar .eyebrow { display: none; }
  .topbar h1 { max-width: 115px; font-size: 18px; }
  .month-control { min-width: 0; }
  .quick-row { grid-template-columns: 36px 1fr; padding: 9px 0; }
  .quick-action { grid-column: 2; }
  .panel-title-row { align-items: flex-start; }
  .date-control { display: grid; }
}
