/* Event Badger Customer Portal — shared styles */
:root {
  --navy: #283279;
  --navy-700: #1f286a;
  --navy-100: #e8eaf6;
  --navy-50: #f3f4fb;
  --ink: #1b1d2a;
  --ink-2: #4a4e63;
  --ink-3: #7b8095;
  --line: #e3e5ee;
  --bg: #f6f7fb;
  --card: #ffffff;
  --ok: #1f8a4c;
  --ok-bg: #e6f5ec;
  --warn: #b7791f;
  --warn-bg: #fdf3df;
  --bad: #c0392b;
  --bad-bg: #fbe9e7;
  --info: #2b7bb9;
  --info-bg: #e6f1fa;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 24, 60, .06), 0 4px 16px rgba(20, 24, 60, .06);
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--navy); }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.25; font-weight: 600; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }
p { margin: 0 0 .8em; }
small, .muted { color: var(--ink-3); }
.hidden { display: none !important; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; }
.stack > * + * { margin-top: 12px; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }

/* Layout */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
}
.topbar-inner {
  max-width: 1120px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 14px;
}
.topbar img.logo { height: 30px; }
.topbar .spacer { flex: 1; }
.topbar .who { font-size: .85rem; color: var(--ink-2); max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .btn { flex: none; }
@media (max-width: 600px) { .topbar .tag { display: none; } .topbar img.logo { height: 24px; } .topbar-inner { gap: 8px; } }
.topbar .tag {
  font-size: .7rem; letter-spacing: .06em; text-transform: uppercase;
  background: var(--navy-100); color: var(--navy); padding: 3px 8px; border-radius: 999px; font-weight: 600;
}
.wrap { max-width: 1120px; margin: 0 auto; padding: 20px 16px 60px; }
.wrap.narrow { max-width: 760px; }
.grid { display: grid; gap: 16px; }
.grid > *, .form-grid > *, .items-editor .row > *, .card { min-width: 0; }
.grid.two { grid-template-columns: 1fr 1fr; }
.grid.side { grid-template-columns: 2fr 1fr; }
@media (max-width: 800px) { .grid.two, .grid.side { grid-template-columns: 1fr; } }

.nav { display: flex; gap: 4px; flex-wrap: wrap; margin: 6px 0 18px; }
.nav a, .nav button {
  border: 1px solid transparent; background: transparent; padding: 7px 12px; border-radius: 8px;
  font: inherit; font-size: .9rem; color: var(--ink-2); cursor: pointer; text-decoration: none;
}
.nav a.active, .nav button.active { background: var(--navy); color: #fff; }
.nav a:hover:not(.active), .nav button:hover:not(.active) { background: var(--navy-100); color: var(--navy); }

/* Cards */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px;
}
.card.tight { padding: 12px 14px; }
.card h2, .card h3 { display: flex; align-items: center; gap: 8px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.section-note { font-size: .88rem; color: var(--ink-2); margin-bottom: 10px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: 9px; border: 1px solid var(--navy);
  background: var(--navy); color: #fff; font: inherit; font-size: .92rem; font-weight: 500;
  cursor: pointer; text-decoration: none; transition: background .15s, transform .05s;
}
.btn:hover { background: var(--navy-700); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.secondary { background: #fff; color: var(--navy); border-color: var(--navy); }
.btn.secondary:hover { background: var(--navy-50); }
.btn.ghost { background: transparent; color: var(--ink-2); border-color: var(--line); }
.btn.ghost:hover { background: var(--navy-50); color: var(--navy); }
.btn.ok { background: var(--ok); border-color: var(--ok); }
.btn.ok:hover { background: #187140; }
.btn.danger { background: #fff; color: var(--bad); border-color: var(--bad); }
.btn.danger:hover { background: var(--bad-bg); }
.btn.sm { padding: 6px 11px; font-size: .82rem; border-radius: 7px; }
.btn.block { width: 100%; }
.btn.google { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.google:hover { background: var(--bg); }
.btn.google img { width: 18px; height: 18px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* Forms — one look for every control: 40px tall, same border/radius/padding, whether or not the input has a type attribute */
.field { display: block; font-size: .82rem; font-weight: 500; color: var(--ink-2); margin-bottom: 14px; }
.field > span { display: block; margin-bottom: 5px; }
.field > span .opt { font-weight: 400; color: var(--ink-3); }
input:not([type]), input[type=text], input[type=email], input[type=tel], input[type=date], input[type=number], input[type=url],
input[type=password], input[type=search], input[type=time],
select, textarea {
  display: block; width: 100%; min-height: 40px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px;
  font: inherit; font-size: .95rem; line-height: 1.35; background: #fff; color: var(--ink); margin: 0;
  -webkit-appearance: none; appearance: none;
}
select {
  padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%234a4e63' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
select[multiple] { background-image: none; padding-right: 11px; min-height: 90px; }
input[type=date] { min-width: 0; }
input::placeholder, textarea::placeholder { color: #a5a9bd; opacity: 1; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(40, 50, 121, .25); outline-offset: 0; border-color: var(--navy); }
input:disabled, select:disabled, textarea:disabled { background: var(--bg); color: var(--ink-3); cursor: not-allowed; }
input[type=number] { -moz-appearance: textfield; }
input[type=number]::-webkit-outer-spin-button, input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
textarea { min-height: 96px; resize: vertical; }
textarea.short { min-height: 64px; }
textarea.tall { min-height: 150px; }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; margin: 0; accent-color: var(--navy); flex: none; }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 16px; }
.form-grid .span2 { grid-column: 1 / -1; }
.form-grid .sub { grid-column: 1 / -1; margin: 4px 0 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: .92rem; font-weight: 600; color: var(--ink); }
.form-grid .sub:first-child { border-top: 0; padding-top: 0; }
.form-grid .sub small { display: block; font-weight: 400; color: var(--ink-3); font-size: .8rem; margin-top: 2px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }
.field .pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 8px; }
@media (max-width: 480px) { .field .pair { grid-template-columns: minmax(0, 1fr); } }
.check { display: flex; align-items: flex-start; gap: 9px; font-size: .9rem; font-weight: 400; color: var(--ink); margin-bottom: 14px; line-height: 1.35; cursor: pointer; }
.check input { margin-top: 2px; }
.help { font-size: .8rem; font-weight: 400; color: var(--ink-3); margin-top: -8px; margin-bottom: 14px; line-height: 1.4; }
.field .help { margin: 5px 0 0; }
.card-head select, .card-head input { width: auto; display: inline-block; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 4px; }

/* Status chips */
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: .78rem; font-weight: 600; letter-spacing: .01em; white-space: nowrap;
  background: var(--navy-100); color: var(--navy);
}
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.info { background: var(--info-bg); color: var(--info); }
.chip.grey { background: #eef0f5; color: var(--ink-2); }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* Progress timeline */
.timeline { display: flex; gap: 0; margin: 8px 0 4px; overflow-x: auto; padding-bottom: 6px; }
.step { flex: 1; min-width: 92px; position: relative; text-align: center; font-size: .74rem; color: var(--ink-3); }
.step .bubble {
  width: 26px; height: 26px; border-radius: 50%; margin: 0 auto 6px; display: grid; place-items: center;
  background: #fff; border: 2px solid var(--line); color: var(--ink-3); font-size: .72rem; font-weight: 700; position: relative; z-index: 1;
}
.step::before {
  content: ""; position: absolute; top: 12px; left: -50%; width: 100%; height: 2px; background: var(--line);
}
.step:first-child::before { display: none; }
.step.done .bubble { background: var(--ok); border-color: var(--ok); color: #fff; }
.step.done::before { background: var(--ok); }
.step.current .bubble { background: var(--navy); border-color: var(--navy); color: #fff; box-shadow: 0 0 0 4px var(--navy-100); }
.step.current::before { background: var(--ok); }
.step.current { color: var(--navy); font-weight: 600; }
.step.done { color: var(--ink-2); }

/* Checklist */
.todo { list-style: none; margin: 0; padding: 0; }
.todo li {
  display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: .92rem;
}
.todo li:first-child { border-top: 0; }
.todo .mark {
  width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); flex: none; margin-top: 2px;
  display: grid; place-items: center; font-size: .7rem; color: #fff;
}
.todo li.done .mark { background: var(--ok); border-color: var(--ok); }
.todo li.done { color: var(--ink-3); }
.todo li.due .mark { border-color: var(--warn); }
.todo li .what { flex: 1; }
.todo li .when { font-size: .78rem; color: var(--ink-3); white-space: nowrap; }

/* Files */
.dropzone {
  border: 2px dashed var(--line); border-radius: 10px; padding: 18px; text-align: center; color: var(--ink-2);
  background: var(--navy-50); cursor: pointer; transition: border-color .15s, background .15s; font-size: .9rem;
}
.dropzone.over { border-color: var(--navy); background: var(--navy-100); }
.dropzone input { display: none; }
.filelist { list-style: none; padding: 0; margin: 10px 0 0; }
.filelist li {
  display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: .9rem;
}
.filelist li:first-child { border-top: 0; }
.filelist .icon { width: 34px; height: 34px; border-radius: 8px; background: var(--navy-100); color: var(--navy); display: grid; place-items: center; font-size: .7rem; font-weight: 700; flex: none; }
.filelist .name { flex: 1; min-width: 0; }
.filelist .name a { text-decoration: none; font-weight: 500; }
.filelist .meta { font-size: .78rem; color: var(--ink-3); }
.progress { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.progress > div { height: 100%; background: var(--navy); width: 0; transition: width .2s; }

/* Messages */
.thread { display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow-y: auto; padding: 4px 2px; }
.msg { max-width: 82%; padding: 9px 12px; border-radius: 12px; font-size: .92rem; background: var(--bg); border: 1px solid var(--line); }
.msg.mine { align-self: flex-end; background: var(--navy); color: #fff; border-color: var(--navy); }
.msg .from { font-size: .72rem; opacity: .75; margin-bottom: 2px; }
.msg.internal { background: var(--warn-bg); border-color: #f2dfb5; }
.msg .body { white-space: pre-wrap; word-break: break-word; }

/* Tables */
table.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.tbl th { text-align: left; font-size: .75rem; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); padding: 8px; border-bottom: 1px solid var(--line); }
table.tbl td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tr.click { cursor: pointer; }
table.tbl tr.click:hover td { background: var(--navy-50); }
table.tbl td.num, table.tbl th.num { text-align: right; white-space: nowrap; }
.tbl-wrap { overflow-x: auto; }

/* Key/value */
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: .9rem; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; }
@media (max-width: 480px) { .kv { grid-template-columns: 1fr; gap: 0; } .kv dt { margin-top: 8px; font-size: .78rem; } }

/* Alerts */
.alert { padding: 10px 14px; border-radius: 9px; font-size: .9rem; border: 1px solid; }
.alert.info { background: var(--info-bg); border-color: #cfe1f1; color: #1d4f79; }
.alert.warn { background: var(--warn-bg); border-color: #f2dfb5; color: #6f4a0f; }
.alert.ok { background: var(--ok-bg); border-color: #bfe3cc; color: #14522d; }
.alert.bad { background: var(--bad-bg); border-color: #f3c5be; color: #7b2318; }

/* Toast */
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; }
#toast .t { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 9px; font-size: .9rem; box-shadow: var(--shadow); animation: pop .2s ease-out; }
#toast .t.ok { background: var(--ok); }
#toast .t.bad { background: var(--bad); }
@keyframes pop { from { opacity: 0; transform: translateY(8px);} to { opacity: 1; transform: none; } }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(20, 24, 60, .45); z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 640px; max-height: 92vh; overflow: auto; padding: 20px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal.wide { max-width: 900px; }
.modal h2 { margin-bottom: 12px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* Sign in */
.signin { max-width: 420px; margin: 40px auto; }
.signin .logo { display: block; height: 42px; margin: 0 auto 18px; }
.signin h1 { text-align: center; font-size: 1.3rem; }
.signin .or { text-align: center; color: var(--ink-3); font-size: .8rem; margin: 12px 0; }

/* Board */
.board-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.board-filters input[type=text], .board-filters input[type=search] { flex: 1 1 240px; max-width: 380px; }
.board-filters select { width: auto; flex: none; }
.board-filters .muted { flex: none; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; cursor: pointer; }
.stat:hover { border-color: var(--navy); }
.stat .n { font-size: 1.5rem; font-weight: 600; line-height: 1.1; }
.stat .l { font-size: .78rem; color: var(--ink-3); }
.stat.warn .n { color: var(--warn); }
.stat.bad .n { color: var(--bad); }
.flag { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.flag.warn { background: var(--warn); }
.flag.bad { background: var(--bad); }
.flag.info { background: var(--info); }

/* Activity */
.activity { list-style: none; margin: 0; padding: 0; font-size: .85rem; }
.activity li { padding: 6px 0; border-top: 1px solid var(--line); display: flex; gap: 10px; }
.activity li:first-child { border-top: 0; }
.activity .t { color: var(--ink-3); white-space: nowrap; min-width: 120px; font-size: .78rem; }

/* Proof viewer */
.proof-frame { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #f0f1f5; }
.proof-frame img { display: block; max-width: 100%; margin: 0 auto; }
.proof-frame iframe { width: 100%; height: 520px; border: 0; background: #fff; }
.proof-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* Items editor */
.items-editor { margin-bottom: 8px; }
.items-editor .row, .items-editor .head { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, .9fr) 76px 96px minmax(0, 1.2fr) 30px; gap: 8px; align-items: center; }
.items-editor .row { margin-bottom: 8px; }
.items-editor .head { font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); margin-bottom: 6px; }
.items-editor .row input, .items-editor .row select { min-height: 38px; padding: 7px 9px; font-size: .9rem; }
.items-editor .row select { padding-right: 28px; background-position: right 9px center; }
.items-editor .row .x { border: 0; background: transparent; color: var(--ink-3); cursor: pointer; font-size: 1.25rem; line-height: 1; padding: 6px 0; border-radius: 6px; }
.items-editor .row .x:hover { color: var(--bad); background: #fbe9ec; }
@media (max-width: 800px) {
  .items-editor .head { display: none; }
  .items-editor .row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
  .items-editor .row [name=i_desc], .items-editor .row [name=i_notes] { grid-column: 1 / -1; }
  .items-editor .row .x { grid-column: 1 / -1; justify-self: end; }
}

.loading { text-align: center; color: var(--ink-3); padding: 30px; }
.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--navy); border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto 8px; }
@keyframes spin { to { transform: rotate(360deg);} }

.empty { text-align: center; padding: 30px 10px; color: var(--ink-3); }
.empty .big { font-size: 2rem; }

footer.foot { text-align: center; font-size: .78rem; color: var(--ink-3); padding: 30px 0 10px; }
footer.foot a { color: var(--ink-3); }

@media print {
  .topbar, .nav, .btn, .dropzone, footer.foot { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; }
}
