/* Protect PNW Security sales tracker. Company colors: black, gold and white. */
:root {
  --navy: #141414;      /* black: header, headings, table heads */
  --gold: #C9A227;      /* gold fills (buttons, active tab) with black text */
  --gold-bright: #E7C55A; /* gold text on black */
  --teal: #8A6A0F;      /* dark gold: links and accents on white (readable contrast) */
  --teal-soft: #FBF5E3; /* pale gold tint */
  --ink: #1E1E1E;
  --muted: #5E5A50;
  --line: #E4DED0;
  --bg: #F7F6F2;
  --card: #FFFFFF;
  --bad: #B02A37;
  --bad-soft: #F8D7DA;
  --warn: #8A5A00;
  --warn-soft: #FFF3CD;
  --good: #0F5132;
  --good-soft: #D1E7DD;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); line-height: 1.45; }
a { color: var(--teal); }
h1 { font-size: 1.5rem; margin: 0 0 .75rem; color: var(--navy); display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
h2 { font-size: 1.05rem; margin: 1.1rem 0 .6rem; color: var(--teal); }
h2:first-child, .card > h2:first-child, .form > h2:first-of-type { margin-top: 0; }
h3 { font-size: .95rem; color: var(--navy); }
code { background: var(--teal-soft); padding: .1rem .35rem; border-radius: 4px; }
code.pw { font-size: 1.1rem; letter-spacing: .05em; }

/* Header */
.topbar { background: var(--navy); border-bottom: 3px solid var(--gold); color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 1.25rem; flex-wrap: wrap; }
.brand { color: #fff; text-decoration: none; display: flex; align-items: center; }
.brand img { max-height: 48px; max-width: 220px; }
.brand .wordmark { color: var(--gold-bright); margin-left: .6rem; font-size: 1.02rem; }
.wordmark { font-weight: 700; letter-spacing: .02em; }
.topbar nav { display: flex; gap: .25rem; flex-wrap: wrap; }
.topbar nav a { color: #E9E2CC; text-decoration: none; padding: .4rem .7rem; border-radius: 6px; font-size: .92rem; }
.topbar nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.topbar nav a.on { background: var(--gold); color: #111; font-weight: 600; }
.topbar nav a.signout { opacity: .8; }
.strip { background: #EDE8DA; color: var(--muted); font-size: .8rem; padding: .3rem 1.25rem; }
main { max-width: 1280px; margin: 0 auto; padding: 1.25rem; }
main.narrow, .narrow { max-width: 620px; margin: 0 auto; }
.foot { text-align: center; color: var(--muted); font-size: .75rem; padding: 2rem 0 1.5rem; }

/* Cards & forms */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 1.1rem 1.25rem; margin-bottom: 1rem; }
.form label { display: block; font-size: .82rem; font-weight: 600; color: var(--navy); margin-bottom: .7rem; }
.form input:not([type=checkbox]), .form select, .form textarea, .filters input:not([type=checkbox]), .filters select {
  display: block; width: 100%; margin-top: .25rem; padding: .5rem .6rem; font: inherit; font-size: .92rem; font-weight: 400;
  border: 1px solid #CFC7B3; border-radius: 6px; background: #fff; color: var(--ink);
}
.form textarea { resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus, .filters input:focus, .filters select:focus { outline: 2px solid var(--teal); outline-offset: 0; border-color: var(--teal); }
label.check { display: flex; align-items: center; gap: .45rem; font-weight: 600; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .9rem; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 .9rem; }
.dncbox { margin-top: 1.6rem; color: var(--bad) !important; }
.formfoot { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: .5rem; }
.narrowform { max-width: 720px; }
.btn { display: inline-block; background: var(--gold); color: #111; border: 0; border-radius: 6px; padding: .55rem 1rem; font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer; text-decoration: none; }
.btn:hover { background: #B38E1C; }
.btn.dark { background: var(--navy); color: var(--gold-bright); }
.btn.dark:hover { background: #2a2a2a; }
.btn.ghost { background: #fff; color: var(--teal); border: 1px solid var(--teal); }
.btn.small { padding: .4rem .75rem; font-size: .85rem; }
.linkbtn { background: none; border: 0; color: var(--teal); cursor: pointer; font: inherit; font-size: .82rem; padding: 0; text-decoration: underline; }
.linkbtn.bad { color: var(--bad); }
form.inline { display: inline; }
.muted { color: var(--muted); font-weight: 400; }
.small { font-size: .82rem; }
.sub { color: var(--muted); font-size: .78rem; font-weight: 400; }
.crumb { margin: 0 0 .5rem; font-size: .85rem; }

.flash { padding: .65rem .9rem; border-radius: 8px; margin-bottom: 1rem; font-size: .9rem; }
.flash.success { background: var(--good-soft); color: var(--good); }
.flash.error { background: var(--bad-soft); color: var(--bad); }
.flash.info { background: var(--teal-soft); color: var(--navy); }

/* Login */
.login { max-width: 420px; margin: 3rem auto; }
.login h1 { margin-bottom: .1rem; }

/* Tracker page */
.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .5rem; }
.pagehead h1 { margin: 0; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.chips { display: flex; gap: .5rem; flex-wrap: wrap; margin: .75rem 0; }
.chip { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: .3rem .8rem; font-size: .85rem; text-decoration: none; color: var(--navy); }
.chip b { margin-left: .25rem; }
.chip.bad b { color: var(--bad); }
.chip.warn b { color: var(--warn); }
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .6rem .9rem; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .75rem .9rem; margin-bottom: 1rem; }
.filters label { font-size: .78rem; font-weight: 600; color: var(--navy); min-width: 150px; }
.filters label.check { min-width: 0; margin-bottom: .55rem; font-size: .85rem; white-space: nowrap; }
.filters.tight { background: none; border: 0; padding: 0; margin: 0; }
.filters.tight select { width: auto; }

.tablewrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; background: #fff; font-size: .88rem; }
table.grid th { text-align: left; background: var(--navy); color: var(--gold-bright); font-weight: 600; padding: .55rem .6rem; white-space: nowrap; font-size: .8rem; }
table.grid th a { color: var(--gold-bright); text-decoration: none; }
table.grid th a.on { text-decoration: underline; }
table.grid td { padding: .5rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.grid tbody tr:hover { background: #FCF9EF; }
table.grid tr.closed td, table.grid tr.zero td { color: #8C99A3; }
table.grid tr.dnc td { background: #FBF3F4; }
table.grid.compact td { padding: .35rem .5rem; }
.card > .tablewrap, .card > table.grid { margin: 0; }
.num { text-align: right; white-space: nowrap; }
.badtxt { color: var(--bad); font-weight: 700; }
.empty { text-align: center; padding: 2rem; }

.stage { display: inline-block; font-size: .75rem; font-weight: 600; padding: .15rem .5rem; border-radius: 999px; background: var(--teal-soft); color: var(--navy); white-space: nowrap; }
.stage.s-research { background: #EEF1F4; color: var(--muted); }
.stage.s-won, .stage.s-partner { background: var(--good-soft); color: var(--good); }
.stage.s-closed { background: #EEF1F4; color: #8C99A3; }
.stage.s-nurture { background: #F1ECF7; color: #5B3F86; }
.flag { display: inline-block; font-size: .72rem; font-weight: 700; padding: .1rem .45rem; border-radius: 4px; margin-left: .25rem; white-space: nowrap; }
.flag.bad { background: var(--bad-soft); color: var(--bad); }
.flag.warn { background: var(--warn-soft); color: var(--warn); }
.tag { display: inline-block; font-size: .68rem; font-weight: 700; padding: .05rem .4rem; border-radius: 4px; background: #EDE8DA; color: var(--navy); margin-left: .3rem; vertical-align: middle; }
.tag.bad { background: var(--bad-soft); color: var(--bad); }

/* Contact page */
.split { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { border-left: 3px solid var(--teal-soft); padding: .1rem 0 .7rem .8rem; position: relative; }
.timeline li .note { font-size: .88rem; margin-top: .2rem; white-space: normal; }
.timeline li form { margin-top: .15rem; }
.timeline.compact li { padding-bottom: .45rem; font-size: .88rem; }
.danger { text-align: right; }

/* Dashboard */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .75rem; margin: 1rem 0; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .8rem 1rem; }
.tile span { display: block; font-size: .78rem; color: var(--muted); font-weight: 600; }
.tile b { display: block; font-size: 1.5rem; color: var(--navy); margin-top: .2rem; }
.tile.bad b { color: var(--bad); }
.cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
td.acts { white-space: normal; }
td.acts form { margin-right: .6rem; }
form.move select { width: auto; display: inline-block; font-size: .8rem; padding: .15rem .3rem; }

@media (max-width: 900px) {
  .split, .cols { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  main { padding: .9rem; }
  .row2, .row3 { grid-template-columns: 1fr; }
  .dncbox { margin-top: 0; }
  .filters label { min-width: 100%; }
  .filters label.check { min-width: 0; }
  .hide-sm { display: none; }
}

/* Brand touches */
.login .card { border-top: 4px solid var(--gold); text-align: left; }
.login .crest { display: block; margin: 0 auto .8rem; height: 120px; }
.card.accent { border-left: 4px solid var(--gold); }

/* Today */
.todaygrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.todaygrid .card h2 { display: flex; justify-content: space-between; align-items: center; }
.count { background: var(--navy); color: var(--gold-bright); border-radius: 999px; font-size: .75rem; padding: .1rem .55rem; }
.item { border-bottom: 1px solid var(--line); padding: .55rem 0; }
.item:last-child { border-bottom: 0; }
.item .top { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.item .preview { font-size: .86rem; color: var(--muted); margin-top: .2rem; white-space: pre-line; max-height: 5.6em; overflow: hidden; }
.item form { display: inline; }

/* Pipeline board */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: .75rem; overflow-x: auto; padding-bottom: .5rem; }
.col { background: #EFEBE0; border-radius: 10px; padding: .6rem; min-height: 120px; }
.col h3 { margin: 0 0 .5rem; display: flex; justify-content: space-between; font-size: .85rem; }
.col h3 .sum { color: var(--muted); font-weight: 400; }
.deal { background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: 8px; padding: .55rem .6rem; margin-bottom: .5rem; font-size: .85rem; }
.deal a.name { font-weight: 700; color: var(--navy); text-decoration: none; }
.deal .meta { color: var(--muted); font-size: .78rem; margin: .15rem 0 .35rem; }

/* Email */
.msg { border: 1px solid var(--line); border-radius: 8px; padding: .55rem .7rem; margin-bottom: .5rem; font-size: .86rem; }
.msg.in { border-left: 3px solid var(--gold); background: #FFFDF6; }
.msg .body { white-space: pre-line; margin-top: .35rem; color: #333; max-height: 9em; overflow: auto; }
.pill { display: inline-block; font-size: .7rem; font-weight: 700; padding: .05rem .45rem; border-radius: 999px; background: #EDE8DA; color: var(--navy); }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
pre.copy { white-space: pre-wrap; background: #FBFAF6; border: 1px solid var(--line); border-radius: 6px; padding: .6rem; font: inherit; font-size: .86rem; max-height: 22em; overflow: auto; }
.statusgrid { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; font-size: .88rem; }
.secret { font-family: monospace; }
details.box { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .7rem 1rem; margin-bottom: 1rem; }
details.box summary { cursor: pointer; font-weight: 600; color: var(--navy); }

@media (max-width: 900px) { .todaygrid { grid-template-columns: 1fr; } }
