:root {
  --ink: #0f1b2d;
  --muted: #5b6b82;
  --line: #d7e2ef;
  --bg: #e8eef6;
  --card: #ffffff;
  --deep: #0d6e9a;
  --blue: #0782b8;
  --mid: #1aa0d0;
  --cyan: #2ec4e6;
  --coral: #e56d56;
  --pending: #d4832a;
  --pending-bg: #fff5e8;
  --done: #1f8a55;
  --done-bg: #e7f7ef;
  --warn: #b85a22;
  --warn-bg: #fff0e6;
  --err: #c0392b;
  --err-bg: #fdeceb;
  --side: #0b1626;
  --side-2: #122338;
  --side-text: #c5d4e8;
  --side-muted: #8da0b8;
  --accent: #1ec8e8;
  --shadow: 0 1px 2px rgba(15, 40, 70, .04), 0 10px 28px rgba(15, 40, 70, .07);
  --font: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: var(--font); color: var(--ink);
  background:
    radial-gradient(ellipse 70% 45% at 100% -10%, rgba(30, 180, 220, .14), transparent 55%),
    radial-gradient(ellipse 50% 40% at 0% 100%, rgba(13, 110, 154, .1), transparent 50%),
    linear-gradient(180deg, #e6edf6 0%, #eef3f8 100%);
  min-height: 100vh;
}
a { color: var(--blue); text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: 14px; }
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(ellipse 60% 50% at 70% 0%, rgba(30, 200, 232, .22), transparent 55%),
    radial-gradient(ellipse 50% 40% at 10% 100%, rgba(13, 110, 154, .28), transparent 50%),
    linear-gradient(160deg, #0b1626 0%, #123049 48%, #0d3d5c 100%);
}
.login-card {
  width: min(420px, 100%); background: rgba(255,255,255,.96);
  border: 1px solid rgba(255,255,255,.55); border-radius: 18px;
  padding: 32px 28px; box-shadow: 0 20px 50px rgba(0, 20, 40, .35);
  backdrop-filter: blur(8px);
}
.brand { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; }
.mark {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(145deg, var(--cyan), var(--deep));
  color: #fff; display: grid; place-items: center; font-weight: 800;
  box-shadow: 0 6px 16px rgba(14, 140, 180, .35);
}
.brand h1 { font-size: 20px; margin: 0; letter-spacing: .02em; }
.brand p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 6px; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=time], select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  background: #f8fbfe; color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: #7dc9e6; box-shadow: 0 0 0 3px rgba(30, 200, 232, .18); background: #fff;
}
textarea { min-height: 120px; resize: vertical; }
.btn {
  border: 0; border-radius: 10px; padding: 10px 16px; cursor: pointer;
  background: linear-gradient(180deg, #1896c4, var(--deep)); color: #fff; font-weight: 650;
  box-shadow: 0 4px 12px rgba(13, 110, 154, .28);
}
.btn:hover { filter: brightness(1.05); }
.btn.coral { background: linear-gradient(180deg, #f2917b, var(--coral)); box-shadow: 0 4px 12px rgba(229, 109, 86, .28); }
.btn.ghost { background: #fff; color: var(--deep); border: 1px solid var(--line); box-shadow: none; }
.btn.small { padding: 6px 10px; border-radius: 8px; font-size: 13px; box-shadow: none; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.shell { display: flex; min-height: 100vh; }
.side {
  width: 248px; flex: none; padding: 18px 12px 28px; overflow-y: auto;
  color: var(--side-text);
  background:
    linear-gradient(180deg, rgba(30, 200, 232, .08) 0%, transparent 28%),
    linear-gradient(165deg, var(--side) 0%, var(--side-2) 55%, #0e2740 100%);
  border-right: 1px solid rgba(90, 160, 200, .18);
  box-shadow: 8px 0 32px rgba(8, 20, 40, .12);
}
.side .brand { color: #fff; padding: 4px 8px 14px; margin-bottom: 6px; border-bottom: 1px solid rgba(140, 180, 210, .15); }
.side .brand p { color: var(--side-muted); }
.side-nav { margin-top: 10px; }
.nav-group { border: 0; margin: 6px 0; }
.nav-group > summary {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center; justify-content: space-between;
  color: #e8f2fb; font-size: 15px; font-weight: 700; letter-spacing: .03em;
  padding: 11px 12px; border-radius: 10px;
  background: rgba(255,255,255,.03);
  transition: background .15s, color .15s;
}
.nav-group > summary:hover { background: rgba(30, 200, 232, .1); }
.nav-group[open] > summary {
  color: #fff;
  background: linear-gradient(90deg, rgba(30, 200, 232, .16), rgba(30, 200, 232, .04));
}
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary::after {
  content: ""; width: 7px; height: 7px;
  border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg); transition: transform .15s ease; margin-left: 8px; opacity: .9;
  flex: none;
}
.nav-group[open] > summary::after { transform: rotate(45deg); }
.nav-sub { padding: 4px 0 8px 6px; border-left: 1px solid rgba(30, 200, 232, .22); margin: 2px 0 4px 14px; }
.side a {
  display: block; color: var(--side-text); padding: 8px 12px;
  border-radius: 8px; margin: 2px 0; font-size: 13.5px;
  transition: background .15s, color .15s, padding-left .15s;
}
.side a:hover { background: rgba(255,255,255,.07); color: #fff; }
.side a.on {
  background: linear-gradient(90deg, rgba(30, 200, 232, .22), rgba(30, 200, 232, .06));
  color: #fff; font-weight: 650;
  box-shadow: inset 3px 0 0 var(--accent);
}
.main { flex: 1; min-width: 0; }
.top {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 22px; gap: 12px;
  background: rgba(255,255,255,.55); backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(200, 220, 235, .7);
  position: sticky; top: 0; z-index: 3;
}
.top h2 { margin: 0; font-size: 18px; letter-spacing: .02em; }
.who { color: var(--muted); font-size: 13px; }
.content { padding: 14px 22px 40px; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat {
  background: var(--card); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow);
  border: 1px solid rgba(200, 220, 238, .8);
  position: relative; overflow: hidden;
}
.stat::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--cyan), var(--deep));
}
.stat b { display: block; font-size: 26px; margin-top: 4px; color: var(--deep); }
.stat span { color: var(--muted); font-size: 13px; }
.card {
  background: var(--card); border-radius: 14px; padding: 16px; box-shadow: var(--shadow);
  margin-top: 14px; border: 1px solid rgba(200, 220, 238, .75);
}
.card h3 { margin: 0 0 12px; font-size: 16px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 650; font-size: 12px; letter-spacing: .03em; }
tr:hover td { background: rgba(30, 180, 220, .03); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; background: var(--pending-bg); color: var(--pending); }
.badge.done { background: var(--done-bg); color: var(--done); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.muted { background: #eef1f4; color: var(--muted); }
.flash { padding: 10px 12px; border-radius: 10px; margin-bottom: 12px; }
.flash.ok { background: var(--done-bg); color: var(--done); }
.flash.err { background: var(--err-bg); color: var(--err); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filters input, .filters select { width: auto; }
.split { display: grid; grid-template-columns: 1.2fr .8fr; gap: 14px; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 10px; font-size: 14px; }
.kv b { color: var(--muted); font-weight: 500; }
.help { color: var(--muted); font-size: 12px; line-height: 1.6; }
.pager { display: flex; gap: 8px; margin-top: 12px; }
.check-grid { display: flex; gap: 8px; flex-wrap: wrap; }
.check-grid label { margin: 0; color: var(--ink); background: #eef6fb; border-radius: 8px; padding: 6px 10px; }
.nav-toggle { display: none; }
@media (max-width: 960px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .split { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 5; inset: 0 auto 0 0; transform: translateX(-105%); transition: transform .2s; }
  .nav-toggle:checked ~ .shell .side { transform: none; }
  .menu-btn { display: inline-flex; }
}
.menu-btn { display: none; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 10px; }
@media (max-width: 960px) { .menu-btn { display: inline-flex; } }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 4px 0 12px; flex-wrap: wrap; }
.toolbar .help { margin: 0; }
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(8, 18, 32, .55); z-index: 40;
  backdrop-filter: blur(2px);
}
.modal {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px;
}
.modal[hidden], .modal-backdrop[hidden] { display: none !important; }
.modal-panel {
  width: min(560px, 100%); max-height: min(88vh, 900px); overflow: auto;
  background: var(--card); border-radius: 16px;
  border: 1px solid rgba(180, 210, 230, .7);
  box-shadow: 0 20px 56px rgba(10, 30, 55, .28);
}
.modal-panel:has(.split) { width: min(720px, 100%); }
.modal-panel.modal-sm { width: min(420px, 100%); }
.modal-body .split { margin-top: 0; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 18px 0;
}
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-close {
  border: 0; background: #e8f3f8; color: var(--muted); width: 32px; height: 32px;
  border-radius: 8px; cursor: pointer; font-size: 20px; line-height: 1;
}
.modal-close:hover { background: #d7ebf4; color: var(--ink); }
.modal-body { padding: 8px 18px 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.sr-only, .visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
form[hidden] { display: none !important; }
.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 156px;
  margin-top: 2px;
  padding: 18px 16px 16px;
  border: 1.5px dashed #9ec4d8;
  border-radius: 14px;
  background:
    radial-gradient(ellipse 80% 80% at 50% 0%, rgba(46, 196, 230, .12), transparent 60%),
    #f5fafd;
  color: var(--ink);
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.dropzone:hover, .dropzone:focus-visible {
  border-color: #3aa7cc;
  box-shadow: 0 0 0 3px rgba(30, 200, 232, .16);
  outline: none;
}
.dropzone.is-dragover {
  border-color: var(--blue);
  background: #e7f6fc;
  box-shadow: 0 0 0 3px rgba(7, 130, 184, .16);
}
.dropzone.is-error { border-color: var(--coral); background: #fff6f4; }
.dropzone input[type=file] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.dropzone-icon {
  width: 46px;
  height: 46px;
  margin-bottom: 4px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--deep);
  background: #fff;
  box-shadow: 0 6px 16px rgba(13, 110, 154, .12);
}
.dropzone-title { margin: 0; font-size: 14px; font-weight: 650; }
.dropzone-hint, .dropzone-name { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.dropzone.has-file .dropzone-title,
.dropzone.has-file .dropzone-hint { display: none; }
.dropzone-name { color: var(--ink); font-weight: 650; word-break: break-all; }
.dropzone-clear {
  margin-top: 6px;
  border: 0;
  background: transparent;
  color: var(--deep);
  cursor: pointer;
  font-size: 12px;
  text-decoration: underline;
  position: relative;
  z-index: 1;
}
.dropzone.is-error .dropzone-name { color: var(--coral); font-weight: 500; }
textarea[data-richtext] { min-height: 280px; }
.modal-panel:has(.ql-toolbar) { width: min(760px, 100%); }
.ql-toolbar.ql-snow {
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  background: #f8fbfe;
  font-family: var(--font);
}
.ql-container.ql-snow {
  border: 1px solid var(--line);
  border-radius: 0 0 10px 10px;
  background: #fff;
  font-family: var(--font);
  font-size: 14px;
}
.richtext .ql-editor { min-height: 280px; line-height: 1.7; }
.richtext .ql-editor.ql-blank::before { color: #8da0b8; font-style: normal; }
.richtext-error { color: var(--coral); font-size: 12px; margin: 8px 0 0; }
