:root {
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 14px;
  color: #172c2c;
  background: #edf3f1;
  --top: #193b3a;
  --primary: #086b62;
  --accent: #8a5a18;
  --danger: #a63243;
  --muted: #566964;
  --line: #d9e5e0;
  --surface: #fff;
  --soft: #f4f8f6;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 23px; margin-bottom: 6px; letter-spacing: .015em; }
h2 { font-size: 17px; margin-bottom: 15px; }
h3 { font-size: 15px; margin-bottom: 12px; }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: 2px solid #16857c; outline-offset: 2px; }
.app-shell { display: grid; grid-template-columns: 208px minmax(0, 1fr); grid-template-rows: 58px 1fr; min-height: 100vh; }
.topbar { grid-column: 1 / -1; color: #fff; background: var(--top); display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 0 24px; }
.brand, .login-brand { display: flex; align-items: center; gap: 10px; color: inherit; font-size: 17px; font-weight: 650; }
.brand:hover { text-decoration: none; }
.brand-mark { border-radius: 7px; background: #c9ebd7; color: #16473c; display: inline-grid; place-items: center; width: 32px; height: 32px; font: 750 20px/1 system-ui, sans-serif; }
.top-user { display: flex; align-items: center; gap: 15px; font-size: 13px; }
.top-role { color: #c2ddd5; }
.top-logout { color: #fff !important; background: transparent !important; border-color: #688784 !important; }
.sidebar { grid-column: 1; padding: 20px 12px; background: #e5eeea; border-right: 1px solid #d5e2dc; }
.nav-section { margin: 2px 8px 14px; font-weight: 650; color: #31524b; }
.nav-link { display: block; padding: 11px 10px; margin: 3px 0; border-radius: 6px; color: #385750; }
.nav-link:hover { background: #dbe9e3; text-decoration: none; }
.nav-link.current { color: #075a50; font-weight: 650; background: #d1e8de; }
.workspace { min-width: 0; padding: 17px 22px 32px; }
.breadcrumb { color: var(--muted); font-size: 12px; margin: 0 0 15px; }
.breadcrumb span { color: #7a9189; margin: 0 10px; }
.workspace-content { min-width: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 0 0 15px; }
.page-head p { color: var(--muted); margin: 5px 0 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 18px; margin: 0 0 15px; min-width: 0; }
.filter-grid, .form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 17px; align-items: end; }
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field { display: grid; gap: 6px; min-width: 0; color: #294541; }
.field > span, .field > label, label > .label { font-size: 13px; font-weight: 550; }
.field.full, .full-width { grid-column: 1 / -1; }
input:not([type="checkbox"], [type="radio"]), select, textarea {
  border: 1px solid #bdcfc7;
  background: #fff;
  color: #16332d;
  padding: 7px 9px;
  border-radius: 5px;
  min-height: 34px;
  min-width: 0;
  max-width: 100%;
}
input::placeholder, textarea::placeholder { color: #61776f; }
input:read-only, input:disabled, select:disabled, textarea:disabled { background: #f1f6f3; }
textarea { min-height: 84px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); }
.btn {
  border: 1px solid #bdcfc7;
  background: #fff;
  color: #24443b;
  padding: 6px 12px;
  min-height: 32px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.3;
  text-decoration: none;
}
.btn:hover { filter: brightness(.96); text-decoration: none; }
.btn.primary, .btn.accent, .btn.danger { color: #fff; border-color: transparent; }
.btn.primary { background: var(--primary); }
.btn.accent { background: var(--accent); }
.btn.danger { background: var(--danger); }
.btn:disabled { opacity: .55; cursor: default; }
.actions, .toolbar, .form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.form-actions { justify-content: flex-end; margin-top: 14px; }
.table-wrap { overflow: auto; max-width: 100%; }
table { width: 100%; border-spacing: 0; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 9px; vertical-align: middle; border-bottom: 1px solid #e0eae6; }
th { color: #fff; background: #36635d; font-weight: 610; white-space: nowrap; }
tbody tr:nth-child(even) { background: #f8fbf9; }
tbody tr:hover { background: #edf7f1; }
.status { background: #eaf1ee; color: #3d5750; border-radius: 4px; padding: 2px 6px; white-space: nowrap; font-size: 12px; }
.status.following, .status.submitted, .status.blue, .status.inquiry { background: #e4eff9; color: #205584; }
.status.approved, .status.active, .status.completed, .status.confirmed, .status.green { background: #daeee0; color: #1d5e36; }
.status.pending, .status.orange { background: #fff0d8; color: #805213; }
.status.rejected, .status.invalid, .status.red { background: #f8e4e7; color: #8d2d3b; }
.muted, .hint, .empty { color: var(--muted); }
.empty { text-align: center; padding: 26px; }
.error-panel, .form-error { color: #9a2d41; }
.error-panel { border-color: #f0c6ce; }
.form-error { min-height: 1.3em; margin: 0; }
.drawer { background: #fff; max-width: 100%; }
dialog { border: 1px solid var(--line); border-radius: 8px; color: inherit; max-width: calc(100vw - 24px); }
dialog::backdrop { background: rgb(24 46 39 / .38); }
.notifications { position: fixed; right: 20px; bottom: 20px; z-index: 100; }
.notification { background: #11644e; border-radius: 6px; padding: 10px 16px; color: #fff; box-shadow: 0 4px 16px #132b3030; }
.notification.error { background: #9a2d41; }
.login-screen { min-height: 100vh; padding: 26px; display: grid; place-items: center; background: #e8f1ed; }
.login-panel { width: min(400px, 100%); padding: 32px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 22px 60px #163a3414; }
.login-brand { margin-bottom: 29px; color: var(--top); }
.login-form { display: grid; gap: 14px; margin-top: 20px; }
.login-form .btn { min-height: 40px; }
@media (max-width: 800px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto 1fr; }
  .topbar { min-height: 54px; padding: 0 14px; }
  .sidebar { display: flex; flex-wrap: wrap; padding: 4px 8px; gap: 2px; border-right: 0; border-bottom: 1px solid var(--line); }
  .nav-section { display: none; }
  .nav-link { padding: 7px 8px; font-size: 12px; }
  .workspace { padding: 12px; }
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 470px) {
  .filter-grid, .form-grid { grid-template-columns: 1fr; }
  .top-role { display: none; }
  .panel { padding: 12px; }
}
