/* PR Dashboard - styles */
:root {
  --ink: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --soft: #f1f5f9;
  --bg: #f4f7f9;
  --card: #ffffff;
  --blue: #0066cc;
  --blue-dark: #0052a3;
  --green-bg: #dcfce7; --green: #166534;
  --red-bg: #fee2e2;   --red: #991b1b;
  --amber-bg: #ffedd5; --amber: #c2410c;
  --yellow-bg: #fef9c3; --yellow: #854d0e;
  --sky-bg: #dbeafe;   --sky: #1e40af;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
}
[hidden] { display: none !important; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 16px; }
.card { background: var(--card); border-radius: 14px; box-shadow: 0 4px 20px rgba(15, 23, 42, .07); }
.muted { color: var(--muted); }
.loading { text-align: center; color: var(--muted); padding: 80px 0; }
.demo-banner {
  background: #7c2d12; color: #fff; text-align: center; font-size: 13px; font-weight: 600;
  letter-spacing: .04em; padding: 6px 12px;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 9px; padding: 9px 16px; font: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; text-decoration: none; white-space: nowrap; line-height: 1.2;
}
.btn.primary { background: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-dark); }
.btn.view { background: var(--line); color: var(--ink); }
.btn.view:hover { background: #cbd5e1; }
.btn.green { background: #16a34a; color: #fff; }
.btn.ghost { background: rgba(255, 255, 255, .12); color: #e2e8f0; }
.btn.ghost:hover { background: rgba(255, 255, 255, .22); }
.btn.small { padding: 7px 12px; font-size: 13px; }
.btn:focus-visible, input:focus-visible, select:focus-visible, .tab:focus-visible {
  outline: 3px solid #93c5fd; outline-offset: 2px;
}
.btn[disabled] { opacity: .6; cursor: default; }

/* ---------- sign in ---------- */
.signin { max-width: 470px; margin: 56px auto; padding: 34px 30px; text-align: center; }
.signin h1 { margin: 4px 0 6px; font-size: 26px; }
.brand { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--blue); }
.google-area { display: flex; justify-content: center; margin: 22px 0 6px; min-height: 44px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 14px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.stack { text-align: left; margin-top: 18px; }
.stack label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row input, .row select {
  flex: 1 1 220px; min-width: 0; padding: 10px 12px; font: inherit; border: 1px solid #cbd5e1; border-radius: 9px;
  background: #fff; color: var(--ink);
}
.hint { color: var(--muted); font-size: 12.5px; margin: 6px 0 0; }
.msg { margin-top: 18px; padding: 11px 13px; border-radius: 9px; font-size: 14px; text-align: left; }
.msg.ok { background: var(--green-bg); color: var(--green); }
.msg.err { background: #fff5f5; color: #c53030; border-left: 3px solid #c53030; }

/* ---------- dashboard ---------- */
#app { background: var(--card); border-radius: 14px; box-shadow: 0 4px 20px rgba(15, 23, 42, .07); overflow: hidden; }
.topbar {
  background: var(--ink); color: #fff; padding: 16px 22px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
}
.eyebrow { font-size: 11px; letter-spacing: .12em; opacity: .75; }
.who-name { font-size: 20px; font-weight: 700; }
.who-email { font-size: 12.5px; opacity: .7; }
.top-actions { display: flex; gap: 8px; }

.tabs { display: flex; gap: 4px; padding: 10px 16px 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab {
  background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 12px; font: inherit;
  font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap;
}
.tab[aria-selected="true"] { color: var(--blue); border-bottom-color: var(--blue); }
.tab .count {
  display: inline-block; min-width: 22px; padding: 1px 7px; margin-left: 6px; border-radius: 11px;
  background: var(--soft); color: var(--ink); font-size: 12px; text-align: center;
}
.tab .count.hot { background: var(--blue); color: #fff; }

.toolbar { padding: 14px 22px 0; }
.toolbar input {
  width: 100%; max-width: 420px; padding: 9px 12px; font: inherit; font-size: 14px;
  border: 1px solid #cbd5e1; border-radius: 9px;
}
.panel { padding: 6px 22px 22px; }
.stats { display: flex; gap: 12px; flex-wrap: wrap; margin: 12px 0 6px; }
.stat { flex: 1 1 150px; border-radius: 11px; padding: 13px 16px; }
.stat b { display: block; font-size: 28px; line-height: 1.1; }
.stat span { font-size: 11.5px; text-transform: uppercase; font-weight: 700; letter-spacing: .04em; }
.s-yellow { background: var(--yellow-bg); color: var(--yellow); }
.s-green { background: var(--green-bg); color: var(--green); }
.s-red { background: var(--red-bg); color: var(--red); }
.s-amber { background: var(--amber-bg); color: var(--amber); }
.s-sky { background: var(--sky-bg); color: var(--sky); }
.chips { margin: 8px 0 2px; }
.chip { display: inline-block; background: var(--soft); border-radius: 14px; padding: 4px 12px; margin: 0 6px 6px 0; font-size: 13px; }

h2.sec { font-size: 17px; margin: 22px 0 10px; padding-left: 10px; border-left: 4px solid var(--ink); }
.empty { color: var(--green); padding: 8px 0 4px; }
.none-found { color: var(--muted); padding: 8px 0 4px; font-style: italic; }

table.list { width: 100%; border-collapse: collapse; }
table.list th {
  background: #f8fafc; text-align: left; padding: 10px; border-bottom: 2px solid var(--line);
  color: #475569; font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em;
}
table.list td { padding: 10px; border-bottom: 1px solid var(--soft); vertical-align: top; }
table.list td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.list tr.late td:first-child { box-shadow: inset 4px 0 0 #f59e0b; }
table.list tr.very-late td:first-child { box-shadow: inset 4px 0 0 #dc2626; }
.sub { color: var(--muted); font-size: 12.5px; }
.prno { font-weight: 700; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.p-green { background: var(--green-bg); color: var(--green); }
.p-red { background: var(--red-bg); color: var(--red); }
.p-yellow { background: var(--yellow-bg); color: var(--yellow); }
.p-amber { background: var(--amber-bg); color: var(--amber); }
.p-grey { background: var(--soft); color: #475569; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.wait-late { color: #b45309; font-weight: 600; }
.wait-very-late { color: #b91c1c; font-weight: 700; }

.foot {
  display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 12px 22px 16px; border-top: 1px solid var(--soft); color: var(--muted); font-size: 12.5px;
}
.admin-status.bad { color: #b91c1c; font-weight: 600; }

/* ---------- phones: each row becomes a card ---------- */
@media (max-width: 760px) {
  .wrap { padding: 0; }
  #app { border-radius: 0; }
  .signin { margin: 24px 16px; padding: 26px 20px; }
  .topbar, .toolbar, .panel, .foot { padding-left: 16px; padding-right: 16px; }
  table.list, table.list tbody, table.list tr, table.list td { display: block; width: 100%; }
  table.list thead { display: none; }
  table.list tr { border: 1px solid var(--line); border-radius: 11px; margin: 0 0 12px; padding: 6px 4px; }
  table.list td { border: 0; padding: 6px 10px; }
  table.list td.num { text-align: left; }
  table.list td[data-label]::before {
    content: attr(data-label); display: block; font-size: 11px; font-weight: 700; color: var(--muted);
    text-transform: uppercase; letter-spacing: .03em;
  }
  table.list tr.late, table.list tr.very-late { border-left-width: 4px; }
  table.list tr.late { border-left-color: #f59e0b; }
  table.list tr.very-late { border-left-color: #dc2626; }
  table.list tr.late td:first-child, table.list tr.very-late td:first-child { box-shadow: none; }
  .stat b { font-size: 24px; }
}
