:root {
  --navy: #122c4e;
  --navy2: #0d3043;
  --teal: #2463d4;
  --bg: #eef3f7;
  --line: #dce7ed;
  --text: #172d3f;
  --muted: #728795;
  --danger: #a33b32;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.55 -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif; }
button, input, textarea, select { font: inherit; }
.hidden { display: none !important; }
a { color: var(--teal); }
.brand { display:flex; flex-direction:column; align-items:flex-start; gap:8px; text-decoration:none; }
.brand img { display:block; width:194px; max-width:100%; height:auto; background:#fff; border-radius:6px; }
.brand span { font-size:12px; font-weight:500; color:var(--muted); letter-spacing:1px; }
.brand.small { padding:4px 8px 22px; }
.brand.small span { color:#b9cadc; }
.login-view { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(145deg, #10243f, #244c79); padding: 24px; }
.login-card { width: min(460px, 100%); padding: 34px; background: #fff; border-radius: 18px; box-shadow: 0 20px 60px #0004; }
.login-card h1 { margin: 22px 0 8px; font-size: 24px; }
.login-card p { color: var(--muted); line-height: 1.8; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 0 16px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.ghost { background: #f4f9fb; color: #087f94; }
.btn.danger { background: #fff0ee; color: var(--danger); border-color: #f0c9c4; }
.btn.sm { min-height: 30px; padding: 0 10px; font-size: 12px; }
.btn:disabled, .btn.disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.app-view { display: flex; min-height: 100vh; }
.sidebar { width: 210px; flex-shrink: 0; background: var(--navy); color: #fff; padding: 22px 14px; display: flex; flex-direction: column; }
#nav { display: flex; flex-direction: column; gap: 4px; }
#nav button { text-align: left; border: 0; border-radius: 8px; padding: 11px 12px; color: #a9c1cb; background: transparent; cursor: pointer; }
#nav button:hover { background: #102f43; color: #fff; }
#nav button.active { background: #123f4d; color: #fff; }
.sidebar-foot { margin-top: auto; padding: 18px 8px 0; border-top: 1px solid #173d4d; }
.text-btn { border: 0; background: transparent; color: #7fbecb; padding: 0; cursor: pointer; }
.main { flex: 1; min-width: 0; padding: 28px 34px; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 18px; }
.topbar h1 { margin: 0; font-size: 26px; }
.muted { color: var(--muted); font-size: 12px; line-height: 1.7; }
.status { padding: 6px 12px; background: #e8f8fa; color: #07869b; border-radius: 20px; font-size: 12px; white-space: nowrap; }
.error { margin-bottom: 16px; padding: 12px 16px; background: #fff0ee; border: 1px solid #f0c9c4; border-radius: 10px; color: var(--danger); white-space: pre-wrap; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: center; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin-bottom: 16px; }
.card h2 { margin: 0 0 6px; font-size: 18px; }
.card h3 { margin: 0 0 6px; font-size: 15px; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 11px 10px; border-bottom: 1px solid #edf2f5; text-align: left; vertical-align: top; }
th { color: #5f7584; font-size: 12px; font-weight: 600; background: #f8fbfc; }
td { font-size: 13px; }
tr:hover td { background: #fbfefe; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 20px; background: #eef8fa; color: #087f94; font-size: 11px; }
.pill.warn { background: #fff4dc; color: #8b6517; }
.pill.ok { background: #e9f8ee; color: #2b7b45; }
.pill.muted { background: #eef2f5; color: #718492; }
.empty { padding: 40px; text-align: center; color: var(--muted); background: #fff; border: 1px dashed var(--line); border-radius: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: #5f7584; margin-bottom: 5px; }
.field input, .field textarea, .field select { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: #f8fbfc; }
.field textarea { min-height: 120px; resize: vertical; }
dialog { border: 0; border-radius: 14px; padding: 0; width: min(560px, 94vw); box-shadow: 0 30px 80px #0005; }
dialog::backdrop { background: #061827aa; }
#dialog-form { padding: 24px; }
#dialog-form h2 { margin: 0 0 6px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
code { background: #f1f6f8; padding: 2px 5px; border-radius: 4px; font-size: 12px; }
pre { background: #0b2438; color: #d6eef2; padding: 14px; border-radius: 10px; overflow: auto; font-size: 12px; }
@media (max-width: 760px) {
  .app-view { display: block; }
  .sidebar { width: 100%; padding: 14px; }
  #nav { flex-direction: row; overflow-x: auto; }
  .sidebar-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
  .main { padding: 18px; }
  .topbar { display: block; }
  .status { display: inline-block; margin-top: 8px; }
}

#admin-login label{display:block;text-align:left;margin:16px 0;font-size:13px}#admin-login input{width:100%;padding:11px;border:1px solid #ccd6e2;border-radius:5px;margin-top:6px}#admin-login button{width:100%}.main{min-width:0}#content-area{overflow:auto}#password-link-result{width:100%;min-height:100px;overflow-wrap:anywhere}#dialog-error{position:sticky;top:0}.login-card h1{font-size:27px}button:focus-visible,a:focus-visible{outline:3px solid #82acf3;outline-offset:3px}

.detail-fields{display:grid;grid-template-columns:100px 1fr;gap:12px}.detail-fields dd{margin:0;overflow-wrap:anywhere}
.mail-summary{display:flex;gap:14px 24px;flex-wrap:wrap;margin-top:12px}.mail-summary strong{font-size:20px;margin-left:5px}.mail-scope p{margin:8px 0}.mail-feedback{white-space:pre-wrap;overflow-wrap:anywhere;color:#21633c}#mail-form{max-width:850px}#mail-form select{max-width:100%}#mail-feedback{overflow-wrap:anywhere}#mail-form .toolbar{margin-top:20px}
.mail-toggle{display:flex;align-items:center;gap:8px;margin:18px 0}.mail-toggle input{width:18px;height:18px}.mail-table{overflow:auto}.mail-table td{overflow-wrap:anywhere;max-width:360px}#mail-form .grid{grid-template-columns:repeat(auto-fit,minmax(min(220px,100%),1fr))}
@media(max-width:760px){#nav{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}#nav button{text-align:center;white-space:nowrap;padding:10px 6px}}
