/* Yechim Club - admin dashboard.
   Brand: deep navy, signal orange, white. Motif: the road from the logo - a dashed
   lane line runs down the sidebar and the active page is marked by an orange arrow. */

:root {
  --navy-900: #061634;
  --navy-800: #0a2152;
  --navy-700: #12306b;
  --navy-500: #3a5a9a;
  --orange: #f7931e;
  --orange-600: #e07f0a;
  --orange-50: #fff4e6;

  --bg: #f3f4f7;
  --paper: #ffffff;
  --ink: #0d1b33;
  --ink-2: #44506a;
  --muted: #7b8499;
  --line: #e3e6ee;
  --line-2: #eef0f5;

  --ok: #12805c;     --ok-bg: #e3f5ec;
  --warn: #b85c00;   --warn-bg: #fff1dc;
  --err: #c0362c;    --err-bg: #fdeceb;
  --info: #2c4f99;   --info-bg: #e8eefb;
  --dim: #98a1b3;

  --radius: 14px;
  --shadow: 0 1px 2px rgba(13, 27, 51, .05), 0 6px 20px -8px rgba(13, 27, 51, .10);
  --display: "Unbounded", "Segoe UI", sans-serif;
  --body: "Onest", "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 14.5px/1.5 var(--body); font-feature-settings: "tnum" 1;
}
a { color: var(--navy-700); text-decoration: none; font-weight: 500; }
a:hover { color: var(--orange-600); }
code { font: 12px/1.4 var(--mono); background: var(--line-2); color: var(--ink-2); padding: 2px 6px; border-radius: 6px; }
h1 { font: 700 26px/1.15 var(--display); letter-spacing: -.02em; margin: 0 0 18px; }
h2 { font: 600 15px/1.3 var(--body); margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
h3 { font: 600 11px/1.3 var(--body); margin: 18px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.right { text-align: right; }
.eyebrow { display: block; font: 600 10.5px/1 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }

/* -- shell: navy sidebar + content ------------------------------------------ */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  padding: 22px 16px 18px; color: #c9d4ee;
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(247, 147, 30, .10), transparent 60%),
    linear-gradient(180deg, var(--navy-800), var(--navy-900));
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; color: #fff; }
.brand:hover { color: #fff; }
.brand img { border-radius: 12px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .12), 0 8px 18px rgba(0, 0, 0, .35); }
.brand b { display: block; font: 700 15px/1.1 var(--display); letter-spacing: -.01em; }
.brand small { display: block; font-size: 11.5px; color: #8fa0c7; margin-top: 3px; }

/* the lane: a dashed centre line behind the menu icons */
.road { position: relative; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.road::before {
  content: ""; position: absolute; left: 21px; top: 8px; bottom: 8px; width: 2px;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, .22) 0 9px, transparent 9px 18px);
}
.road a {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 12px 9px 10px;
  border-radius: 10px; color: #c9d4ee; font-weight: 500; transition: background .15s, color .15s;
}
.road a svg {
  position: relative; z-index: 1; width: 24px; height: 24px; padding: 4px; flex: none; border-radius: 8px;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  background: var(--navy-800);
}
.road a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.road a.on { background: rgba(247, 147, 30, .12); color: #fff; }
.road a.on svg { background: var(--orange); color: var(--navy-900); }
.road a.on::after {                     /* the arrow, pointing on to the page */
  content: ""; position: absolute; right: 10px; top: 50%; width: 8px; height: 8px; margin-top: -4px;
  border-top: 2px solid var(--orange); border-right: 2px solid var(--orange); transform: rotate(45deg);
}
.logout { margin: 12px 0 0; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .08); }
.logout button.link { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 10px; color: #8fa0c7; }
.logout button.link:hover { color: #fff; }
.logout svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

main { padding: 30px 36px 60px; max-width: 1280px; width: 100%; }

/* -- page head ----------------------------------------------------------------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; }
.head-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 500;
        background: var(--paper); border: 1px solid var(--line); color: var(--ink-2); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--dim); }
.pill.ok::before { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
.pill.warn::before { background: var(--orange); }

/* -- hero band ------------------------------------------------------------------- */
.hero {
  position: relative; overflow: hidden; display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px;
  padding: 26px 28px 0; margin-bottom: 18px; border-radius: 20px; color: #fff;
  background:
    radial-gradient(80% 120% at 100% 0%, rgba(247, 147, 30, .28), transparent 55%),
    linear-gradient(135deg, var(--navy-700), var(--navy-900) 70%);
  box-shadow: 0 18px 40px -22px rgba(6, 22, 52, .7);
}
.hero::after {                          /* a lane line sweeping across the band */
  content: ""; position: absolute; left: -10%; right: -10%; bottom: 58px; height: 2px; opacity: .35;
  background: repeating-linear-gradient(90deg, #fff 0 18px, transparent 18px 34px);
  transform: rotate(-4deg);
}
.hero .eyebrow { color: #9fb0d6; }
.hero-figure { font: 700 clamp(28px, 4vw, 44px)/1.05 var(--display); letter-spacing: -.03em; }
.hero-sub { margin-top: 8px; color: #c9d4ee; font-size: 13px; }
.hero-sub .up { color: #6be3a9; } .hero-sub .down { color: #ffb38a; }
.hero-side { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-content: start; }
.hero-num { font: 700 34px/1.05 var(--display); color: var(--orange); }
.hero-num.small { font-size: 22px; color: #fff; }
.hero-num em { display: block; margin-top: 4px; font: 500 12px var(--body); color: #9fb0d6; font-style: normal; }
.hero-plans {
  position: relative; z-index: 1; grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin: 22px -28px 0; padding: 14px 28px; background: rgba(0, 0, 0, .18); color: #c9d4ee; font-weight: 400;
}
.hero-plans span { padding: 5px 11px; border-radius: 999px; background: rgba(255, 255, 255, .08); font-size: 12.5px; }
.hero-plans b { color: #fff; margin-right: 6px; }
.hero-plans i { margin-left: auto; font-style: normal; color: var(--orange); font-weight: 600; }
.hero-plans:hover { color: #fff; }

/* -- tiles --------------------------------------------------------------------------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile {
  position: relative; display: block; overflow: hidden; padding: 16px 18px 15px; border-radius: var(--radius);
  background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--ink);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--dim); }
a.tile:hover { transform: translateY(-2px); border-color: #d3d8e4; color: var(--ink); }
.tile b { display: block; font: 700 28px/1.1 var(--display); letter-spacing: -.02em; margin-bottom: 4px; }
.tile span { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.tile.t-ok::before { background: var(--ok); }
.tile.t-warn::before { background: var(--orange); }
.tile.t-warn b { color: var(--warn); }
.tile.t-info::before { background: var(--info); }
.tile.t-dim b { color: var(--dim); }
/* older templates */
.tile.warn::before { background: var(--orange); }
.tile.dim b { color: var(--dim); }

/* -- cards, tables ----------------------------------------------------------------- */
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.card.narrow { max-width: 680px; }
.h-link { margin-left: auto; font-size: 12.5px; }
.empty { color: var(--muted); padding: 10px 0; margin: 0; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
th { font: 600 10.5px/1.2 var(--body); color: var(--muted); text-transform: uppercase; letter-spacing: .09em; background: #f8f9fb; }
tr:last-child td { border-bottom: 0; }
table.wide { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
table.wide tr:hover td { background: #fafbfd; }
.card table td:first-child, .card table th:first-child { padding-left: 0; }
.card table td:last-child, .card table th:last-child { padding-right: 0; }
.card table.wide td:first-child, .card table.wide th:first-child { padding-left: 12px; }
.card table.wide td:last-child, .card table.wide th:last-child { padding-right: 12px; }
.table-scroll { overflow-x: auto; }

dl { display: grid; grid-template-columns: max-content 1fr; gap: 7px 18px; margin: 0; }
dt { color: var(--muted); }
dd { margin: 0; font-weight: 500; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px 2px 8px; border-radius: 999px;
         font-size: 11.5px; font-weight: 600; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.active, .badge.paid { background: var(--ok-bg); color: var(--ok); }
.badge.past_due, .badge.pending { background: var(--warn-bg); color: var(--warn); }
.badge.expired, .badge.failed { background: var(--err-bg); color: var(--err); }
.badge.cancelled { background: var(--info-bg); color: var(--info); }

/* activity feed */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.feed li:last-child { border-bottom: 0; }
.feed-dot { width: 9px; height: 9px; margin-top: 6px; border-radius: 50%; flex: none; background: var(--dim); }
.feed-dot.k-charged, .feed-dot.k-joined, .feed-dot.k-join { background: var(--ok); }
.feed-dot.k-charge, .feed-dot.k-unpaid, .feed-dot.k-expired { background: var(--err); }
.feed-dot.k-card, .feed-dot.k-consent, .feed-dot.k-plan { background: var(--orange); }
.feed-dot.k-dashboard, .feed-dot.k-admin { background: var(--navy-500); }

/* -- flash -------------------------------------------------------------------------- */
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 12px; margin-bottom: 16px;
         background: var(--ok-bg); color: var(--ok); border: 1px solid rgba(18, 128, 92, .18); font-weight: 500; }
.flash::before { content: "✓"; font-weight: 700; }
.flash.err { background: var(--err-bg); color: var(--err); border-color: rgba(192, 54, 44, .18); }
.flash.err::before { content: "!"; display: inline-grid; place-items: center; width: 18px; height: 18px; flex: none;
                     border-radius: 50%; background: var(--err); color: #fff; font-size: 12px; }
.flash a { color: inherit; text-decoration: underline; }

/* -- forms ------------------------------------------------------------------------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; align-items: center;
           padding: 10px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
input, select, textarea {
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; color: var(--ink);
  background: #fbfbfd; transition: border-color .15s, box-shadow .15s, background .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--orange); background: #fff; box-shadow: 0 0 0 3px rgba(247, 147, 30, .18); }
input[type=search] { min-width: 260px; flex: 1; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--orange); }
textarea { width: 100%; min-height: 110px; resize: vertical; }
label { display: block; margin: 12px 0 4px; color: var(--ink-2); font-size: 13px; font-weight: 500; }
label input, label textarea, label select { display: block; width: 100%; margin-top: 6px; }
label.inline { display: inline-flex; align-items: center; gap: 8px; }
label.inline input { display: inline; width: auto; margin: 0; }
.row { display: flex; gap: 12px; align-items: end; }
.row > * { flex: 1; }
form.card h2 { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line-2); }
form.card h2:first-of-type { margin-top: 6px; padding-top: 0; border-top: 0; }

button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--paper); font: 600 13.5px var(--body);
  cursor: pointer; color: var(--ink); transition: border-color .15s, background .15s, transform .05s;
}
button:hover, .button:hover { border-color: var(--navy-500); color: var(--ink); }
button:active { transform: translateY(1px); }
button.primary { background: var(--orange); border-color: var(--orange); color: var(--navy-900); margin-top: 18px;
                 box-shadow: 0 6px 16px -8px rgba(224, 127, 10, .8); }
button.primary:hover { background: var(--orange-600); border-color: var(--orange-600); }
button.wide { width: 100%; padding: 12px 16px; font-size: 15px; }
button.danger { color: var(--err); border-color: #f2c3bf; }
button.danger:hover { background: var(--err-bg); border-color: var(--err); }
button:disabled { opacity: .45; cursor: default; }
button.link { background: none; border: 0; padding: 0; font-weight: 500; color: var(--muted); }
.actions { display: flex; flex-direction: column; gap: 8px; }
.actions .row { align-items: center; }
.actions .row input { flex: 0 0 auto; margin: 0; }

/* plans table */
tr.dim td { color: var(--dim); }
.plan-form { gap: 6px; align-items: center; flex-wrap: wrap; }
.plan-form > * { flex: 0 0 auto; margin: 0; }
.plan-form input { padding: 7px 9px; }

/* -- login --------------------------------------------------------------------------- */
body.login { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.login-hero {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center;
  padding: 60px 8vw; color: #fff;
  background:
    radial-gradient(70% 60% at 85% 15%, rgba(247, 147, 30, .30), transparent 60%),
    linear-gradient(160deg, var(--navy-700), var(--navy-900) 65%);
}
.login-hero img { border-radius: 30px; box-shadow: 0 24px 50px -18px rgba(0, 0, 0, .6); margin-bottom: 30px; }
.login-hero h1 { font-size: clamp(30px, 4vw, 46px); margin: 0 0 12px; }
.login-hero p { max-width: 380px; color: #b6c3e2; font-size: 16px; margin: 0; }
.lane {                                  /* the road, running off the bottom */
  position: absolute; left: 50%; bottom: -40px; width: 160px; height: 260px; transform: translateX(10%) perspective(300px) rotateX(45deg);
  background:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, .8) 0 22px, transparent 22px 44px) center / 4px 100% no-repeat,
    linear-gradient(90deg, transparent 0 8px, rgba(255, 255, 255, .25) 8px 11px, transparent 11px calc(100% - 11px), rgba(247, 147, 30, .7) calc(100% - 11px) calc(100% - 8px), transparent calc(100% - 8px));
  opacity: .5;
}
.login-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--bg); }
.login-form form { width: 100%; max-width: 360px; }
.login-form h2 { font: 700 24px/1.2 var(--display); letter-spacing: -.02em; margin: 0 0 18px; display: block; }

/* -- motion ----------------------------------------------------------------------------- */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
main > * { animation: rise .45s cubic-bezier(.2, .7, .2, 1) both; }
main > *:nth-child(2) { animation-delay: .04s; }
main > *:nth-child(3) { animation-delay: .08s; }
main > *:nth-child(4) { animation-delay: .12s; }
main > *:nth-child(5) { animation-delay: .16s; }
main > *:nth-child(n+6) { animation-delay: .2s; }
.tiles .tile { animation: rise .45s cubic-bezier(.2, .7, .2, 1) both; }
.tiles .tile:nth-child(2) { animation-delay: .1s; }
.tiles .tile:nth-child(3) { animation-delay: .14s; }
.tiles .tile:nth-child(4) { animation-delay: .18s; }
.tiles .tile:nth-child(5) { animation-delay: .22s; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* -- small screens: the sidebar becomes a top bar ----------------------------------------- */
@media (max-width: 960px) {
  .cols { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { min-width: 0; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-side { grid-template-columns: 1fr 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px 14px; gap: 8px; }
  .brand { padding: 0; flex: 1; }
  .brand img { width: 36px; height: 36px; }
  .logout { margin: 0; padding: 0; border: 0; }
  .logout button.link { padding: 6px; }
  .road { order: 3; flex: 1 1 100%; flex-direction: row; overflow-x: auto; gap: 4px; scrollbar-width: none; }
  .road::before { display: none; }
  .road a { flex: none; padding: 7px 12px 7px 8px; }
  .road a.on::after { display: none; }
  .road a svg { width: 22px; height: 22px; padding: 3px; }
  main { padding: 20px 16px 48px; }
  h1 { font-size: 22px; }
  .hero { padding: 20px 18px 0; }
  .hero-plans { margin: 18px -18px 0; padding: 12px 18px; }
  table.wide { display: block; overflow-x: auto; }
  input[type=search] { min-width: 0; width: 100%; }
  .row { flex-direction: column; align-items: stretch; }
  body.login { grid-template-columns: 1fr; }
  .login-hero { padding: 40px 24px 60px; }
  .login-hero img { width: 84px; height: 84px; border-radius: 20px; margin-bottom: 18px; }
}

a.eyebrow.back { color: var(--muted); }
a.eyebrow.back:hover { color: var(--orange-600); }
.page-head .badge { align-self: center; }

/* -- applications ------------------------------------------------------------------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs a { padding: 7px 12px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line);
          color: var(--ink-2); font-size: 13px; }
.tabs a b { margin-left: 4px; color: var(--muted); font-weight: 600; }
.tabs a.on { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.tabs a.on b { color: var(--orange); }
.apps { display: grid; gap: 12px; }
.app { margin: 0; border-left: 4px solid var(--orange); }
.app.s-no_answer, .app.s-call_back { border-left-color: var(--navy-500); }
.app.s-approved { border-left-color: var(--ok); }
.app.s-rejected { border-left-color: var(--dim); opacity: .85; }
.app-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.app-head h2 { margin: 0 0 6px; font-size: 17px; }
.app-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.app .phone { font: 600 17px var(--mono); color: var(--navy-700); padding: 8px 14px; border-radius: 12px;
              background: var(--orange-50); border: 1px solid #fbd9ab; white-space: nowrap; }
.app .phone small { font: 500 11px var(--body); color: var(--ok); margin-left: 4px; }
.app .phone:hover { background: var(--orange); color: var(--navy-900); }
.position { margin: 12px 0 10px; font-size: 15px; }
.app-form textarea { min-height: 54px; margin-bottom: 10px; }
.app-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.app-actions button.primary { margin-top: 0; }
.app-actions .danger { margin-left: auto; }
.badge.new { background: var(--orange-50); color: var(--warn); }
.badge.no_answer, .badge.call_back { background: var(--info-bg); color: var(--info); }
.badge.approved { background: var(--ok-bg); color: var(--ok); }
.badge.rejected { background: var(--line-2); color: var(--muted); }
.mode-box { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px;
            background: var(--orange-50); border: 1px solid #fbd9ab; }
.mode-box input { margin-top: 3px; }
@media (max-width: 760px) { .app-actions .danger { margin-left: 0; } .app .phone { width: 100%; text-align: center; } }