/* MKNLY BD — brand tokens from Assets/BrandStandards_NOV2023.pdf (see CLAUDE.md).
   Red is EMPHASIS ONLY; slate carries the UI; light, info-dense, analytics-forward. */
:root {
  --pomme: #ee2737;
  --slate: #7a939c;
  --slate-mark: #5e7a87;
  --slate-deep: #46606c;
  --graphite: #000000;
  --alabaster: #e8e8e8;
  --bg: #f4f4f3;
  --surface: #ffffff;
  --line: #dcdedf;
  --text: #16191b;
  --text-dim: #5c686e;
  --ok: #3f7a52;
  --warn: #b07a1e;
  --font: "Suisse Int'l", "Gothic A1", Helvetica, Arial, sans-serif;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; }

#app { display: flex; min-height: 100vh; }

/* --- sidebar --- */
#sidebar {
  width: 208px; flex: none; background: var(--graphite); color: #fff;
  display: flex; flex-direction: column; padding: 20px 0;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 18px 22px; }
.brand-mark {
  width: 28px; height: 28px; background: var(--pomme); color: var(--graphite);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 18px; line-height: 1;
}
.brand-word { font-weight: 700; letter-spacing: 0.02em; font-size: 16px; }
.brand-word em { font-style: normal; color: var(--slate); font-weight: 500; }

#nav { display: flex; flex-direction: column; }
#nav a {
  color: #c9ced1; text-decoration: none; padding: 9px 18px; font-size: 13.5px;
  border-left: 3px solid transparent;
}
#nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.05); }
#nav a.active { color: #fff; border-left-color: var(--pomme); background: rgba(255, 255, 255, 0.07); }

#user-box { margin-top: auto; padding: 14px 18px; border-top: 1px solid rgba(255, 255, 255, 0.12); }
.user-name { font-weight: 700; }
.user-role { color: var(--slate); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; margin: 2px 0 8px; }
#attribution { padding: 10px 18px 0; color: #7d8a90; font-size: 10.5px; line-height: 1.5; }

/* --- main --- */
#main { flex: 1; padding: 24px 28px; min-width: 0; }
h1 { font-size: 20px; font-weight: 800; margin: 0 0 4px; }
h2 { font-size: 15px; font-weight: 700; margin: 0 0 10px; }
.subtitle { color: var(--text-dim); margin: 0 0 20px; }

/* --- primitives --- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.grid { display: grid; gap: 14px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1100px) { .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); } }

.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .value { font-size: 26px; font-weight: 800; }
.stat .label { color: var(--text-dim); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
.stat .delta-up { color: var(--ok); font-size: 12px; }
.stat .delta-down { color: var(--pomme); font-size: 12px; }

table.data { width: 100%; border-collapse: collapse; background: var(--surface); }
table.data th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-dim); padding: 8px 10px; border-bottom: 2px solid var(--line);
}
table.data td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data tr:hover td { background: #fafaf9; cursor: pointer; }

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  background: var(--alabaster); color: var(--slate-deep);
}
.badge.red { background: rgba(238, 39, 55, 0.1); color: var(--pomme); }
.badge.slate { background: var(--slate-deep); color: #fff; }
.score-pill { font-weight: 800; color: var(--slate-deep); }
.score-pill.hot { color: var(--pomme); }

button, .btn {
  font-family: var(--font); font-size: 13px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: var(--radius); padding: 7px 14px;
}
button:hover, .btn:hover { border-color: var(--slate); }
.btn-primary { background: var(--graphite); color: #fff; border-color: var(--graphite); }
.btn-danger { background: var(--pomme); color: #fff; border-color: var(--pomme); }
.btn-ghost { background: transparent; color: #c9ced1; border-color: rgba(255, 255, 255, 0.25); font-size: 12px; padding: 4px 10px; }

input, select, textarea {
  font-family: var(--font); font-size: 13.5px; padding: 7px 10px;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--slate); outline-offset: 0; }
label { font-size: 12px; font-weight: 600; color: var(--text-dim); display: block; margin-bottom: 4px; }

.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }

/* --- drawer (opportunity drill-down) --- */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.35); z-index: 40; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 92vw); z-index: 41;
  background: var(--surface); border-left: 1px solid var(--line); padding: 22px; overflow-y: auto;
}

/* --- kanban --- */
.kanban { display: flex; gap: 12px; overflow-x: auto; align-items: flex-start; }
.kanban-col { flex: 0 0 240px; background: var(--alabaster); border-radius: var(--radius); padding: 10px; }
.kanban-col h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--slate-deep); margin: 2px 4px 10px; }
.kanban-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; margin-bottom: 8px; }

/* --- modal --- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.35); z-index: 50; display: flex; align-items: center; justify-content: center; }
.modal { background: var(--surface); border-radius: var(--radius); padding: 22px; width: min(520px, 92vw); max-height: 88vh; overflow-y: auto; }

/* --- charts (inline SVG) --- */
.chart svg { width: 100%; height: auto; display: block; }
.chart .mark { fill: var(--slate-mark); }
.chart .mark-deep { fill: var(--slate-deep); }
.chart .mark-emphasis { fill: var(--pomme); }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.chart text { font-family: var(--font); font-size: 11px; fill: var(--text-dim); }

.loading { color: var(--text-dim); padding: 40px; text-align: center; }
.error-panel { background: rgba(238, 39, 55, 0.06); border: 1px solid rgba(238, 39, 55, 0.3); color: var(--pomme); padding: 14px; border-radius: var(--radius); }
.empty { color: var(--text-dim); padding: 30px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); }
