/* Tlou Moka Suppliers — Inquiry Desk
   Brand: royal blue + gold on deep navy. Headings: Montserrat (matches the logo). Body: Inter. */
:root {
  --blue: #117EC2; --blue-dark: #0A5C93; --blue-soft: #E6F3FB;
  --navy: #0A2540; --navy-deep: #061829; --navy-mid: #123A63;
  --gold: #F8C901; --gold-dark: #D9AC00; --gold-soft: #FFF6CC;
  --steel: #5B6B7F; --steel-light: #93A3B5;
  --bg: #F3F6FA; --surface: #FFFFFF; --text: #0F1C2E; --text-muted: #5B6B7F;
  --border: #E1E8F0; --success: #1F8A5B; --success-bg: #E6F5EE;
  --danger: #C13B31; --danger-bg: #FCECEA;
  --open-bg: #EDF2F7; --progress-bg: #FFF3C7;
  --radius: 12px; --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(10,37,64,.06), 0 1px 3px rgba(10,37,64,.05);
  --shadow: 0 6px 20px rgba(10,37,64,.08);
  --shadow-lg: 0 18px 50px rgba(6,24,41,.28);
  --ease: cubic-bezier(.22,.8,.24,1);
  --amber: var(--gold); --amber-dark: #9A7A00;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--text); font-family: 'Inter', -apple-system, 'Segoe UI', sans-serif; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3, h4, .brand-font { font-family: 'Montserrat', 'Inter', sans-serif; letter-spacing: -0.01em; margin: 0; }
button { font-family: inherit; cursor: pointer; }
a { color: inherit; }
::selection { background: var(--gold); color: var(--navy); }

/* ---------- Auth pages ---------- */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--surface); }
.auth-hero { position: relative; overflow: hidden; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px; text-align: center;
  background: radial-gradient(1200px 600px at 10% -10%, #17568f 0%, transparent 60%), radial-gradient(900px 500px at 110% 110%, #0d4a7d 0%, transparent 55%), linear-gradient(160deg, #0A2540 0%, #061829 100%); }
.auth-hero::before, .auth-hero::after { content: ""; position: absolute; border-radius: 50%; filter: blur(2px); opacity: .5; animation: float 14s ease-in-out infinite; }
.auth-hero::before { width: 420px; height: 420px; right: -140px; top: -120px; border: 60px solid rgba(248,201,1,.14); }
.auth-hero::after { width: 320px; height: 320px; left: -110px; bottom: -100px; border: 44px solid rgba(17,126,194,.28); animation-delay: -6s; }
.auth-hero img { position: relative; z-index: 1; width: min(380px, 70%); height: auto; animation: rise .9s var(--ease) both; filter: drop-shadow(0 12px 30px rgba(0,0,0,.35)); }
.auth-hero .tagline { position: relative; z-index: 1; margin-top: 28px; font-family: 'Montserrat', sans-serif; font-weight: 600; letter-spacing: .32em; font-size: 12px; color: var(--gold); text-transform: uppercase; animation: rise .9s .15s var(--ease) both; }
.auth-hero .blurb { position: relative; z-index: 1; margin-top: 10px; max-width: 360px; color: #B9CCE0; font-size: 14px; line-height: 1.6; animation: rise .9s .25s var(--ease) both; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 32px; background: linear-gradient(180deg, #fff 0%, #F3F6FA 100%); }
.auth-card { width: 100%; max-width: 400px; animation: rise .7s .1s var(--ease) both; }
.auth-brand { display: none; margin-bottom: 22px; }
.auth-brand img { height: 84px; width: auto; }
.auth-card h2 { font-size: 28px; font-weight: 800; color: var(--navy); margin-bottom: 6px; }
.auth-card .sub-line { font-size: 14px; color: var(--text-muted); margin-bottom: 26px; line-height: 1.5; }
@media (max-width: 860px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .auth-brand { display: block; }
}

/* ---------- Forms ---------- */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--navy); margin-bottom: 6px; letter-spacing: .01em; }
.field input, .field select, .field textarea {
  width: 100%; border: 1.5px solid var(--border); border-radius: 10px; padding: 12px 14px; font-size: 14px; font-family: inherit; color: var(--text); background: var(--surface);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.field input::placeholder, .field textarea::placeholder { color: #A5B2C1; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: #C5D3E2; }
.field textarea { resize: vertical; min-height: 92px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(17,126,194,.15); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: 10px; font-size: 13.5px; font-weight: 600; border: 1.5px solid transparent; transition: transform .18s var(--ease), box-shadow .2s, background .2s, border-color .2s, color .2s; white-space: nowrap; position: relative; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { background: linear-gradient(135deg, #FFD83A 0%, var(--gold) 55%, #EBB900 100%); color: var(--navy); width: 100%; box-shadow: 0 6px 16px rgba(248,201,1,.35); font-weight: 700; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(248,201,1,.45); }
.btn-navy { background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%); color: #fff; box-shadow: 0 4px 12px rgba(17,126,194,.28); }
.btn-navy:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(17,126,194,.36); }
.btn-outline { background: var(--surface); color: var(--navy); border-color: var(--border); }
.btn-outline:hover { border-color: var(--blue); color: var(--blue-dark); background: var(--blue-soft); transform: translateY(-1px); }
.btn-sm { padding: 7px 12px; font-size: 12px; border-radius: 8px; }
.btn.active-toggle { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.card-actions .btn-primary { width: auto; }

.form-error { background: var(--danger-bg); color: var(--danger); border: 1px solid #F3C4BF; padding: 11px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 18px; animation: shake .4s; }
.form-success { background: var(--success-bg); color: var(--success); border: 1px solid #BFE6D3; padding: 11px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 18px; }
.link-row { text-align: center; margin-top: 18px; font-size: 13px; color: var(--text-muted); }
.link-row a { color: var(--blue-dark); font-weight: 600; text-decoration: none; border-bottom: 1.5px solid rgba(17,126,194,.3); transition: border-color .2s, color .2s; }
.link-row a:hover { color: var(--blue); border-color: var(--blue); }

/* ---------- App shell ---------- */
#app { display: flex; min-height: 100vh; }
.splash { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.splash img { width: 150px; animation: pulse 1.4s ease-in-out infinite; }

.sidebar { width: 268px; flex-shrink: 0; color: #DCE7F2; display: flex; flex-direction: column; padding: 22px 16px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: radial-gradient(500px 280px at 0% 0%, rgba(17,126,194,.35), transparent 65%), linear-gradient(180deg, #0A2540 0%, #061829 100%); }
.brand { padding: 6px 8px 22px; border-bottom: 1px solid rgba(255,255,255,.1); margin-bottom: 18px; text-align: center; }
.brand-logo { width: 150px; max-width: 100%; height: auto; display: block; margin: 0 auto; filter: drop-shadow(0 6px 14px rgba(0,0,0,.35)); }
.brand-sub { margin-top: 12px; font-family: 'Montserrat', sans-serif; font-size: 10.5px; font-weight: 700; letter-spacing: .3em; color: var(--gold); }
nav.sidenav { display: flex; flex-direction: column; gap: 4px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; color: #B7C7D9; font-size: 13.5px; font-weight: 500; background: transparent; border: none; text-align: left; width: 100%; position: relative; transition: background .25s var(--ease), color .2s, transform .25s var(--ease); }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s var(--ease), color .2s; }
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; transform: translateX(3px); }
.nav-item:hover svg { transform: scale(1.1); }
.nav-item.active { background: linear-gradient(90deg, rgba(17,126,194,.45), rgba(17,126,194,.12)); color: #fff; font-weight: 600; }
.nav-item.active::before { content: ""; position: absolute; left: -16px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--gold); animation: grow .35s var(--ease); }
.nav-item.active svg { color: var(--gold); }
.nav-badge { margin-left: auto; background: var(--gold); color: var(--navy-deep); font-size: 10.5px; font-weight: 800; padding: 2px 7px; border-radius: 10px; animation: pop .4s var(--ease); }
.sidebar-footer { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.1); }
.who-card { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; padding: 12px; font-size: 12px; display: flex; gap: 10px; align-items: center; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--gold), #EBB900); color: var(--navy); font-weight: 800; font-family: 'Montserrat', sans-serif; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.who-card .u-name { font-weight: 600; color: #fff; font-size: 13px; }
.who-card .u-role { color: #9FB6CC; font-size: 11px; margin-top: 2px; word-break: break-all; }
.logout-link { display: block; margin-top: 12px; font-size: 12px; color: #9FB6CC; background: none; border: none; padding: 4px 2px; text-align: left; transition: color .2s; }
.logout-link:hover { color: var(--gold); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { background: rgba(255,255,255,.82); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid var(--border); padding: 18px 32px; display: flex; align-items: center; justify-content: space-between; gap: 16px; position: sticky; top: 0; z-index: 5; }
.topbar h1 { font-size: 22px; font-weight: 800; color: var(--navy); position: relative; padding-bottom: 6px; }
.topbar h1::after { content: ""; position: absolute; left: 0; bottom: 0; width: 34px; height: 3px; border-radius: 3px; background: var(--gold); animation: grow-w .5s var(--ease); }
.topbar .clock { font-size: 12.5px; color: var(--text-muted); text-align: right; font-weight: 500; }
.content { padding: 28px 32px 64px; flex: 1; }

/* Page transition: applied only when the view changes */
.view-enter > * { animation: rise .55s var(--ease) both; }
.view-enter > *:nth-child(2) { animation-delay: .06s; }
.view-enter > *:nth-child(3) { animation-delay: .12s; }
.view-enter > *:nth-child(4) { animation-delay: .18s; }
.view-enter .card, .view-enter .stat-card, .view-enter .perf-card { animation: rise .55s var(--ease) both; }
.view-enter .board > div:nth-child(1) .card { animation-delay: .08s; }
.view-enter .board > div:nth-child(2) .card { animation-delay: .16s; }
.view-enter .board > div:nth-child(3) .card { animation-delay: .24s; }
.view-enter .stat-card:nth-child(2) { animation-delay: .06s; } .view-enter .stat-card:nth-child(3) { animation-delay: .12s; } .view-enter .stat-card:nth-child(4) { animation-delay: .18s; }

/* ---------- Board ---------- */
.toggle-row { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.board { display: grid; grid-template-columns: repeat(3,1fr); gap: 22px; align-items: start; }
@media (max-width: 1100px) { .board { grid-template-columns: 1fr; } }
.col-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 12px; }
.col-head h3 { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--steel); }
.col-count { background: var(--surface); border: 1px solid var(--border); font-size: 11px; font-weight: 700; color: var(--navy); padding: 2px 10px; border-radius: 20px; box-shadow: var(--shadow-sm); }
.col-strip { height: 4px; border-radius: 4px; margin-bottom: 12px; }
.strip-open { background: linear-gradient(90deg, var(--steel-light), #C5D3E2); } .strip-progress { background: linear-gradient(90deg, var(--gold), #FFE066); } .strip-completed { background: linear-gradient(90deg, var(--success), #5FC79A); }
.col-body { display: flex; flex-direction: column; gap: 14px; min-height: 40px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s; position: relative; overflow: hidden; }
.card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--steel-light); transition: background .2s; }
.card-open::before { background: var(--steel-light); } .card-in_progress::before { background: var(--gold); } .card-completed::before { background: var(--success); }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #CFE0EE; }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.card-ticket { font-size: 11px; font-weight: 700; color: var(--blue); letter-spacing: .06em; }
.card-company { font-family: 'Montserrat', sans-serif; font-size: 15.5px; font-weight: 700; color: var(--navy); margin-top: 2px; line-height: 1.3; }
.badge { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 3px 9px; border-radius: 20px; white-space: nowrap; }
.badge-open { background: var(--open-bg); color: var(--steel); }
.badge-progress { background: var(--progress-bg); color: #8A6A00; }
.badge-completed { background: var(--success-bg); color: var(--success); }
.badge-urgent { background: var(--danger-bg); color: var(--danger); }
.badge-method { background: var(--blue-soft); color: var(--blue-dark); }
.card-items { font-size: 13.5px; margin-top: 10px; line-height: 1.55; color: #22354B; }
.card-contact { font-size: 12px; color: var(--text-muted); margin-top: 12px; background: var(--bg); border-radius: 10px; padding: 9px 12px; line-height: 1.65; }
.card-contact b { color: var(--navy); }
.card-meta { font-size: 12px; color: var(--text-muted); margin-top: 12px; display: flex; flex-direction: column; gap: 3px; }
.card-meta b { color: var(--text); font-weight: 600; }
.card-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.card-quote-link { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 10px 12px; background: var(--success-bg); border: 1px solid #BFE6D3; border-radius: 10px; font-size: 12.5px; color: var(--success); font-weight: 600; }
.card-quote-link a { transition: opacity .2s; } .card-quote-link a:hover { opacity: .7; }
.empty-col { border: 1.5px dashed #CBD7E4; border-radius: var(--radius); padding: 28px 12px; text-align: center; color: var(--text-muted); font-size: 12.5px; background: rgba(255,255,255,.5); }

.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 32px; max-width: 720px; box-shadow: var(--shadow); }
.form-section-title { font-family: 'Montserrat', sans-serif; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--blue); margin: 26px 0 14px; display: flex; align-items: center; gap: 10px; }
.form-section-title::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.form-section-title:first-child { margin-top: 0; }
.radio-group { display: flex; gap: 10px; }
.radio-pill { flex: 1; } .radio-pill input { display: none; }
.radio-pill span { display: block; text-align: center; padding: 11px 8px; border: 1.5px solid var(--border); border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--text-muted); transition: all .2s var(--ease); cursor: pointer; }
.radio-pill span:hover { border-color: var(--blue); color: var(--blue-dark); }
.radio-pill input:checked + span { border-color: var(--blue); background: linear-gradient(135deg, var(--blue), var(--blue-dark)); color: #fff; box-shadow: 0 4px 12px rgba(17,126,194,.3); }

/* ---------- Reports / tables ---------- */
.stats-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 24px; }
@media (max-width: 900px) { .stats-row { grid-template-columns: repeat(2,1fr); } }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; transition: transform .25s var(--ease), box-shadow .25s; }
.stat-card::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, var(--blue), var(--gold)); }
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.stat-card .num { font-family: 'Montserrat', sans-serif; font-size: 30px; color: var(--navy); font-weight: 800; }
.stat-card .lbl { font-size: 12px; color: var(--text-muted); margin-top: 4px; font-weight: 500; }
table.audit { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; font-size: 13px; box-shadow: var(--shadow-sm); }
table.audit th { text-align: left; background: linear-gradient(180deg, #0F3358, var(--navy)); color: #DCE7F2; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; padding: 12px 14px; }
table.audit td { padding: 13px 14px; border-top: 1px solid var(--border); vertical-align: top; transition: background .15s; }
table.audit tbody tr:hover td { background: #F7FAFD; }
.filter-bar { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 22px; display: grid; grid-template-columns: repeat(5,1fr); gap: 12px; align-items: end; box-shadow: var(--shadow-sm); }
@media (max-width: 980px) { .filter-bar { grid-template-columns: repeat(2,1fr); } }
.filter-bar .f-field label { display: block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: 5px; }
.filter-bar .f-field select, .filter-bar .f-field input { width: 100%; border: 1.5px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 13px; font-family: inherit; transition: border-color .2s, box-shadow .2s; }
.filter-bar .f-field select:focus, .filter-bar .f-field input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(17,126,194,.15); }
.perf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
@media (max-width: 860px) { .perf-grid { grid-template-columns: 1fr; } }
.perf-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.perf-card h4 { font-size: 12px; color: var(--blue); margin-bottom: 12px; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.perf-row { display: flex; justify-content: space-between; padding: 9px 0; border-top: 1px solid var(--border); font-size: 13px; }
.perf-row:first-of-type { border-top: none; }

.locked-view, .empty-state { max-width: 480px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 32px; box-shadow: var(--shadow-sm); }
.locked-view h3 { font-size: 17px; color: var(--navy); margin-bottom: 8px; }
.toast-wrap { position: fixed; bottom: 22px; right: 22px; z-index: 60; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--navy); color: #fff; padding: 13px 20px; border-radius: 12px; font-size: 13px; font-weight: 500; box-shadow: var(--shadow-lg); border-left: 4px solid var(--gold); animation: slide-in .4s var(--ease); }
.toast.error { background: var(--danger); border-left-color: #fff; }
.users-table-wrap { margin-top: 20px; overflow-x: auto; }

/* Customer typeahead dropdown */
.cust-dd { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; margin-top: 6px; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); max-height: 300px; overflow-y: auto; animation: dropdown .18s var(--ease); }
.cust-dd-title { padding: 8px 14px; font-size: 11px; color: var(--text-muted); background: var(--bg); border-bottom: 1px solid var(--border); font-weight: 500; }
.cust-dd-item { display: flex; justify-content: space-between; gap: 12px; width: 100%; padding: 11px 14px; border: 0; background: #fff; text-align: left; cursor: pointer; font: inherit; font-size: 13.5px; transition: background .15s, padding-left .2s var(--ease); }
.cust-dd-item:hover, .cust-dd-item:focus { background: var(--blue-soft); outline: none; padding-left: 18px; }
.cust-dd-name { font-weight: 600; color: var(--navy); }
.cust-dd-sub { color: var(--text-muted); font-size: 12px; }

/* Quote upload progress */
.upload-progress { width: 100%; }
.upload-progress-label { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; margin-bottom: 6px; color: var(--navy); font-weight: 600; }
.upload-progress-track { height: 10px; background: var(--open-bg); border-radius: 10px; overflow: hidden; }
.upload-progress-bar { height: 100%; border-radius: 10px; background: repeating-linear-gradient(135deg, var(--gold) 0 10px, #FFDF55 10px 20px); background-size: 28px 28px; animation: stripes 1s linear infinite; transition: width .15s linear; }

/* Push notification control */
.push-btn { display: flex; align-items: center; gap: 10px; width: 100%; margin-bottom: 10px; padding: 10px 12px; border-radius: 10px; border: 1px dashed rgba(248,201,1,.55); background: rgba(248,201,1,.08); color: var(--gold); font-size: 12.5px; font-weight: 600; transition: background .2s, transform .2s var(--ease); }
.push-btn svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.push-btn:hover { background: rgba(248,201,1,.16); transform: translateY(-1px); }
.push-btn.on { border-style: solid; border-color: rgba(255,255,255,.14); background: rgba(255,255,255,.06); color: #BFE9D4; }
.push-note { margin-bottom: 10px; padding: 9px 11px; border-radius: 10px; background: rgba(255,255,255,.06); color: #B7C7D9; font-size: 11.5px; line-height: 1.5; }

/* View-as (Site Owner) */
.viewas { margin-bottom: 10px; padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); }
.viewas label { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); margin-bottom: 6px; }
.viewas select { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,.18); background: #0F3358; color: #fff; font-size: 13px; font-family: inherit; }
.viewas select:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.viewas-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 32px; background: linear-gradient(90deg, #FFF3C4, #FFE680); color: #5A4600; font-size: 13px; border-bottom: 1px solid #E8C93A; position: sticky; top: 0; z-index: 6; animation: dropdown .3s var(--ease); }
.btn-danger-ghost { color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); }
.private-note { margin-bottom: 16px; padding: 12px 16px; border-radius: 10px; background: var(--blue-soft); border: 1px solid #C6E2F3; color: var(--blue-dark); font-size: 13px; }
.sub-cell { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

/* ---------- Motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes grow-w { from { width: 0; } to { width: 34px; } }
@keyframes slide-in { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
@keyframes dropdown { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes float { 0%, 100% { transform: translate(0,0); } 50% { transform: translate(-22px, 18px); } }
@keyframes pulse { 0%, 100% { opacity: .55; transform: scale(.97); } 50% { opacity: 1; transform: scale(1); } }
@keyframes stripes { to { background-position: 28px 0; } }
@keyframes shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Tablets & phones ---------- */
.menu-btn, .nav-backdrop, .fab { display: none; }
.topbar-title { min-width: 0; }
body.no-scroll { overflow: hidden; }
.board { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
@media (max-width: 1100px) { .board { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); } }

/* Sidebar becomes a slide-in drawer on tablets/phones so content gets the full width */
@media (max-width: 1024px) {
  #app-inner { display: block !important; }
  .sidebar { position: fixed; z-index: 40; left: 0; top: 0; bottom: 0; height: 100dvh; width: min(300px, 84vw); transform: translateX(-102%); transition: transform .35s var(--ease); padding-bottom: calc(22px + env(safe-area-inset-bottom)); box-shadow: none; }
  .nav-open .sidebar { transform: none; box-shadow: 12px 0 40px rgba(0,0,0,.35); }
  .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(6,24,41,.55); opacity: 0; pointer-events: none; transition: opacity .3s; backdrop-filter: blur(2px); }
  .nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }
  .main { width: 100%; }
  .menu-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--navy); box-shadow: var(--shadow-sm); }
  .menu-btn svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
  .topbar { justify-content: flex-start; padding: 12px 20px; padding-top: calc(12px + env(safe-area-inset-top)); }
  .topbar-title { flex: 1; }
  .topbar .clock { display: none; }
  .content { padding: 22px 20px calc(96px + env(safe-area-inset-bottom)); }
  .viewas-banner { padding: 10px 20px; top: 68px; }
  .fab { display: inline-flex; align-items: center; gap: 8px; position: fixed; z-index: 20; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); padding: 15px 20px; border: 0; border-radius: 30px; background: linear-gradient(135deg, #FFD83A, var(--gold) 55%, #EBB900); color: var(--navy); font-weight: 700; font-size: 14px; box-shadow: 0 10px 26px rgba(217,172,0,.5); animation: pop .4s var(--ease); }
  .fab svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2.6; stroke-linecap: round; }
  .fab:active { transform: scale(.96); }
  .toast-wrap { left: 16px; right: 16px; bottom: calc(90px + env(safe-area-inset-bottom)); }
}

/* Phones */
@media (max-width: 640px) {
  .topbar h1 { font-size: 19px; }
  .content { padding: 18px 14px calc(96px + env(safe-area-inset-bottom)); }
  .topbar { padding-left: 14px; padding-right: 14px; }
  .form-card { padding: 20px 16px; border-radius: 14px; }
  .auth-panel { padding: 22px 18px; align-items: flex-start; padding-top: 8vh; }
  .auth-card h2 { font-size: 25px; }
  .auth-brand { display: block; text-align: center; margin-bottom: 26px; }
  .auth-brand img { height: 92px; }
  /* 16px inputs stop iOS Safari zooming the page on focus; taller targets are easier to tap */
  .field input, .field select, .field textarea, .filter-bar .f-field select, .filter-bar .f-field input { font-size: 16px; min-height: 48px; }
  .field textarea { min-height: 110px; }
  .btn { min-height: 46px; }
  .btn-sm { min-height: 40px; padding: 8px 14px; font-size: 12.5px; }
  .card { padding: 16px; }
  .card-actions .btn { flex: 1 1 auto; }
  .toggle-row .btn { flex: 1 1 auto; }
  .radio-group { flex-wrap: wrap; }
  .radio-pill { flex: 1 1 30%; }
  .stats-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { padding: 14px; } .stat-card .num { font-size: 24px; }
  .filter-bar { grid-template-columns: 1fr 1fr; padding: 14px; }
  .perf-card { padding: 16px; }
  .cust-dd { max-height: 240px; }
  .cust-dd-item { padding: 14px; min-height: 48px; }
  .viewas-banner { top: 62px; font-size: 12.5px; }
  .viewas-banner .btn { width: 100%; }
  .sidebar-footer .push-btn, .sidebar-footer .viewas { width: 100%; }
  .nav-item { padding: 13px 12px; }

  /* Tables collapse into stacked cards */
  table.audit, table.audit tbody, table.audit tr, table.audit td { display: block; width: 100%; }
  table.audit { background: transparent; border: 0; box-shadow: none; }
  table.audit thead { display: none; }
  table.audit tbody tr { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 6px 14px; margin-bottom: 12px; box-shadow: var(--shadow-sm); }
  table.audit td { display: flex; justify-content: space-between; gap: 16px; text-align: right; border-top: 1px solid var(--border); padding: 10px 0; }
  table.audit td:first-child { border-top: 0; }
  table.audit td::before { content: attr(data-label); flex-shrink: 0; text-align: left; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); padding-top: 3px; }
  table.audit td.hide-m { display: none; }
  table.audit td .cell { min-width: 0; overflow-wrap: anywhere; }
  table.audit td:empty, table.audit td[data-label=""] { display: none; }
  table.audit tbody tr:hover td { background: transparent; }
  .users-table-wrap { overflow: visible; }
}

/* Touch devices: no sticky hover states or lift effects */
@media (hover: none) {
  .card:hover, .stat-card:hover, .btn:hover, .nav-item:hover, .push-btn:hover { transform: none; }
  .card:hover { box-shadow: var(--shadow-sm); border-color: var(--border); }
}
