/* Cannabis Now Sales Hub — styling. Reskin via :root variables only.
   Palette: editorial dark + Cannabis Now green, magazine gold accent. */
:root {
  --bg: #0d100d;
  --bg-2: #121712;
  --panel: #171d17;
  --panel-2: #1e261e;
  --line: #262f26;
  --line-2: #344034;
  --txt: #e9eee7;
  --txt-dim: #a3b0a0;
  --txt-faint: #6f7d6d;
  --accent: #3fae52;      /* CN green */
  --accent-2: #d4a24e;    /* magazine gold */
  --blue: #2f9bff;
  --warn: #e2572b;
  --danger: #f25c8a;
  --good: #4fd07a;
  --radius: 10px;
  --radius-sm: 6px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: "Iowan Old Style", Georgia, "Times New Roman", serif;
  --mono: "SF Mono", ui-monospace, "Cascadia Code", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--txt);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout */
.app { display: grid; grid-template-columns: 224px 1fr; height: 100vh; }
.sidebar {
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding: 16px 12px;
  overflow-y: auto;
}
.brand { padding: 4px 8px 16px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.brand .logo { font-family: var(--serif); font-weight: 700; font-size: 17px; letter-spacing: .2px; }
.brand .logo span { color: var(--accent); }
.brand .sub { color: var(--accent-2); font-size: 10.5px; margin-top: 3px; text-transform: uppercase; letter-spacing: 1.2px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav button {
  display: flex; align-items: center; gap: 10px;
  background: none; border: 0; color: var(--txt-dim);
  padding: 9px 10px; border-radius: var(--radius-sm);
  font-size: 13.5px; cursor: pointer; text-align: left; width: 100%;
  font-family: var(--font);
}
.nav button:hover { background: var(--panel); color: var(--txt); }
.nav button.active { background: var(--panel-2); color: var(--txt); box-shadow: inset 2px 0 0 var(--accent); }
.nav .glyph { color: var(--accent); width: 16px; text-align: center; font-size: 13px; }

.sidebar .foot { margin-top: auto; padding-top: 14px; font-size: 11px; color: var(--txt-faint); border-top: 1px solid var(--line); }
.sidebar .foot .src { display: inline-block; padding: 2px 7px; border-radius: 20px; background: var(--panel-2); color: var(--accent-2); font-family: var(--mono); font-size: 10px; }
.internal-tag { display:block; margin-top:8px; color: var(--warn); font-size: 10px; text-transform: uppercase; letter-spacing:.6px; }

.main { overflow-y: auto; padding: 0; }
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; background: rgba(13,16,13,.87); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 17px; margin: 0; font-weight: 600; font-family: var(--serif); }
.topbar .meta { color: var(--txt-faint); font-size: 12px; }
.content { padding: 22px 24px 60px; }

/* Cards & panels */
.grid { display: grid; gap: 14px; }
.cols-2 { grid-template-columns: 1fr 1fr; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
.cols-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1100px) { .cols-3, .cols-4, .cols-5 { grid-template-columns: 1fr 1fr; } }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.panel h2, .panel h3 { margin: 0 0 12px; }
.panel h2 { font-size: 14px; font-weight: 600; }
.panel h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--txt-dim); }
.section-head { display:flex; align-items:center; justify-content:space-between; margin: 4px 0 14px; flex-wrap:wrap; gap:10px; }
.section-head h2 { font-size: 15px; margin:0; }
.section-head .tools { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }

/* Stat tiles */
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .k { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--txt-faint); }
.stat .v { font-size: 24px; font-weight: 700; margin-top: 4px; }
.stat .v small { font-size: 13px; color: var(--txt-dim); font-weight: 500; }
.stat .d { font-size: 11.5px; color: var(--txt-faint); margin-top: 3px; }

/* Progress / chart bars */
.bar { height: 8px; border-radius: 20px; background: var(--panel-2); overflow: hidden; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

.hbar-row { display:flex; align-items:center; gap:12px; margin-bottom:9px; }
.hbar-row .lbl { width: 130px; min-width:130px; font-size:12.5px; color: var(--txt-dim); text-align:right; }
.hbar-wrap { flex:1; }
.hbar { height: 24px; border-radius: 4px; background: var(--panel-2); border:1px solid var(--line-2); min-width:4px; display:flex; align-items:center; padding: 0 8px; }
.hbar .val { font-size:11.5px; font-family: var(--mono); white-space:nowrap; }

.vchart { display:flex; align-items:flex-end; gap:10px; height: 180px; padding: 8px 4px 0; }
.vchart .vcol { flex:1; display:flex; flex-direction:column; align-items:center; gap:6px; height:100%; justify-content:flex-end; }
.vchart .vbar { width: 100%; max-width: 54px; border-radius: 5px 5px 0 0; background: linear-gradient(180deg, var(--accent), #2a7a3a); }
.vchart .vlab { font-size: 10.5px; color: var(--txt-faint); }
.vchart .vval { font-size: 10.5px; font-family: var(--mono); color: var(--txt-dim); }

/* Funnel */
.funnel .frow { display:flex; align-items:center; gap:10px; margin-bottom:8px; }
.funnel .fname { width: 150px; min-width:150px; text-align:right; font-size:12.5px; color: var(--txt-dim); }
.funnel .fbar { height: 26px; border-radius: 4px; display:flex; align-items:center; padding: 0 9px; min-width: 6px; }
.funnel .fbar .fv { font-size: 11.5px; font-family: var(--mono); color: #fff; white-space:nowrap; text-shadow: 0 1px 2px rgba(0,0,0,.5); }

/* Tables */
table { width:100%; border-collapse: collapse; font-size: 13px; }
th { text-align:left; color: var(--txt-faint); font-weight:600; font-size:11px; text-transform:uppercase; letter-spacing:.5px; padding: 8px 10px; border-bottom:1px solid var(--line); position: sticky; top: 0; background: var(--panel); z-index:1; cursor:pointer; user-select:none; }
td { padding: 9px 10px; border-bottom:1px solid var(--line); vertical-align: top; }
tr:hover td { background: var(--panel-2); }
tr.clickable { cursor: pointer; }
.table-wrap { background: var(--panel); border:1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table-scroll { overflow-x: auto; max-height: 70vh; overflow-y:auto; }

/* Badges & chips */
.badge { display:inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight:600; line-height:1.6; white-space:nowrap; }
.dot { display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:6px; vertical-align: middle; }
.chip { display:inline-block; padding: 1px 7px; border-radius: 5px; font-size:11px; background: var(--panel-2); color: var(--txt-dim); font-family: var(--mono); }

/* Buttons */
.btn { background: var(--panel-2); color: var(--txt); border:1px solid var(--line-2); border-radius: var(--radius-sm); padding: 7px 12px; font-size:12.5px; cursor:pointer; font-family: var(--font); }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: #08170b; border-color: var(--accent); font-weight:600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.sm { padding: 4px 9px; font-size:11.5px; }
.seg { display:inline-flex; border:1px solid var(--line-2); border-radius: var(--radius-sm); overflow:hidden; }
.seg button { background: var(--bg-2); border:0; color: var(--txt-dim); padding: 6px 12px; font-size:12px; cursor:pointer; font-family:var(--font); }
.seg button.active { background: var(--panel-2); color: var(--txt); }
.seg button + button { border-left:1px solid var(--line-2); }
select, input, textarea { background: var(--bg-2); border:1px solid var(--line-2); color: var(--txt); border-radius: var(--radius-sm); padding: 6px 9px; font-size:12.5px; font-family: var(--font); }
.filters { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }

/* Kanban */
.kanban { display:grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap:12px; overflow-x:auto; padding-bottom:8px; }
.kcol { background: var(--bg-2); border:1px solid var(--line); border-radius: var(--radius); padding: 10px; min-height: 140px; }
.kcol h4 { margin:0 0 4px; font-size:12px; text-transform:uppercase; letter-spacing:.5px; display:flex; justify-content:space-between; }
.kcol .ksum { font-size:10.5px; font-family: var(--mono); color: var(--txt-faint); margin-bottom:10px; }
.kcol h4 .ct { color: var(--txt-faint); }
.kcard { background: var(--panel); border:1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; margin-bottom: 8px; cursor: grab; }
.kcard:active { cursor: grabbing; }
.kcard.drag { opacity:.4; }
.kcol.over { border-color: var(--accent); }
.kcard .t { font-size:12.5px; font-weight:500; margin-bottom:6px; }
.kcard .m { display:flex; gap:6px; align-items:center; flex-wrap:wrap; font-size:11px; color: var(--txt-faint); }

/* Modal */
.modal-bg { position:fixed; inset:0; background: rgba(0,0,0,.55); display:none; align-items:center; justify-content:center; z-index:50; padding:20px; }
.modal-bg.show { display:flex; }
.modal { background: var(--panel); border:1px solid var(--line-2); border-radius: var(--radius); width: 580px; max-width:100%; max-height: 90vh; overflow-y:auto; padding: 20px; }
.modal h3 { margin:0 0 16px; font-size:15px; }
.field { margin-bottom: 12px; }
.field label { display:block; font-size:11px; text-transform:uppercase; letter-spacing:.5px; color: var(--txt-faint); margin-bottom:5px; }
.field input, .field select, .field textarea { width:100%; }
.field textarea { min-height:64px; resize:vertical; }
.field.row2 { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.modal-actions { display:flex; justify-content:space-between; gap:10px; margin-top:18px; }

/* Library */
.lib-grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap:12px; }
.lib-card { background: var(--panel); border:1px solid var(--line); border-radius: var(--radius); padding:14px; display:flex; flex-direction:column; gap:6px; }
.lib-card .nm { font-weight:600; font-size:13.5px; }
.lib-card .mt { font-size:11px; color: var(--txt-faint); }

.muted { color: var(--txt-dim); }
.faint { color: var(--txt-faint); }
.mono { font-family: var(--mono); }
.right { text-align:right; }
.nowrap { white-space:nowrap; }
.empty { color: var(--txt-faint); text-align:center; padding: 30px; font-size:13px; }
.kv { display:flex; justify-content:space-between; gap:12px; padding:6px 0; border-bottom:1px dashed var(--line); font-size:12.5px; }
.kv:last-child { border-bottom:0; }
.kv .k { color: var(--txt-faint); }
.countdown { font-family: var(--mono); }
.countdown.soon { color: var(--accent-2); }
.countdown.past { color: var(--txt-faint); }
.notice { background: rgba(212,162,78,.08); border:1px solid rgba(212,162,78,.35); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 12.5px; color: var(--txt-dim); }
.notice b { color: var(--accent-2); }

/* Systems roadmap */
.phase { display:flex; gap:14px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.phase:last-child { border-bottom:0; }
.phase .pnum { width:34px; height:34px; min-width:34px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-family:var(--mono); font-weight:700; font-size:13px; border:2px solid var(--line-2); color: var(--txt-faint); }
.phase.now .pnum { border-color: var(--accent); color: var(--accent); }
.phase.done .pnum { border-color: var(--good); color: var(--good); background: rgba(79,208,122,.08); }
.phase .pt { font-weight:600; font-size:13.5px; }
.phase .pd { color: var(--txt-dim); font-size:12.5px; margin-top:2px; }

/* Workstream chips */
.ws-chip { padding:2px 8px; border-radius:5px; font-size:11px; font-weight:600; }

/* Inline status dropdowns (Work section) */
.inline-sel { padding: 2px 6px; font-size: 11.5px; border-radius: 5px; max-width: 150px; cursor: pointer; background: var(--bg-2); border:1px solid var(--line-2); color: var(--txt-dim); font-family: var(--font); }
.inline-sel:hover { border-color: var(--accent); }
.inline-sel.st-Done { color: var(--good); border-color: rgba(79,208,122,.5); }
.inline-sel.st-Blocked { color: var(--danger); border-color: rgba(242,92,138,.5); }
.inline-sel.st-InProgress { color: var(--blue); border-color: rgba(47,155,255,.5); }
.inline-sel.st-ToDo { color: var(--accent-2); }
.inline-sel.st-Backlog { color: var(--txt-faint); }

/* Gantt */
.gantt { background: var(--panel); border:1px solid var(--line); border-radius: var(--radius); overflow:auto; }
.gantt-row { display:flex; align-items:center; border-bottom:1px solid var(--line); min-height: 34px; }
.gantt-row:hover { background: var(--panel-2); }
.gantt-label { width: 260px; min-width:260px; padding: 6px 12px; font-size:12.5px; border-right:1px solid var(--line); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.gantt-track { position:relative; flex:1; height: 34px; }
.gantt-bar { position:absolute; top:8px; height:18px; border-radius:4px; opacity:.9; cursor:pointer; }
.gantt-bar span { position:absolute; left:7px; top:1px; font-size:10.5px; color:#fff; white-space:nowrap; text-shadow:0 1px 2px rgba(0,0,0,.6); }
.gantt-head { display:flex; position:sticky; top:0; background: var(--panel); z-index:2; border-bottom:1px solid var(--line-2); }
.gantt-head .gantt-label { font-size:11px; text-transform:uppercase; color: var(--txt-faint); }
.gantt-month { flex:1; text-align:center; font-size:11px; color: var(--txt-faint); padding:6px 0; border-right:1px solid var(--line); }
.gantt-today { position:absolute; top:0; bottom:0; width:2px; background: var(--danger); z-index:1; }

/* News */
.news-card { cursor:pointer; }
.news-rel { margin-top:10px; padding:10px 12px; background: var(--bg-2); border-left:3px solid var(--accent); border-radius:6px; font-size:12.5px; }
.news-rel .rl { color: var(--accent); font-weight:600; font-size:11px; text-transform:uppercase; letter-spacing:.5px; }
.cgroup-title { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--txt-dim); margin: 18px 0 10px; font-weight: 600; }

/* Events — 12-month year view */
.yr-grid { display:grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 1100px) { .yr-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px) { .yr-grid { grid-template-columns: 1fr; } }
.yr-month { background: var(--panel); border:1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.yr-mhead { font-family: var(--serif); font-weight: 600; font-size: 13.5px; margin-bottom: 8px; cursor: pointer; }
.yr-mhead:hover { color: var(--accent); }
.yr-mini { display:grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 8px; }
.yr-dow { text-align:center; font-size: 8.5px; color: var(--txt-faint); text-transform:uppercase; }
.yr-day { text-align:center; font-size: 9.5px; color: var(--txt-faint); font-family: var(--mono); border-radius: 4px; padding: 2px 0; }
.yr-day.has-ev { background: color-mix(in srgb, var(--evc, var(--accent)) 22%, transparent); color: var(--evc, var(--accent)); font-weight: 700; }
.yr-day.today { outline: 1px solid var(--accent); color: var(--accent); font-weight: 700; }
.yr-day.collide { outline: 1.5px solid var(--danger); color: var(--danger); font-weight: 700; }
.yr-chip { font-size: 11px; padding: 3px 7px; border-radius: 4px; margin-bottom: 4px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.yr-chip:hover { filter: brightness(1.25); }
.yr-chip-d { font-family: var(--mono); font-size: 9.5px; opacity: .8; margin-right: 2px; }

/* Events calendar */
.cal-grid { display:grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-head div { text-align:center; font-size:10.5px; text-transform:uppercase; letter-spacing:.5px; color: var(--txt-faint); padding: 4px 0; }
.cal-day { min-height: 86px; background: var(--bg-2); border:1px solid var(--line); border-radius: 6px; padding: 5px; overflow:hidden; }
.cal-day.pad { background: transparent; border-color: transparent; }
.cal-day.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cal-num { font-size: 11px; color: var(--txt-faint); font-family: var(--mono); margin-bottom: 3px; }
.cal-day.today .cal-num { color: var(--accent); font-weight: 700; }
.cal-chip { font-size: 10.5px; padding: 2px 5px; border-radius: 4px; margin-bottom: 3px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-chip:hover { filter: brightness(1.25); }
@media (max-width: 860px) { .cal-day { min-height: 54px; } .cal-chip { font-size: 9px; } }

/* Mobile */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: 100vh; }
  .sidebar { flex-direction: row; align-items:center; overflow-x:auto; overflow-y:hidden; padding: 8px 10px; border-right:0; border-bottom:1px solid var(--line); gap:10px; }
  .brand { border-bottom:0; margin-bottom:0; padding: 0 8px 0 0; border-right:1px solid var(--line); white-space:nowrap; }
  .brand .sub { display:none; }
  .nav { flex-direction: row; }
  .nav button { white-space: nowrap; padding: 7px 9px; }
  .sidebar .foot { display:none; }
  .cols-2, .cols-3, .cols-4, .cols-5 { grid-template-columns: 1fr; }
  .content { padding: 14px 12px 60px; }
  .topbar { padding: 10px 14px; }
  .funnel .fname, .hbar-row .lbl { width: 96px; min-width:96px; font-size:11px; }
}
