/* Zaya Corporate console */
body.has-tabs { background: #000; }
.app { min-height: 100vh; }
.side { display: none; }
.main { min-width: 0; }
.bar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: rgba(0,0,0,.8); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.bar .ent { flex: 1; min-width: 0; }
.bar select.input { height: 40px; border-radius: 999px; font-size: 14px; font-weight: 500; padding: 0 34px 0 14px; appearance: none; -webkit-appearance: none; background: var(--bg-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center; text-overflow: ellipsis; }
.who-btn { display: flex; align-items: center; gap: 8px; padding: 3px; border-radius: 999px; border: 1px solid var(--line-2); flex: none; }
.who-btn img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.who-btn span { display: none; text-align: left; line-height: 1.15; padding-right: 10px; }
.who-btn b { font-size: 13px; font-weight: 600; display: block; }
.who-btn small { font-family: var(--f-mono); font-size: 10px; color: var(--mid); }
.view { padding: 20px 16px 120px; outline: none; max-width: 1180px; }
.view > * { animation: vin .45s var(--ease) both; }
.view > *:nth-child(2) { animation-delay: .04s; } .view > *:nth-child(3) { animation-delay: .08s; } .view > *:nth-child(4) { animation-delay: .12s; }
@keyframes vin { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) { .view > * { animation: none; } }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(5, 1fr); background: rgba(10,9,8,.92); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.tabs a, .tabs button { display: grid; justify-items: center; gap: 3px; font-size: 10.5px; font-weight: 500; color: var(--mid); padding: 6px 0; position: relative; }
.tabs svg { width: 22px; height: 22px; }
.tabs .on { color: #fff; }
.tabs .on svg { color: var(--orange-hi); }
.badge { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 16px; height: 16px; border-radius: 999px; background: var(--orange); color: #fff; font: 600 10px/16px var(--f-body); padding: 0 4px; text-align: center; }

@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: 236px 1fr; }
  .side { display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; padding: 20px 14px; border-right: 1px solid var(--line); overflow-y: auto; }
  .side nav { display: grid; gap: 2px; }
  .side nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; font-size: 14px; color: #BDB8B2; position: relative; }
  .side nav a svg { width: 18px; height: 18px; }
  .side nav a:hover { background: rgba(255,255,255,.05); color: #fff; }
  .side nav a.on { background: rgba(255,255,255,.08); color: #fff; }
  .side nav a.on svg { color: var(--orange-hi); }
  .side nav .badge { position: static; margin-left: auto; }
  .side-foot { margin-top: auto; }
  .tabs, .m-only { display: none; }
  .bar { padding: 12px 28px; }
  .bar .ent { flex: 0 1 320px; }
  .bar .who-btn { margin-left: auto; }
  .who-btn span { display: block; }
  .view { padding: 28px 28px 80px; }
  body.has-tabs .toast { bottom: 24px; }
}

/* view building blocks */
.vh { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.vh h1 { font-family: var(--f-head); font-weight: 500; letter-spacing: -0.04em; font-size: clamp(30px, 7vw, 44px); line-height: 1; margin: 6px 0 0; }
.vh h1 .tone { display: inline; }
.grid { display: grid; gap: 12px; }
@media (min-width: 700px) { .g2 { grid-template-columns: 1fr 1fr; } .g3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) { .g-main { grid-template-columns: 1.6fr 1fr; } }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (min-width: 1000px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { padding: 16px; border-radius: var(--r-md); background: var(--bg-2); border: 1px solid var(--line); }
.kpi .v { font-family: var(--f-head); font-weight: 500; font-size: clamp(22px, 5.5vw, 30px); letter-spacing: -0.04em; margin-top: 6px; line-height: 1.05; }
.kpi .d { font-family: var(--f-mono); font-size: 11px; margin-top: 4px; color: var(--green); }
.kpi .d.dn { color: var(--pink); }
.kpi.hero { grid-column: span 2; background: radial-gradient(90% 140% at 100% 120%, #EA580C, #7C2006 45%, #141210 80%); border-color: rgba(249,115,22,.3); }
.kpi.hero .v { font-size: clamp(36px, 10vw, 56px); }
.chart { width: 100%; height: 170px; display: block; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 6px; }
.legend span { display: flex; align-items: center; gap: 6px; font-family: var(--f-mono); font-size: 11px; color: var(--mid); }
.legend i { width: 10px; height: 3px; border-radius: 2px; background: var(--orange-hi); }
.legend i.f { background: repeating-linear-gradient(90deg, var(--mid) 0 4px, transparent 4px 7px); }
.mix { display: flex; height: 10px; border-radius: 6px; overflow: hidden; gap: 2px; margin: 10px 0 4px; }
.mix i { display: block; height: 100%; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font: 500 11px var(--f-mono); color: var(--mid); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl td.r, .tbl th.r { text-align: right; }
.tbl .mono { font-size: 12px; }
.scroll-x { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
.empty { padding: 28px 8px; text-align: center; color: var(--mid); font-size: 14px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; }
.line-v { animation: vin .35s var(--ease) both; }
.ok-ic { color: var(--green); } .warn-ic { color: var(--amber); } .no-ic { color: var(--pink); }
.ring-t { font-family: var(--f-mono); font-size: 22px; }
.big-quote { font-family: var(--f-head); font-weight: 500; font-size: clamp(40px, 11vw, 64px); letter-spacing: -0.045em; line-height: 1; }
.tenor { display: flex; gap: 6px; flex-wrap: wrap; }
.tenor button { padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 13px; }
.tenor button.on { background: #fff; color: #000; border-color: #fff; }

/* cards */
.cardg { display: grid; gap: 12px; }
@media (min-width: 700px) { .cardg { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .cardg { grid-template-columns: repeat(3, 1fr); } }
.vcard { aspect-ratio: 1.586; border-radius: 16px; padding: 16px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; transition: filter .3s, opacity .3s; }
.vcard.k1 { background: linear-gradient(135deg, #2C2824, #000); border: 1px solid var(--line-2); }
.vcard.k2 { background: radial-gradient(120% 120% at 100% 100%, #F97316, #C2410C 40%, #3A1206); }
.vcard.k3 { background: linear-gradient(135deg, #FAF8F5, #E9E5E0); color: #16130F; }
.vcard.frozen { filter: grayscale(1) brightness(.6); }
.vcard .tp { display: flex; justify-content: space-between; font-family: var(--f-mono); font-size: 11px; }
.vcard .no { font-family: var(--f-mono); font-size: 14px; letter-spacing: .08em; }
.vcard .fz { position: absolute; inset: 0; display: none; place-items: center; font-family: var(--f-mono); font-size: 12px; color: #fff; }
.vcard.frozen .fz { display: grid; }
.cardbox { display: grid; gap: 10px; }
input[type=range] { width: 100%; accent-color: var(--orange); }

/* sheet */
.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 90; opacity: 0; pointer-events: none; transition: opacity .3s; }
.sheet-bg.on { opacity: 1; pointer-events: auto; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 91; max-height: 88vh; overflow-y: auto; background: var(--bg-1); border: 1px solid var(--line-2); border-radius: 24px 24px 0 0; padding: 10px 18px calc(24px + env(safe-area-inset-bottom)); transform: translateY(104%); transition: transform .4s var(--ease); }
.sheet.on { transform: none; }
.sheet::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--line-2); margin: 0 auto 14px; }
@media (min-width: 700px) { .sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: 460px; border-radius: 24px; transform: translate(-50%, -46%); opacity: 0; pointer-events: none; transition: transform .35s var(--ease), opacity .3s; } .sheet.on { transform: translate(-50%, -50%); opacity: 1; pointer-events: auto; } .sheet::before { display: none; } }
.sheet h3 { font-family: var(--f-head); font-weight: 500; font-size: 26px; letter-spacing: -0.035em; margin: 4px 0 12px; }
.role { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); margin-bottom: 8px; width: 100%; text-align: left; }
.role.on { border-color: var(--orange-hi); background: rgba(234,88,12,.08); }
.role img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.more-g { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.more-g a { display: grid; justify-items: center; gap: 8px; padding: 16px 6px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); font-size: 13px; text-align: center; }
.more-g svg { width: 22px; height: 22px; color: var(--orange-hi); }
.faceid { width: 84px; height: 84px; margin: 12px auto; border-radius: 22px; border: 2px solid var(--orange-hi); display: grid; place-items: center; animation: fid 1.1s ease-in-out infinite; }
.faceid svg { width: 44px; height: 44px; color: var(--orange-hi); }
@keyframes fid { 50% { transform: scale(.94); box-shadow: 0 0 0 10px rgba(249,115,22,.12); } }

/* chat */
.chat { display: flex; flex-direction: column; gap: 10px; min-height: 280px; }
.msg { max-width: 82%; padding: 10px 14px; border-radius: 18px; font-size: 14.5px; line-height: 1.45; animation: vin .3s var(--ease) both; }
.msg.them { background: var(--bg-3); border-bottom-left-radius: 6px; align-self: flex-start; }
.msg.me { background: var(--orange); color: #fff; border-bottom-right-radius: 6px; align-self: flex-end; }
.msg small { display: block; font-family: var(--f-mono); font-size: 10px; opacity: .6; margin-top: 4px; }
.compose { display: flex; gap: 8px; margin-top: 14px; }
.compose .input { border-radius: 999px; }
.typing { display: inline-flex; gap: 4px; padding: 14px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--mid); animation: ty 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes ty { 50% { opacity: .3; transform: translateY(-3px); } }
.log { font: 500 11.5px/1.8 var(--f-mono); color: #CFCAC4; max-height: 220px; overflow: hidden; }
.log div { animation: vin .3s both; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log b { color: var(--green); font-weight: 500; }

@keyframes sp { to { transform: rotate(360deg); } }
