:root {
  --bg: #0c0a08;
  --panel: #16120e;
  --line: rgba(214, 176, 106, 0.28);
  --gold: #f0d59a;
  --gold-deep: #c49645;
  --text: #f6efe2;
  --muted: #a89880;
  --danger: #e7b2a0;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Hiragino Sans GB", "Helvetica Neue", sans-serif;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(224, 180, 90, 0.18), transparent 42%),
    var(--bg);
}
.login-card {
  width: min(420px, calc(100% - 32px));
  padding: 36px 32px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(22, 18, 14, 0.94);
}
.brand { margin: 0; letter-spacing: 0.28em; color: var(--gold); font-size: 13px; }
.login-card h1 { margin: 10px 0 8px; font-size: 32px; }
.sub, .muted, header p { color: var(--muted); }
label { display: block; margin: 18px 0 8px; color: var(--gold); font-size: 13px; }
input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #0e0c0a;
  outline: none;
}
textarea { min-height: 80px; resize: vertical; }
button {
  border: 0;
  border-radius: 999px;
  padding: 11px 18px;
  background: linear-gradient(180deg, #fff1c9, #e0b45a);
  color: #1a1208;
  font-weight: 700;
}
.login-card button { width: 100%; margin-top: 18px; }
.ghost {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--line);
}
.error { min-height: 22px; color: var(--danger); }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; }

.shell { min-height: 100vh; display: flex; }
aside {
  width: 232px;
  flex-shrink: 0;
  padding: 22px 16px;
  border-right: 1px solid var(--line);
  background: #100d0a;
  display: flex;
  flex-direction: column;
}
.side-brand { padding: 6px 10px 18px; }
.side-brand strong { display: block; color: var(--gold); letter-spacing: 0.18em; }
.side-brand span { color: var(--muted); font-size: 13px; }
nav { display: flex; flex-direction: column; gap: 6px; }
nav button {
  text-align: left;
  background: transparent;
  color: var(--text);
  border-radius: 12px;
  font-weight: 500;
}
nav button.active { background: rgba(224, 180, 90, 0.16); color: var(--gold); }
#logout { margin-top: auto; }
main { flex: 1; padding: 28px; min-width: 0; }
header { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
header h2 { margin: 0 0 6px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.card, .panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}
.card { padding: 18px; cursor: pointer; }
.card b { display: block; margin-top: 8px; font-size: 28px; color: var(--gold); }
.panel { padding: 18px; margin-top: 8px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 10px; border-bottom: 1px solid rgba(214, 176, 106, 0.14); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-weight: 500; font-size: 13px; }
.actions { display: flex; gap: 8px; justify-content: flex-end; }
.actions button, .status { padding: 6px 10px; border-radius: 999px; }
.status { background: #0e0c0a; }
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--gold);
  font-size: 12px;
}
.off { color: var(--muted); }
.plus { color: var(--gold); }
.minus { color: #ddd4c6; }
.empty { padding: 28px 8px; color: var(--muted); }
.lookup { margin: 4px 0 14px; }
.lookup input {
  font-size: 28px;
  letter-spacing: 0.16em;
  padding: 18px 20px;
  border-radius: 16px;
}
.found { margin: 0 0 4px; color: var(--gold); }
.hit {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 10px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}
.who { font-size: 20px; font-weight: 700; }
.phone-lg { margin: 6px 0; font-size: 28px; letter-spacing: 0.04em; }
.tail { color: var(--gold); }
.mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.dialog {
  width: min(520px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 22px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #16120e;
}
.dialog h3 { margin-top: 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
@media (max-width: 800px) {
  .shell { display: block; }
  aside { width: auto; }
  nav { flex-direction: row; flex-wrap: wrap; }
  #logout { margin-top: 12px; }
  .grid { grid-template-columns: 1fr; }
  .hit { display: block; }
  .hit .actions { margin-top: 12px; }
  .lookup input, .phone-lg { font-size: 22px; }
}
