@font-face { font-family: "Barlow Condensed"; src: url('/assets/barlow-condensed-700.ttf') format('truetype'); font-style: normal; font-weight: 700; font-display: swap; }
@font-face { font-family: Inter; src: url('/assets/inter-400.ttf') format('truetype'); font-style: normal; font-weight: 400; font-display: swap; }
@font-face { font-family: Inter; src: url('/assets/inter-600.ttf') format('truetype'); font-style: normal; font-weight: 600; font-display: swap; }
@font-face { font-family: Inter; src: url('/assets/inter-700.ttf') format('truetype'); font-style: normal; font-weight: 700; font-display: swap; }

:root {
  --navy: #071323;
  --navy-raised: #0d2035;
  --orange: #ff4b0b;
  --orange-dark: #da3a00;
  --offwhite: #f7f4ef;
  --white: #fff;
  --ink: #111c29;
  --muted: #64707d;
  --line: #d9d8d4;
  --success: #11834d;
  --danger: #b62d20;
  --display: "Barlow Condensed", "Arial Narrow", "Helvetica Neue Condensed", sans-serif;
  --body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: light;
  font-family: var(--body);
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
html { min-width: 320px; background: var(--offwhite); }
body { margin: 0; color: var(--ink); background: var(--offwhite); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
svg { display: block; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }

.skip-link {
  position: fixed; z-index: 100; top: 12px; left: 12px; padding: 10px 14px;
  color: white; background: var(--orange); transform: translateY(-180%);
}
.skip-link:focus { transform: none; }

/* Auth screen */
.login-body { min-height: 100svh; background: #031426; color: var(--white); }
.login-shell { min-height: 100svh; display: grid; grid-template-columns: minmax(480px, 1fr) minmax(580px, 1fr); }
.login-brand {
  position: relative; min-height: 100%; padding: 64px 96px;
  overflow: hidden; border-right: 1px solid rgba(255,255,255,.12);
  background: radial-gradient(circle at 62% 38%, rgba(15,66,103,.27), transparent 34%), linear-gradient(145deg, #061a2e 0%, #031426 74%);
}
.login-brand > img { position: relative; z-index: 3; width: 330px; max-width: 62%; height: auto; }
.brand-signature { position: absolute; z-index: 4; top: 129px; left: 137px; display: flex; align-items: center; gap: 18px; color: #d8e0e9; font: 600 .58rem/1 Inter, sans-serif; letter-spacing: .45em; text-transform: uppercase; }
.brand-signature i { width: 70px; height: 15px; border-top: 6px solid var(--orange); border-radius: 55%; transform: rotate(-7deg) skewX(-25deg); }
.route-art { position: absolute; z-index: 1; inset: 0; opacity: .96; pointer-events: none; }
.route-art img { width: 100%; height: 100%; object-fit: fill; animation: kite-drift 7s ease-in-out infinite; }
.wind-mantra { position: absolute; z-index: 3; left: 88px; top: 48.3%; display: grid; gap: 10px; margin: 0; color: #aebbc9; font: 600 .72rem/1 var(--body); letter-spacing: .48em; text-transform: uppercase; }
.wind-mantra i { width: 32px; height: 2px; margin-top: 9px; background: var(--orange); }
.login-panel { display: grid; place-items: center; padding: 48px clamp(48px, 7vw, 120px); background: radial-gradient(circle at 49% 45%, rgba(12,54,88,.23), transparent 45%), #061528; }
.login-card { width: min(100%, 520px); }
.login-card h1 {
  margin: 0; font: 700 clamp(4rem, 5vw, 4.7rem)/.9 var(--display); letter-spacing: -.018em; white-space: nowrap;
  transform: scale(1.13, 1.2); transform-origin: left bottom;
}
.login-card h1 span { color: var(--orange); }
.login-card > p { margin: 29px 0 56px; color: #cbd2da; font-size: 1.22rem; line-height: 1.35; }
.login-card form { display: grid; }
.login-card label:not(.checkbox) { margin: 0 0 9px; font-size: 1.08rem; font-weight: 700; }
.input-wrap { position: relative; margin-bottom: 28px; }
.input-wrap > svg {
  position: absolute; top: 50%; left: 18px; width: 21px; height: 21px; transform: translateY(-50%);
  fill: none; stroke: #b9c3cf; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.input-wrap input {
  width: 100%; min-height: 66px; padding: 14px 56px; color: white; background: rgba(255,255,255,.018);
  border: 1px solid #607084; border-radius: 9px; transition: border-color 150ms ease, box-shadow 150ms ease;
}
.input-wrap input:focus { outline: none; border-color: #6aa9f4; box-shadow: 0 0 0 2px rgba(65,147,247,.72), 0 0 20px rgba(50,133,241,.24); }
.reveal-password {
  position: absolute; top: 50%; right: 13px; width: 40px; height: 40px; display: grid; place-items: center;
  color: #c5ced8; background: transparent; border: 0; border-radius: 6px; transform: translateY(-50%);
}
.reveal-password svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.login-options { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0 0 23px; color: #d4dae1; font-size: 1.02rem; }
.checkbox { display: inline-flex; align-items: center; gap: 9px; }
.checkbox input { width: 19px; height: 19px; margin: 0; accent-color: var(--orange); }
.reset-note { color: #91b9eb; cursor: help; }
.form-error { min-height: 10px; margin: 0 0 4px; color: #ff9989; font-size: .9rem; }
.primary-button {
  min-height: 60px; border: 0; border-radius: 8px; color: white; background: linear-gradient(90deg, #ff520d, #ff4a08);
  font-size: 1.08rem; font-weight: 700; transition: background 150ms ease, transform 150ms ease;
}
.primary-button:hover { background: var(--orange-dark); }
.primary-button:active { transform: translateY(1px); }
.primary-button:disabled { cursor: wait; opacity: .65; }

/* Protected shell */
.app-body { min-height: 100svh; }
.app-shell { min-height: 100svh; display: grid; grid-template-columns: 244px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100svh; display: flex; flex-direction: column; padding: 28px 8px 24px; color: white; background: var(--navy); }
.sidebar-brand { position: relative; display: flex; align-items: flex-end; gap: 9px; margin: 0 26px 42px; }
.sidebar-brand img { width: 150px; height: auto; }
.sidebar-brand > span:last-child { padding-bottom: 1px; color: #abb6c2; font-size: .87rem; letter-spacing: .08em; }
.sidebar-brand .brand-wave { position: absolute; left: 4px; bottom: -12px; width: 42px; height: 12px; border-top: 3px solid var(--orange); border-radius: 50%; transform: rotate(-5deg); }
.sidebar nav { display: grid; gap: 7px; }
.nav-link {
  position: relative; display: flex; align-items: center; gap: 14px; min-height: 54px; padding: 0 22px;
  border-radius: 5px; color: #cbd3dc; font-weight: 650; font-size: .96rem;
}
.nav-link::before { content: ""; position: absolute; inset: 0 auto 0 -8px; width: 5px; background: transparent; }
.nav-link:hover { color: white; background: rgba(255,255,255,.055); }
.nav-link.active { color: white; background: var(--navy-raised); }
.nav-link.active::before { background: var(--orange); }
.nav-link svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-link:first-child svg { fill: currentColor; stroke: none; }
.sidebar-meta { margin: auto 20px 0; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.16); color: #7f91a4; font-size: .75rem; line-height: 1.6; }
.sidebar-meta span { display: block; color: #aeb8c3; font-size: .66rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.app-column { min-width: 0; }
.topbar { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 34px; background: white; border-bottom: 1px solid var(--line); }
.topbar > p { margin: 0; font-weight: 800; font-size: 1.06rem; }
.mobile-menu { display: none; }
.user-menu { display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--navy); font-weight: 800; }
.user-menu > span:nth-child(2) { display: grid; line-height: 1.15; }
.user-menu strong { font-size: .87rem; }
.user-menu small { margin-top: 3px; color: var(--muted); font-size: .66rem; letter-spacing: .06em; }
.user-menu button { margin-left: 8px; padding: 8px 11px; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 6px; font-size: .78rem; }
.user-menu button:hover { color: var(--ink); border-color: #a6a6a3; }
.user-menu form { margin: 0; }
.app-main { position: relative; min-height: calc(100svh - 72px); padding: clamp(46px, 5vw, 76px) clamp(34px, 5vw, 72px); overflow: hidden; }
.app-main::after {
  content: ""; position: absolute; z-index: -1; right: -60px; bottom: -30px; width: min(48vw, 620px); aspect-ratio: 620 / 470;
  background: url('/assets/app-contours.svg') center / contain no-repeat; opacity: .72;
}

@keyframes kite-drift { 0%, 100% { transform: translate3d(0,0,0); } 50% { transform: translate3d(0,-7px,0); } }
.page-heading { max-width: 900px; }
.page-heading h1 { margin: 0; font: 900 clamp(3rem, 5vw, 4.8rem)/.9 var(--display); letter-spacing: -.035em; text-transform: uppercase; }
.page-heading p { max-width: 760px; margin: 20px 0 0; color: var(--muted); font-size: 1.08rem; line-height: 1.55; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, .9fr); gap: clamp(42px, 6vw, 82px); margin-top: 52px; }
.overview-grid h2 { margin: 0 0 22px; font: 900 1.85rem/1 var(--display); }
.status-row { display: grid; grid-template-columns: minmax(180px, 1.7fr) minmax(150px, .8fr); min-height: 56px; align-items: center; gap: 24px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.status-head { min-height: 38px; color: var(--muted); font-size: .78rem; font-weight: 750; }
.configured { display: inline-flex; align-items: center; gap: 10px; }
.configured > span { width: 22px; height: 22px; display: inline-grid; place-items: center; border-radius: 50%; color: white; background: var(--success); font-size: .8rem; font-weight: 900; }
.module-section { padding-left: clamp(28px, 4vw, 54px); border-left: 1px solid var(--line); }
.module-list { margin: 0; padding: 0; list-style: none; }
.module-list li { min-height: 65px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.module-list li::after { content: "→"; margin-left: auto; color: var(--muted); }
.module-list small { color: var(--muted); font-size: .72rem; }

/* User administration */
.users-page { position: relative; z-index: 1; }
.app-main:has(.users-page) { padding-inline: 40px; }
.app-main:has(.user-drawer.open) { padding-right: 430px; }
.users-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 32px; }
.add-user-button { min-height: 50px; display: inline-flex; align-items: center; gap: 10px; padding: 0 20px; border-radius: 7px; color: white; background: var(--orange); font-weight: 700; white-space: nowrap; }
.add-user-button:hover { background: var(--orange-dark); }
.add-user-button > svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.success-notice { margin: 28px 0 -8px; padding: 12px 15px; color: #0b643b; background: #e5f5eb; border-left: 4px solid var(--success); }
.user-search { position: relative; margin: 46px 0 24px; }
.user-search svg { position: absolute; top: 50%; left: 17px; width: 21px; transform: translateY(-50%); fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; }
.user-search input { width: 100%; height: 48px; padding: 0 18px 0 50px; color: var(--ink); background: rgba(255,255,255,.72); border: 1px solid #c7cbd0; border-radius: 6px; }
.user-search input:focus { outline: 2px solid rgba(255,75,11,.28); border-color: var(--orange); }
.user-table { width: 100%; font-size: .86rem; }
.user-row { display: grid; grid-template-columns: 1.25fr 1.55fr .9fr .72fr 1.08fr .5fr; min-height: 66px; align-items: center; gap: 16px; border-bottom: 1px solid var(--line); }
.user-row > span { min-width: 0; overflow-wrap: anywhere; }
.user-head { min-height: 42px; color: #526172; font-size: .73rem; font-weight: 700; }
.user-name { display: flex; align-items: center; gap: 11px; }
.user-name > i { flex: 0 0 38px; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: #18304a; background: #dbe7f3; font-style: normal; font-weight: 700; }
.user-name strong { font-weight: 600; }
.user-status { display: inline-flex; align-items: center; gap: 8px; }
.user-status > i { width: 10px; height: 10px; border-radius: 50%; background: var(--success); }
.user-status.inactive { color: var(--muted); }
.user-status.inactive > i { background: #9ca4ad; }
.self-note { color: var(--muted); font-size: .72rem; }
.user-actions { position: relative; width: max-content; margin-left: auto; }
.user-actions summary { width: 38px; height: 38px; display: grid; place-items: center; cursor: pointer; border-radius: 50%; font-weight: 800; letter-spacing: .12em; list-style: none; }
.user-actions summary::-webkit-details-marker { display: none; }
.user-actions summary:hover { background: #e9e8e4; }
.user-actions > div { position: absolute; z-index: 20; top: 42px; right: 0; width: 230px; padding: 16px; background: white; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 18px 46px rgba(7,19,35,.16); }
.user-actions form { display: grid; gap: 9px; }
.user-actions form + form { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.user-actions label { display: grid; gap: 6px; color: var(--muted); font-size: .72rem; font-weight: 700; }
.user-actions select { height: 38px; padding: 0 9px; border: 1px solid var(--line); border-radius: 5px; background: white; }
.user-actions button { min-height: 36px; padding: 0 11px; border: 0; border-radius: 5px; color: white; background: var(--navy); font-size: .78rem; font-weight: 700; }
.user-actions .danger-link { color: var(--danger); background: transparent; border: 1px solid #edc8c3; }
.empty-users { padding: 28px 0; color: var(--muted); }
.user-drawer { position: fixed; z-index: 50; top: 0; right: 0; width: min(430px, 100vw); height: 100svh; padding: 36px 30px; overflow-y: auto; background: #fff; border-left: 1px solid var(--line); box-shadow: -22px 0 58px rgba(7,19,35,.12); transform: translateX(105%); transition: transform 220ms ease; }
.user-drawer.open { transform: none; }
.drawer-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 38px; }
.drawer-heading h2 { margin: 0; font: 700 2.15rem/1 var(--display); }
.drawer-heading a { font-size: 2rem; font-weight: 300; }
.user-drawer > form { display: grid; gap: 24px; }
.user-drawer label { display: grid; gap: 9px; font-weight: 700; }
.user-drawer input, .user-drawer select { width: 100%; min-height: 50px; padding: 0 14px; color: var(--ink); background: white; border: 1px solid #c7cbd0; border-radius: 6px; }
.drawer-password { position: relative; }
.drawer-password input { padding-right: 50px; }
.drawer-password button { position: absolute; top: 50%; right: 8px; width: 38px; height: 38px; display: grid; place-items: center; padding: 0; color: var(--navy); background: transparent; border: 0; transform: translateY(-50%); }
.drawer-password svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.user-drawer input:focus, .user-drawer select:focus { outline: 2px solid rgba(255,75,11,.22); border-color: var(--orange); }
.user-drawer small { color: var(--muted); font-weight: 400; line-height: 1.4; }
.drawer-actions { display: grid; grid-template-columns: 1fr 1.12fr; gap: 12px; margin-top: 28px; }
.drawer-actions > a { min-height: 50px; display: grid; place-items: center; border: 1px solid #98a4b0; border-radius: 6px; font-weight: 700; }
.drawer-actions .primary-button { min-height: 50px; }


/* ALL-INKL staging setup and data views */
.setup-body { min-height: 100svh; color: white; background: var(--navy); }
.setup-shell { min-height: 100svh; display: grid; place-items: center; padding: 40px 20px; }
.setup-card { width: min(100%, 560px); padding: clamp(30px, 5vw, 54px); border: 1px solid #405267; border-radius: 12px; background: var(--navy-raised); box-shadow: 0 28px 80px rgba(0,0,0,.28); }
.setup-card > img { width: 230px; height: auto; margin-bottom: 38px; }
.setup-card .eyebrow { margin: 0 0 8px; color: var(--orange); font-size: .75rem; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }
.setup-card h1 { margin: 0; font: 900 clamp(2.5rem, 7vw, 4rem)/.95 var(--display); text-transform: uppercase; }
.setup-card > p:not(.eyebrow):not(.setup-error) { margin: 16px 0 28px; color: #cbd2da; line-height: 1.55; }
.setup-card form { display: grid; gap: 18px; }
.setup-card label { display: grid; gap: 8px; font-weight: 750; }
.setup-card input { min-height: 54px; padding: 12px 14px; color: white; background: rgba(255,255,255,.035); border: 1px solid #607084; border-radius: 7px; }
.setup-card input:focus { outline: none; border-color: #78a9e6; box-shadow: 0 0 0 3px rgba(76,139,220,.22); }
.setup-error { padding: 12px 14px; color: #ffd4cd; background: rgba(182,45,32,.22); border: 1px solid rgba(255,153,137,.4); border-radius: 7px; }
.content-card { margin-top: 42px; padding: 20px; background: white; border: 1px solid var(--line); border-radius: 9px; }
.data-row { display: grid; grid-template-columns: 1fr 1.5fr .8fr .65fr; align-items: center; gap: 20px; min-height: 58px; padding: 0 12px; border-bottom: 1px solid var(--line); font-size: .9rem; }
.data-row:last-child { border-bottom: 0; }
.data-head { min-height: 40px; color: var(--muted); font-size: .73rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.role-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 20px; margin-top: 44px; }
.role-card { padding: 28px; background: white; border: 1px solid var(--line); border-radius: 9px; }
.role-card p { margin: 0 0 10px; color: var(--orange); font-size: .72rem; font-weight: 850; letter-spacing: .12em; }
.role-card h2 { margin: 0 0 10px; font: 900 1.55rem/1 var(--display); }
.role-card span { color: var(--muted); line-height: 1.5; }
.not-found { min-height: 100svh; display: grid; place-content: center; text-align: center; }
.not-found h1 { margin: 0; color: var(--orange); font: 900 6rem/1 var(--display); }
.not-found a { color: var(--orange); font-weight: 800; }

@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { min-height: 170px; padding: 34px; border-right: 0; border-bottom: 1px solid rgba(255,255,255,.12); }
  .login-brand > img { width: 230px; }
  .brand-signature { display: none; }
  .route-art { inset: -64px -56px -365px 13%; opacity: .82; }
  .wind-mantra { display: none; }
  .login-panel { padding: 46px 28px 64px; place-items: start center; }
  .app-shell { grid-template-columns: 190px minmax(0, 1fr); }
  .sidebar-brand { margin-inline: 16px; }
  .sidebar-brand img { width: 116px; }
  .nav-link { padding-inline: 15px; }
  .overview-grid { grid-template-columns: 1fr; }
  .module-section { padding: 0; border-left: 0; }
}

@media (max-width: 680px) {
  .login-card h1 { font-size: 3.05rem; white-space: normal; transform: none; }
  .login-options { align-items: flex-start; flex-direction: column; gap: 12px; }
  .app-shell { display: block; }
  .sidebar { position: static; height: auto; min-height: auto; padding: 16px; }
  .sidebar-brand { margin: 0 0 15px; }
  .sidebar nav { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  .nav-link { min-height: 48px; justify-content: center; padding: 8px; font-size: .72rem; }
  .nav-link svg { width: 18px; }
  .nav-link::before, .sidebar-meta { display: none; }
  .topbar { min-height: 62px; padding: 0 18px; }
  .topbar > p { font-size: .9rem; }
  .user-menu .avatar, .user-menu > span:nth-child(2) { display: none; }
  .user-menu button { margin: 0; }
  .app-main { min-height: calc(100svh - 184px); padding: 40px 20px 60px; }
  .page-heading h1 { font-size: 2.65rem; }
  .page-heading p { font-size: .98rem; }
  .overview-grid { margin-top: 42px; }
  .status-row { grid-template-columns: 1fr; gap: 7px; padding: 14px 4px; }
  .status-head { display: none; }
  .module-list small { display: none; }
  .users-heading { display: grid; }
  .add-user-button { width: max-content; }
  .user-search { margin-top: 34px; }
  .user-table { display: block; overflow-x: auto; }
  .user-row { min-width: 840px; }
  .user-drawer { padding: 28px 22px; }
  .app-main:has(.users-page), .app-main:has(.user-drawer.open) { padding-inline: 20px; }
  .content-card { padding: 10px; overflow-x: auto; }
  .data-row { min-width: 700px; }
  .role-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
  .route-art img { animation: none; }
}
