:root {
  color-scheme: light;
  --blue: #23815b;
  --blue-soft: #eaf6ef;
  --ink: #172033;
  --muted: #6d778b;
  --line: #e5e9f0;
  --surface: #ffffff;
  --background: #f5f7f2;
  --danger: #c73535;
  --success: #147a4a;
  --radius: 18px;
  font-family: Inter, "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--background); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 20% 10%, #dfeee3, transparent 42%), var(--background); }
.login-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 28px; padding: 38px; box-shadow: 0 24px 70px rgba(35, 61, 104, .12); }
.brand-mark { width: 58px; height: 58px; display: block; flex: 0 0 auto; border-radius: 18px; object-fit: cover; background: var(--blue); }
.brand-mark.small { width: 42px; height: 42px; border-radius: 13px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin: 12px 0 8px; }
.eyebrow { margin: 20px 0 4px; color: var(--blue); font-size: 12px; font-weight: 750; letter-spacing: .14em; }
.muted { color: var(--muted); }
.stack { display: grid; gap: 16px; margin-top: 28px; }
label { display: grid; gap: 7px; color: #4d586b; font-size: 13px; font-weight: 650; }
input, select, textarea { width: 100%; border: 1px solid #d8deea; border-radius: 12px; padding: 11px 12px; color: var(--ink); background: white; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(35,129,91,.12); }
textarea { min-height: 96px; resize: vertical; }
button { border: 0; border-radius: 12px; padding: 10px 14px; font-weight: 700; }
.primary { color: white; background: var(--blue); }
.primary:hover { background: #176b49; }
.ghost { color: var(--ink); background: #eef1f6; }
.danger { color: var(--danger); background: #fff0f0; }
.error { min-height: 20px; color: var(--danger); font-size: 13px; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 236px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 20px 16px; overflow-y: auto; background: #123f32; color: white; }
.brand-row { display: flex; gap: 12px; align-items: center; padding: 0 8px 24px; }
.brand-row div:last-child { display: grid; gap: 2px; }
.brand-row span { color: #9ca8bd; font-size: 12px; }
nav { display: grid; gap: 5px; }
.nav-group { margin: 13px 12px 2px; color: #7f8da5; font-size: 11px; font-weight: 750; letter-spacing: .08em; }
nav button { text-align: left; color: #bfc8d8; background: transparent; padding: 12px 14px; }
nav button:hover, nav button.active { color: white; background: rgba(255,255,255,.1); }
.metric-link { width: 100%; text-align: left; color: inherit; background: var(--surface); border: 1px solid var(--line); }
.metric-link:hover, .metric-link:focus-visible { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(35,129,91,.12); outline: none; }
.drilldown-header { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.drilldown-header .muted { margin-left: auto; }
.filter-summary { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; padding: 10px 12px; border-radius: 12px; color: #286347; background: var(--blue-soft); }
.logout { margin-top: auto; color: #d7deeb; background: rgba(255,255,255,.08); }
.workspace { min-width: 0; }
.topbar { min-height: 98px; display: flex; align-items: center; justify-content: space-between; padding: 22px 34px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.86); }
.topbar .eyebrow { margin: 0 0 3px; }
.topbar h2 { margin: 0; font-size: 24px; }
.local-pill { display: flex; align-items: center; gap: 7px; padding: 8px 11px; border-radius: 99px; color: var(--success); background: #eaf8f1; font-size: 12px; font-weight: 750; }
.local-pill span { width: 7px; height: 7px; border-radius: 50%; background: #22a265; }
.content { padding: 28px 34px 60px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 18px; }
#user-bulk-actions[hidden] { display: none; }
.toolbar label { min-width: 150px; flex: 1; }
.toolbar .compact { flex: 0 1 180px; }
.grid { display: grid; gap: 16px; }
.metric-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rule-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end; margin-top: 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 19px; box-shadow: 0 8px 28px rgba(39,58,92,.045); }
.sub-card { margin-top: 0; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--background); }
.metric strong { display: block; margin-top: 10px; font-size: 32px; }
.metric span { color: var(--muted); font-size: 13px; }
.card-header { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-header h3 { margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: white; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: 13px; }
th { position: sticky; top: 0; color: #59657a; background: #f8f9fc; z-index: 1; }
tr:last-child td { border-bottom: 0; }
.badge { display: inline-block; padding: 4px 8px; border-radius: 99px; font-size: 11px; font-weight: 750; background: #eef1f6; color: #536078; }
.badge.ok { background: #e8f7ef; color: var(--success); }
.badge.warn { background: #fff3db; color: #9b6410; }
.badge.bad { background: #ffeded; color: var(--danger); }
.subtle { font-size: 12px; color: var(--muted); }
.slot-list { display: flex; flex-wrap: wrap; gap: 8px; }
.slot { padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.slot.off { opacity: .52; text-decoration: line-through; }
.inventory-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); gap: 8px; margin-top: 14px; }
.inventory-cell { min-height: 66px; border: 1px solid var(--line); background: white; display: grid; gap: 3px; place-content: center; }
.inventory-cell.blocked { color: var(--danger); background: #fff1f1; border-color: #ffd2d2; }
.empty { padding: 44px 20px; text-align: center; color: var(--muted); border: 1px dashed #ced5e1; border-radius: var(--radius); }
.toast { position: fixed; right: 24px; top: 20px; z-index: 20; max-width: 380px; padding: 12px 16px; color: white; background: #172033; border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.18); transform: translateY(-80px); opacity: 0; transition: .2s ease; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast.error-toast { background: var(--danger); }
dialog { width: min(560px, calc(100% - 32px)); border: 0; border-radius: 20px; padding: 0; box-shadow: 0 30px 90px rgba(0,0,0,.24); }
dialog::backdrop { background: rgba(13,21,35,.48); }
#dialog-form { padding: 24px; }
#setup-form { padding: 28px; }
#setup-form h1, #setup-form p { margin: 0; }
#setup-form h1 { font-size: 24px; }
#setup-dialog { max-height: calc(100dvh - 32px); overflow-y: auto; }
#setup-form button:disabled { cursor: wait; opacity: .65; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.section-title { margin: 28px 0 12px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; }
.version-policy-note { margin: -8px 0 0; }
.feedback-table { min-width: 960px; table-layout: fixed; }
.feedback-table th:nth-child(1), .feedback-table td:nth-child(1) { width: 7%; }
.feedback-table th:nth-child(2), .feedback-table td:nth-child(2) { width: 9%; }
.feedback-table th:nth-child(3), .feedback-table td:nth-child(3) { width: 8%; }
.feedback-table th:nth-child(4), .feedback-table td:nth-child(4) { width: 14%; }
.feedback-table th:nth-child(5), .feedback-table td:nth-child(5) { width: 27%; }
.feedback-table th:nth-child(6), .feedback-table td:nth-child(6),
.feedback-table th:nth-child(7), .feedback-table td:nth-child(7) { width: 12%; }
.feedback-table th:nth-child(8), .feedback-table td:nth-child(8) { width: 11%; }
.feedback-summary { min-width: 0; }
.feedback-summary strong, .feedback-summary span {
  display: -webkit-box;
  overflow: hidden;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.feedback-summary span { margin-top: 5px; color: var(--muted); }
.mono-cell { font-family: ui-monospace, "Cascadia Mono", monospace; }
.feedback-detail { max-height: min(72vh, 760px); overflow: auto; padding-right: 4px; }
.long-text {
  margin-top: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--background);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 280px;
  overflow: auto;
}
.timeline { display: grid; gap: 10px; margin: 8px 0 0; padding-left: 22px; }
.timeline li { padding-left: 4px; overflow-wrap: anywhere; }
.lost-image-preview {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border-radius: 14px;
  background: var(--background);
}
@media (max-width: 850px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  nav { grid-template-columns: repeat(2, 1fr); }
  .logout { margin-top: 16px; }
  .two-columns { grid-template-columns: 1fr; }
  .rule-grid { grid-template-columns: 1fr; }
  .topbar, .content { padding-left: 18px; padding-right: 18px; }
}


/* MyChuannong operations */
.hero-card { background:linear-gradient(115deg,#e4f2e6,#f4f8eb); border:1px solid #d5e4d7; padding:30px; border-radius:22px; margin-bottom:24px; }
.hero-card h3 { font-size:28px; margin-bottom:12px; color:#154d37; }
.hero-card p { color:#52745e; margin-bottom:0; line-height:1.8; }
.campus-tabs { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:20px; }
.campus-tabs button.active { background:#23815b; color:white; }
.provider-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(290px,1fr)); gap:18px; }
.provider-image { width:100%; height:155px; object-fit:cover; border-radius:12px; margin-bottom:16px; }
.provider-placeholder { height:100px; background:#edf5ed; border-radius:12px; display:grid; place-items:center; color:#42765a; font-size:28px; margin-bottom:16px; }
.module-note { border-left:3px solid #79a58b; padding:14px 18px; background:#edf4ed; color:#45644f; line-height:1.7; margin:16px 0; }
.nav-icon { display:inline-flex; vertical-align:middle; margin-right:10px; opacity:.85; }
.nav-icon svg { width:18px; height:18px; }
.campus-detail { white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.8; }
.campus-detail img { max-width:100%; max-height:240px; border-radius:12px; }
.campus-pager { display:flex; justify-content:flex-end; gap:12px; align-items:center; margin-top:16px; }
.table-wrap td .actions { min-width:140px; }
.source-note { font-size:12px; color:#718675; margin-top:24px; }
@media(max-width:850px) {
  .app-shell {display:block} .sidebar {position:relative;height:auto;padding:16px;overflow:visible}
  .brand-row {padding:0 100px 14px 0} .sidebar .logout {position:absolute;top:16px;right:16px;margin:0}
  nav {display:flex;overflow-x:auto;gap:6px;padding-bottom:4px} nav .nav-group {display:none}
  nav button {white-space:nowrap;flex-shrink:0;padding:10px 12px} .nav-icon {margin-right:7px}
  .content {padding:20px 16px} .topbar {padding:18px 16px;gap:12px;align-items:flex-start}
  .topbar h2 {font-size:21px} .topbar .eyebrow {font-size:10px;letter-spacing:.08em}
  #admin-identity {font-size:11px;max-width:180px} .hero-card {padding:22px}
  .provider-grid {grid-template-columns:repeat(auto-fit,minmax(240px,1fr))}
}
