/* Login + dashboard (reuses the tokens of app.css) */
:root { --navy: #0e2740; --ink: #1a2836; --muted: #5d6c7b; --line: #dde4ec; --bg: #f3f5f8; --teal: #0b7a9e; --teal-d: #08607c; --teal-bg: #e6f3f8;
  --pass: #137a47; --pass-bg: #e3f4ea; --fail: #c0362b; --fail-bg: #fdebe9; --warn: #9a5b00; --warn-bg: #fff3dc;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; color: var(--ink); }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); font-size: 15px; line-height: 1.45; min-height: 100vh; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid rgba(11,122,158,.45); outline-offset: 2px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent; background: var(--teal); color: #fff; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--teal-d); } .btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.secondary { background: #fff; color: var(--navy); border-color: #c3cdd8; } .btn.secondary:hover { background: #eef2f6; }
.btn.danger { background: var(--fail); } .btn.sm { min-height: 36px; padding: 0 12px; font-size: 13.5px; }
.btn.quiet { background: none; color: var(--teal-d); padding: 0 10px; } .btn.quiet:hover { background: var(--teal-bg); }
.btn.quiet.red { color: var(--fail); } .btn.quiet.red:hover { background: var(--fail-bg); }
.input { width: 100%; min-height: 46px; padding: 9px 12px; border: 1px solid #c3cdd8; border-radius: 10px; background: #fff; }
.input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(11,122,158,.18); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; } .field label { font-size: 13px; font-weight: 600; color: #34465a; }
.err { background: var(--fail-bg); color: #8a2218; border-radius: 9px; padding: 10px 12px; font-size: 14px; margin-bottom: 14px; }
.chip { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: #eceff3; color: #4a5865; white-space: nowrap; }
.chip.pass { background: var(--pass-bg); color: var(--pass); } .chip.fail { background: var(--fail-bg); color: var(--fail); } .chip.warn { background: var(--warn-bg); color: var(--warn); } .chip.info { background: var(--teal-bg); color: var(--teal-d); }

/* dashboard extras */
.sigs { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin-top: 7px; }
td.site small.ser { font-variant-numeric: tabular-nums; } .left { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; max-width: 170px; }
.resend { padding: 0 4px; min-height: 28px; margin-top: 2px; }
dialog form .db .field label { font-size: 13px; }
/* search + date filters */
.searchbox { position: relative; flex: 0 1 430px; min-width: 240px; }
.searchbox svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.searchbox .input { padding-left: 38px; max-width: none; }
.datebar { align-items: center; border-bottom: 1px solid var(--line); background: #fafbfc; gap: 8px 10px; }
.datebar .tools, .tools.datebar { padding-top: 10px; padding-bottom: 10px; }
.dlab { font-size: 13px; font-weight: 600; color: #34465a; }
.dinp { max-width: 160px !important; min-height: 38px; padding: 4px 10px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-left: 4px; }
.chipbtn { border: 1px solid #c3cdd8; background: #fff; border-radius: 99px; padding: 6px 12px; font-size: 13px; cursor: pointer; color: var(--navy); min-height: 34px; }
.chipbtn:hover { background: #eef2f6; } .chipbtn[aria-pressed="true"] { background: var(--teal); color: #fff; border-color: var(--teal); }
.count { margin-left: auto; font-size: 13px; color: var(--muted); }
td.dt b { display: block; color: var(--navy); white-space: nowrap; }
/* ---- login ---- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(160deg, #0e2740 0%, #16344f 55%, #0b7a9e 140%); }
.login-card { width: min(100%, 420px); background: #fff; border-radius: 16px; padding: 32px 30px 26px; box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.login-brand strong { font-size: 22px; color: var(--navy); display: block; line-height: 1.1; } .login-brand span { font-size: 13px; color: var(--muted); }
.login-card h1 { font-size: 18px; margin: 0 0 4px; color: var(--navy); } .login-card p.lede { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.login-card .btn { width: 100%; min-height: 48px; margin-top: 6px; }
.foot-note { text-align: center; color: #a9bdd0; font-size: 12.5px; margin-top: 18px; }

/* ---- dashboard ---- */
.top { position: sticky; top: 0; z-index: 10; background: var(--navy); color: #fff; height: 58px; display: flex; align-items: center; gap: 12px; padding: 0 20px; }
.top .brand { display: flex; align-items: center; gap: 10px; } .top .brand strong { font-size: 17px; } .top .brand small { display: block; color: #a9bdd0; font-size: 12px; line-height: 1.1; }
.top .sp { flex: 1; } .who { text-align: right; line-height: 1.15; font-size: 13.5px; } .who small { color: #a9bdd0; display: block; font-size: 12px; }
.top .btn.secondary { background: rgba(255,255,255,.1); color: #fff; border-color: transparent; min-height: 38px; } .top .btn.secondary:hover { background: rgba(255,255,255,.2); }
main { max-width: 1120px; margin: 0 auto; padding: 26px 20px 60px; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.head h1 { margin: 0; font-size: 26px; color: var(--navy); } .head p { margin: 4px 0 0; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; box-shadow: 0 1px 2px rgba(14,39,64,.06); }
.stat b { display: block; font-size: 28px; line-height: 1.1; color: var(--navy); font-variant-numeric: tabular-nums; } .stat span { font-size: 13px; color: var(--muted); }
.stat.pass b { color: var(--pass); } .stat.fail b { color: var(--fail); } .stat.warn b { color: var(--warn); }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 1px 2px rgba(14,39,64,.06); overflow: hidden; margin-bottom: 20px; }
.tools { display: flex; gap: 10px; padding: 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tools .input { max-width: 340px; } .tools select.input { max-width: 190px; }
.tbl-scroll { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; min-width: 760px; }
table.list th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 14px; background: #f8fafc; border-bottom: 1px solid var(--line); }
table.list td { padding: 12px 14px; border-bottom: 1px solid #eef2f6; vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; } table.list tbody tr:hover { background: #fafcfd; }
td.site b { display: block; color: var(--navy); } td.site small { color: var(--muted); }
.meter { width: 120px; } .meter .bar { height: 7px; background: #eaeff4; border-radius: 99px; overflow: hidden; } .meter .bar span { display: block; height: 100%; background: var(--teal); }
.meter small { color: var(--muted); font-size: 12px; }
td.act { text-align: right; white-space: nowrap; }
.empty { text-align: center; padding: 46px 20px; color: var(--muted); } .empty b { display: block; font-size: 17px; color: var(--navy); margin-bottom: 6px; }
.panel h2 { margin: 0; font-size: 16px; padding: 14px; border-bottom: 1px solid var(--line); color: var(--navy); }
.users { padding: 14px; } .urow { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid #eef2f6; flex-wrap: wrap; } .urow:last-child { border-bottom: 0; } .urow .nm { flex: 1; min-width: 160px; } .urow small { color: var(--muted); display: block; }
.uform { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 10px; padding: 14px; background: #f8fafc; border-top: 1px solid var(--line); align-items: end; }
.uform .field { margin: 0; }
dialog { border: 0; border-radius: 14px; padding: 0; width: min(92vw, 440px); box-shadow: 0 20px 60px rgba(0,0,0,.35); } dialog::backdrop { background: rgba(14,39,64,.5); }
dialog .dh { padding: 18px 22px 4px; font-size: 18px; font-weight: 700; color: var(--navy); } dialog .db { padding: 6px 22px 14px; color: #3b4d60; } dialog .df { padding: 12px 22px 18px; display: flex; justify-content: flex-end; gap: 10px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 10px; opacity: 0; pointer-events: none; transition: .2s; z-index: 80; } .toast.show { opacity: 1; transform: translate(-50%, 0); } .toast.err { background: var(--fail); }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .uform { grid-template-columns: 1fr 1fr; } .who { display: none; } .head h1 { font-size: 22px; } }

.login-wrap > div { width: min(100%, 420px); }
a.btn { text-decoration: none; }

.to { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* roomier dashboard table */
main { max-width: 1300px; }
table.list { min-width: 1020px; } table.list th { white-space: nowrap; padding: 10px 12px; } table.list td { padding: 12px; }
td.site { min-width: 230px; max-width: 300px; } td.site small { display: block; margin-top: 2px; }
td.act { min-width: 320px; } .act .btn.sm { padding: 0 11px; } td:nth-last-child(2) { white-space: nowrap; }
.meter { width: 130px; } .left { max-width: 150px; }

/* full recipient list */
.sentto { margin-top: 6px; font-size: 12.5px; line-height: 1.35; }
.sentto small { display: block; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 1px; }
.sentto span { display: block; color: var(--ink); word-break: break-all; }
td.email-col, table.list td:nth-child(4) { min-width: 210px; }
