:root {
  color-scheme: light;
  --background: #f5f7fb;
  --foreground: #182433;
  --card: #fff;
  --sidebar: #fff;
  --muted: #56677b;
  --border: #d8e1ec;
  --accent: #e7f0fc;
  --primary: #1769bd;
  --on-primary: #fff;
  --chart: #3d7fbd;
  --rise: #e5f0ff;
  --rise-ink: #215d9b;
  --fall: #fbebea;
  --fall-ink: #924139;
}
:root.dark {
  color-scheme: dark;
  --background: #101925;
  --foreground: #edf3fc;
  --card: #192535;
  --sidebar: #152131;
  --muted: #adbdcf;
  --border: #34465b;
  --accent: #233d5b;
  --primary: #89bbff;
  --on-primary: #102038;
  --chart: #7daee4;
  --rise: #223e61;
  --rise-ink: #adceff;
  --fall: #422927;
  --fall-ink: #f0b9ad;
}

/* Business actions size to their labels in both grid and flex layouts. */
form button, #records td:last-child button, #download, #statement {
  width: fit-content !important;
  max-width: 100%;
  flex: 0 0 auto;
  justify-self: start;
}
#employees form.restore-employee, form.restore-employee {
  display: flex;
  flex-flow: row wrap;
  align-items: center;
  gap: 8px 12px;
}

.hourly-pane .hour-search{width:230px;max-width:100%;margin:4px 0 16px}
.hour-line{display:grid;grid-template-columns:.5fr .9fr 1.1fr 1.35fr 1.35fr 8.5rem;gap:12px;align-items:center;padding:12px 10px;border-bottom:1px solid var(--border);font-size:14px}
.hour-line[hidden],.hour-dialog [hidden]{display:none!important}
.hour-head{background:var(--accent);color:var(--muted);font-weight:600}
.hour-line .action-buttons{display:flex;grid-column:6;grid-row:1;flex-wrap:nowrap;gap:6px;margin:0}
.hour-line .action-buttons button{width:auto;white-space:nowrap;color:var(--primary)}
.hour-line button,.hour-dialog header button{min-height:36px;padding:5px 10px}
.hour-dialog{box-sizing:border-box;width:min(440px,96vw);max-height:90dvh;padding:20px;background:var(--card);color:var(--foreground);border:1px solid var(--border);border-radius:10px}
.hour-dialog.history{position:fixed;inset:0 0 0 auto;margin:0;height:100dvh;max-height:100dvh;border-radius:0}
.hour-dialog::backdrop{background:#14274428}
body .hour-dialog header{position:static;display:flex;justify-content:space-between;align-items:center;background:transparent;color:inherit;padding:0;border:0}
.hour-dialog article{padding:14px 0;border-bottom:1px solid var(--border)}
.hour-dialog article small{color:var(--muted)}
.hour-dialog form{padding:0;margin:8px 0}
@media(max-width:850px){.hour-line{grid-template-columns:auto 1fr auto}.hour-head{display:none}.hour-line time{grid-column:1/3}.hour-line .hour-next{grid-column:1/3}.hour-line .hour-next::before{content:'下次调价　'}.hour-line strong::after{content:' 元/小时';font-weight:400}.hour-line .action-buttons{grid-column:3;grid-row:2/4}.hour-line{gap:5px 8px}.hour-dialog.history{width:min(440px,100vw)}}

.wage-impact{width:100%}
.impact-row{display:grid;grid-template-columns:minmax(160px,2fr) repeat(3,minmax(80px,1fr)) minmax(75px,.75fr);gap:10px;align-items:center;border-top:1px solid var(--border);padding:10px 4px;font-size:15px;font-variant-numeric:tabular-nums}
.impact-row small{display:block;color:var(--muted);font-weight:400;font-size:12px}
.impact-changed{color:var(--primary)}
.impact-basis{margin:0 0 10px;color:var(--muted);font-size:14px;overflow-wrap:anywhere}
@media(max-width:720px){.impact-row{grid-template-columns:repeat(3,minmax(0,1fr))}.impact-row>b{grid-column:1/3;grid-row:1}.impact-row>strong{grid-column:3;grid-row:1}.impact-row>span{grid-row:2}}

.wage-impact .impact-hero{display:flex;align-items:center;justify-content:space-between;gap:20px;flex-wrap:wrap;padding:20px 24px;border:1px solid var(--border);border-radius:12px;background:var(--card);box-shadow:0 1px 3px #1824330d}
.impact-hero strong,.impact-flow small{display:block}
.impact-hero strong{line-height:1.25;font-weight:650;margin-top:5px}
.impact-hero.fall strong,.impact-row.fall .impact-delta{color:var(--fall-ink)}
.impact-hero.rise strong,.impact-row.rise .impact-delta{color:var(--rise-ink)}
.impact-flow{display:flex;align-items:center;gap:16px}
.impact-hero strong,.impact-flow b{font-size:18px}
.impact-flow small,.impact-counts,.impact-hero .text-body-medium{color:var(--muted)}
.impact-flow small,.impact-counts,.impact-count{font-size:12px}
.wage-impact .impact-group{background:transparent;border:0;box-shadow:none;padding:0;margin:22px 0}
.impact-group h4{display:flex;align-items:center;gap:8px;margin-bottom:8px}
.impact-count{padding:2px 8px;border-radius:20px;background:var(--accent);color:var(--primary)}
.impact-row.fall .impact-delta,.impact-row.rise .impact-delta{font-weight:700}
.impact-group .impact-row.fall,.impact-group .impact-row.rise{background:var(--accent);border-radius:6px;padding-inline:10px}
.impact-group .impact-basis{font-size:12px;margin:6px 0 12px}
@media(max-width:520px){.wage-impact .impact-hero{padding:16px;gap:12px}.impact-flow{width:100%}.impact-counts{line-height:1.8}}
#wages .hour-dialog form.hour-correction,.hour-dialog form.hour-correction{display:block}
.hour-correction label{display:grid;width:min(100%,230px);gap:6px}
.hour-correction .action-buttons{justify-content:flex-start}
.hour-log{margin-block:12px;font-size:13px;color:var(--muted)}
.hour-log b{display:block;color:var(--foreground);font-size:15px}

/* Employee work entry uses a white surface regardless of the admin theme. */
html.employee-light,html.employee-light body{color-scheme:light;background:#fff}
.employee-light .employee-wage-summary{background:var(--accent);border:1px solid var(--border);padding:16px;border-radius:10px}
.employee-light .employee-wage-summary h2{margin:0 0 8px}
.employee-light .employee-wage-summary p{margin:8px 0 0}
.employee-light .employee-detail-title{margin:22px 0 6px}
.employee-light .employee-wage-line{margin:0;padding:14px 4px;border-top:1px solid var(--border);border-radius:0}
.employee-light .employee-wage-line p{margin:8px 0}

:is(#employees,#catalog,#wages):is(:empty,:has(> .panel-notice:only-child:empty)){display:none}

@media(min-width:768px){html.employee-light body:not(:has(.employee-login)){max-width:1200px;padding-inline:32px}}
