/* ==========================================================================
   GreenFlip DeckShare — design tokens
   Pulled from the GreenFlip Design System (claude.ai/design).
   Swap/extend tokens here only; components below consume the variables.
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@300;400;500;600;700&display=swap');

:root {
  /* Brand greens */
  --green-dark:   #063024;  /* sidebar, headers, primary surfaces */
  --green-base:   #32544A;  /* muted green, paired with white */
  --green-bright: #1ED65E;  /* highlight / data "best" */
  --green-cta:    #1A7A3E;  /* primary action buttons */

  /* Ink + neutrals */
  --ink:      #101729;      /* primary text (near-black navy) */
  --charcoal: #2C2E35;
  --muted:    #6B6E78;
  --white:    #FFFFFF;
  --canvas:   #FFFFFF;      /* app background */
  --tile:     #F4F3EF;      /* KPI tile background */
  --paper:    #F7F6F1;      /* warm marketing surface */
  --border:   #E2DFD4;

  /* Accent palette (status chips + charts) */
  --amber:      #E8A33D;
  --coral:      #E5533D;
  --slate-blue: #4A6FA5;
  --plum:       #7A4A78;
  --teal:       #2BA89E;
  --burnt:      #C5622A;
  --sand:       #D8C290;

  /* System */
  --font: 'Lexend', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(16,23,41,.04), 0 4px 16px rgba(16,23,41,.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
}

/* ---- App shell: dark-green sidebar + white canvas ---------------------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  background: var(--green-dark);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 32px; padding: 0 6px; }
/* Real GreenFlip mark: the flipped "N" — bright green on deep green. */
.mark, .brand .mark {
  width: 30px; height: 30px; border-radius: 7px;
  background: var(--green-dark); color: var(--green-bright);
  border: 1px solid rgba(30, 214, 94, .30);
  display: grid; place-items: center; font-weight: 700; font-size: 19px;
  transform: scaleX(-1);
}
.brand .name { font-weight: 700; font-size: 18px; letter-spacing: -.01em; }
.brand .name span { color: var(--green-bright); }
/* Real GreenFlip wordmark logo. Knockout = white version for dark surfaces. */
.gf-logo { height: 27px; width: auto; display: block; }
.gf-logo-knockout { filter: brightness(0) invert(1); }
/* Large mark for login + viewer cards — same flipped "N". */
.mark-lg {
  width: 46px; height: 46px; border-radius: 12px;
  background: var(--green-dark); color: var(--green-bright);
  border: 1px solid rgba(30, 214, 94, .30);
  display: grid; place-items: center; font-weight: 700; font-size: 28px;
  transform: scaleX(-1); margin-bottom: 18px;
}

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  color: rgba(255,255,255,.72); text-decoration: none;
  padding: 9px 12px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 10px;
}
.nav a.active, .nav a:hover { background: rgba(255,255,255,.10); color: #fff; }
.nav a { cursor: pointer; }
.nav-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-count { font-size: 11px; color: rgba(255,255,255,.4); }
.nav a.active .nav-count { color: rgba(255,255,255,.65); }
.nav-del { color: rgba(255,255,255,.45); font-size: 11px; visibility: hidden; }
.nav a:hover .nav-del { visibility: visible; }
.nav-del:hover { color: var(--coral); }
.nav-add { color: rgba(255,255,255,.55); margin-top: 6px; }
.section-sel { font-family: var(--font); font-size: 12px; border: 1px solid var(--border);
  border-radius: 5px; padding: 1px 5px; background: #fff; color: var(--green-base); cursor: pointer; vertical-align: middle; }
.sidebar .foot { margin-top: auto; font-size: 12px; color: rgba(255,255,255,.45); padding: 0 6px; }

.main { flex: 1; min-width: 0; padding: 32px 40px; max-width: 1100px; }

/* ---- Typography -------------------------------------------------------- */
h1 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.overline { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.subtle { color: var(--muted); font-size: 14px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 24px; gap: 16px; flex-wrap: wrap; }

/* ---- Buttons ----------------------------------------------------------- */
.btn {
  font-family: var(--font); font-size: 14px; font-weight: 600;
  border: none; border-radius: var(--radius-sm); padding: 10px 16px;
  cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  transition: filter .12s ease, background .12s ease;
}
.btn-primary { background: var(--green-cta); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: var(--tile); color: var(--ink); }
.btn-ghost:hover { background: #ebeae4; }
.btn-bright { background: var(--green-bright); color: var(--green-dark); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-ghost.danger { color: var(--coral); }
.btn-ghost.danger:hover { background: rgba(229,83,61,.10); }

/* ---- Cards + tiles ----------------------------------------------------- */
.card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
}
.tile {
  background: var(--tile); border-radius: var(--radius); padding: 16px 18px;
  display: flex; flex-direction: column; gap: 6px;
}
.tile .num { font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.tile-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }

/* ---- Chips / badges ---------------------------------------------------- */
.chip {
  font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 5px;
}
.chip-green { background: rgba(30,214,94,.14); color: #0f7a37; }
.chip-amber { background: rgba(232,163,61,.18); color: #9a6512; }
.chip-red   { background: rgba(229,83,61,.15); color: #b3331f; }
.chip-grey  { background: var(--tile); color: var(--muted); }

/* ---- Forms ------------------------------------------------------------- */
label.field { display: block; margin-bottom: 14px; }
label.field .lbl { font-size: 13px; font-weight: 600; margin-bottom: 6px; display: block; }
input[type=text], input[type=email], input[type=password], input[type=datetime-local], select {
  width: 100%; font-family: var(--font); font-size: 14px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: #fff; color: var(--ink);
}
input:focus, select:focus { outline: none; border-color: var(--green-base); box-shadow: 0 0 0 3px rgba(50,84,74,.12); }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }

/* ---- Tables / lists ---------------------------------------------------- */
.deck-list { display: flex; flex-direction: column; gap: 14px; }
.deck-item { display: flex; align-items: flex-start; gap: 16px; }
/* keep the trailing stats + action aligned with the deck title row */
.deck-item .kpis, .deck-item > .btn-bright { margin-top: 3px; }
.deck-item .thumb {
  position: relative; width: 148px; height: 92px; border-radius: 7px; overflow: hidden;
  background: #16201b; display: grid; place-items: center; flex-shrink: 0; cursor: pointer;
  border: 1px solid var(--border);
}
.deck-item .thumb canvas { display: block; }
.deck-item .thumb:hover { box-shadow: 0 0 0 2px var(--green-bright); }
.thumb-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); width: 22px; height: 22px;
  border-radius: 50%; border: none; background: rgba(0,0,0,.5); color: #fff; font-size: 14px;
  line-height: 1; cursor: pointer; display: none; place-items: center; z-index: 2;
}
.deck-item .thumb:hover .thumb-arrow { display: grid; }
.thumb-arrow.l { left: 4px; } .thumb-arrow.r { right: 4px; }
.thumb-pg { position: absolute; bottom: 3px; right: 4px; font-size: 10px; color: #fff;
  background: rgba(0,0,0,.55); padding: 1px 5px; border-radius: 8px; }
.links-more { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.more-toggle { background: none; border: none; cursor: pointer; color: var(--green-base);
  font-size: 12px; font-weight: 600; padding: 4px 0; margin-top: 2px; text-align: left; }
.more-toggle:hover { text-decoration: underline; }
.deck-item .meta { flex: 1; min-width: 0; }
.deck-item .meta .t { font-weight: 600; font-size: 15px; }
.deck-item .kpis { display: flex; gap: 22px; text-align: right; }
.deck-item .kpis .k .num { font-weight: 700; font-size: 18px; }
.deck-item .kpis .k .lbl { font-size: 11px; color: var(--muted); }

.linkline {
  display: flex; align-items: center; gap: 8px; margin-top: 6px;
  font-size: 13px; color: var(--green-base);
}
.linkline code { background: var(--tile); padding: 3px 7px; border-radius: 5px; font-size: 12px; }

/* Per-link rows with on/off toggle */
.links { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.linkrow { display: flex; align-items: center; gap: 8px; font-size: 13px; min-width: 0; }
.linkrow .linklabel { flex: none; width: 96px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linkrow code { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: var(--tile); padding: 4px 8px; border-radius: 5px; font-size: 12px; color: var(--green-base); }
.linkrow .btn, .linkrow .linkdel { flex: none; }
.linkrow code.muted-link { color: var(--muted); text-decoration: line-through; opacity: .7; }
.linkactions { display: flex; gap: 8px; margin-top: 10px; }
/* Animated on/off switch — knob slides left/right */
.switch {
  width: 40px; height: 23px; flex: none; border: none; cursor: pointer; padding: 0;
  border-radius: 999px; background: #c7c4b7; position: relative; transition: background .2s ease;
}
.switch .knob {
  position: absolute; top: 2.5px; left: 2.5px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(16,23,41,.3);
  transition: left .2s cubic-bezier(.4,.1,.3,1.45);
}
.switch.on { background: var(--green-cta); }
.switch.on .knob { left: 19.5px; }
.switch:focus-visible { outline: 2px solid var(--green-base); outline-offset: 2px; }

/* Per-link delete (✕) */
.linkdel {
  border: none; background: none; cursor: pointer; color: #b9b6a9;
  font-size: 13px; line-height: 1; padding: 4px 7px; border-radius: 6px; transition: all .12s ease;
}
.linkdel:hover { color: var(--coral); background: rgba(229,83,61,.10); }

/* ---- Heatmap (per-page dwell) ------------------------------------------ */
.heat { display: flex; gap: 4px; flex-wrap: wrap; }
.heat .cell {
  width: 38px; height: 38px; border-radius: 5px; display: grid; place-items: center;
  font-size: 11px; font-weight: 600; color: var(--ink); background: var(--tile);
}

/* ---- Modal ------------------------------------------------------------- */
.modal-bg {
  position: fixed; inset: 0; background: rgba(16,23,41,.45);
  display: none; place-items: center; z-index: 50; padding: 20px;
}
.modal-bg.show { display: grid; }
.modal { background: #fff; border-radius: 12px; padding: 26px; width: 100%; max-width: 460px; }
.modal h2 { margin-bottom: 16px; }

.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
hr.div { border: none; border-top: 1px solid var(--border); margin: 22px 0; }
