.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login form { width: 100%; max-width: 400px; padding: 32px; text-align: center; }
.login form .logo { width: 90px; margin-bottom: 8px; }
.login form h1 { font-size: 32px; }
.login form label { text-align: left; }
.btn.google { width: 100%; margin-top: 6px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 18px 0; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }

#shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.side { background: #fff; border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 20px; position: sticky; top: 0; height: 100vh; }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.side .brand img { width: 40px; height: 40px; object-fit: contain; }
.side .brand b { display: block; font-family: var(--serif); font-size: 18px; letter-spacing: 2px; text-transform: uppercase; line-height: 1; }
.side .brand span { font-family: var(--serif); font-style: italic; color: var(--gold); }
.side nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.side nav a { padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--ink); font-weight: 500; }
.side nav a.on { background: var(--gold-l); color: var(--gold-d); font-weight: 600; }
.side .me { display: flex; align-items: center; justify-content: space-between; font-size: 14px; padding: 0 8px; }
@media (max-width: 820px) {
  #shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; align-items: center; padding: 10px 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side .brand div { display: none; }
  .side nav { flex-direction: row; }
  .side .me span { display: none; }
}

main#view { padding: 28px clamp(16px, 3vw, 40px); max-width: 1200px; width: 100%; min-width: 0; }
.ph { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.ph h1 { font-size: 36px; line-height: 1.1; }
.crumb { font-size: 14px; margin-bottom: 4px; }
.crumb a { text-decoration: none; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stat { padding: 16px 18px; }
.stat b { display: block; font-family: var(--serif); font-size: 34px; line-height: 1; margin-bottom: 4px; }
.stat span { color: var(--muted); font-size: 13px; }
.stat.hot b { color: var(--amber); }
@media (max-width: 820px) { .stats { grid-template-columns: 1fr 1fr; } }

.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filters input, .filters select { min-height: 42px; width: auto; flex: 1 1 160px; font-size: 14px; padding: 8px 12px; }
.filters input[type=search] { flex: 3 1 240px; }

.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:hover td { background: #fdfbf8; }
.tbl .name { font-weight: 600; }
.tbl .sub { color: var(--muted); font-size: 12.5px; }
.tblwrap { overflow-x: auto; }
.empty { padding: 50px 20px; text-align: center; color: var(--muted); }
@media (max-width: 700px) { .tbl .hide-sm { display: none; } }

.detail { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
@media (max-width: 1000px) { .detail { grid-template-columns: 1fr; } }
.panel { padding: 20px 22px; margin-bottom: 18px; }
.panel h2 { font-size: 22px; margin-bottom: 12px; }
.panel h3 { font-family: var(--sans); font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 18px 0 8px; }
.alerts { background: var(--red-l); border: 1px solid #f0c4bd; border-radius: 12px; padding: 14px 18px; margin-bottom: 18px; }
.alerts b { color: var(--red); }
.alerts ul { margin: 6px 0 0; padding-left: 20px; }
.kv { display: grid; grid-template-columns: minmax(150px, 40%) 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.kv dd.yes { color: var(--gold-d); font-weight: 600; }
.kv dd.flag { color: var(--red); font-weight: 600; }
.sigimg { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.sigimg img { max-width: 100%; height: 90px; display: block; margin: auto; }
.actions { display: flex; flex-direction: column; gap: 8px; }
.actions .btn { width: 100%; }
.history { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.history li { padding: 6px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 8px; }
.linkbox { display: flex; gap: 8px; margin: 10px 0; }
.linkbox input { font-size: 13px; min-height: 42px; }
.note { font-size: 13px; background: var(--gold-l); border-radius: 8px; padding: 8px 12px; }
.email-err { color: var(--red); font-size: 13px; overflow-wrap: anywhere; }

dialog { border: 0; padding: 26px; width: min(520px, calc(100% - 32px)); }
dialog::backdrop { background: rgba(45,42,38,.35); backdrop-filter: blur(2px); }
dialog h2 { font-size: 28px; margin-bottom: 6px; }
.client-results { max-height: 200px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; margin-top: -8px; margin-bottom: 16px; }
.client-results button { display: block; width: 100%; text-align: left; padding: 10px 14px; background: #fff; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.client-results button:hover { background: var(--gold-l); }
.picked { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-radius: 10px; background: var(--gold-l); margin-bottom: 16px; }
.row-btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; margin-top: 8px; }
