/* ==========================================================================
   ZigSuite - one stylesheet for every business app.
   Layout: dark app rail + light workspace.
   ========================================================================== */

:root {
  --ink: #101828;
  --ink-2: #344054;
  --muted: #667085;
  --muted-2: #98a2b3;
  --line: #e4e7ec;
  --line-2: #f2f4f7;
  --bg: #f6f7fb;
  --surface: #ffffff;
  --rail: #12172b;
  --brand: #4f46e5;
  --brand-soft: #eef2ff;
  --green: #12b76a;
  --green-soft: #e7f8ef;
  --amber: #f79009;
  --amber-soft: #fef4e6;
  --red: #f04438;
  --red-soft: #feeceb;
  --blue: #2e90fa;
  --blue-soft: #e8f3ff;
  --slate-soft: #f2f4f7;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px -12px rgba(16, 24, 40, .18);
  --sidebar: 268px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }

/* ---------------------------------------------------------------- shell -- */

.shell { display: flex; min-height: 100vh; }

.rail {
  width: var(--sidebar);
  flex: 0 0 var(--sidebar);
  background: linear-gradient(180deg, var(--rail) 0%, #0b1020 100%);
  color: #cdd3e4;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.rail__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 20px 18px;
  color: #fff;
}

.rail__brand:hover { text-decoration: none; }

.rail__logo {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #22d3ee);
  display: grid; place-items: center;
  font-weight: 700; color: #0b1020;
}

.rail__brand-name { font-weight: 680; letter-spacing: -.02em; font-size: 17px; }
.rail__brand-sub { display: block; font-size: 11px; color: #8d95b5; letter-spacing: .04em; text-transform: uppercase; }

.rail__section {
  padding: 16px 20px 8px;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #737d9e;
}

.rail__group {
  padding: 12px 20px 4px;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #8d95b5;
}

.rail__nav { padding: 0 12px 24px; }

.rail__link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: #c3c9dd;
  font-weight: 520;
  margin-bottom: 2px;
}

.rail__link:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }

.rail__link.is-active {
  background: linear-gradient(90deg, rgba(99, 102, 241, .32), rgba(99, 102, 241, .08));
  color: #fff;
  box-shadow: inset 2px 0 0 #818cf8;
}

.rail__link .icon { width: 19px; height: 19px; flex: 0 0 19px; }
.rail__link-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.rail__foot { margin-top: auto; padding: 16px 20px 22px; border-top: 1px solid rgba(255, 255, 255, .08); }

.rail__org { font-size: 12px; color: #8d95b5; }
.rail__org strong { display: block; color: #e8eaf4; font-size: 13.5px; font-weight: 600; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* --------------------------------------------------------------- topbar -- */

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 28px;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar__spacer { flex: 1; }

.topbar__crumb { font-size: 13px; color: var(--muted); }
.topbar__crumb strong { color: var(--ink); font-weight: 600; }

.notif-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: var(--ink-2);
  border: 1px solid var(--line);
  background: #fff;
  text-decoration: none;
}

.notif-bell:hover { color: var(--brand); border-color: var(--brand-soft); }

.notif-bell svg { width: 18px; height: 18px; }

.notif-bell__count {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.workspace { padding: 26px 28px 60px; max-width: 1320px; width: 100%; }

/* -------------------------------------------------------------- pieces -- */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.page-head__title { font-size: 24px; }
.page-head__sub { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.page-head__actions { display: flex; gap: 10px; flex-wrap: wrap; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--slate-soft);
  color: var(--ink-2);
  white-space: nowrap;
}

.badge--green { background: var(--green-soft); color: #067647; }
.badge--amber { background: var(--amber-soft); color: #b54708; }
.badge--red { background: var(--red-soft); color: #b42318; }
.badge--blue { background: var(--blue-soft); color: #175cd3; }
.badge--slate { background: var(--slate-soft); color: var(--ink-2); }
.badge--brand { background: var(--brand-soft); color: #3538cd; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  background: var(--surface);
  color: var(--ink-2);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .05);
  white-space: nowrap;
}

.btn:hover { text-decoration: none; filter: brightness(.98); }
.btn--primary { background: var(--brand); color: #fff; }
.btn--ghost { background: transparent; color: var(--ink-2); border-color: var(--line); box-shadow: none; }
.btn--danger { background: var(--red-soft); color: #b42318; }
.btn--sm { padding: 6px 11px; font-size: 12.5px; }
.btn__icon { display: inline-flex; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  overflow: hidden;
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-2);
}

.panel__title { font-size: 15px; }
.panel__actions { display: flex; gap: 8px; align-items: center; }
.panel__body { padding: 20px; }
.panel__body--flush { padding: 0; }

.grid { display: grid; gap: 16px; }
.grid--stats { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--brand);
}

.stat--green { border-top-color: var(--green); }
.stat--amber { border-top-color: var(--amber); }
.stat--red { border-top-color: var(--red); }
.stat--blue { border-top-color: var(--blue); }
.stat--slate { border-top-color: var(--muted-2); }

.stat__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stat__label { font-size: 12.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.stat__icon { width: 20px; height: 20px; color: var(--muted-2); }
.stat__value { margin: 8px 0 2px; font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.stat__hint { margin: 0; font-size: 12.5px; color: var(--muted); }

/* --------------------------------------------------------------- table -- */

.table-wrap { overflow-x: auto; }

table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }

table.table th {
  text-align: left;
  padding: 12px 18px;
  background: #fbfbfe;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

table.table th a { color: inherit; }
table.table th a:hover { color: var(--brand); text-decoration: none; }

table.table td {
  padding: 13px 18px;
  border-bottom: 1px solid var(--line-2);
  vertical-align: middle;
}

table.table tbody tr:hover { background: #fcfcff; }
table.table tbody tr:last-child td { border-bottom: 0; }

.table__num { font-variant-numeric: tabular-nums; }
.table__actions { display: flex; gap: 8px; justify-content: flex-end; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

.toolbar {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-2);
  background: #fdfdfe;
}

.toolbar__field { display: flex; flex-direction: column; gap: 4px; }
.toolbar__field label { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.toolbar__spacer { flex: 1; }

.pagination ul { display: flex; gap: 6px; list-style: none; padding: 16px 20px; margin: 0; }
.pagination li a, .pagination li span {
  display: inline-block;
  min-width: 34px;
  text-align: center;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink-2);
  font-size: 13px;
  background: #fff;
}
.pagination li a:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.pagination li.is-active span { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }

/* CodeIgniter's own pager template markup (nav > ul.pagination). */
ul.pagination { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 16px 20px; margin: 0; }
ul.pagination li a { display: block; padding: 6px 11px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink-2); font-size: 13px; }
ul.pagination li a:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
ul.pagination li.active a { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }

/* --------------------------------------------------------------- forms -- */

.form-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }

.field { display: flex; flex-direction: column; gap: 6px; grid-column: span 12; }
.field--col-6 { grid-column: span 6; }
.field--col-4 { grid-column: span 4; }
.field--col-3 { grid-column: span 3; }
.field__label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field__label .req { color: var(--red); }
.field__hint { margin: 0; font-size: 12px; color: var(--muted); }
.field__error { margin: 0; font-size: 12px; color: #b42318; font-weight: 500; }
.field--invalid .input { border-color: var(--red); }

.input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
}

.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79, 70, 229, .13); }
.input--area { min-height: 96px; resize: vertical; }
.input--select { appearance: none; }
.input--static { padding: 10px 0; color: var(--ink-2); }
.input[readonly] { background: var(--line-2); }

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  border-top: 1px solid var(--line-2);
  margin-top: 8px;
  padding-top: 18px;
}

.form-section {
  margin: 26px 0 12px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; }
.switch__input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track {
  width: 42px; height: 24px; border-radius: 999px;
  background: #d0d5dd; position: relative; transition: background .16s ease;
  flex: 0 0 42px;
}
.switch__track::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%; background: #fff;
  transition: transform .16s ease; box-shadow: 0 1px 2px rgba(16, 24, 40, .25);
}
.switch__input:checked + .switch__track { background: var(--brand); }
.switch__input:checked + .switch__track::after { transform: translateX(18px); }
.switch__label { font-size: 13.5px; color: var(--ink-2); }

.def-list { display: grid; grid-template-columns: 200px 1fr; margin: 0; border-top: 1px solid var(--line-2); }
.def-list dt { padding: 12px 20px; font-size: 12.5px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line-2); }
.def-list dd { margin: 0; padding: 12px 20px; border-bottom: 1px solid var(--line-2); }

/* -------------------------------------------------------------- flashes -- */

.flash {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid transparent;
}

.flash--success { background: var(--green-soft); color: #05603a; border-color: #a9e6c8; }
.flash--error { background: var(--red-soft); color: #912018; border-color: #f7c6c3; }
.flash--info { background: var(--blue-soft); color: #194185; border-color: #bfdbfe; }

/* -------------------------------------------------------------- empty -- */

.empty { padding: 42px 22px; text-align: center; }
.empty__title { margin: 0 0 4px; font-size: 16px; font-weight: 620; }
.empty__text { margin: 0 0 16px; color: var(--muted); font-size: 13.5px; }

/* ------------------------------------------------------- app launcher -- */

.hero {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 45%, #4338ca 100%);
  color: #fff;
  border-radius: 18px;
  padding: 34px 34px 30px;
  margin-bottom: 24px;
}

.hero h1 { font-size: 28px; letter-spacing: -.02em; }
.hero p { margin: 10px 0 0; color: #c7d2fe; max-width: 62ch; font-size: 14.5px; }
.hero__actions { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; }

.app-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--ink);
  position: relative;
  overflow: hidden;
}

.app-card:hover { text-decoration: none; transform: translateY(-2px); border-color: #c7d2fe; }
.app-card__icon {
  width: 40px; height: 40px;
  border-radius: 11px;
  display: grid; place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
}
.app-card__icon .icon { width: 21px; height: 21px; }
.app-card__name { font-size: 16px; font-weight: 640; }
.app-card__tag { margin: 0; color: var(--muted); font-size: 13px; }
.app-card__count { font-size: 12px; color: var(--muted-2); font-weight: 600; letter-spacing: .03em; text-transform: uppercase; }
.app-card.is-locked { opacity: .62; }
.app-card__lock { position: absolute; top: 14px; right: 14px; font-size: 11px; }

/* ------------------------------------------------------------ auth -- */

.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  background: var(--surface);
}

.auth-art {
  background: linear-gradient(150deg, #1e1b4b 0%, #312e81 50%, #0ea5e9 100%);
  color: #fff;
  padding: 46px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.auth-art__logo { display: flex; align-items: center; gap: 10px; font-weight: 680; font-size: 18px; }
.auth-art h2 { font-size: 27px; letter-spacing: -.02em; }
.auth-art p { color: #cbd5f5; max-width: 46ch; margin: 0; }
.auth-art__apps { margin-top: auto; display: grid; gap: 10px; }
.auth-art__app { display: flex; gap: 10px; align-items: center; background: rgba(255, 255, 255, .1); border-radius: 12px; padding: 10px 14px; font-size: 13.5px; }
.auth-art__app .icon { width: 18px; height: 18px; }

.auth-form { padding: 54px 56px; display: flex; flex-direction: column; justify-content: center; }
.auth-form h1 { font-size: 25px; }
.auth-form__sub { color: var(--muted); margin: 6px 0 26px; font-size: 14px; }
.auth-form form { display: grid; gap: 16px; }
.auth-form__foot { margin-top: 22px; font-size: 13.5px; color: var(--muted); }
.auth-form__demo { margin-top: 26px; padding: 14px 16px; background: var(--brand-soft); border-radius: var(--radius-sm); font-size: 12.5px; color: #3538cd; }

/* --------------------------------------------------------- forbidden -- */

.denied { max-width: 620px; margin: 60px auto; text-align: center; }
.denied__code { font-size: 60px; font-weight: 700; letter-spacing: -.04em; color: var(--brand); }
.denied h1 { margin: 6px 0 10px; font-size: 22px; }
.denied p { color: var(--muted); }

/* ------------------------------------------------------------ user -- */

.user-chip { display: flex; align-items: center; gap: 9px; }

.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12.5px; font-weight: 650; color: #fff;
  background: var(--brand);
  flex: 0 0 34px;
}

.avatar--sm { width: 26px; height: 26px; font-size: 11px; flex-basis: 26px; }

.user-chip__meta { line-height: 1.25; }
.user-chip__name { font-size: 13.5px; font-weight: 600; }
.user-chip__role { font-size: 11.5px; color: var(--muted); }

.meta-row { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.meta-row strong { color: var(--ink-2); font-weight: 600; }

.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 20px; align-items: start; }

.activity { list-style: none; margin: 0; padding: 6px 0; }
.activity li { display: flex; gap: 12px; padding: 11px 20px; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.activity li:last-child { border-bottom: 0; }
.activity__time { color: var(--muted); font-size: 12px; white-space: nowrap; }

.progress { height: 7px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.progress__bar { height: 100%; background: var(--brand); border-radius: 999px; }

.icon-tile {
  display: grid; place-items: center;
  width: 38px; height: 38px; flex: 0 0 38px;
  border-radius: 10px; background: var(--brand-soft); color: #3538cd;
}
.icon-tile .icon { width: 19px; height: 19px; }

.stack { display: grid; gap: 4px; }
.stack strong { font-weight: 620; font-size: 14px; }
.stack span { font-size: 12.5px; color: var(--muted); }

.app-row { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.app-row:last-child { border-bottom: 0; }
.app-row__body { flex: 1; min-width: 0; }
.app-row__meta { display: flex; gap: 8px; align-items: center; margin-top: 4px; flex-wrap: wrap; }
.app-row__toggle { display: flex; gap: 12px; align-items: center; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  background: var(--slate-soft); color: var(--ink-2);
  font-size: 11.5px; font-weight: 600;
}
.chips { display: flex; gap: 6px; flex-wrap: wrap; }

.choice-grid { display: grid; gap: 8px; }
.choice {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 13px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: 13.5px; cursor: pointer;
}
.choice input { accent-color: var(--brand); margin: 0; }
.choice:hover { border-color: #c7d2fe; }

.access-list { display: grid; gap: 12px; }
.access-row { display: grid; gap: 8px; padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.access-row:last-child { border-bottom: 0; padding-bottom: 0; }
.access-row__head { display: flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 600; }

.pager-wrap { border-top: 1px solid var(--line-2); }

/* In-app tab bar (see app_tabs()) */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 18px; border-bottom: 1px solid var(--line-2); }
.tabs__tab {
    padding: 9px 13px; font-size: 13.5px; font-weight: 600; color: var(--muted);
    border-radius: 9px 9px 0 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs__tab:hover { color: var(--ink); background: var(--slate-soft); text-decoration: none; }
.tabs__tab.is-active { color: var(--brand); border-bottom-color: var(--brand); }

/* Dashboard bits shared by the app modules */
.bars { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 120px 1fr 64px; align-items: center; gap: 12px; }
.bar-row__label { font-size: 13px; font-weight: 600; color: var(--muted); }
.bar-row__value { font-size: 13px; font-weight: 600; text-align: right; }
.mini-list { display: grid; gap: 2px; }
.mini-row {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 11px 0; border-bottom: 1px solid var(--line-2);
}
.mini-row:last-child { border-bottom: 0; }
.mini-row__main { display: grid; gap: 2px; min-width: 0; }
.mini-row__title { font-size: 13.5px; font-weight: 600; }
.mini-row__meta { font-size: 12.5px; color: var(--muted); }
.link-list { display: grid; gap: 2px; }
.link-list a {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 10px 12px; border-radius: 10px; font-size: 13.5px; font-weight: 600;
}
.link-list a:hover { background: var(--slate-soft); text-decoration: none; }
.danger-zone { display: grid; gap: 10px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-row .btn[aria-current="true"] { border-color: var(--brand); color: var(--brand); }

/* --------------------------------------------------------- kanban board -- */
.board { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; align-items: start; }
.board__col {
  background: var(--slate-soft);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  padding: 12px;
}
.board__col--won { background: #ecfdf3; border-color: #bbf7d0; }
.board__col--lost { background: #fff1f2; border-color: #fecdd3; }
.board__col-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 2px 10px; }
.board__col-title { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.board__col-total { font-size: 12px; color: var(--muted); }
.board__cards { display: grid; gap: 8px; }
.board__card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 11px;
  box-shadow: var(--shadow);
}
.board__card-title { font-size: 13.5px; font-weight: 650; color: var(--ink); }
.board__card-meta { margin-top: 3px; font-size: 12px; color: var(--muted); }
.board__card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 9px; }
.board__card select.input { padding: 4px 6px; font-size: 12px; width: auto; max-width: 130px; }

@media (max-width: 1020px) {
  .split { grid-template-columns: 1fr; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-form { padding: 34px 24px; }
}

@media (max-width: 900px) {
  .rail { position: fixed; z-index: 40; transform: translateX(-100%); transition: transform .2s ease; }
  body.rail-open .rail { transform: none; }
  .workspace { padding: 20px 16px 60px; }
  .topbar { padding: 12px 16px; }
}

@media (min-width: 901px) { .rail-toggle { display: none; } }

/* ======================================================= public pages == */
/* No app chrome: a soft canvas, one centred column, and the answer cards
   stacked the way a Google Form reads. */

@keyframes pub-rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

.pub-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: #f4f5fb;
}

/* Aurora wash across the top of the page - no extra markup needed. */
.pub-body::before {
  content: "";
  position: fixed;
  top: -280px; left: 50%;
  width: min(1100px, 135vw); height: 640px;
  transform: translateX(-50%);
  background:
    radial-gradient(closest-side, rgba(99, 102, 241, .30), rgba(99, 102, 241, 0)),
    radial-gradient(closest-side at 76% 62%, rgba(34, 211, 238, .22), rgba(34, 211, 238, 0));
  pointer-events: none;
  z-index: 0;
}

.pub-shell {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
  padding: 54px 20px 8px;
}

.pub-foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 26px 20px 34px;
  font-size: 12.5px;
  color: var(--muted);
}

.pub-foot__mark {
  display: grid; place-items: center;
  width: 22px; height: 22px; border-radius: 7px;
  background: linear-gradient(135deg, #6366f1, #22d3ee);
  color: #0b1020; font-size: 10.5px; font-weight: 700;
}

.gform { display: grid; gap: 12px; }

.gform__card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 18px 40px -32px rgba(16, 24, 40, .45);
}

/* ----------------------------------------------------- title card -- */

.gform__head {
  position: relative;
  padding: 34px 30px 28px;
  overflow: hidden;
}

.gform__head::before {
  content: "";
  position: absolute; inset: 0 0 auto;
  height: 9px;
  background: linear-gradient(90deg, #4f46e5, #7c3aed 48%, #22d3ee);
}

.gform__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 2px 0 14px;
  padding: 4px 11px 4px 9px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: #3538cd;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.gform__eyebrow-icon { width: 14px; height: 14px; }

.gform__title {
  font-size: 30px;
  font-weight: 680;
  line-height: 1.18;
  letter-spacing: -.028em;
}

.gform__desc {
  margin: 16px 0 0;
  padding-top: 15px;
  border-top: 1px solid var(--line-2);
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 1.6;
}

/* --------------------------------------------------- alerts and empty -- */

.gform__alert {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 14px 18px;
  border: 1px solid #f7c6c3;
  border-radius: 14px;
  background: var(--red-soft);
  color: #912018;
  font-size: 13.5px;
  font-weight: 600;
}

.gform__alert-icon { width: 18px; height: 18px; flex: 0 0 18px; margin-top: 1px; }

.gform__empty { padding: 44px 30px; text-align: center; }
.gform__empty-icon { width: 34px; height: 34px; color: var(--muted-2); }
.gform__empty h2 { margin: 14px 0 6px; font-size: 19px; }
.gform__empty p { margin: 0; color: var(--muted); font-size: 14px; }

/* ------------------------------------------------------- questions -- */

.gform__body { display: grid; gap: 14px; }

/* One card per question, so the app form grid becomes a plain stack. */
.gform .form-grid { display: block; }

.gform .field {
  gap: 9px;
  margin-bottom: 12px;
  padding: 22px 24px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
  transition: border-color .16s ease, box-shadow .16s ease;
}

.gform .field:hover {
  border-color: #d9dbe7;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 16px 34px -28px rgba(16, 24, 40, .6);
}

.gform .field:focus-within {
  border-color: #c3c5f7;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 18px 34px -26px rgba(79, 70, 229, .55);
}

/* Beats the `:focus-within` above so the red survives while the answer is
   being corrected; the focus shadow still comes from that rule. */
.gform .field--invalid,
.gform .field--invalid:focus-within { border-color: #f7c6c3; background: #fffbfb; }

.gform .field__label {
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: -.01em;
  color: var(--ink);
}

.gform .field__label .req { font-weight: 700; }
.gform .field__hint { font-size: 12.5px; }
.gform .field__error { font-size: 12.5px; }

/* Short answers are underlined, the way a Google Form draws them. */
.gform .input {
  padding: 9px 2px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: 15px;
  transition: border-color .16s ease, box-shadow .16s ease;
}

.gform .input:hover { border-bottom-color: var(--muted-2); }

.gform .input:focus {
  outline: none;
  border-bottom-color: var(--brand);
  box-shadow: 0 1px 0 0 var(--brand);
}

.gform .input::placeholder { color: var(--muted-2); }

/* Long answers and dropdowns keep their box. */
.gform .input--area,
.gform .input--select {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.gform .input--area { min-height: 108px; }

.gform .input--area:focus,
.gform .input--select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .13);
}

.gform .input--select {
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  background-size: 17px 17px;
  cursor: pointer;
}

/* The underline above outranks the suite's own `.field--invalid .input`, so
   restate the red here - validation stays red even while being corrected. */
.gform .field--invalid .input { border-color: var(--red); }

.gform .field--invalid .input:focus {
  border-color: var(--red);
  box-shadow: 0 1px 0 0 var(--red);
}

.gform .field--invalid .input--area:focus,
.gform .field--invalid .input--select:focus { box-shadow: 0 0 0 3px var(--red-soft); }

/* Yes / no answers */
.gform .choices { display: flex; flex-wrap: wrap; gap: 10px; }

.gform .choice {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 18px 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-2);
  font-size: 14px;
  cursor: pointer;
  transition: border-color .14s ease, background .14s ease, color .14s ease;
}

.gform .choice:hover { border-color: #c7d2fe; background: #fbfbff; }
.gform .choice input { width: 16px; height: 16px; margin: 0; accent-color: var(--brand); }

.gform .choice:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: #3538cd;
  font-weight: 600;
}

/* ---------------------------------------------------------- submit -- */

.gform__legend {
  margin: 2px 2px 0;
  color: var(--red);
  font-size: 12.5px;
  font-weight: 600;
}

.gform__submit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 4px 2px 0;
}

.gform__btn {
  padding: 12px 26px;
  border-radius: 10px;
  font-size: 14.5px;
  background: linear-gradient(135deg, #4f46e5, #6d28d9);
  box-shadow: 0 12px 24px -14px rgba(79, 70, 229, .85);
  transition: transform .16s ease, filter .16s ease, box-shadow .16s ease;
}

.gform__btn:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
  box-shadow: 0 16px 28px -14px rgba(79, 70, 229, .9);
}

.gform__btn:active { transform: translateY(0); }
.gform__btn:focus-visible { outline: 2px solid #7c3aed; outline-offset: 2px; }

.gform__safe { margin: 0; color: var(--muted); font-size: 12.5px; }
.gform__safe--centred { margin-top: 4px; text-align: center; }

/* ------------------------------------------------- thanks and errors -- */

.gform__done { padding: 44px 30px 42px; text-align: center; }

.gform__done-icon {
  display: grid;
  place-items: center;
  width: 64px; height: 64px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
}

.gform__done-icon .icon { width: 30px; height: 30px; }
.gform__done h1, .gform__done h2 { font-size: 23px; letter-spacing: -.02em; }

.gform__done p {
  max-width: 46ch;
  margin: 10px auto 0;
  color: var(--muted);
  font-size: 14.5px;
}

.gform__done--warn .gform__done-icon { background: var(--amber-soft); color: var(--amber); }

/* ------------------------------------------------------- entrance -- */

.gform__card,
.gform__alert,
.gform .field {
  animation: pub-rise .44s cubic-bezier(.21, .68, .35, 1) backwards;
}

.gform .form-grid > .field:nth-child(1) { animation-delay: .05s; }
.gform .form-grid > .field:nth-child(2) { animation-delay: .10s; }
.gform .form-grid > .field:nth-child(3) { animation-delay: .15s; }
.gform .form-grid > .field:nth-child(4) { animation-delay: .20s; }
.gform .form-grid > .field:nth-child(5) { animation-delay: .25s; }
.gform .form-grid > .field:nth-child(6) { animation-delay: .30s; }
.gform .form-grid > .field:nth-child(n+7) { animation-delay: .35s; }

@media (prefers-reduced-motion: reduce) {
  .gform__card,
  .gform__alert,
  .gform .field { animation: none; }
  .gform__btn:hover { transform: none; }
}

@media (max-width: 620px) {
  .pub-shell { padding: 30px 14px 6px; }
  .gform__head { padding: 28px 20px 22px; }
  .gform__title { font-size: 24px; }
  .gform .field { padding: 18px 18px 16px; border-radius: 14px; }
  .gform__submit { flex-direction: column; align-items: stretch; }
  .gform__btn { justify-content: center; }
  .gform__safe { text-align: center; }
}

/* ====================================================== module shells == */
/* The base vocabulary every app layout is built from. Each module ships its
   own shell (Modules/<App>/Views/layouts/app.php) and its own stylesheet in
   assets/css/modules/<slug>.css, which only has to describe the parts that
   make that app look like itself: how wide its canvas is, where its nav sits,
   what its masthead is made of. Everything a layout needs to place itself is
   here, so a module stylesheet stays small and the suite keeps one place for
   the shared behaviour. */

.mod-body { min-height: 100vh; }

.mod-shell { display: flex; min-height: 100vh; }

.mod-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* Bars and mastheads stick to the top of the scrolling canvas. */
.mod-bar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.mod-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.mod-head__mark {
  width: 40px; height: 40px; flex: 0 0 40px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--mod-accent, var(--brand));
  color: #fff;
}

.mod-head__mark .icon { width: 21px; height: 21px; }

.mod-head__text { min-width: 0; }

.mod-head__title { font-size: 17px; font-weight: 680; letter-spacing: -.01em; }

.mod-head__sub {
  margin: 1px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.mod-head__actions { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* App navigation, rendered as a strip, an outline or a drawer. */
.mod-nav { display: flex; align-items: center; gap: 6px; padding: 0 28px; }

.mod-nav__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 13px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.mod-nav__item:hover { color: var(--ink); text-decoration: none; }

.mod-nav__item.is-active {
  color: var(--mod-accent, var(--brand));
  border-bottom-color: var(--mod-accent, var(--brand));
}

.mod-nav__icon { width: 17px; height: 17px; flex: 0 0 17px; }

.mod-nav__step {
  display: grid; place-items: center;
  width: 20px; height: 20px; flex: 0 0 20px;
  border-radius: 50%;
  font-size: 11px; font-weight: 700;
  background: var(--line-2);
  color: var(--muted);
}

.mod-nav__item.is-active .mod-nav__step { background: var(--mod-accent, var(--brand)); color: #fff; }

.mod-nav__label { overflow: hidden; text-overflow: ellipsis; }

.mod-canvas { padding: 26px 28px 60px; width: 100%; }

.mod-search { display: flex; align-items: center; gap: 8px; }

.mod-search .input { width: 220px; padding: 6px 12px; font-size: 13px; border-radius: 999px; }

.mod-side { flex: 0 0 auto; }

.mod-side__title {
  margin: 0;
  padding: 0 0 10px;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.mod-side .mod-nav { flex-direction: column; align-items: stretch; gap: 2px; padding: 0; }

.mod-side .mod-nav__item { border-bottom: 0; border-radius: var(--radius-sm); }

.mod-side .mod-nav__item.is-active { background: var(--mod-accent-soft, var(--brand-soft)); }

@media (max-width: 900px) {
  .mod-head { padding: 14px 16px; }
  .mod-nav, .mod-canvas { padding-left: 16px; padding-right: 16px; }

  /* Nav strips collapse into a drawer the rail toggle opens, so a module
     without a rail of its own still has working navigation on a phone. */
  .mod-shell--stacked .mod-nav {
    display: none;
    flex-direction: column; align-items: stretch; gap: 2px;
    padding: 10px 16px 14px;
    border-bottom: 1px solid var(--line);
  }
  .mod-shell--stacked .mod-nav__item { border-bottom: 0; border-radius: var(--radius-sm); }
  .mod-shell--stacked .mod-nav__item.is-active { background: var(--mod-accent-soft, var(--brand-soft)); }
  body.rail-open .mod-shell--stacked .mod-nav { display: flex; }
}

@media (min-width: 901px) { .rail-toggle { display: none; } }

/* ------------------------------------------------------------- notifications -- */

.notif-list { display: flex; flex-direction: column; }

.notif-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 20px;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.notif-row:last-child { border-bottom: 0; }

.notif-row:hover { background: var(--slate-soft); }

.notif-row.is-unread { background: var(--brand-soft); }

.notif-row__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }

.notif-row__title { font-size: 13.5px; font-weight: 650; color: var(--ink); }

.notif-row__body { font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.notif-row__time { font-size: 12px; color: var(--muted); }

.notif-row__dot { width: 9px; height: 9px; margin-top: 6px; border-radius: 50%; background: var(--brand); flex: 0 0 auto; }

