/* Pragati Audit — design system */

:root {
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --faint: #94a3b8;
  --line: #e2e8f0;
  --line-2: #eef1f6;
  --bg: #f5f6fb;
  --card: #ffffff;

  --brand: #4338ca;
  --brand-600: #4f46e5;
  --brand-700: #3730a3;
  --brand-50: #eef2ff;
  --brand-100: #e0e7ff;
  --accent: #f59e0b;

  --ok: #047857;
  --ok-50: #ecfdf5;
  --ok-100: #d1fae5;
  --warn: #b45309;
  --warn-50: #fffbeb;
  --warn-100: #fef3c7;
  --err: #dc2626;
  --err-50: #fef2f2;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 8px 24px -12px rgba(15, 23, 42, .12);
  --shadow-lg: 0 24px 60px -24px rgba(30, 27, 75, .35);
  --ring: 0 0 0 4px rgba(79, 70, 229, .15);

  --font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 15px/1.6 var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-600); text-decoration: none; }
a:hover { color: var(--brand-700); text-decoration: underline; }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; line-height: 1.25; }
h1 { font-size: 26px; font-weight: 800; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0; }
svg { flex: none; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Brand mark ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; color: inherit; letter-spacing: -.02em; }
.brand:hover { color: inherit; text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #fb923c); color: #fff;
  box-shadow: 0 6px 16px -6px rgba(245, 158, 11, .6);
}

/* ---------- Cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-body { padding: 28px; }
.card-head { padding: 20px 24px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
@media (max-width: 600px) { .card-body { padding: 20px; } .card-head { padding: 16px 20px; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 15px/1 var(--font); padding: 13px 22px; border-radius: 11px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none; transition: background .15s, box-shadow .15s, transform .05s, border-color .15s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn-primary { background: var(--brand-600); color: #fff; box-shadow: 0 8px 20px -8px rgba(79, 70, 229, .7); }
.btn-primary:hover { background: var(--brand-700); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: var(--line); }
.btn-ghost:hover { background: #f8fafc; color: var(--ink); }
.btn-soft { background: var(--brand-50); color: var(--brand-700); }
.btn-soft:hover { background: var(--brand-100); color: var(--brand-700); }
.btn-sm { padding: 9px 14px; font-size: 14px; border-radius: 9px; }
.btn-block { width: 100%; }

/* ---------- Forms ---------- */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .grid { grid-template-columns: 1fr; } }
.field { margin-bottom: 18px; }
.field label { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13.5px; color: var(--ink-2); margin-bottom: 7px; }
.req { color: var(--err); }
input[type=text], input[type=email], input[type=tel], input[type=url], input[type=number],
input[type=password], input[type=search], input[type=date], select, textarea {
  width: 100%; padding: 12px 14px; font: 15px/1.4 var(--font); color: var(--ink);
  background: #fff; border: 1px solid #d5dbe5; border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea { resize: vertical; min-height: 88px; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: #b8c2d3; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-600); box-shadow: var(--ring); }
.help { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.error { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--err); margin-top: 6px; font-weight: 500; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--err); background: var(--err-50); }
.has-error input:focus, .has-error select:focus, .has-error textarea:focus { box-shadow: 0 0 0 4px rgba(220, 38, 38, .12); }

/* Fetched values */
.fetched input, .fetched select, .fetched textarea { background: #f7f8ff; border-color: #c7cdfa; }
.tag {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; letter-spacing: .02em;
  color: var(--brand-700); background: var(--brand-50); border: 1px solid var(--brand-100); border-radius: 999px; padding: 1px 8px;
}

/* Form sections */
.form-section { padding: 24px 0; border-top: 1px solid var(--line-2); }
.form-section:first-of-type { border-top: 0; padding-top: 4px; }
.section-title { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.section-title .num {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none;
  background: var(--brand-50); color: var(--brand-700); font-weight: 800; font-size: 13px;
}
.section-title p { font-size: 13px; color: var(--muted); }

/* Toggle card (checkbox) */
.choice {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 18px; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fbfcfe; transition: border-color .15s, background .15s;
}
.choice:hover { border-color: #c7cdfa; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice .switch { width: 40px; height: 24px; border-radius: 999px; background: #cbd5e1; position: relative; transition: background .2s; flex: none; }
.choice .switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s;
}
.choice input:checked + .switch { background: var(--brand-600); }
.choice input:checked + .switch::after { transform: translateX(16px); }
.choice input:focus-visible + .switch { box-shadow: var(--ring); }
.choice:has(input:checked) { border-color: #c7cdfa; background: var(--brand-50); }
.choice strong { display: block; font-size: 14.5px; }
.choice span.sub { display: block; font-size: 13px; color: var(--muted); }
.is-hidden { display: none !important; }

/* Upload dropzone */
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  padding: 28px 20px; border: 1.5px dashed #c3cbe0; border-radius: var(--radius); background: #fafbff;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.is-dragging { border-color: var(--brand-600); background: var(--brand-50); }
.dropzone .dz-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: #fff; color: var(--brand-600); box-shadow: var(--shadow-sm); border: 1px solid var(--line); margin-bottom: 6px; }
.dropzone strong { color: var(--brand-700); }
.dropzone .dz-hint { font-size: 13px; color: var(--muted); }
.dropzone .dz-file { display: none; align-items: center; gap: 8px; margin-top: 8px; padding: 8px 12px; border-radius: 10px; background: #fff; border: 1px solid var(--line); font-weight: 600; font-size: 14px; color: var(--ink); max-width: 100%; }
.dropzone .dz-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropzone.has-file { border-style: solid; border-color: #a7f3d0; background: var(--ok-50); }
.dropzone.has-file .dz-file { display: inline-flex; }
.dropzone.has-file .dz-icon { color: var(--ok); }
.dropzone input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.has-error .dropzone { border-color: var(--err); background: var(--err-50); }

/* ---------- Notices ---------- */
.notice { display: flex; gap: 12px; align-items: flex-start; border-radius: 12px; padding: 14px 16px; margin-bottom: 18px; font-size: 14.5px; border: 1px solid transparent; }
.notice svg { margin-top: 1px; }
.notice.ok { background: var(--ok-50); color: #065f46; border-color: var(--ok-100); }
.notice.warn { background: var(--warn-50); color: #92400e; border-color: var(--warn-100); }
.notice.info { background: var(--brand-50); color: var(--brand-700); border-color: var(--brand-100); }
.notice strong { font-weight: 700; }

/* ---------- Badges & chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.submitted { background: var(--ok-50); color: var(--ok); }
.badge.draft { background: var(--warn-50); color: var(--warn); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 3px 9px; border-radius: 7px; background: #f1f5f9; color: var(--ink-2); white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; letter-spacing: 0; }

.avatar {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none;
  font-weight: 800; font-size: 14px; color: var(--brand-700); background: linear-gradient(135deg, var(--brand-50), var(--brand-100));
}
.avatar.lg { width: 56px; height: 56px; border-radius: 16px; font-size: 20px; }

/* =========================================================
   Customer onboarding layout
   ========================================================= */
.onboard { display: grid; grid-template-columns: 400px 1fr; min-height: 100vh; }
.onboard-side {
  position: sticky; top: 0; height: 100vh; padding: 40px 36px; color: #e0e7ff; display: flex; flex-direction: column; gap: 36px;
  background:
    radial-gradient(600px 300px at -10% 0%, rgba(245, 158, 11, .22), transparent 60%),
    radial-gradient(500px 400px at 110% 100%, rgba(99, 102, 241, .45), transparent 60%),
    linear-gradient(160deg, #1e1b4b 0%, #312e81 60%, #3730a3 100%);
  overflow: hidden;
}
.onboard-side .brand { color: #fff; }
.onboard-side h2 { color: #fff; font-size: 28px; font-weight: 800; line-height: 1.2; }
.onboard-side .intro p { margin-top: 12px; color: #c7d2fe; font-size: 15px; }

.vsteps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.vsteps li { display: grid; grid-template-columns: 36px 1fr; gap: 14px; position: relative; padding-bottom: 22px; }
.vsteps li:last-child { padding-bottom: 0; }
.vsteps li:not(:last-child)::after { content: ""; position: absolute; left: 17px; top: 38px; bottom: 4px; width: 2px; background: rgba(199, 210, 254, .25); border-radius: 2px; }
.vsteps li.complete:not(:last-child)::after { background: #a5b4fc; }
.vsteps .dot { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px; border: 2px solid rgba(199, 210, 254, .35); color: #c7d2fe; }
.vsteps .active .dot { background: #fff; color: var(--brand-700); border-color: #fff; box-shadow: 0 0 0 6px rgba(255, 255, 255, .12); }
.vsteps .complete .dot { background: #a5b4fc; border-color: #a5b4fc; color: #1e1b4b; }
.vsteps .title { color: #fff; font-weight: 700; margin-top: 6px; }
.vsteps .desc { color: #a5b4fc; font-size: 13px; }
.vsteps li:not(.active):not(.complete) .title { color: #c7d2fe; }

.trust { margin-top: auto; display: grid; gap: 12px; font-size: 13.5px; color: #c7d2fe; }
.trust div { display: flex; gap: 10px; align-items: center; }
.trust svg { color: #fbbf24; }

.onboard-main { padding: 48px 40px 64px; display: flex; flex-direction: column; align-items: center; }
.onboard-main > .inner { width: 100%; max-width: 760px; }
.page-head { margin-bottom: 22px; }
.page-head .eyebrow { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-600); margin-bottom: 8px; }
.page-head p { margin-top: 8px; color: var(--muted); font-size: 15.5px; max-width: 620px; }

.mobile-bar { display: none; }
.hsteps { display: none; }

.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 22px; border-top: 1px solid var(--line-2); margin-top: 6px; flex-wrap: wrap; }

@media (max-width: 1000px) {
  .onboard { grid-template-columns: 1fr; }
  .onboard-side { display: none; }
  .mobile-bar { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; background: #1e1b4b; color: #fff; }
  .mobile-bar .brand { color: #fff; font-size: 16px; }
  .hsteps { display: flex; gap: 6px; margin-bottom: 18px; }
  .hsteps span { flex: 1; height: 5px; border-radius: 999px; background: var(--line); }
  .hsteps span.on { background: var(--brand-600); }
  .onboard-main { padding: 24px 16px 48px; }
  h1 { font-size: 23px; }
}

/* Review summary on verify page */
.who-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 22px; }
@media (max-width: 640px) { .who-cards { grid-template-columns: 1fr; } }
.who { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: #fbfcfe; }
.who .label { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.who .name { font-weight: 700; }
.who .line { font-size: 13.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.udyam-strip { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-radius: 12px; background: #f8fafc; border: 1px solid var(--line); margin-bottom: 14px; flex-wrap: wrap; }
.udyam-strip .mono { font-weight: 700; font-size: 15px; }

/* Success page */
.success { text-align: center; padding: 48px 28px; }
.success .check {
  width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 22px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #10b981, #047857); box-shadow: 0 0 0 10px var(--ok-50), 0 16px 32px -12px rgba(4, 120, 87, .6);
  animation: pop .5s cubic-bezier(.2, 1.4, .4, 1) both;
}
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.success h1 { font-size: 28px; }
.success .lead { color: var(--muted); margin: 10px auto 0; max-width: 460px; }
.next-steps { text-align: left; max-width: 460px; margin: 32px auto 28px; display: grid; gap: 14px; }
.next-steps > div { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; }
.next-steps .n { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-700); font-weight: 800; font-size: 13px; flex: none; }
.next-steps strong { display: block; font-size: 14.5px; }
.next-steps span { font-size: 13.5px; color: var(--muted); }

/* =========================================================
   Superuser portal
   ========================================================= */
.topbar { background: #0f172a; color: #cbd5e1; position: sticky; top: 0; z-index: 10; }
.topbar .wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.topbar .brand { color: #fff; font-size: 17px; }
.topbar .brand small { font-weight: 600; font-size: 12px; color: #94a3b8; margin-left: 4px; padding: 2px 8px; border: 1px solid #334155; border-radius: 999px; }
.topbar nav { display: flex; align-items: center; gap: 6px; }
.topbar nav a { color: #cbd5e1; padding: 8px 12px; border-radius: 9px; font-weight: 600; font-size: 14px; }
.topbar nav a:hover, .topbar nav a.on { background: #1e293b; color: #fff; text-decoration: none; }
.userchip { display: flex; align-items: center; gap: 10px; margin-left: 10px; padding-left: 16px; border-left: 1px solid #1e293b; }
.userchip .avatar { width: 32px; height: 32px; border-radius: 50%; font-size: 13px; background: linear-gradient(135deg, var(--accent), #fb923c); color: #fff; }
.userchip .uname { color: #fff; font-weight: 600; font-size: 14px; }
.userchip button { background: none; border: 0; color: #94a3b8; font: 600 13px var(--font); cursor: pointer; padding: 6px 8px; border-radius: 8px; display: inline-flex; gap: 6px; align-items: center; }
.userchip button:hover { color: #fff; background: #1e293b; }
@media (max-width: 640px) { .userchip .uname, .topbar .brand small { display: none; } .topbar .wrap { padding: 0 16px; } }

.portal { max-width: 1240px; margin: 0 auto; padding: 32px 24px 64px; }
@media (max-width: 640px) { .portal { padding: 20px 16px 48px; } }
.portal-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.portal-head p { color: var(--muted); margin-top: 6px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
@media (max-width: 760px) { .stats { grid-template-columns: 1fr; } }
.stat { display: flex; align-items: center; gap: 16px; padding: 20px; }
.stat .icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; }
.stat .icon.indigo { background: var(--brand-50); color: var(--brand-600); }
.stat .icon.green { background: var(--ok-50); color: var(--ok); }
.stat .icon.amber { background: var(--warn-50); color: var(--warn); }
.stat .num { font-size: 28px; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.stat .lbl { font-size: 13.5px; color: var(--muted); font-weight: 500; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.filters .search { position: relative; flex: 1 1 280px; }
.filters .search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.filters .search input { padding-left: 40px; }
.filters select { width: auto; flex: 0 1 auto; padding-top: 10px; padding-bottom: 10px; }
.filters input { padding-top: 10px; padding-bottom: 10px; }

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 12px 20px; background: #fafbfd; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 14px 20px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.data tbody tr { position: relative; transition: background .12s; }
table.data tbody tr:hover { background: #f8f9ff; }
table.data tbody tr:last-child td { border-bottom: 0; }
.company-cell { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.company-cell a { font-weight: 700; color: var(--ink); }
.company-cell a::after { content: ""; position: absolute; inset: 0; }  /* whole row clickable */
.company-cell a:hover { color: var(--brand-700); text-decoration: none; }
.company-cell .sub { font-size: 12.5px; color: var(--muted); }
.person .sub { font-size: 12.5px; color: var(--muted); }

.pager { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; border-top: 1px solid var(--line); font-size: 14px; gap: 10px; flex-wrap: wrap; }
.pager .links { display: flex; gap: 8px; align-items: center; }

.empty { text-align: center; padding: 64px 20px; }
.empty .icon { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; margin: 0 auto 16px; background: var(--brand-50); color: var(--brand-600); }
.empty h3 { font-size: 17px; }
.empty p { color: var(--muted); margin-top: 6px; }

/* Detail page */
.back { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; color: var(--muted); margin-bottom: 16px; }
.back:hover { color: var(--ink); text-decoration: none; }
.hero { padding: 24px 28px; display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.hero .title { flex: 1 1 320px; min-width: 0; }
.hero h1 { font-size: 24px; overflow-wrap: anywhere; }
.hero .meta { display: flex; gap: 8px 16px; flex-wrap: wrap; margin-top: 8px; font-size: 13.5px; color: var(--muted); align-items: center; }
.hero .meta span { display: inline-flex; align-items: center; gap: 6px; }

.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 20px; align-items: start; }
@media (max-width: 1000px) { .detail-layout { grid-template-columns: 1fr; } }
.stack { display: grid; gap: 20px; }
.sticky { position: sticky; top: 84px; }
@media (max-width: 1000px) { .sticky { position: static; } }

.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.kv .item { padding: 14px 24px; border-bottom: 1px solid var(--line-2); min-width: 0; }
.kv .item:nth-child(odd) { border-right: 1px solid var(--line-2); }
.kv .item.wide { grid-column: 1 / -1; border-right: 0; }
.kv .k { font-size: 12px; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.kv .v { font-weight: 600; overflow-wrap: anywhere; }
.kv .v.multiline { white-space: pre-line; font-weight: 500; }
.kv .v .empty-val { color: var(--faint); font-weight: 500; }
.kv .was { display: block; margin-top: 4px; font-size: 12.5px; font-weight: 500; color: var(--warn); }
@media (max-width: 640px) { .kv { grid-template-columns: 1fr; } .kv .item:nth-child(odd) { border-right: 0; } .kv .item { padding: 12px 20px; } }

.preview { width: 100%; height: 520px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; display: block; }
img.preview { height: auto; }
details.raw-box summary { cursor: pointer; font-weight: 600; color: var(--brand-600); font-size: 14px; }
pre.raw { font-size: 12px; background: #0f172a; color: #e2e8f0; border-radius: 10px; padding: 14px; max-height: 380px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; margin: 12px 0 0; }

/* Login */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background:
    radial-gradient(700px 400px at 0% 0%, rgba(99, 102, 241, .18), transparent 60%),
    radial-gradient(600px 400px at 100% 100%, rgba(245, 158, 11, .14), transparent 60%),
    var(--bg);
}
.auth-card { width: 100%; max-width: 420px; }
.auth-card .card-body { padding: 36px; }
.auth-head { text-align: center; margin-bottom: 26px; }
.auth-head .brand { margin-bottom: 22px; }
.auth-head p { color: var(--muted); margin-top: 6px; }
.auth-foot { text-align: center; font-size: 13px; color: var(--muted); margin-top: 18px; display: flex; align-items: center; justify-content: center; gap: 6px; }

/* Captcha */
.captcha-box { display: flex; gap: 12px; align-items: stretch; flex-wrap: wrap; }
.captcha-img { display: flex; align-items: center; gap: 4px; padding: 4px 4px 4px 4px; border: 1px solid #d5dbe5; border-radius: var(--radius-sm); background: #f5f6fb; flex: none; }
.captcha-img img { display: block; border-radius: 7px; width: 170px; height: 50px; }
.captcha-refresh { width: 40px; height: 50px; border: 0; background: transparent; color: var(--muted); border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.captcha-refresh:hover { background: #fff; color: var(--brand-600); }
.captcha-refresh.spinning svg { animation: spin .6s linear; }
@keyframes spin { to { transform: rotate(360deg); } }
.captcha-input { flex: 1 1 180px; display: flex; }
.captcha-input input[type=text] { font-size: 18px; font-weight: 700; letter-spacing: .25em; text-transform: uppercase; }
.captcha-input input[type=text]::placeholder { letter-spacing: normal; text-transform: none; font-weight: 400; font-size: 15px; }

/* Honeypot: off-screen, not display:none (some bots skip hidden fields) */
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* =========================================================
   Company profile editing (superuser)
   ========================================================= */
.btn-xs { padding: 4px 9px; font-size: 12.5px; border-radius: 7px; gap: 5px; }
.stats.four { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1000px) { .stats.four { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .stats.four { grid-template-columns: 1fr; } }
.stat .icon.slate { background: #f1f5f9; color: var(--ink-2); }

/* Tracking status badges */
.badge.track-in_process { background: var(--brand-50); color: var(--brand-700); }
.badge.track-payment_due { background: var(--warn-50); color: var(--warn); }
.badge.track-completed { background: var(--ok-50); color: var(--ok); }

img.avatar.logo-img { object-fit: contain; background: #fff; border: 1px solid var(--line); padding: 3px; }
.hero-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.edit-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.edit-head p { margin-top: 6px; }

/* Section tabs */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px; margin-bottom: 18px; background: #fff; border: 1px solid var(--line); border-radius: 13px; scrollbar-width: thin; }
.tab { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; padding: 9px 14px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.tab:hover { background: #f5f6fb; color: var(--ink); text-decoration: none; }
.tab.on { background: var(--brand-600); color: #fff; box-shadow: 0 6px 14px -8px rgba(79, 70, 229, .8); }
.tabs.jump { margin-bottom: 20px; }

/* File inputs with current file */
.file-field input[type=file] { width: 100%; padding: 9px; font: 14px var(--font); border: 1px dashed #c3cbe0; border-radius: var(--radius-sm); background: #fafbff; cursor: pointer; }
.file-field input[type=file]:hover { border-color: var(--brand-600); }
.file-current { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.file-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; background: #f8fafc; }
.file-badge { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 8px; background: var(--brand-50); color: var(--brand-700); font-weight: 800; font-size: 11px; flex: none; }
.file-meta { display: flex; flex-direction: column; gap: 2px; font-size: 14px; font-weight: 600; }
.file-clear { display: inline-flex !important; align-items: center; gap: 6px; font-weight: 500 !important; font-size: 13px !important; color: var(--err) !important; margin: 0 !important; cursor: pointer; }
.inline-check { display: inline-flex !important; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.file-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }

/* Editable lists */
.list-block { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line-2); }
.list-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.list-empty { color: var(--muted); font-size: 14px; margin: 4px 0 12px; }
table.edit-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; margin-bottom: 12px; }
table.edit-table th { text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 0 8px 8px; white-space: nowrap; }
table.edit-table td { padding: 4px 8px 8px 0; vertical-align: top; min-width: 150px; }
table.edit-table td:first-child { padding-left: 0; }
table.edit-table td.row-actions, table.edit-table th.row-actions { width: 44px; min-width: 44px; padding-right: 0; }
table.edit-table input, table.edit-table select, table.edit-table textarea { padding: 9px 11px; font-size: 14px; }
table.edit-table textarea { min-height: 42px; }
table.edit-table .file-current { padding: 6px 8px; margin-bottom: 6px; }
table.edit-table .file-thumb, table.edit-table .file-badge { width: 34px; height: 34px; }
table.edit-table .has-error input, table.edit-table .has-error textarea { border-color: var(--err); background: var(--err-50); }
.row-delete { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--muted); cursor: pointer; }
.row-delete:hover { color: var(--err); border-color: #fecaca; background: var(--err-50); }
.row-delete input { position: absolute; opacity: 0; pointer-events: none; }
.formset-row.is-deleted td { opacity: .45; }
.formset-row.is-deleted td.row-actions { opacity: 1; }
.formset-row.is-deleted .row-delete { color: #fff; background: var(--err); border-color: var(--err); }
@media (max-width: 760px) {
  table.edit-table thead { display: none; }
  table.edit-table, table.edit-table tbody, table.edit-table tr, table.edit-table td { display: block; width: 100%; }
  table.edit-table tr { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 12px; position: relative; }
  table.edit-table td { padding: 0 0 10px; min-width: 0; }
  table.edit-table td::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
  table.edit-table td.row-actions { position: absolute; top: 10px; right: 10px; width: auto; padding: 0; }
  table.edit-table td.row-actions::before { content: none; }
}

/* Sticky save bar */
.action-bar { position: sticky; bottom: 0; z-index: 5; margin-top: 18px; padding: 14px 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 -8px 24px -16px rgba(15, 23, 42, .25); }
.action-group { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 640px) { .action-bar { flex-direction: column-reverse; align-items: stretch; } .action-group { flex-direction: column; } .action-bar .btn { width: 100%; } }

/* Read-only profile */
.kv .v .yes { color: var(--ok); font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.kv .v .no { color: var(--ink-2); }
.kv .v .multiline, td .multiline { white-space: pre-line; font-weight: 500; }
.sub-table { border-top: 1px solid var(--line-2); }
.sub-table h3 { display: flex; align-items: center; gap: 8px; padding: 16px 24px 10px; font-size: 14.5px; }
table.data.compact th { padding: 10px 24px; }
table.data.compact td { padding: 12px 24px; vertical-align: top; }
table.data.compact tbody tr:hover { background: transparent; }
.section-empty { padding: 22px 24px; color: var(--muted); font-size: 14px; }
.thumb-link { display: inline-block; }
.secret { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
