/* TagMix Event Operations - brand: Ink / White / Cream, one Signal orange accent.
   Rubik for text, JetBrains Mono for labels and technical values. */
:root {
  --ink: #0A0908;
  --white: #FFFFFF;
  --cream: #F5F1EA;
  --signal: #FF5C2A;
  --golden: #FFB347;
  --burnt: #B73D14;
  --grey: #9B9184;
  --line: #E4DED3;
  --muted: #6B645B;
  --ok: #2E6B3F;
  --ok-bg: #E7F0E8;
  --prov-bg: #FFF1DC;
  --miss-bg: #FBE9E2;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(10, 9, 8, .06);
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'Rubik', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--cream); color: var(--ink); font: 15px/1.5 var(--sans); }
a { color: var(--ink); text-decoration-color: var(--signal); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.15; }
h1 { font-weight: 800; letter-spacing: -0.03em; font-size: clamp(24px, 4vw, 34px); }
h2 { font-weight: 700; letter-spacing: -0.02em; font-size: 20px; }
h3 { font-weight: 600; font-size: 16px; }
.eyebrow { font: 500 11px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--signal); margin-bottom: 4px; }
.mono { font-family: var(--mono); font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }

/* Header */
.topbar { background: var(--ink); color: var(--white); position: sticky; top: 0; z-index: 20; }
.topbar-inner { max-width: 1240px; margin: 0 auto; display: flex; align-items: center; gap: 20px; padding: 10px 16px; }
.wordmark { font-weight: 800; font-size: 22px; letter-spacing: -0.04em; color: var(--white); text-decoration: none; white-space: nowrap; }
.wordmark small { font: 500 10px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: #CFC7BA; margin-left: 8px; vertical-align: 3px; }
.nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav a { color: #D9D2C6; text-decoration: none; padding: 8px 9px; border-radius: 8px; font-size: 14px; white-space: nowrap; position: relative; }
.nav a:hover { color: var(--white); background: #1d1a17; }
.nav a.active { color: var(--white); }
.nav a.active::after { content: ''; position: absolute; left: 11px; right: 11px; bottom: 2px; height: 2px; background: var(--signal); border-radius: 2px; }
.nav .count { font: 600 11px var(--mono); background: var(--signal); color: var(--ink); border-radius: 10px; padding: 0 6px; margin-left: 4px; }
.userbox { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #CFC7BA; white-space: nowrap; }
.userbox button { background: none; border: 1px solid #3a352f; color: #E9E3D8; border-radius: 8px; padding: 5px 10px; cursor: pointer; }

main { max-width: 1240px; margin: 0 auto; padding: 20px 16px 96px; }

/* Cards and layout */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card + .card { margin-top: 14px; }
.grid > .card + .card, .row > .card + .card { margin-top: 0; }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.stack > * + * { margin-top: 10px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.page-head { margin-bottom: 16px; }

/* Stats */
.stat { display: block; text-decoration: none; }
.stat .n { font: 800 32px/1 var(--sans); letter-spacing: -0.03em; }
.stat .n.alert { color: var(--signal); }
.stat .l { font: 500 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--ink); background: var(--white); color: var(--ink); border-radius: 9px; padding: 8px 14px; font-weight: 500; cursor: pointer; text-decoration: none; font-size: 14px; min-height: 38px; }
.btn:hover { background: var(--cream); }
.btn.primary { background: var(--signal); border-color: var(--signal); color: var(--ink); font-weight: 600; }
.btn.primary:hover { filter: brightness(.96); }
.btn.dark { background: var(--ink); color: var(--white); }
.btn.small { padding: 4px 10px; min-height: 30px; font-size: 13px; }
.btn.ghost { border-color: var(--line); }
.btn.danger { border-color: var(--burnt); color: var(--burnt); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* Status chips: always text + shape, never colour alone */
.chip { display: inline-flex; align-items: center; gap: 5px; font: 500 11px/1 var(--mono); letter-spacing: .04em; text-transform: uppercase; border-radius: 999px; padding: 5px 9px; white-space: nowrap; border: 1px solid transparent; }
.chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.confirmed { background: var(--ok-bg); color: var(--ok); }
.chip.provisional { background: var(--prov-bg); color: #8A5A00; border: 1px dashed #D9962A; }
.chip.missing { background: var(--miss-bg); color: var(--burnt); }
.chip.missing::before { background: none; border: 1.5px solid currentColor; }
.chip.neutral { background: var(--cream); color: var(--muted); }
.chip.dark { background: var(--ink); color: var(--white); }
.chip.alert { background: var(--signal); color: var(--ink); }

.banner { border-radius: 10px; padding: 10px 14px; margin: 10px 0; border: 1px solid var(--line); background: var(--white); }
.banner.prov { background: var(--prov-bg); border: 1px dashed #D9962A; }
.banner.warn { background: var(--miss-bg); border-color: #E9B7A5; }
.banner.info { background: var(--cream); }
.banner strong { font-weight: 600; }

/* Tables and lists */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font: 500 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 8px 8px; border-bottom: 1px solid var(--ink); }
td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
.list-item { padding: 10px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }

/* Fields */
.section-title { display: flex; justify-content: space-between; align-items: baseline; margin: 6px 0 8px; }
.field { display: grid; grid-template-columns: minmax(150px, 34%) 1fr auto; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); align-items: start; }
.field:last-child { border-bottom: 0; }
.field .label { color: var(--muted); font-size: 14px; }
.field .value { white-space: pre-wrap; word-break: break-word; }
.field .value.empty { color: var(--burnt); font-style: italic; }
.field .src { font: 400 11px/1.4 var(--mono); color: var(--muted); margin-top: 3px; }
.field .src q { font-style: italic; }
.field-actions { display: flex; gap: 6px; align-items: center; }

/* Forms */
label.fl { display: block; font: 500 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 10px 0 4px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=search], select, textarea {
  width: 100%; border: 1px solid #CFC7BA; border-radius: 9px; padding: 9px 11px; background: var(--white); min-height: 40px;
}
textarea { min-height: 90px; resize: vertical; }
textarea.big { min-height: 300px; font: 13px/1.5 var(--mono); }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--signal); outline-offset: 1px; }
.checks label { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 14px 0; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 9px 12px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; font-size: 14px; }
.tabs a.active { color: var(--ink); border-color: var(--signal); font-weight: 600; }
.tabs .count { font: 600 11px var(--mono); background: var(--cream); border-radius: 10px; padding: 1px 6px; margin-left: 4px; }

/* Schedule */
.event-card { display: grid; grid-template-columns: 74px 1fr; gap: 12px; text-decoration: none; color: inherit; }
.event-card.prov { border-style: dashed; border-color: #D9962A; }
.datebox { align-self: start; background: var(--ink); color: var(--white); border-radius: 10px; text-align: center; padding: 8px 4px; }
.prov .datebox { background: var(--white); color: var(--ink); border: 1px dashed #D9962A; }
.datebox .d { font: 800 26px/1 var(--sans); letter-spacing: -0.03em; }
.datebox .m { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .1em; }
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.calendar .dow { background: var(--cream); font: 500 11px var(--mono); text-transform: uppercase; padding: 6px; text-align: center; }
.calendar .day { background: var(--white); min-height: 96px; padding: 4px; font-size: 12px; }
.calendar .day.other { background: #FBF9F5; color: var(--grey); }
.calendar .day.today .num { background: var(--signal); color: var(--ink); border-radius: 6px; padding: 0 5px; }
.calendar .num { font: 500 11px var(--mono); }
.cal-ev { display: block; margin-top: 3px; padding: 2px 5px; border-radius: 5px; background: var(--ink); color: var(--white); text-decoration: none; font-size: 11px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-ev.prov { background: var(--prov-bg); color: #6E4700; border: 1px dashed #D9962A; }
.cal-ev.setup { opacity: .55; }

/* Emails / briefing text */
.mailbox-label { font: 500 11px var(--mono); }
pre.letter { white-space: pre-wrap; word-break: break-word; background: var(--cream); padding: 14px; border-radius: 10px; font: 13px/1.55 var(--mono); max-height: 520px; overflow: auto; margin: 0; }
.quote { border-left: 3px solid var(--signal); padding-left: 10px; color: var(--muted); }
.diff-old { text-decoration: line-through; color: var(--muted); }

/* Toasts */
#toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 50; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 520px); }
.toast { background: var(--ink); color: var(--white); border-radius: 10px; padding: 10px 14px; box-shadow: 0 6px 24px rgba(0,0,0,.2); }
.toast.error { border-left: 4px solid var(--signal); }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(120% 90% at 20% 0%, #FF5C2A 0%, #B73D14 38%, #0A0908 78%); padding: 16px; }
.login-card { background: var(--white); border-radius: 16px; padding: 28px; width: min(420px, 100%); }
.login-card .wordmark { color: var(--ink); font-size: 30px; }

/* Bottom bar on phones */
.bottom-nav { display: none; }
@media (max-width: 1100px) { .userbox span { display: none; } }
@media (max-width: 760px) {
  .topbar-inner { gap: 10px; }
  .topbar .nav { display: none; }
  .userbox span { display: none; }
  .bottom-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: var(--ink); z-index: 30; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); overflow-x: auto; }
  .bottom-nav a { flex: 1; min-width: 64px; color: #CFC7BA; text-decoration: none; text-align: center; font-size: 11px; padding: 6px 2px; border-radius: 8px; }
  .bottom-nav a.active { color: var(--white); background: #1d1a17; box-shadow: inset 0 -2px 0 var(--signal); }
  .field { grid-template-columns: 1fr; gap: 2px; }
  .field-actions { margin-top: 4px; }
  .calendar .day { min-height: 64px; }
  .cal-ev { font-size: 10px; }
  main { padding-top: 14px; }
  .hide-sm { display: none; }
}
