/* 模拟挂号系统样式：复刻原系统的青绿色旧式后台布局 */
:root {
  --head1: #4d8e98;
  --head2: #7fb8bd;
  --nav: #e9f8f4;
  --side: #eaf8f5;
  --line: #87bdbe;
  --line-soft: #c8e3e1;
  --text: #333;
  --link: #145a8a;
  --red: #d40000;
  --gray: #9a9a9a;
  --teal: #8ac6c6;
  --purple: #8000ff;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font: 12px/1.5 "SimSun", "宋体", Arial, sans-serif;
  color: var(--text);
  background: #fff;
}
a { color: var(--link); text-decoration: none; cursor: pointer; }
a:hover { text-decoration: underline; color: #c00; }
button, input, select, textarea { font: 12px "SimSun", "宋体", Arial, sans-serif; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }

/* 登录页 */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #e8f5f4, #f8fdfc);
}
.login-box {
  width: 360px; border: 1px solid var(--line); background: #fff;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
}
.login-title {
  height: 34px; line-height: 34px; padding-left: 14px;
  background: linear-gradient(90deg, var(--head1), var(--head2));
  color: #fff; font-weight: bold; letter-spacing: 2px;
}
.login-body { padding: 26px 30px 22px; }
.login-row { display: flex; align-items: center; margin-bottom: 16px; }
.login-row label { width: 80px; text-align: right; margin-right: 10px; }
.login-row input { flex: 1; height: 24px; border: 1px solid #9bb; padding: 2px 6px; }
.login-actions { text-align: center; margin-top: 22px; }
.login-actions button { height: 26px; padding: 0 18px; border: 1px solid #6aa; background: #eaf7f5; }
.login-foot { text-align: center; margin-top: 18px; }

/* 主框架 */
.shell { min-height: 100vh; border: 1px solid var(--line); margin: 0; }
.app-header {
  height: 38px; background: linear-gradient(90deg, var(--head1), var(--head2));
  color: #fff; display: flex; align-items: center; padding: 0 12px;
  position: relative; overflow: hidden;
}
.app-header .brand { font-size: 15px; font-weight: bold; letter-spacing: 3px; text-shadow: 1px 1px 2px rgba(0,0,0,.3); }
.app-header .tenant-badge { display: inline-block; margin-left: 14px; padding: 2px 10px; border: 1px solid rgba(255,255,255,.75); border-radius: 10px; font-size: 12px; letter-spacing: 0; color: #fff; background: rgba(255,255,255,.22); vertical-align: middle; }
.login-sub { padding: 8px 14px; color: #4a6b66; font-size: 12px; background: #f0f7f5; border-bottom: 1px solid var(--line-soft); }
.deploy-badge { display: inline-block; margin-left: 14px; padding: 2px 8px; border: 1px solid rgba(255,255,255,.5); border-radius: 10px; font-size: 11px; letter-spacing: 0; color: #fff; background: rgba(255,255,255,.12); vertical-align: middle; }
.app-header .deploy-badge.badge-off { background: #b33b3b; border-color: #ffb3b3; }
.app-header .decor { position: absolute; left: 42%; top: -10px; color: rgba(255,255,255,.35); font-size: 26px; letter-spacing: 28px; }
.app-nav {
  height: 27px; background: var(--nav); border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; padding: 0 8px;
}
.app-nav .tabs { display: flex; height: 100%; }
.app-nav .tab {
  display: flex; align-items: center; padding: 0 10px; height: 100%;
  border-right: 1px solid var(--line-soft);
}
.app-nav .tab.active { color: var(--red); font-weight: bold; background: #fff; }
.app-nav .spacer { flex: 1; }
.app-nav .util { padding: 0 8px; }
.app-body { display: flex; min-height: calc(100vh - 68px); }
.sidebar { width: 166px; flex: 0 0 166px; background: var(--side); border-right: 1px solid var(--line-soft); padding: 6px; }
.sidebar.hidden { display: none; }
.side-title {
  padding: 4px 8px; color: var(--red); font-weight: bold;
  background: #fff; border: 1px solid var(--line-soft);
}
.side-menu { border: 1px solid var(--line-soft); background: #fff; margin-top: 2px; }
.side-menu a { display: block; padding: 4px 10px; color: #333; }
.side-menu a:hover, .side-menu a.active { background: #fff2d9; color: var(--red); text-decoration: none; }
.side-box { margin-top: 12px; border: 1px solid var(--line-soft); background: #fff; }
.side-box h4 { margin: 0; padding: 5px 8px; background: #f3faf8; border-bottom: 1px solid var(--line-soft); font-size: 12px; display: flex; justify-content: space-between; }
.side-box .user { display: block; padding: 5px 8px; }
.content { flex: 1; padding: 8px 10px 20px; min-width: 0; overflow: auto; background: #fff; }
.content-heading { font-size: 13px; font-weight: bold; margin: 2px 0 8px; }

/* 通用表格 */
table.grid { border-collapse: collapse; width: 100%; background: #fff; }
table.grid th, table.grid td { border: 1px solid var(--line-soft); padding: 3px 5px; vertical-align: middle; }
table.grid th { background: #f0f8f6; font-weight: normal; white-space: nowrap; }
table.grid .band { background: #f5f5f5; }
table.grid .group { background: #ffe9c4; font-weight: bold; text-align: center; }
.zone { border: 1px solid var(--line); margin-bottom: 12px; }
.zone-title { background: #f3faf8; border-bottom: 1px solid var(--line-soft); padding: 4px 8px; font-weight: bold; }
.zone-body { padding: 6px 10px; }
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-bottom: 6px; }
.toolbar input[type=text] { height: 22px; border: 1px solid #99b; padding: 0 4px; }
.btn { height: 22px; padding: 0 8px; border: 1px solid #8ab; background: #f6fbfa; }
.btn:hover { background: #e7f5f2; }
.btn-primary { background: #fff2d9; border-color: #d9b87a; font-weight: bold; }
.btn-danger { background: #fff0ef; border-color: #d99b96; color: #b3261e; }
.op-danger { color: #b3261e; }
.op-danger:hover { text-decoration: underline; }
.hint { color: #777; }
.stat-line { background: #fafafa; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); padding: 4px 8px; display: flex; justify-content: space-between; }
.legend { padding: 4px 8px; color: #555; }
.legend .st-等待 { color: #000; }
.legend .st-已到 { color: red; }
.legend .st-未到 { color: silver; }
.legend .st-过期 { color: #8ac6c6; }
.legend .st-回访 { color: #8000ff; }
.list-wrap { overflow: auto; max-height: 62vh; border: 1px solid var(--line-soft); }
.list-wrap table.grid { min-width: 1180px; }
.list-wrap th a { font-weight: normal; }
.cell-clip { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: middle; }
.pager { display: flex; align-items: center; gap: 6px; padding: 6px 2px; flex-wrap: wrap; }
.pager select, .pager input { height: 22px; border: 1px solid #99b; }
.empty { text-align: center; padding: 24px; color: #888; }

/* 表单 */
.form-zone { max-width: 980px; }
.form-zone table.form { width: 100%; border-collapse: collapse; }
.form-zone table.form td { border: 1px solid var(--line-soft); padding: 5px 6px; vertical-align: middle; }
.form-zone table.form td.label { width: 110px; background: #f7fbfa; text-align: right; white-space: nowrap; }
.form-zone input[type=text], .form-zone input[type=password], .form-zone select, .form-zone textarea {
  border: 1px solid #99b; padding: 2px 4px; min-height: 21px;
}
.form-zone input[type=text] { width: 210px; }
.form-zone textarea { width: 300px; height: 56px; resize: vertical; }
.form-zone select { min-width: 220px; }
.quick a { margin-right: 6px; }
.notice { background: #fff9e8; border: 1px solid #e8d6a8; padding: 6px 10px; margin-bottom: 10px; }
.notice ul { margin: 4px 0 0 18px; padding: 0; }
.section-title { background: #eaf5f2; border-bottom: 1px solid var(--line-soft); padding: 5px 8px; font-weight: bold; }

/* 详情页 */
.detail-tabs { display: flex; border-bottom: 1px solid var(--line); background: #f3faf8; }
.detail-tabs span { padding: 6px 18px; border-right: 1px solid var(--line-soft); cursor: pointer; }
.detail-tabs span.active { background: #fff; color: var(--red); font-weight: bold; }
.detail-table td { border: 1px solid var(--line-soft); padding: 4px 8px; }
.detail-table td.k { width: 120px; background: #f7fbfa; text-align: right; }
.card { border: 2px solid #e2b34a; max-width: 480px; margin: 16px 0; padding: 10px 14px; font-size: 12px; }
.card h3 { margin: 2px 0 6px; font-size: 16px; text-align: center; color: #b27a14; }
.card .sub { text-align: center; color: #666; margin-bottom: 10px; }
.card p { margin: 3px 0; }
.card .hotline { color: #c00; font-weight: bold; font-size: 14px; }

/* 弹窗 / 提示 */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.28); display: flex; align-items: center; justify-content: center; z-index: 999; }
.modal { background: #fff; border: 1px solid var(--line); box-shadow: 0 4px 18px rgba(0,0,0,.2); min-width: 320px; max-width: 92vw; }
.modal .modal-title { background: linear-gradient(90deg, var(--head1), var(--head2)); color: #fff; padding: 6px 10px; display: flex; justify-content: space-between; }
.modal .modal-body { padding: 12px 16px; }
.modal .modal-foot { padding: 8px 16px 14px; text-align: right; }
.modal textarea { width: 100%; height: 190px; border: 1px solid #99b; padding: 6px; resize: none; }
.toast { position: fixed; left: 50%; top: 40%; transform: translate(-50%, -50%); background: #fff; border: 2px solid #6aa; padding: 16px 26px; z-index: 1000; box-shadow: 0 4px 16px rgba(0,0,0,.25); min-width: 240px; text-align: center; }
.toast button { margin-top: 12px; padding: 3px 16px; }
.fake-alert { max-width: 420px; white-space: pre-wrap; text-align: left; }

/* 首页统计 */
.dash-table { border-collapse: collapse; border: 1px solid var(--line); margin-bottom: 14px; }
.dash-table td { border: 1px solid var(--line-soft); padding: 4px 10px; }
.dash-table td.title { background: #f3faf8; font-weight: bold; padding-left: 14px; }
.dash-table td.muted { color: #999; }
.dash-table a { margin-right: 10px; }

/* 报表 */
.report-table { border-collapse: collapse; border: 1px solid var(--line); margin-bottom: 14px; }
.report-table th, .report-table td { border: 1px solid var(--line-soft); padding: 4px 10px; text-align: center; }
.report-table th { background: #f3faf8; }
.report-table tr.summary td { background: #fff7e6; font-weight: bold; }

/* 新增：角色、后台管理与配置字典 */
.role-badge { position: absolute; right: 12px; top: 8px; color: #eaf8f5; font-size: 12px; letter-spacing: 0; }
.login-help { margin-top: 16px; padding: 8px 10px; background: #f3faf8; border: 1px solid var(--line-soft); color: #555; line-height: 1.7; }
.muted { color: #999; }
.badge { display: inline-block; padding: 0 6px; border: 1px solid; border-radius: 2px; }
.badge.on { color: #1a7a4c; border-color: #8bc9a8; background: #eefaf2; }
.badge.off { color: #a33; border-color: #d9a0a0; background: #fff2f2; }
.dict-layout { display: flex; gap: 12px; align-items: flex-start; }
.dict-cats { width: 190px; flex: 0 0 190px; border: 1px solid var(--line); background: #fff; }
.dict-cats .zone-title { display: flex; justify-content: space-between; align-items: center; }
.dict-cats a { display: block; padding: 6px 10px; border-bottom: 1px solid var(--line-soft); color: #333; }
.dict-cats a.active { background: #fff2d9; color: var(--red); font-weight: bold; }
.dict-values { flex: 1; min-width: 0; border: 1px solid var(--line); background: #fff; }
.dict-values .zone-title { display: flex; justify-content: space-between; align-items: center; }
.dict-values table.grid { min-width: 0; }
.admin-note { color: #b27a14; }
span[class^="st-"] { padding: 0 3px; }

/* 日期时间选择器 */
.cal-ico { display: inline-block; width: 17px; height: 17px; margin-left: 2px; vertical-align: -3px; cursor: pointer; border: 1px solid #7a9c93; background: #f7fbfa url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 13 13'%3E%3Crect x='1' y='2' width='11' height='10' fill='%23fff' stroke='%23557'/%3E%3Crect x='1' y='2' width='11' height='3' fill='%23c33'/%3E%3Cg fill='%23557'%3E%3Crect x='3' y='6' width='2' height='2'/%3E%3Crect x='6' y='6' width='2' height='2'/%3E%3Crect x='9' y='6' width='2' height='2'/%3E%3Crect x='3' y='9' width='2' height='2'/%3E%3Crect x='6' y='9' width='2' height='2'/%3E%3C/g%3E%3C/svg%3E") no-repeat center; background-size: 13px 13px; }
.cal-ico:hover { border-color: #c33; }
.cal-pop { position: fixed; z-index: 1200; width: 254px; background: #fff; border: 1px solid #6a9; box-shadow: 0 4px 16px rgba(0,0,0,.25); font-size: 12px; user-select: none; }
.cal-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px; background: #e5f2ef; border-bottom: 1px solid #bcd8d1; }
.cal-head a { display: inline-block; width: 30px; text-align: center; color: #356; font-size: 15px; line-height: 18px; text-decoration: none; }
.cal-head a:hover { color: #c33; }
.cal-title { font-weight: bold; color: #234; }
.cal-week, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-week { padding: 2px 0; border-bottom: 1px solid var(--line-soft); background: #f7fbfa; }
.cal-week span { text-align: center; padding: 2px 0; color: #456; }
.cal-week span.cal-we { color: #c33; }
.cal-grid { padding: 2px; }
.cal-cell { display: block; text-align: center; padding: 3px 0; color: #234; text-decoration: none; line-height: 16px; }
.cal-cell:hover { background: #e5f2ef; }
.cal-cell.cal-we { color: #c33; }
.cal-cell.cal-out { color: #b8c4cc; }
.cal-cell.cal-today { box-shadow: inset 0 0 0 1px #5aa; font-weight: bold; }
.cal-cell.cal-sel { background: #4a9c8c; color: #fff; }
.cal-cell.cal-sel:hover { background: #3c8a7b; }
.cal-time { display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-top: 1px solid var(--line-soft); background: #fbfdfc; color: #567; }
.cal-time a { color: #267; text-decoration: none; }
.cal-time a:hover { color: #c33; }
.cal-foot { display: flex; justify-content: flex-end; gap: 6px; padding: 5px 8px; border-top: 1px solid var(--line-soft); background: #f3faf8; }
.cal-foot .btn { padding: 2px 12px; }
