/* Trendaj brand board: deep ink, teal, lime, cool paper.
   Lime is a fill only — never a word or a line on the light ground. */
:root {
  --teal-900: #0B1420;
  --teal-800: #13202F;
  --teal-700: #00796B;
  --lime-500: #C6FF3D;
  --lime-600: #7DB51C;
  --lime-50: #F3FFDC;
  --apno-50: #F1F5F7;
  --apno-100: #E6EDF1;
  --apno-200: #DDE5EA;
  --kamen-600: #56677A;
  --red-600: #a8361f;
  --red-50: #fbecea;
  --ochre-600: #9e5e1a;
  --ochre-50: #fbf2e4;

  --surface: var(--apno-50);
  --raised: #fff;
  --sunken: var(--apno-100);
  --ink: var(--teal-900);
  --muted: var(--kamen-600);
  --line: var(--apno-200);

  --font-display: 'Sora', 'Segoe UI', sans-serif;
  --font-sans: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --radius-card: 1rem;
  --radius-field: 0.625rem;
  --elev-card: 0 1px 2px rgb(6 21 15 / 0.04), 0 6px 16px -8px rgb(6 21 15 / 0.14);
  --elev-float: 0 2px 4px rgb(6 21 15 / 0.05), 0 12px 32px -8px rgb(6 21 15 / 0.22);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--surface); color: var(--ink); font: 15px/1.5 var(--font-sans); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: 28px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
a { color: var(--teal-700); }
code, .mono { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.error { color: var(--red-600); margin: 0; }
:focus-visible { outline: 2px solid var(--teal-700); outline-offset: 2px; }

/* --- buttons and fields ---------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 999px; padding: 9px 16px; font: 600 14px var(--font-sans); color: var(--ink); background: transparent; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-cta { background: var(--lime-500); color: var(--teal-900); }
.btn-cta:hover:not(:disabled) { background: #c1e65a; }
.btn-ghost { background: var(--raised); box-shadow: inset 0 0 0 1px var(--line); }
.btn-ghost:hover:not(:disabled) { background: var(--sunken); }
.btn-danger { background: var(--raised); color: var(--red-600); box-shadow: inset 0 0 0 1px var(--line); }
.btn-danger:hover:not(:disabled) { background: var(--red-50); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.field { display: grid; gap: 6px; font-weight: 500; font-size: 14px; }
input, select, textarea { font: 15px var(--font-sans); color: var(--ink); padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius-field); background: var(--raised); min-width: 0; }
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal-700); box-shadow: 0 0 0 3px rgb(57 101 105 / 0.15); }

/* --- sign in ---------------------------------------------------------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(1200px 500px at 50% -10%, var(--lime-50), transparent 70%), var(--surface); }
.login-card { width: min(400px, 100%); background: var(--raised); border-radius: 1.25rem; padding: 32px 28px; box-shadow: var(--elev-float); display: grid; gap: 14px; }
.login-logo { height: 40px; width: auto; margin-bottom: 8px; }
.login-card p { margin: 0; }

/* --- shell ------------------------------------------------------------ */
/* Desktop: a fixed sidebar and the page beside it. Phones: a top bar whose
   menu button slides the same sidebar in over the page. */
.shell { --side-w: 236px; min-height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { height: 28px; width: auto; }
.tag { font: 600 11px var(--font-sans); text-transform: uppercase; letter-spacing: 0.08em; background: var(--teal-900); color: #fff; padding: 3px 8px; border-radius: 999px; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--side-w); z-index: 20; display: flex; flex-direction: column; gap: 18px; padding: calc(18px + env(safe-area-inset-top, 0px)) 14px calc(16px + env(safe-area-inset-bottom, 0px)); background: var(--raised); box-shadow: 1px 0 0 var(--line); overflow-y: auto; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 0 6px; }
.menu-close { display: none; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 500; font-size: 14px; }
.nav a:hover { background: var(--sunken); }
.nav a[aria-current="page"] { background: var(--teal-900); color: #fff; }
.nav-label { margin: 14px 12px 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.badge { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--lime-500); color: var(--teal-900); font-size: 12px; font-weight: 700; text-align: center; }
.account { margin-top: auto; display: grid; gap: 8px; justify-items: start; font-size: 13px; padding: 12px 6px 0; border-top: 1px solid var(--line); }
.account .who { overflow-wrap: anywhere; }
.env { font: 600 11px var(--font-sans); text-transform: uppercase; letter-spacing: 0.06em; background: var(--ochre-50); color: var(--ochre-600); padding: 3px 8px; border-radius: 999px; }
.mobilebar { display: none; }
.scrim { position: fixed; inset: 0; z-index: 15; background: rgb(6 21 15 / 0.35); }
.view { margin-left: var(--side-w); max-width: calc(1240px + var(--side-w)); padding: 28px 32px 64px; outline: none; }

/* --- layout pieces ---------------------------------------------------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { margin: 4px 0 0; }
.card { background: var(--raised); border-radius: var(--radius-card); box-shadow: var(--elev-card); padding: 20px; }
.card + .card { margin-top: 16px; }
.grid > .card, .stack > .card { margin-top: 0; }
.card h2 { margin-bottom: 12px; }
.grid { display: grid; gap: 16px; align-items: start; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.stat { background: var(--raised); border-radius: var(--radius-card); box-shadow: var(--elev-card); padding: 14px 16px; }
.stat .n { font: 700 28px/1.1 var(--font-display); }
.stat .l { color: var(--muted); font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.stack { display: grid; gap: 12px; align-content: start; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
dl.kv dt { color: var(--muted); font-size: 13px; }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty h3 { color: var(--ink); margin-bottom: 6px; }
.notice { border-radius: var(--radius-field); padding: 12px 14px; background: var(--ochre-50); color: var(--ochre-600); font-size: 14px; }
.notice.ok { background: var(--lime-50); color: var(--teal-800); }
.notice.bad { background: var(--red-50); color: var(--red-600); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters input[type=search] { flex: 1; min-width: 200px; }

/* --- tables ----------------------------------------------------------- */
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 10px; border-bottom: 1px solid var(--apno-100); vertical-align: top; }
table.t tr.link { cursor: pointer; }
table.t tr.link:hover td { background: var(--surface); }
table.t td.wrap { overflow-wrap: anywhere; max-width: 360px; }

/* --- status pills ----------------------------------------------------- */
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--sunken); color: var(--ink); white-space: nowrap; }
.pill.good { background: var(--lime-50); color: var(--teal-800); }
.pill.warn { background: var(--ochre-50); color: var(--ochre-600); }
.pill.bad { background: var(--red-50); color: var(--red-600); }
.pill.dark { background: var(--teal-900); color: #fff; }

/* --- timeline --------------------------------------------------------- */
.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 14px 16px; }
.timeline li::before { content: ''; position: absolute; left: -6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--teal-700); }
.timeline .when { color: var(--muted); font-size: 12px; }
.timeline pre { margin: 4px 0 0; font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); }

/* --- preview and editor ----------------------------------------------- */
.preview-frame { width: 100%; height: 640px; border: 0; border-radius: var(--radius-field); background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.preview-frame.mobile { width: 390px; max-width: 100%; display: block; margin: 0 auto; }
.seg { display: inline-flex; background: var(--sunken); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: transparent; border-radius: 999px; padding: 5px 12px; font: 600 13px var(--font-sans); color: var(--ink); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--raised); box-shadow: var(--elev-card); }
.block { border: 1px solid var(--line); border-radius: var(--radius-field); padding: 12px; display: grid; gap: 8px; background: var(--raised); }
.block-head { display: flex; align-items: center; gap: 6px; }
.block-head strong { font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-right: auto; }
.icon-btn { border: 0; background: var(--sunken); border-radius: 8px; width: 30px; height: 30px; cursor: pointer; color: var(--ink); font-size: 14px; }
.icon-btn:hover { background: var(--apno-200); }
.editor-layout { display: grid; grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr); gap: 16px; align-items: start; }
.sticky { position: sticky; top: 24px; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; }
.switch input { width: 18px; height: 18px; accent-color: var(--teal-900); }
.dns td { font-family: ui-monospace, Consolas, monospace; font-size: 12px; overflow-wrap: anywhere; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--teal-900); color: #fff; padding: 10px 18px; border-radius: 999px; box-shadow: var(--elev-float); font-weight: 500; z-index: 50; max-width: calc(100% - 32px); }

/* --- support thread ------------------------------------------------------ */
.thread { display: grid; gap: 12px; }
.bubble { border-radius: var(--radius-card); padding: 14px 16px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.bubble.out { background: var(--lime-50); box-shadow: none; }
.bubble.note { background: var(--ochre-50); box-shadow: none; }
.bubble-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.bubble-head strong { color: var(--ink); }
.bubble-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.composer { display: grid; gap: 10px; }
.composer textarea { min-height: 160px; }
.ticket-list { display: grid; margin: 0 -20px; }
.ticket { display: grid; gap: 4px; padding: 14px 20px; border-top: 1px solid var(--apno-100); color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.ticket:hover { background: var(--surface); }
.ticket .row { gap: 8px; }
.ticket-subject { font-size: 15px; }
.stars { color: var(--ochre-600); letter-spacing: 1px; white-space: nowrap; }
.feedback-item { display: grid; gap: 6px; padding: 14px 0; border-bottom: 1px solid var(--apno-100); }
.feedback-item:last-child { border-bottom: 0; }
.feedback-item p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

@media (max-width: 1100px) {
  .editor-layout { grid-template-columns: 1fr; }
  .sticky { position: static; }
}
@media (max-width: 860px) {
  .mobilebar { display: flex; position: sticky; top: 0; z-index: 10; align-items: center; gap: 12px; padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; background: var(--raised); box-shadow: 0 1px 0 var(--line); }
  .mobilebar .brand img { height: 24px; }
  .mobile-title { margin-left: auto; font-weight: 600; font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .menu-btn { display: grid; place-items: center; width: 40px; height: 40px; }
  .sidebar { width: min(300px, 86vw); transform: translateX(-100%); transition: transform 0.2s ease; box-shadow: var(--elev-float); }
  .shell.menu-open .sidebar { transform: none; }
  .menu-close { display: grid; place-items: center; width: 36px; height: 36px; }
  .view { margin-left: 0; padding: 16px 16px 48px; }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }
@media (max-width: 640px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .table-wrap { margin: 0 -20px; }
}

/* Outreach sent emails: each opens into the email as the venue received it. */
.sent-mail > summary { list-style: none; cursor: pointer; display: grid; gap: 4px; }
.sent-mail > summary::-webkit-details-marker { display: none; }
.sent-mail[open] { background: var(--surface); }
.mail-preview { margin-top: 12px; background: #fff; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.mail-head { padding: 14px 20px; border-bottom: 1px solid var(--line); display: grid; gap: 3px; font-size: 13px; }
.mail-subject { font-family: var(--font-display); font-weight: 700; font-size: 18px; margin-bottom: 6px; }
.mail-head-row { display: grid; grid-template-columns: 48px 1fr; gap: 8px; overflow-wrap: anywhere; }
.mail-body { padding: 18px 20px 22px; white-space: pre-wrap; overflow-wrap: anywhere; font: 15px/1.6 Arial, Helvetica, sans-serif; color: #222; }
.mail-body a { color: #1a5fb4; }
.nav a.nav-sub { padding-left: 26px; font-size: 13px; }

/* Outreach list: a checkbox on the right of each venue, and the bulk bar under the list. */
.ticket-pick { display: grid; grid-template-columns: 1fr auto; align-items: center; border-top: 1px solid var(--apno-100); }
.ticket-pick > .ticket { border-top: 0; }
.ticket-pick:hover { background: var(--surface); }
.pick { align-self: stretch; display: grid; place-items: center; padding: 0 20px 0 8px; cursor: pointer; }
.pick input, .bulk-bar input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--teal-900); cursor: pointer; }
.pick input:disabled { cursor: not-allowed; opacity: 0.35; }
.bulk-bar {
  position: sticky; bottom: 12px; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin: 12px -8px 0; padding: 10px 14px; border-radius: 999px; background: var(--raised); box-shadow: var(--elev-float);
}
