/* ============================================================
   Moduflex — shared brand styles
   Colours / type from the Brand Identity Guidelines.
   ============================================================ */
:root {
  --blue:        #6FAAC4;   /* core blue  — RGB 111/170/196 */
  --blue-deep:   #4E8CA8;
  --blue-tint:   #DDEBF2;
  --blue-tint-2: #F1F7FA;
  --grey:        #8D9097;   /* core grey  — RGB 141/144/151 */
  --grey-deep:   #5F6167;
  --line:        #DBDEE2;
  --ink:         #3E4045;
  --white:       #FFFFFF;
  --danger:      #C0392B;
  --radius:      10px;
  --maxw:        720px;
  --font: "Bahnschrift", "DIN Alternate", "Segoe UI", system-ui, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }

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

a { color: var(--blue-deep); }

/* ---- Top navigation ---- */
.nav {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(0,0,0,0.02);
}
.nav__brand { display: inline-flex; align-items: center; }
.nav__brand img { height: 26px; width: auto; display: block; }
.nav__links { display: flex; gap: 20px; flex: 1; flex-wrap: wrap; }
.nav__links a {
  text-decoration: none;
  color: var(--grey-deep);
  font-size: 0.92rem;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}
.nav__links a:hover { color: var(--blue-deep); }
.nav__links a.is-active { color: var(--blue-deep); border-bottom-color: var(--blue); }
.nav__user { display: flex; align-items: center; gap: 14px; }
.nav__who { color: var(--grey); font-size: 0.85rem; white-space: nowrap; }

/* ---- Page wrapper ---- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 40px 20px 80px; }
.wrap--wide { max-width: 1100px; }

.page-head { margin-bottom: 26px; }
.page-head h1 { font-size: 1.6rem; font-weight: 400; color: var(--blue); margin: 0 0 6px; }
.page-head .lede { color: var(--grey-deep); margin: 0; }

/* ---- Card ---- */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 4px solid var(--blue);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.card__head { margin-bottom: 8px; }
.card__head h1 { font-size: 1.6rem; font-weight: 400; color: var(--blue); margin: 0 0 6px; letter-spacing: 0.01em; }
.card__head .lede { color: var(--grey-deep); margin: 0; }
.account-note { color: var(--grey); font-size: 0.85rem; margin: 14px 0 0; }

/* ---- Sections ---- */
.section { padding-top: 30px; margin-top: 30px; border-top: 1px solid var(--line); }
.section:first-of-type { border-top: 0; margin-top: 24px; padding-top: 0; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--blue);
  margin: 0 0 18px;
}

/* ---- Fields ---- */
.field { margin-bottom: 20px; }
.field:last-child { margin-bottom: 0; }
label { display: block; font-size: 0.9rem; color: var(--grey-deep); margin-bottom: 7px; }
label .req { color: var(--blue); }

input, select {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input::placeholder { color: #B8BBC0; }

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 42px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'><path d='M1 1l6 6 6-6' fill='none' stroke='%238D9097' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 16px center;
  cursor: pointer;
}
input:focus, select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-tint); }
input:focus-visible, select:focus-visible { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-tint); }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

/* ---- Buttons ---- */
.btn {
  font-family: inherit;
  font-size: 1rem;
  letter-spacing: 0.02em;
  color: var(--white);
  background: var(--blue);
  border: 0;
  border-radius: var(--radius);
  padding: 13px 30px;
  cursor: pointer;
  transition: background .15s ease;
}
.btn:hover { background: var(--blue-deep); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--blue-tint); }
.btn:disabled { opacity: .6; cursor: default; }
.btn--ghost { background: transparent; color: var(--blue); border: 1px solid var(--blue); }
.btn--ghost:hover { background: var(--blue-tint-2); }
.btn--sm { padding: 8px 16px; font-size: 0.88rem; }

/* ---- Status text ---- */
.actions { margin-top: 34px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.status { font-size: 0.9rem; }
.status--error { color: var(--danger); }
.status--ok { color: var(--blue-deep); }

/* ---- Success panel ---- */
.success {
  text-align: center;
  padding: 56px 40px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--blue);
  border-radius: var(--radius);
  background: var(--white);
}
.success svg { width: 56px; height: 56px; margin-bottom: 18px; }
.success h2 { font-size: 1.5rem; font-weight: 400; color: var(--blue); margin: 0 0 8px; }
.success p { color: var(--grey-deep); margin: 0 0 6px; }
.refbox {
  display: inline-block;
  margin: 14px 0 26px;
  padding: 10px 18px;
  background: var(--blue-tint-2);
  border: 1px solid var(--blue-tint);
  border-radius: var(--radius);
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  color: var(--grey-deep);
}

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table.data { border-collapse: collapse; width: 100%; font-size: 0.88rem; white-space: nowrap; }
table.data thead th {
  background: var(--blue-tint-2);
  color: var(--blue-deep);
  text-align: left;
  font-weight: 600;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0;
}
table.data tbody td { padding: 11px 14px; border-bottom: 1px solid var(--line); color: var(--ink); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--blue-tint-2); }
/* Frozen actions column — pinned to the right so the buttons are always
   reachable without scrolling the wide table sideways. */
table.data th.col-actions, table.data td.col-actions {
  position: sticky; right: 0; z-index: 3;
  background: var(--white);
  box-shadow: -10px 0 12px -8px rgba(15, 42, 68, 0.18);
}
table.data thead th.col-actions { background: var(--blue-tint-2); z-index: 5; }
table.data tbody tr:hover td.col-actions { background: var(--blue-tint-2); }
.muted { color: var(--grey); }
.pill {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 0.75rem; letter-spacing: 0.03em;
  background: var(--blue-tint); color: var(--blue-deep);
}
.pill--admin { background: #E7EFE4; color: #4F6B3F; }
.pill--ok { background: #E7EFE4; color: #4F6B3F; }
.pill--no { background: #F6E1DE; color: #B23A2E; }
.empty { padding: 40px; text-align: center; color: var(--grey); }
.tabs { display: flex; gap: 4px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.tab { font-family: inherit; font-size: 0.92rem; color: var(--grey-deep); background: transparent; border: 0; border-bottom: 2px solid transparent; padding: 9px 18px; cursor: pointer; margin-bottom: -1px; }
.tab:hover { color: var(--blue-deep); }
.tab.is-active { color: var(--blue-deep); border-bottom-color: var(--blue); font-weight: 600; }
.pill--done { background: #E7EFE4; color: #4F6B3F; }

/* ---- Layout review ---- */
.review-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); margin-top: 24px; }
.review-stat { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; text-align: center; background: var(--blue-tint-2); }
.review-num { display: block; font-size: 2rem; color: var(--blue); line-height: 1; }
.review-lbl { display: block; margin-top: 8px; font-size: 0.8rem; color: var(--grey-deep); }
.review-note { margin-top: 18px; color: var(--danger); font-size: 0.9rem; }
.layout-plan { margin-top: 24px; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 8px; background: #fff; }
.plan-caption { color: var(--grey); font-size: 0.82rem; margin: 10px 0 0; text-align: center; }

/* ---- Ramp selector ---- */
.ramp-guide { background: var(--blue-tint-2); border: 1px solid var(--blue-tint); border-radius: var(--radius); padding: 12px 14px; font-size: 0.86rem; color: var(--grey-deep); margin-bottom: 16px; }
.ramp-guide strong { color: var(--ink); }
.ramp-box-wrap { display: flex; justify-content: center; }
.ramp-box-wrap svg { width: 100%; max-width: 340px; height: auto; }
.ramp-line { stroke: #cbd5e1; stroke-width: 3.5; stroke-dasharray: 7 5; fill: none; }
.ramp.on .ramp-line { stroke: #ef4444; }
.ramp-hit { fill: transparent; cursor: pointer; }
.ramp-label { font-size: 12px; fill: var(--grey); pointer-events: none; }
.ramp.on .ramp-label { fill: #ef4444; font-weight: 600; }
.ramp-summary { text-align: center; color: var(--grey-deep); font-size: 0.86rem; margin: 10px 0 0; }

/* ---- Searchable contact dropdown ---- */
.combo { position: relative; }
.combo__list { position: absolute; z-index: 30; left: 0; right: 0; top: 100%; margin-top: 4px; max-height: 260px; overflow-y: auto; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 26px rgba(0,0,0,0.10); }
.combo__item { padding: 9px 12px; cursor: pointer; border-bottom: 1px solid var(--line); }
.combo__item:last-child { border-bottom: 0; }
.combo__item:hover { background: var(--blue-tint-2); }
.combo__item .nm { font-weight: 600; color: var(--ink); }
.combo__item .mt { font-size: 0.82rem; color: var(--grey); }
.contact-card { margin-top: 10px; padding: 10px 12px; background: var(--blue-tint-2); border: 1px solid var(--blue-tint); border-radius: var(--radius); font-size: 0.88rem; }

/* ---- Login ---- */
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 380px; }
.login-logo { text-align: center; margin-bottom: 26px; }
.login-logo img { width: 55%; max-width: 200px; height: auto; }

/* ---- Header logo (form page card) ---- */
.brand { text-align: center; margin-bottom: 40px; }
.brand-logo { display: inline-block; width: 60%; max-width: 240px; height: auto; }

[hidden] { display: none !important; }

@media (max-width: 560px) {
  .card, .success { padding-left: 22px; padding-right: 22px; }
  .nav { padding: 12px 16px; gap: 14px; }
  .nav__who { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
