/* TA Kho dự án — brand blue from the logo, cool blue-grey neutrals, Be Vietnam Pro + Chakra Petch. */
:root {
  --bg: #eef3fa;
  --surface: #ffffff;
  --surface-2: #f5f8fd;
  --ink: #12203a;
  --muted: #5a6476;
  --brand: #2460ac;
  --brand-2: #3d8cf0;
  --line: rgba(36, 96, 172, .16);
  --danger: #c0392b;
  --ok: #1f8a5b;
  --shadow: 0 1px 2px rgba(18, 32, 58, .06), 0 10px 30px -12px rgba(36, 96, 172, .28);
  --veil: rgba(238, 243, 250, .5);
  --f-display: "Be Vietnam Pro", "Segoe UI", system-ui, sans-serif;
  --f-tech: "Chakra Petch", "Be Vietnam Pro", ui-monospace, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #08101d; --surface: #0f1a2c; --surface-2: #132137; --ink: #e5ecf7; --muted: #93a0b4;
    --brand: #4f93ea; --brand-2: #8cc0ff; --line: rgba(140, 192, 255, .16); --danger: #ef7a6b; --ok: #4cc38a;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 14px 34px -14px rgba(0,0,0,.7); --veil: rgba(8, 16, 29, .45);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-display); font-size: 15px; line-height: 1.5; overflow-x: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }

/* ---------- Ambient background ---------- */
.aurora { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.aurora i { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(80px); opacity: .28; }
.aurora i:nth-child(1) { background: var(--brand); left: -18vmax; top: -22vmax; animation: drift1 22s ease-in-out infinite alternate; }
.aurora i:nth-child(2) { background: var(--brand-2); right: -22vmax; bottom: -26vmax; animation: drift2 26s ease-in-out infinite alternate; opacity: .22; }
@keyframes drift1 { to { transform: translate(14vmax, 10vmax) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-12vmax, -8vmax) scale(.9); } }
#bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
body.inside #bg { opacity: .45; }

/* ---------- Logo masks ---------- */
.mark { aspect-ratio: 640 / 422; -webkit-mask: url("mark.png") center / contain no-repeat; mask: url("mark.png") center / contain no-repeat;
  background: linear-gradient(115deg, var(--brand) 0 38%, var(--brand-2) 50%, var(--brand) 62% 100%); background-size: 260% 100%; animation: shimmer 5s linear infinite; }
.tag { aspect-ratio: 900 / 51; -webkit-mask: url("tag.png") center / contain no-repeat; mask: url("tag.png") center / contain no-repeat; background: var(--muted); }
@keyframes shimmer { from { background-position: 130% 0; } to { background-position: -130% 0; } }

/* ---------- Login ---------- */
.gate { position: relative; z-index: 1; min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; background: var(--veil);
  padding-block: calc(28px + env(safe-area-inset-top, 0px)) calc(28px + env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.gate-inner { display: grid; justify-items: center; gap: 30px; width: min(410px, 100%); perspective: 900px; }
.logo-stack { display: grid; justify-items: center; gap: 18px; transform-style: preserve-3d; transition: transform .25s ease-out; }
.gate .mark { width: min(230px, 56vw); animation: shimmer 5s linear infinite, rise 1s cubic-bezier(.2,.8,.2,1) both; filter: drop-shadow(0 18px 30px rgba(36,96,172,.35)); }
.gate .tag { width: min(260px, 64vw); animation: wipe 1.1s .45s cubic-bezier(.6,0,.2,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(26px) scale(.86); filter: blur(14px); } }
@keyframes wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

.login-card { width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow);
  padding: 26px 24px 22px; display: grid; gap: 16px; position: relative; animation: card-in .8s .6s cubic-bezier(.2,.8,.2,1) backwards; }
.login-card::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--ang, 0deg), transparent 0 70%, var(--brand-2) 82%, transparent 94%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: spin 4.5s linear infinite; }
@property --ang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes spin { to { --ang: 360deg; } }
@keyframes card-in { from { opacity: 0; transform: translateY(18px); } }
.login-card.shake { animation: card-in .8s .6s cubic-bezier(.2,.8,.2,1) backwards, shake .5s 1.3s; }
@keyframes shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-8px); } 40%, 60% { transform: translateX(8px); } }
.login-card h1 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.eyebrow { font-family: var(--f-tech); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--brand); }
.float { position: relative; }
.float input { width: 100%; padding: 20px 14px 8px 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); outline: none; transition: border-color .2s, box-shadow .2s, background .2s; }
.float input:focus { border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent); }
.float label { position: absolute; left: 44px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; transition: top .2s, font-size .2s, color .2s; }
.float input:focus + label, .float input:not(:placeholder-shown) + label { top: 13px; font-size: 11.5px; color: var(--brand); }
.float .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.float input:focus ~ .ico { color: var(--brand); }
.peek { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; cursor: pointer; padding: 8px; border-radius: 8px; color: var(--muted); }
.peek:hover { color: var(--ink); }
.float.pw input { padding-right: 44px; }
.err { margin: 0; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; color: var(--danger); background: color-mix(in srgb, var(--danger) 9%, transparent); border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); }
.enter { position: relative; overflow: hidden; border: 0; border-radius: 14px; padding: 15px 20px; cursor: pointer; font-weight: 600; font-size: 16px; color: #fff;
  background: linear-gradient(120deg, #1d4f93, #2f7ad8 55%, #1d4f93); background-size: 200% 100%; transition: background-position .5s, transform .15s, box-shadow .3s;
  box-shadow: 0 10px 24px -10px rgba(36,96,172,.8); display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; }
.enter:hover { background-position: 100% 0; box-shadow: 0 14px 30px -10px rgba(61,140,240,.9); }
.enter:active { transform: scale(.98); }
.enter svg { transition: transform .25s; }
.enter:hover svg { transform: translateX(4px); }
.enter.loading { pointer-events: none; }
.enter.loading .txt, .enter.loading svg { opacity: 0; }
.enter.loading::after { content: ""; position: absolute; width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.35); border-top-color: #fff; animation: rot .7s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }
.ripple { position: absolute; border-radius: 50%; background: rgba(255,255,255,.45); transform: scale(0); animation: ripple .7s ease-out forwards; pointer-events: none; }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }
.fine { font-size: 12.5px; color: var(--muted); margin: 0; text-align: center; }
.wipe-out { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: var(--bg); clip-path: circle(150% at 50% 50%); transition: clip-path .75s .25s cubic-bezier(.7,0,.2,1); pointer-events: none; }
.wipe-out .mark { width: min(160px, 40vw); }
.wipe-out.go { clip-path: circle(0% at 50% 50%); }

/* ---------- App shell ---------- */
.app { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto;
  padding-block: 18px 64px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.topbar { display: flex; align-items: center; gap: 14px 20px; flex-wrap: wrap; padding: 10px 0 26px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.brand .mark { width: 54px; flex: none; }
.brand-txt { display: grid; min-width: 0; }
.brand-txt strong { font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.brand-txt span { font-family: var(--f-tech); font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; margin-right: auto; }
.nav a { text-decoration: none; padding: 8px 12px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--muted); transition: color .2s, background .2s; }
.nav a:hover { color: var(--ink); background: color-mix(in srgb, var(--surface) 70%, transparent); }
.nav a.on { color: var(--brand); background: var(--surface); box-shadow: var(--shadow); }
.me { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-family: var(--f-tech); font-weight: 600; font-size: 13px; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.role { font-family: var(--f-tech); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--brand); }
form.inline { display: inline; margin: 0; }

.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 10px 14px; cursor: pointer; font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; transition: border-color .2s, background .2s, transform .1s; }
.btn:hover { border-color: var(--brand); }
.btn:active { transform: scale(.98); }
.btn.ghost { background: transparent; padding: 7px 10px; font-size: 13px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger); }
.btn.sm { padding: 7px 10px; font-size: 13px; }

.head { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 18px; }
.head h2 { margin: 0; font-size: clamp(26px, 4vw, 34px); font-weight: 800; letter-spacing: -.02em; text-wrap: balance; }
.count { font-family: var(--f-tech); color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; margin-right: auto; }
.search { position: relative; flex: 0 1 300px; }
.search input { width: 100%; padding: 11px 14px 11px 38px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); outline: none; transition: border-color .2s, box-shadow .2s; }
.search input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }

/* ---------- Project cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.card { --mx: 50%; --my: 50%; position: relative; display: grid; grid-template-columns: 44px 1fr; row-gap: 14px; column-gap: 14px; align-items: center;
  padding: 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); text-decoration: none; overflow: hidden; isolation: isolate;
  transition: transform .25s cubic-bezier(.2,.8,.2,1), border-color .25s; animation: pop .6s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i, 0) * 50ms); }
.card::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .3s;
  background: radial-gradient(280px circle at var(--mx) var(--my), color-mix(in srgb, var(--brand-2) 22%, transparent), transparent 65%); }
.card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--brand) 55%, transparent); }
.card:hover::before { opacity: 1; }
@keyframes pop { from { opacity: .3; transform: translateY(14px) scale(.98); } }
.logo { width: 64px; height: 64px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; flex: none; }
.logo img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.mono { width: 100%; height: 100%; display: grid; place-items: center; font-family: var(--f-tech); font-weight: 600; font-size: 22px; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.card-title { min-width: 0; }
.card-title h3 { margin: 0; font-size: 16.5px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.card-title span { display: block; margin-top: 3px; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.open { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; padding-top: 12px; border-top: 1px dashed var(--line); font-size: 13.5px; font-weight: 600; color: var(--brand); }
.open svg { transition: transform .25s; }
.card:hover .open svg { transform: translate(3px, -3px); }
.empty { grid-column: 1 / -1; display: grid; justify-items: center; gap: 10px; text-align: center; padding: 56px 20px; border: 1.5px dashed var(--line); border-radius: 20px; background: color-mix(in srgb, var(--surface) 70%, transparent); }
.empty h3 { margin: 0; font-size: 18px; }
.empty p { margin: 0; color: var(--muted); max-width: 46ch; }

/* ---------- Investor groups ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; margin: 0 0 18px; scrollbar-width: thin; }
.chip { flex: none; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 80%, transparent); border-radius: 999px; padding: 7px 12px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; transition: color .2s, background .2s, border-color .2s; }
.chip b { font-family: var(--f-tech); font-weight: 600; margin-left: 4px; opacity: .7; font-variant-numeric: tabular-nums; }
.chip:hover { color: var(--ink); border-color: var(--brand); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip.on b { opacity: .85; }
.inv { margin-bottom: 34px; }
.inv-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.inv-head .logo { width: 56px; height: 56px; border-radius: 14px; background: #fff; }
.inv-head .logo .mono { font-size: 18px; }
.inv-name { display: grid; min-width: 0; }
.inv-name h3 { margin: 0; font-size: 21px; font-weight: 800; letter-spacing: -.01em; line-height: 1.25; }
.inv-count { font-family: var(--f-tech); font-size: 13px; color: var(--muted); margin-right: auto; font-variant-numeric: tabular-nums; }
.inv-head.plain .inv-name h3 { font-size: 17px; }
.ficon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent); transition: background .25s, color .25s; }
.card:hover .ficon { background: var(--brand); color: #fff; }
.bare-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.bare { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: color-mix(in srgb, var(--surface) 75%, transparent); border: 1px dashed var(--line); text-decoration: none; font-weight: 600; font-size: 14px; transition: border-color .2s, background .2s; min-width: 0; }
.bare span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bare svg { color: var(--muted); flex: none; }
a.bare:hover { border-style: solid; border-color: var(--brand); background: var(--surface); }
.bare .logo { width: 36px; height: 36px; border-radius: 10px; background: #fff; }
.bare .logo img { padding: 4px; }
.bare .mono { font-size: 13px; }
.group-title { margin: 8px 0 2px; font-size: 13px; font-weight: 700; color: var(--muted); display: flex; align-items: center; gap: 8px; }

/* ---------- Admin ---------- */
.split { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 22px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 20px; display: grid; gap: 14px; min-width: 0; }
.panel h3 { margin: 0; font-family: var(--f-tech); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--brand); }
.sticky { position: sticky; top: 16px; }
.lbl { display: grid; gap: 6px; font-size: 13px; font-weight: 600; }
.field { width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); outline: none; font-weight: 400; transition: border-color .2s, box-shadow .2s; }
.field:focus { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent); }
.hint { font-size: 12px; color: var(--muted); font-weight: 400; }
.drop { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 12px; border: 1.5px dashed var(--line); background: var(--bg); cursor: pointer; transition: border-color .2s, background .2s; }
.drop:hover, .drop.over { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, var(--bg)); }
.drop .logo { width: 56px; height: 56px; border-radius: 14px; }
.drop-txt { display: grid; gap: 2px; font-weight: 400; font-size: 13px; color: var(--muted); min-width: 0; }
.drop-txt strong { color: var(--ink); font-weight: 600; }
.drop input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.check { display: flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 500; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.list { display: grid; gap: 8px; }
.item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); flex-wrap: wrap; }
.item.editing { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent); }
.item .logo { width: 42px; height: 42px; border-radius: 10px; }
.item .logo img { padding: 4px; }
.item .mono { font-size: 14px; }
.item-main { flex: 1 1 160px; min-width: 0; }
.item-main strong { display: block; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-main span { display: block; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { font-family: var(--f-tech); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.pill.admin { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 40%, transparent); }

.toast { position: fixed; z-index: 60; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 12px; font-size: 14px; font-weight: 500; transition: transform .3s, opacity .3s; max-width: calc(100% - 32px); }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.error { background: var(--danger); color: #fff; }

@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .sticky { position: static; }
}
@media (max-width: 560px) {
  .me .nm { display: none; }
  .search { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* =====================================================================
   Signed-in pages: plain white canvas so investor logos read cleanly.
   Always light, whatever the system theme. Animated background stays on login only.
   ===================================================================== */
body.inside {
  --bg: #ffffff; --surface: #ffffff; --surface-2: #f5f7fb; --ink: #14213a; --muted: #5d6779;
  --brand: #2460ac; --brand-2: #3d8cf0; --line: #e4e9f1; --danger: #c0392b; --ok: #1f8a5b;
  --shadow: 0 1px 2px rgba(20, 33, 58, .05), 0 6px 18px -10px rgba(20, 33, 58, .18);
  color-scheme: light; background: #fff; color: var(--ink);
}

/* Sticky top bar */
.bar { position: sticky; top: 0; z-index: 40; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0px); transition: box-shadow .25s; }
.bar.scrolled { box-shadow: 0 8px 24px -16px rgba(20, 33, 58, .35); }
body.inside::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 41; background: #fff; }
.bar-in { max-width: 1240px; margin: 0 auto; display: flex; align-items: center; gap: 10px 22px; flex-wrap: wrap;
  padding-block: 10px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.bar .brand .mark { width: 46px; animation: none; background: var(--brand); }
.bar .brand-txt strong { font-size: 17px; }
.bar .nav { margin-right: 0; }
.bar .nav a.on { background: color-mix(in srgb, var(--brand) 10%, #fff); box-shadow: none; }
.bar .search { flex: 1 1 260px; max-width: 420px; margin-left: auto; }
.bar .search input { background: var(--surface-2); border-color: transparent; }
.bar .search input:focus { background: #fff; border-color: var(--brand); }
.bar .me { margin-left: auto; }
.bar .search + .me { margin-left: 0; }

body.inside .app { max-width: 1240px; padding-block: 26px 64px; }
body.inside .head { margin-bottom: 22px; }
body.inside .head h2 { font-size: clamp(24px, 3vw, 30px); }
body.inside .panel, body.inside .card { box-shadow: var(--shadow); }

/* Investor cards: 5 per row */
.inv-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 22px 20px; }
.inv-card { position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; text-decoration: none; color: inherit;
  transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s, border-color .25s; animation: pop .5s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(min(var(--i, 0), 16) * 30ms); }
.inv-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--brand) 45%, #fff); box-shadow: 0 16px 34px -18px rgba(36, 96, 172, .45); }
.inv-logo { position: relative; aspect-ratio: 16 / 10; min-height: 0; overflow: hidden; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; padding: 15% 19%; background: #fff; }
.inv-logo::after { content: ""; position: absolute; left: 16px; right: 16px; bottom: 0; height: 1px; background: var(--line); }
.inv-logo img { width: 100%; height: 100%; object-fit: contain; padding: 0; transition: transform .35s cubic-bezier(.2,.8,.2,1); }
.inv-card:hover .inv-logo img { transform: scale(1.05); }
.inv-logo .mono { width: 56px; height: 56px; border-radius: 16px; font-size: 20px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.inv-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.go { flex: none; margin-top: -3px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: var(--brand); box-shadow: 0 4px 10px -4px color-mix(in srgb, var(--brand) 70%, transparent); transition: background .2s, box-shadow .2s, transform .25s; }
.inv-card:hover .go, .inv-card:focus-visible .go { background: #e0312f; box-shadow: 0 6px 14px -5px rgba(224, 49, 47, .6); transform: scale(1.08); }
.inv-body { padding: 14px 16px 16px; display: grid; gap: 9px; align-content: start; flex: 1; }
.inv-body h3 { margin: 0; min-width: 0; font-size: 14.5px; font-weight: 800; letter-spacing: -.005em; line-height: 1.3; overflow-wrap: anywhere; }
.prj { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.prj li { font-size: 11.5px; font-weight: 600; line-height: 1.3; padding: 4px 8px; border-radius: 6px; background: #f1f5fb; color: #4a5872; letter-spacing: .01em; }
.inv-body .none { margin: 0; font-size: 13px; color: var(--muted); }

@media (max-width: 1180px) { .inv-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 960px) { .inv-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 800px) {
  .inv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 14px; }
  .bar .search { order: 5; flex-basis: 100%; max-width: none; }
}
/* Phones: 2 compact cards per row */
@media (max-width: 460px) {
  .inv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; }
  .inv-card { border-radius: 13px; }
  .inv-logo { padding: 14% 16%; }
  .inv-logo::after { left: 10px; right: 10px; }
  .inv-logo .mono { width: 42px; height: 42px; border-radius: 12px; font-size: 16px; }
  .inv-body { padding: 9px 9px 11px; gap: 6px; }
  .inv-title { gap: 6px; }
  .inv-body h3 { font-size: 12.5px; line-height: 1.25; }
  .go { width: 26px; height: 26px; margin-top: -2px; }
  .go svg { width: 13px; height: 13px; }
  .prj { gap: 4px; }
  .prj li { font-size: 10px; padding: 3px 6px; border-radius: 6px; }
}
body.inside .sticky { top: 86px; }
textarea.field { resize: vertical; min-height: 110px; line-height: 1.5; }

/* ---------- Show / hide switch (admin list) ---------- */
.vis { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px 7px 7px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; transition: border-color .2s, color .2s; min-width: 64px; }
.vis:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.vis:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.vis .sw { position: relative; width: 28px; height: 16px; border-radius: 999px; background: color-mix(in srgb, var(--muted) 35%, transparent); transition: background .2s; flex: none; }
.vis .sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .2s; }
.vis.on { color: var(--brand); }
.vis.on .sw { background: var(--brand); }
.vis.on .sw::after { transform: translateX(12px); }
.item.off .logo, .item.off .item-main { opacity: .45; }
.item.off .logo { filter: grayscale(1); }
.item-main strong .pill { vertical-align: 1px; margin-left: 4px; }
@media (prefers-reduced-motion: reduce) { .vis .sw, .vis .sw::after { transition: none; } }

/* ---------- Icon buttons in the top bar ---------- */
.bar .me { gap: 6px; flex-wrap: nowrap; }
.ibtn { position: relative; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); background: #fff; color: #3a4a66; cursor: pointer; text-decoration: none; transition: background .2s, color .2s, border-color .2s, transform .1s; }
.ibtn:hover { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); background: color-mix(in srgb, var(--brand) 6%, #fff); }
.ibtn:active { transform: scale(.94); }
.ibtn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.ibtn.on { color: var(--brand); border-color: var(--brand); }
.ibtn.user { color: #fff; border-color: transparent; background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.ibtn.user:hover { color: #fff; filter: brightness(1.08); }
.ibtn.user .badge { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; background: #f5a524; border: 2px solid #fff; }
.ibtn.out:hover { color: #c62f3a; border-color: #f0b8bd; background: #fff5f6; }
/* Tooltip: shows on hover, keyboard focus, or tap (JS adds .show) */
.tip::after { content: attr(data-tip); position: absolute; top: calc(100% + 9px); right: 0; z-index: 60; white-space: nowrap; padding: 6px 10px; border-radius: 8px; background: #1b2436; color: #fff; font: 600 12px/1.3 var(--f-display); letter-spacing: 0; text-transform: none; box-shadow: 0 8px 20px -8px rgba(0,0,0,.35); opacity: 0; transform: translateY(-4px); pointer-events: none; transition: opacity .15s, transform .15s; }
.tip:hover::after, .tip:focus-visible::after, .tip.show::after { opacity: 1; transform: none; }
@media (hover: none) { .tip:not(.show)::after { display: none; } }
@media (max-width: 800px) {
  .bar .brand { order: 1; }
  .bar .me, .bar .search + .me { order: 2; margin-left: auto; }
  .bar .nav { order: 3; flex-basis: 100%; }
}

/* ---------- Staff accounts ---------- */
.stack { display: grid; gap: 18px; align-content: start; min-width: 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 460px) { .two { grid-template-columns: 1fr; } }
.pwset { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px 12px; margin: 0; display: grid; gap: 10px; min-width: 0; }
.pwset legend { font-size: 13px; font-weight: 600; padding: 0 4px; }
.file input { width: 100%; font-size: 13px; padding: 10px; border: 1.5px dashed var(--line); border-radius: 12px; background: var(--surface-2); cursor: pointer; }
.file input::file-selector-button { margin-right: 10px; border: 0; border-radius: 8px; padding: 7px 12px; background: var(--brand); color: #fff; font-weight: 600; cursor: pointer; }
.ugroup + .ugroup { margin-top: 14px; }
.ugroup-h { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; padding: 0 2px; font-size: 13px; font-weight: 700; color: #33415c; }
.ugroup-h .n { font-family: var(--f-tech); font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 1px 7px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.item-main .meta { font-size: 12px; }
.item-main .meta b { font-weight: 600; color: #33415c; }
.report { margin-bottom: 20px; }
.report.bad { border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.report .stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.report .stats div { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); display: grid; }
.report .stats b { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.report .stats span { font-size: 12.5px; color: var(--muted); }
.report .stats .warn b { color: #b4610a; }
.report details { font-size: 13px; }
.report summary { cursor: pointer; font-weight: 600; }
.report ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 3px; max-height: 220px; overflow: auto; }
@media (max-width: 640px) { .report .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mine { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 22px; align-items: start; max-width: 900px; }
@media (max-width: 800px) { .mine { grid-template-columns: 1fr; } }
.profile dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; font-size: 14px; }
.profile dt { color: var(--muted); }
.profile dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
/* Mobile: the logo already links to the project page, so hide the "Dự án" tab
   (staff have no other tabs, so their whole menu row disappears) */
@media (max-width: 800px) {
  .bar .nav .nav-home { display: none; }
  .bar .nav.solo { display: none; }
}
@media (max-width: 800px) {
  .bar-in { column-gap: 10px; }
  .bar .me { gap: 4px; }
  .bar .ibtn { width: 34px; height: 34px; }
}
@media (max-width: 360px) { .bar .brand-txt span { display: none; } }

/* ---------- Login: extra effects ---------- */
.logo-stack { position: relative; }
.gate .mark { animation: shimmer 5s linear infinite, rise 1s cubic-bezier(.2,.8,.2,1) both, glow 3.2s 1s ease-in-out infinite; }
@keyframes glow { 50% { filter: drop-shadow(0 18px 30px rgba(36,96,172,.35)) drop-shadow(0 0 26px color-mix(in srgb, var(--brand-2) 55%, transparent)); } }

/* Glass card that follows the pointer */
.login-card { background: color-mix(in srgb, var(--surface) 76%, transparent); -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  transform-style: preserve-3d; transition: transform .2s ease-out, box-shadow .3s; will-change: transform; }
.login-card::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--brand-2) 16%, transparent), transparent 60%); }
.login-card:hover::after, .login-card:focus-within::after { opacity: 1; }
.login-card > * { position: relative; z-index: 1; animation: up .6s cubic-bezier(.2,.8,.2,1) both; }
.login-card > *:nth-child(2) { animation-delay: .85s; }
.login-card > *:nth-child(3) { animation-delay: .95s; }
.login-card > *:nth-child(4) { animation-delay: 1.05s; }
.login-card > *:nth-child(5) { animation-delay: 1.15s; }
.login-card > *:nth-child(6) { animation-delay: 1.25s; }
.login-card > *:nth-child(7) { animation-delay: 1.35s; }
@keyframes up { from { opacity: 0; transform: translateY(12px); } }

/* Typewriter eyebrow */
.typing.on::after { content: ""; display: inline-block; width: 2px; height: 1em; margin-left: 3px; vertical-align: -2px; background: currentColor; animation: caret .8s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }

/* Light sweep across the button */
.enter::before { content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.38), transparent); transform: skewX(-18deg); animation: sweep 3.8s 2s ease-in-out infinite; }
@keyframes sweep { 0% { left: -60%; } 35%, 100% { left: 130%; } }

/* Warp on submit */
.gate.warping .login-card { transform: scale(.97); box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand-2) 50%, transparent), 0 30px 80px -20px color-mix(in srgb, var(--brand-2) 60%, transparent); }

@media (prefers-reduced-motion: reduce) {
  .enter::before { display: none; }
  .gate .mark, .login-card > * { animation: none; }
  .login-card { transition: none; }
}

/* ---------- Back to top (always floating on inside pages) ---------- */
.totop { position: fixed; z-index: 45; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  width: 52px; height: 52px; border-radius: 50%; border: 0; padding: 0; display: grid; place-items: center; cursor: pointer; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 10px 24px -8px rgba(36, 96, 172, .65);
  transition: transform .2s, box-shadow .2s, filter .2s; }
.totop:hover { transform: translateY(-3px); filter: brightness(1.08); box-shadow: 0 14px 28px -8px rgba(36, 96, 172, .75); }
.totop:active { transform: scale(.94); }
.totop:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
@media (max-width: 460px) { .totop { width: 48px; height: 48px; } }
.totop svg { width: 23px; height: 23px; }
/* Never let the login page scroll sideways on phones */
.gate { overflow: hidden; overflow: clip; }
@media (prefers-reduced-motion: reduce) { .inv-logo img { transition: none; } .inv-card:hover .inv-logo img { transform: none; } }

/* ---------- Project page heading: count sits right under the title ---------- */
body.inside .head-list .count { font-size: 15px; }
@media (max-width: 800px) {
  body.inside .head-list { flex-direction: column; align-items: flex-start; gap: 4px; margin-bottom: 18px; }
  body.inside .head-list .count { font-size: 16.5px; color: #4a5872; }
}

/* ---------- Search box gets a stronger border once the page scrolls ---------- */
.bar .search input { transition: border-color .25s, box-shadow .25s, background .25s; }
.bar.scrolled .search input:not(:focus) { background: #fff; border-color: color-mix(in srgb, var(--brand) 60%, var(--line));
  box-shadow: 0 4px 14px -6px rgba(36, 96, 172, .4); }
