/* ───────────────────────────────────────────────────────────────────────────
   PHONE APP UI — Nicholas Air client app prototype
   Rendered inside the .device frame. Self-contained class namespace: .app*
   ─────────────────────────────────────────────────────────────────────────── */

.app {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  font-family: var(--font-ui);
  background: var(--na-cloud);
  color: var(--na-ink);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Status bar */
.app-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 26px 6px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-ui);
  flex: 0 0 auto;
  z-index: 5;
}
.app-status .dots { display: flex; gap: 5px; align-items: center; }
.app-status .dots svg { display: block; }
.app--dark .app-status { color: #fff; }
.app--light .app-status { color: var(--na-ink); }

/* Scroll body */
.app-body {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.app-body::-webkit-scrollbar { display: none; }

/* Generic header inside a screen */
.scr-head {
  padding: 6px 22px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.scr-back {
  border: 0; background: transparent; cursor: pointer;
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; color: var(--na-brand);
  margin-left: -6px;
}
.scr-back:hover { background: rgba(42,75,240,.08); }
.scr-title { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.scr-sub { font-size: 13px; color: var(--na-muted); margin-top: 2px; }

/* Bottom tab bar */
.tabbar {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 9px 10px 26px;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(160%) blur(14px);
  border-top: 1px solid var(--na-line);
  z-index: 6;
}
.tab {
  border: 0; background: transparent; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: #9aa8b6; font-size: 10.5px; font-weight: 600; letter-spacing: .01em;
  flex: 1; padding: 2px 0;
}
.tab svg { width: 23px; height: 23px; }
.tab.active { color: var(--na-brand); }

/* ── Launch / login ───────────────────────────────────────────────────────── */
.launch {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(42,75,240,.42), transparent 60%),
    linear-gradient(180deg, #0B1A28 0%, #0a1622 100%);
  color: #fff;
  display: flex; flex-direction: column;
  justify-content: flex-end;
  padding: 0 30px 46px;
}
.launch::before {
  /* subtle horizon glow, no clip art */
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 56%;
  background:
    radial-gradient(80% 60% at 30% 30%, rgba(42,75,240,.30), transparent 70%);
  pointer-events: none;
}
.launch-logo { position: relative; margin-bottom: auto; padding-top: 92px; }
.launch-logo img { width: 188px; height: auto; }
.launch-tag {
  position: relative;
  font-family: var(--font-display); font-weight: 600;
  font-size: 26px; line-height: 1.18; letter-spacing: -.02em;
  margin: 0 0 6px;
}
.launch-sub { position: relative; color: var(--na-muted-dark); font-size: 14px; margin: 0 0 28px; max-width: 250px; }
.btn-primary {
  border: 0; cursor: pointer; width: 100%;
  background: var(--na-brand); color: #fff;
  font-family: var(--font-ui); font-weight: 700; font-size: 16px;
  padding: 16px; border-radius: 14px; letter-spacing: .01em;
  transition: background .15s ease, transform .08s ease;
}
.btn-primary:hover { background: var(--na-brand-tint); }
.btn-primary:active { transform: scale(.985); }
.btn-ghost {
  border: 1px solid rgba(255,255,255,.28); background: transparent; color: #fff;
  width: 100%; padding: 15px; border-radius: 14px; margin-top: 10px;
  font-family: var(--font-ui); font-weight: 600; font-size: 15px; cursor: pointer;
}
.btn-ghost:hover { background: rgba(255,255,255,.08); }
.launch-field {
  position: relative;
  display: block; width: 100%; margin-bottom: 10px;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.16);
  border-radius: 12px; padding: 14px 16px; color: #fff;
  font-family: var(--font-ui); font-size: 15px;
}
.launch-field::placeholder { color: rgba(255,255,255,.5); }
.launch-face {
  position: relative; text-align: center; margin-top: 18px;
  color: var(--na-muted-dark); font-size: 12.5px;
}

/* ── Home dashboard ───────────────────────────────────────────────────────── */
.home-top {
  background:
    radial-gradient(120% 120% at 80% -30%, rgba(42,75,240,.45), transparent 55%),
    linear-gradient(180deg, #0B1A28, #102234);
  color: #fff;
  padding: 4px 22px 26px;
  border-radius: 0 0 26px 26px;
}
.home-hello { display: flex; justify-content: space-between; align-items: flex-start; }
.home-hello .greet { font-size: 13px; color: var(--na-muted-dark); }
.home-hello .name { font-family: var(--font-display); font-size: 23px; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; }
.avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: 0 0 auto;
  background: var(--na-brand); color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 15px; font-family: var(--font-display);
  border: 1.5px solid rgba(255,255,255,.25);
}
.home-card {
  margin-top: 18px; background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14); border-radius: 16px;
  padding: 16px;
}
.home-card .lbl { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--na-muted-dark); }
.prog-row { display: flex; justify-content: space-between; align-items: baseline; margin-top: 6px; }
.prog-row .prog-name { font-family: var(--font-display); font-weight: 700; font-size: 18px; }
.prog-row .prog-hrs { font-family: var(--font-mono); font-size: 14px; color: #cfe6f6; }
.prog-bar { height: 6px; background: rgba(255,255,255,.16); border-radius: 99px; margin-top: 12px; overflow: hidden; }
.prog-bar > i { display: block; height: 100%; background: linear-gradient(90deg,#2A4BF0,#6E8BFF); border-radius: 99px; }

.home-pad { padding: 18px 22px 16px; }
.sec-label { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--na-muted); font-weight: 700; margin: 4px 2px 10px; }

/* Reusable surface card on light */
.card {
  background: var(--na-paper); border: 1px solid var(--na-line);
  border-radius: var(--r-md); padding: 16px;
  box-shadow: 0 1px 2px rgba(12,22,32,.04);
}
.card + .card { margin-top: 12px; }
.card.tap { cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .08s; }
.card.tap:hover { border-color: #c5d4e2; box-shadow: 0 6px 22px rgba(12,22,32,.08); }
.card.tap:active { transform: scale(.992); }

/* Trip route row (the recurring flight strip) */
.route {
  display: flex; align-items: center; gap: 12px;
}
.route .code { font-family: var(--font-mono); font-weight: 600; font-size: 22px; letter-spacing: -.01em; }
.route .mid { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.route .mid .pathline { width: 100%; height: 2px; background: repeating-linear-gradient(90deg,#c2d2e0 0 6px,transparent 6px 11px); position: relative; }
.route .mid .pathline::after { content:""; position:absolute; right:-2px; top:-3px; width:8px; height:8px; border-right:2px solid var(--na-brand); border-top:2px solid var(--na-brand); transform: rotate(45deg); }
.route .mid .dur { font-size: 10.5px; color: var(--na-muted); font-family: var(--font-mono); }
.route .city { font-size: 11px; color: var(--na-muted); }

.meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; margin-top: 14px; }
.meta-grid .k { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--na-muted); }
.meta-grid .v { font-size: 14px; font-weight: 600; margin-top: 2px; }
.meta-grid .v.mono { font-family: var(--font-mono); font-weight: 500; }

/* Pills / badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: .03em;
  padding: 5px 10px; border-radius: 99px; white-space: nowrap;
}
.badge.ok { background: rgba(31,138,91,.12); color: var(--na-positive); }
.badge.pend { background: rgba(194,138,44,.14); color: var(--na-pending); }
.badge.alert { background: rgba(182,68,46,.12); color: var(--na-alert); }
.badge.info { background: rgba(42,75,240,.12); color: var(--na-brand); }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* Quick actions grid on home */
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quick button {
  border: 1px solid var(--na-line); background: var(--na-paper); cursor: pointer;
  border-radius: var(--r-md); padding: 16px 14px; text-align: left;
  display: flex; flex-direction: column; gap: 10px; color: var(--na-ink);
  font-family: var(--font-ui); transition: border-color .15s, box-shadow .15s, transform .08s;
}
.quick button:hover { border-color: #c5d4e2; box-shadow: 0 6px 22px rgba(12,22,32,.08); }
.quick button:active { transform: scale(.985); }
.quick .qi { width: 34px; height: 34px; border-radius: 10px; background: rgba(42,75,240,.10); color: var(--na-brand); display: grid; place-items: center; }
.quick .qt { font-weight: 700; font-size: 14px; }
.quick .qs { font-size: 11.5px; color: var(--na-muted); }

/* List rows */
.row {
  display: flex; align-items: center; gap: 13px;
  padding: 13px 2px;
}
.row + .row { border-top: 1px solid var(--na-line); }
.row .ava {
  width: 38px; height: 38px; border-radius: 50%; flex: 0 0 auto;
  background: #e7eef5; color: var(--na-brand-deep); display: grid; place-items: center;
  font-weight: 700; font-size: 13px;
}
.row .rt { flex: 1; min-width: 0; }
.row .rt .t { font-weight: 600; font-size: 14px; }
.row .rt .s { font-size: 12px; color: var(--na-muted); margin-top: 1px; }
.row .chev { color: #b9c6d3; }

/* Forms */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--na-muted); font-weight: 700; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--na-line); border-radius: 11px;
  padding: 13px 14px; font-family: var(--font-ui); font-size: 15px; color: var(--na-ink);
  background: var(--na-paper); -webkit-appearance: none; appearance: none;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--na-brand); box-shadow: 0 0 0 3px rgba(42,75,240,.12); }
.field textarea { resize: none; min-height: 74px; }
.field-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-2 .field { margin-bottom: 14px; }

/* Toggles */
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 13px 0; }
.toggle-row + .toggle-row { border-top: 1px solid var(--na-line); }
.toggle-row .tl { font-size: 14px; font-weight: 600; }
.toggle {
  width: 46px; height: 28px; border-radius: 99px; border: 0; cursor: pointer;
  background: #cdd8e2; position: relative; transition: background .18s; flex: 0 0 auto;
}
.toggle::after { content:""; position:absolute; top:3px; left:3px; width:22px; height:22px; border-radius:50%; background:#fff; box-shadow:0 1px 3px rgba(0,0,0,.2); transition: left .18s; }
.toggle.on { background: var(--na-brand); }
.toggle.on::after { left: 21px; }

/* Message thread */
.thread { padding: 8px 18px 14px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 80%; padding: 11px 14px; border-radius: 16px; font-size: 13.5px; line-height: 1.4; }
.msg .when { display: block; font-size: 10px; margin-top: 5px; opacity: .65; font-family: var(--font-mono); }
.msg.rep { align-self: flex-start; background: #fff; border: 1px solid var(--na-line); border-bottom-left-radius: 5px; }
.msg.member { align-self: flex-end; background: var(--na-brand); color: #fff; border-bottom-right-radius: 5px; }
.compose { flex: 0 0 auto; display: flex; gap: 8px; padding: 10px 16px 14px; border-top: 1px solid var(--na-line); background: var(--na-paper); }
.compose input { flex: 1; border: 1px solid var(--na-line); border-radius: 99px; padding: 11px 16px; font-family: var(--font-ui); font-size: 14px; }
.compose input:focus { outline: none; border-color: var(--na-brand); }
.compose .send { border: 0; background: var(--na-brand); color: #fff; width: 42px; height: 42px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; flex: 0 0 auto; }

/* Quote approval bar */
.quote-cta { padding: 14px 22px 18px; border-top: 1px solid var(--na-line); background: var(--na-paper); flex: 0 0 auto; }
.quote-approved-note { text-align: center; color: var(--na-positive); font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 8px; }

/* Empty leg cards have an accent edge */
.leg { border-left: 3px solid var(--na-alert); }

/* Toast */
.toast {
  position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(8px);
  background: var(--na-ink); color: #fff; font-size: 13px; font-weight: 600;
  padding: 11px 18px; border-radius: 12px; opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s; white-space: nowrap; z-index: 20;
  box-shadow: 0 10px 30px rgba(0,0,0,.3);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Section divider note */
.fineprint { font-size: 11px; color: var(--na-muted); line-height: 1.5; padding: 4px 2px 0; }

/* Screen fade-in */
.screen-anim { animation: scrIn .26s ease; }
@keyframes scrIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Admin (dark operator surface to distinguish from member app) */
.app--admin { background: #0B1A28; color: #eaf2f8; }
.app--admin .app-body { background: #0B1A28; }
.adm-head { padding: 6px 22px 12px; }
.adm-head .scr-title { color: #fff; }
.adm-card {
  background: var(--na-navy-raised); border: 1px solid var(--na-line-dark);
  border-radius: var(--r-md); padding: 15px; margin-bottom: 12px;
}
.adm-card .arow { display: flex; justify-content: space-between; align-items: flex-start; }
.adm-card .client { font-family: var(--font-display); font-weight: 700; font-size: 15px; }
.adm-card .prog { font-size: 11.5px; color: var(--na-muted-dark); margin-top: 1px; }
.adm-route { font-family: var(--font-mono); font-size: 16px; margin-top: 12px; }
.adm-meta { display: flex; gap: 14px; margin-top: 8px; font-size: 12px; color: var(--na-muted-dark); flex-wrap: wrap; }
.adm-meta span { white-space: nowrap; }
.adm-meta b { color: #dbe8f2; font-weight: 600; }
.adm-kpis { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-bottom: 14px; }
.adm-kpi { background: var(--na-navy-raised); border: 1px solid var(--na-line-dark); border-radius: 12px; padding: 13px; }
.adm-kpi .n { font-family: var(--font-display); font-weight: 700; font-size: 21px; color: #fff; }
.adm-kpi .l { font-size: 10.5px; color: var(--na-muted-dark); letter-spacing: .06em; text-transform: uppercase; margin-top: 2px; }
.badge.new { background: rgba(42,75,240,.22); color: #6E8BFF; }
.badge.dark-pend { background: rgba(194,138,44,.2); color: #e0b569; }

/* Accessibility — keyboard focus + reduced motion */
.app button:focus-visible, .app a:focus-visible,
.app input:focus-visible, .app select:focus-visible, .app textarea:focus-visible {
  outline: 2px solid var(--na-brand); outline-offset: 2px;
}
.app--dark button:focus-visible, .app--admin button:focus-visible { outline-color: #6E8BFF; }
@media (prefers-reduced-motion: reduce) {
  .app, .app * { animation: none !important; transition-duration: .01ms !important; }
}
