:root {
  --navy:#11263f;
  --blue:#1478ff;
  --cyan:#00bad6;
  --mint:#e8fbf6;
  --paper:#f4f7fb;
  --ink:#172033;
  --muted:#6b7586;
  --line:#dfe6ef;
  --danger:#d84747;
  --white:#fff;
}
* { box-sizing:border-box; }
html,body { margin:0; min-height:100%; font-family:"Microsoft YaHei","PingFang SC",sans-serif; color:var(--ink); background:var(--paper); }
button,input { font:inherit; }
button { cursor:pointer; border:0; }
.hidden { display:none!important; }
.shell { max-width:1380px; margin:auto; padding:28px; }
.topbar { display:flex; align-items:center; justify-content:space-between; gap:18px; margin-bottom:20px; }
.topbar h1 { margin:0 0 6px; font-size:30px; }
.topbar p { margin:0; color:var(--muted); }
.topbar-actions { display:flex; align-items:center; gap:10px; flex-wrap:wrap; justify-content:flex-end; }
.card { background:var(--white); border:1px solid var(--line); border-radius:18px; box-shadow:0 10px 30px rgba(34,53,84,.06); }
.message { min-height:24px; color:#23805f; }
.message.error { color:var(--danger); }
.doctor-grid { display:grid; grid-template-columns:minmax(0,1.25fr) minmax(340px,.75fr); gap:20px; }
.current-card { padding:34px; text-align:center; }
.state { font-size:18px; color:var(--muted); }
.ticket-number { font-size:92px; line-height:1.2; font-weight:800; color:var(--blue); letter-spacing:3px; }
.patient-line { font-size:24px; margin:8px 0; }
.room-line { color:var(--muted); margin-bottom:28px; }
.doctor-actions { display:flex; gap:12px; justify-content:center; flex-wrap:wrap; }
.doctor-actions button,.primary-button,.secondary-button,.danger-button,.link-button { padding:13px 22px; border-radius:12px; font-weight:700; }
.primary-button { background:var(--blue); color:#fff; }
.secondary-button { background:#e8f1ff; color:#125cb9; }
.danger-button { background:#ffe7e7; color:#a62525; }
.link-button { background:white; border:1px solid var(--line); color:var(--ink); }
button:disabled { opacity:.4; cursor:not-allowed; }
.queue-list { padding:24px; min-height:0; }
.queue-list h2,.history-card h2 { margin:0 0 18px; }
.list-scroll { max-height:350px; overflow:auto; padding-right:4px; }
.queue-row { display:grid; grid-template-columns:80px 1fr auto; align-items:center; gap:12px; padding:13px 4px; border-bottom:1px solid var(--line); }
.queue-no { font-weight:800; color:var(--blue); font-size:20px; }
.queue-time { color:var(--muted); font-size:13px; }
.list-empty { color:var(--muted); text-align:center; padding:34px 10px; }
.doctor-history-grid { display:grid; grid-template-columns:1fr 1fr; gap:20px; margin-top:20px; }
.history-card { padding:24px; min-height:260px; }
.history-list { max-height:330px; overflow:auto; }
.history-row { display:grid; grid-template-columns:74px minmax(90px,1fr) 74px 50px; align-items:center; gap:10px; padding:12px 4px; border-bottom:1px solid var(--line); }
.history-row-action { grid-template-columns:74px minmax(90px,1fr) 74px 94px; }
.history-no { color:var(--blue); font-weight:800; font-size:18px; }
.history-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.history-time { color:var(--muted); font-size:13px; text-align:right; }
.status-badge { display:inline-flex; justify-content:center; padding:5px 8px; border-radius:999px; font-size:12px; font-weight:700; }
.status-done { color:#14705a; background:#e2f7f0; }
.status-skipped { color:#a62525; background:#ffe7e7; }
.small-button { padding:8px 10px; border-radius:9px; font-size:13px; font-weight:700; background:#e8f1ff; color:#125cb9; }
.modal-overlay { position:fixed; inset:0; z-index:30; display:grid; place-items:center; padding:20px; background:rgba(13,28,47,.55); }
.modal-card { width:min(520px,100%); background:#fff; border-radius:20px; padding:28px; box-shadow:0 24px 80px rgba(13,28,47,.28); }
.modal-title-row { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; }
.modal-title-row h2 { margin:0 0 8px; }
.modal-title-row p { margin:0 0 24px; color:var(--muted); line-height:1.6; }
.modal-close { width:36px; height:36px; border-radius:50%; background:#f0f3f7; color:#657083; font-size:24px; line-height:1; }
.form-label { display:block; margin-bottom:8px; font-weight:700; }
.form-label.required::before { content:'*'; color:#e5484d; margin-right:4px; }
.form-input { width:100%; padding:13px 14px; border:1px solid var(--line); border-radius:11px; outline:none; }
.form-input:focus { border-color:var(--blue); box-shadow:0 0 0 3px rgba(20,120,255,.12); }
.form-help { margin:9px 0 22px; color:var(--muted); font-size:13px; }
.modal-actions { display:flex; justify-content:flex-end; gap:10px; }

@media(max-width:1000px) {
  .doctor-grid,.doctor-history-grid { grid-template-columns:1fr; }
  .ticket-number { font-size:66px; }
}

@media(max-width:620px) {
  .shell { padding:18px; }
  .topbar { align-items:flex-start; flex-direction:column; }
  .topbar-actions { justify-content:flex-start; }
  .current-card { padding:24px 16px; }
  .history-row,.history-row-action { grid-template-columns:64px 1fr auto; }
  .history-time { display:none; }
  .history-row-action .status-badge { display:none; }
}
