:root{
  --navy:#192537;
  --gold:#B09E80;
  --taupe:#716551;
  --light:#E9E9E9;
  --white:#fff;
}
*{box-sizing:border-box}
body.bg{background:var(--navy); color:var(--white); margin:0; font-family:Inter,system-ui,Arial}
a{color:var(--gold)}
.container{max-width:1100px; margin:40px auto; padding:0 16px}
.topbar{display:flex; justify-content:space-between; align-items:center; padding:14px 20px; background:#0f1822; border-bottom:1px solid rgba(255,255,255,.08); position:sticky; top:0}
.brand{font-weight:800; letter-spacing:1px}
.brand span{color:var(--gold)}
nav a{margin-left:16px; text-decoration:none; color:#eaeaea}
.card{background:#0f1822; border:1px solid rgba(255,255,255,.08); border-radius:14px; padding:18px; box-shadow:0 6px 18px rgba(0,0,0,.15)}
.form{display:grid; gap:10px; max-width:520px}
input,select,button{padding:10px 12px; border-radius:10px; border:1px solid #2a3441; background:#162232; color:#eaeaea}
button{background:var(--gold); color:#111; border:none; cursor:pointer; font-weight:600}
button:hover{filter:brightness(1.05)}
.grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:16px}
.table{width:100%; border-collapse:collapse; margin-top:16px}
.table th,.table td{border-bottom:1px solid rgba(255,255,255,.1); padding:10px}
.error{color:#ff998f}
.footer{padding:20px; text-align:center; color:#c9c9c9}
.iframe-wrap{background:#0f1822; border:1px solid rgba(255,255,255,.08); border-radius:14px; padding:8px}
.iframe-wrap iframe{width:100%; height:75vh; border:0; border-radius:10px}
.chk{display:inline-block; margin:6px 10px 0 0}
.btn{display:inline-block; background:var(--gold); color:#111; padding:8px 12px; border-radius:10px; text-decoration:none; font-weight:600}
.muted { color: rgba(255,255,255,.72); margin-top:6px; }
.alert { padding:10px 12px; border-radius:10px; margin:12px 0; border:1px solid rgba(255,255,255,.12); }
.alert-error { background: rgba(255,0,0,.10); }
.alert-ok { background: rgba(0,255,120,.10); }

nav a.active { color: var(--gold); border-bottom: 2px solid var(--gold); padding-bottom: 4px; }

.nav-user { margin-left:16px; color: rgba(255,255,255,.75); font-size: 0.95em; }

.inline { display:inline-flex; gap:8px; align-items:center; }
.btn-secondary { display:inline-block; background:#162232; color:#eaeaea; padding:8px 12px; border-radius:10px; text-decoration:none; font-weight:600; border:1px solid #2a3441; cursor:pointer; }
.btn-secondary:hover { filter:brightness(1.08); }

.row { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.row-actions { display:flex; gap:10px; margin-left:auto; }

.scrollbox { max-height: 320px; overflow:auto; padding-right: 8px; }
.scrollbox .chk { display:block; margin:8px 0; }
/* --- Responsive helpers --- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.row { display:flex; gap:12px; flex-wrap:wrap; align-items:center; }
.actions { display:flex; gap:8px; flex-wrap:wrap; }
.muted { color: rgba(255,255,255,.75); }
.badge { display:inline-block; padding:4px 10px; border-radius:999px; border:1px solid rgba(255,255,255,.12); font-size:12px; }
.nav-toggle { display:none; }
.nav-btn { display:none; border:1px solid rgba(255,255,255,.12); background:#162232; color:#eaeaea; padding:8px 10px; border-radius:10px; }

@media (max-width: 820px) {
  .container { margin:20px auto; }
  .topbar { padding:12px 14px; }
  nav { display:none; width:100%; padding:10px 0; }
  .nav-btn { display:inline-block; }
  .topbar { flex-wrap:wrap; gap:10px; }
  .nav-toggle:checked + nav { display:block; }
  nav a { display:block; margin:10px 0 0 0; padding:10px 12px; border-radius:10px; background:#162232; }
}
@media (max-width: 820px) {
  .table { display:block; }
  .table thead { display:none; }
  .table tbody, .table tr, .table td { display:block; width:100%; }
  .table tr { background:#0f1822; border:1px solid rgba(255,255,255,.08); border-radius:14px; padding:12px; margin:12px 0; }
  .table td { border:none; padding:8px 0; }
  .table td[data-label]::before {
    content: attr(data-label);
    display:block;
    font-size:12px;
    color: rgba(255,255,255,.65);
    margin-bottom:4px;
  }
}
@media (max-width: 820px) {
  .iframe-wrap iframe { height: 70vh; }
}
@media (max-width: 480px) {
  .iframe-wrap iframe { height: 78vh; }
}
@media (max-width: 820px) {
  .container { padding: 0 12px; }
  .card { padding: 16px; border-radius: 16px; }
  h1 { font-size: 28px; }
}
/* Desktop default: Actions should be structured and horizontal */
.table td[data-label="Actions"] .actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.table td[data-label="Actions"] .actions-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* Make reset password form align nicely on desktop */
.table td[data-label="Actions"] .reset-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

/* Ensure forms don't behave like full-width blocks on desktop */
.table td[data-label="Actions"] form {
  margin: 0;
  display: inline;
}@media (max-width: 820px) {
  .table td[data-label="Actions"] .actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }

  .table td[data-label="Actions"] .reset-row {
    grid-template-columns: 1fr;
  }

  .table td[data-label="Actions"] button,
  .table td[data-label="Actions"] a {
    width: 100%;
  }
}

.perm-grid { display:grid; gap:10px; }
.perm { display:flex; gap:10px; align-items:center; }

@media (min-width: 900px) {
  .perm-grid { grid-template-columns: 1fr 1fr; }
  .perm-grid button { grid-column: 1 / -1; width: fit-content; }
}
.logo { height: 28px; width: auto; margin-right: 10px; vertical-align: middle; }

.toast{
  position:fixed; right:18px; bottom:18px;
  max-width:420px; width:calc(100% - 36px);
  background:rgba(15,24,34,.95);
  border:1px solid rgba(255,255,255,.12);
  border-radius:16px;
  box-shadow:0 20px 40px rgba(0,0,0,.35);
  transform:translateY(20px); opacity:0;
  pointer-events:none;
  transition:.25s ease;
  z-index:9999;
}
.toast.show{ transform:translateY(0); opacity:1; pointer-events:auto; }
.toast-inner{ display:flex; gap:12px; align-items:flex-start; padding:14px; }
.toast-msg{ line-height:1.35; font-weight:650; }
.toast-close{ margin-left:auto; border:0; background:transparent; color:rgba(255,255,255,.8); font-size:18px; cursor:pointer; }
.toast.ok{ border-color:rgba(0,255,120,.25); }
.toast.error{ border-color:rgba(255,60,60,.35); }
.toast.info{ border-color:rgba(255,215,0,.25); }
.toast-msg { white-space: pre-line; }

.kpi-grid{
  display:grid;
  gap:12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.kpi{
  padding:16px;
}
.kpi-label{
  color: rgba(255,255,255,.65);
  font-weight:800;
  font-size:12px;
  letter-spacing:.8px;
  text-transform:uppercase;
}
.kpi-value{
  font-size:30px;
  font-weight:900;
  margin-top:8px;
}
.chart{
  width:100%;
  height:260px;
  border-radius:14px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
}

/* --- Analytics dashboard helpers --- */
.container { max-width: 1400px; } /* optional, makes dashboards breathe */

.kpi-grid{
  display:grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap:12px;
}
@media (max-width: 900px){
  .kpi-grid{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px){
  .kpi-grid{ grid-template-columns: 1fr; }
}

.kpi-label{
  font-size:12px;
  font-weight:900;
  letter-spacing:.8px;
  text-transform:uppercase;
  color: rgba(255,255,255,.62);
}
.kpi-value{
  font-size:32px;
  font-weight:900;
  margin-top:6px;
}

.chart{
  width:100%;
  height:280px;           /* ✅ this is what you’re missing */
  display:block;
}

.chart-tooltip{
  position:fixed;
  z-index:9999;
  pointer-events:none;
  background: rgba(15,24,34,.96);
  border:1px solid rgba(255,255,255,.14);
  border-radius:12px;
  padding:10px 12px;
  box-shadow:0 16px 40px rgba(0,0,0,.35);
  color:#fff;
  font-size:13px;
  line-height:1.35;
  transform: translate(10px, 10px);
  display:none;
}
.chart-tooltip.show{ display:block; }
.chart { width: 100%; height: 300px; display:block; }

.kpi-grid{
  display:grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
}
.kpi-label{ opacity:.7; font-size:12px; }
.kpi-value{ font-size:28px; font-weight:800; margin-top:6px; }

.chart-tooltip{
  position: fixed;
  z-index: 9999;
  display:none;
  pointer-events:none;
  background: rgba(20,20,20,.92);
  color: #fff;
  border: 1px solid rgba(255,255,255,.12);
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.avatar-container{ margin: 12px 0; }
.avatar-stage{
  position: relative;
  width: 100%;
  max-width: 980px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.18);
}
#avatarVideo{ width: 100%; height: 320px; object-fit: cover; display:block; }
#avatarAudio{ display:none; }
.avatar-overlay{
  position:absolute; inset:0;
  display:flex; align-items:center; justify-content:center;
  background: rgba(0,0,0,0.35);
  font-weight: 700;
}
.avatar-overlay.hidden{ display:none; }
.avatar-overlay.error{ background: rgba(120,0,0,0.35); }
/* ===== Dashboard (Commercial UI) ===== */

.page-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:16px;
  margin: 6px 0 14px;
}
.page-title{ margin:0; font-size:22px; }
.page-actions{ display:flex; gap:10px; flex-wrap:wrap; }

.card{
  background: rgba(0,0,0,.18);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 8px 22px rgba(0,0,0,.18);
}

.card-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  margin-bottom: 10px;
}
.card-title{ font-size:16px; font-weight:700; margin:0; }
.card-body{ margin-top: 6px; }

.muted{ opacity:.78; }
.small{ font-size:12px; }

.divider{
  height:1px;
  background: rgba(255,255,255,.10);
  margin: 12px 0;
}

.pill{
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  opacity: .9;
  white-space: nowrap;
}

.kpi-strip{ padding: 14px; }
.kpi-grid{
  display:grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 10px;
}
.kpi{
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
}
.kpi-strong{
  background: rgba(218, 165, 32, .12);
  border-color: rgba(218, 165, 32, .25);
}
.kpi-label{ font-size:12px; opacity:.82; }
.kpi-value{ font-size:18px; font-weight:800; margin-top:4px; }
.kpi-note{ font-size:12px; opacity:.7; margin-top:4px; min-height: 16px; }

.two-col{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.section-title{
  font-weight:700;
  font-size: 13px;
  margin: 6px 0 8px;
  opacity: .95;
}

.list{
  margin:0;
  padding-left: 18px;
}
.list.compact li{ margin: 4px 0; }
.list li{ margin: 6px 0; }

.btn-row{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top: 12px;
}

.dash-grid{
  margin-top: 14px;
  display:grid;
  grid-template-columns: 2fr 1fr;
  gap: 14px;
}

.stack{ display:flex; flex-direction:column; gap: 14px; }

.trend-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.trend-item{
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
}
.trend-value{ font-size:16px; font-weight:800; margin-top:4px; }

.skeleton{
  opacity: .8;
}

/* Responsive */
@media (max-width: 1100px){
  .kpi-grid{ grid-template-columns: repeat(2, minmax(140px, 1fr)); }
  .dash-grid{ grid-template-columns: 1fr; }
  .two-col{ grid-template-columns: 1fr; }
  .trend-grid{ grid-template-columns: 1fr; }
}
/* -------- Dashboard (commercial layout) -------- */
.dash { display: grid; gap: 14px; }
.dash-header { display:flex; align-items:flex-end; justify-content:space-between; gap: 12px; flex-wrap: wrap; }
.dash-title { margin: 0; font-size: 22px; letter-spacing: .2px; }
.dash-subtitle { opacity: .8; margin-top: 2px; }
.dash-actions { display:flex; gap: 10px; flex-wrap: wrap; }

.card-pad { padding: 14px; }
.section-head { display:flex; justify-content:space-between; align-items:flex-start; gap: 10px; margin-bottom: 12px; }
.section-title { margin: 0; font-size: 16px; }
.section-subtitle { opacity: .75; font-size: 13px; margin-top: 4px; }
.section-right { display:flex; gap: 8px; align-items:center; }

.pill {
  border: 1px solid rgba(255,255,255,.12);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  opacity: .85;
}

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }

/* grid */
.dash-grid {
  display:grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 14px;
}
@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: 1fr; }
}

/* reports */
.report-tabs { display:flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.report-tab {
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.03);
  color: inherit;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  opacity: .85;
}
.report-tab:hover { opacity: 1; }
.report-tab.active {
  border-color: rgba(255,255,255,.22);
  background: rgba(255,255,255,.06);
  opacity: 1;
}

.report-embed {
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 12px;
  overflow: hidden;
  height: 420px;
  background: rgba(255,255,255,.02);
}
.report-embed iframe { width: 100%; height: 100%; border: 0; }
.report-actions { margin-top: 10px; display:flex; justify-content:flex-end; }

/* KPIs */
.kpi-grid { display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
@media (max-width: 520px) { .kpi-grid { grid-template-columns: 1fr; } }

.kpi {
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255,255,255,.02);
}
.kpi-label { opacity: .75; font-size: 12px; }
.kpi-value { font-size: 18px; margin-top: 4px; }
.kpi-note { opacity: .65; font-size: 12px; margin-top: 4px; }

/* split */
.split { display:grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }

.mini-title { margin: 0 0 8px 0; font-size: 13px; opacity: .9; }
.list { margin: 0; padding-left: 18px; }
.muted { opacity: .7; }

/* insights */
.insight-grid { display:grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 900px) { .insight-grid { grid-template-columns: 1fr; } }
.insight { border: 1px solid rgba(255,255,255,.10); border-radius: 12px; padding: 10px; background: rgba(255,255,255,.02); }
.insight-title { font-size: 13px; opacity: .9; margin-bottom: 6px; }
.alert-item { padding: 6px 0; border-bottom: 1px dashed rgba(255,255,255,.08); }
.alert-item:last-child { border-bottom: 0; }

/* tables */
.table-wrap { border: 1px solid rgba(255,255,255,.10); border-radius: 12px; overflow: hidden; background: rgba(255,255,255,.02); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px; font-size: 13px; border-bottom: 1px solid rgba(255,255,255,.08); }
.table th { text-align: left; opacity: .8; background: rgba(255,255,255,.03); }
.table td.num, .table th.num { text-align: right; }
.table tr:last-child td { border-bottom: 0; }

/* chats */
.chat-list { list-style: none; margin: 0; padding: 0; display:grid; gap: 8px; }
.chat-item {
  display:flex;
  justify-content:space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 12px;
  background: rgba(255,255,255,.02);
  text-decoration: none;
  color: inherit;
}
.chat-item:hover { background: rgba(255,255,255,.04); }
.chat-title { opacity: .95; }
.chat-sub { opacity: .65; font-size: 12px; }

/* empty */
.empty { padding: 14px; border: 1px dashed rgba(255,255,255,.18); border-radius: 12px; background: rgba(255,255,255,.02); }
.empty-title { font-weight: 600; }
.empty-sub { opacity: .75; margin-top: 4px; font-size: 13px; }

/* actions */
.quick-actions { display:flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

/* skeleton */
.skeleton {
  height: 90px;
  background: linear-gradient(90deg, rgba(255,255,255,.03), rgba(255,255,255,.06), rgba(255,255,255,.03));
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* optional: primary button */
.btn-primary {
  border-color: rgba(255,255,255,.22) !important;
  background: rgba(255,255,255,.06) !important;
}


/* ---- Messages UI ---- */
.nav-msg-link{ position:relative; }
.nav-badge{
  position:absolute;
  top:-6px;
  right:-10px;
  background:#ff3b30;
  color:#fff;
  border-radius:999px;
  padding:2px 7px;
  font-size:12px;
  font-weight:800;
  line-height:1;
}

.badge{ display:inline-block; padding:3px 8px; border-radius:999px; background:var(--gold); font-weight:700; font-size:12px; }
.badge-red{ background:#ff3b30; color:#fff; }

.msg-wrap{
  max-width: 900px;
  margin: 0 auto;
  background: #40506f;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.06);
}
.msg-header{ padding: 6px 6px 10px 6px; border-bottom: 1px solid #eee; }
.msg-header h2{ margin:0; }
.msg-sub{ opacity:.7; font-size:13px; margin-top:4px; }

.msg-list{
  height: 520px;
  overflow:auto;
  padding: 14px 6px;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.bubble{
  max-width: 75%;
  border-radius: 14px;
  padding: 10px 12px;
  border: 1px solid #eee;
}
.bubble.me{ align-self:flex-end; background:var(--gold); }
.bubble.them{ align-self:flex-start; background:var(--taupe); }

.bubble-meta{
  display:flex;
  gap:10px;
  justify-content:space-between;
  font-size:12px;
  opacity:.7;
  margin-bottom:6px;
}
.bubble-text{ white-space:pre-wrap; }

.msg-compose{
  display:flex;
  gap:10px;
  padding-top: 12px;
  border-top: 1px solid #eee;
}
.msg-input{
  flex:1;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid #ddd;
  outline: none;
}



/* ================================
   ALIVE UI LAYER (drop-in)
   Paste at bottom of styles.css
================================ */

/* Motion + elevation tokens */
:root{
  --bg0:#0b1220;
  --bg1:#0f1822;
  --bg2:#162232;
  --stroke: rgba(255,255,255,.10);
  --stroke2: rgba(255,255,255,.14);
  --shadow1: 0 10px 30px rgba(0,0,0,.22);
  --shadow2: 0 18px 60px rgba(0,0,0,.35);

  --radius-lg: 18px;
  --radius-md: 14px;

  --ease-out: cubic-bezier(.2,.8,.2,1);
  --ease-spring: cubic-bezier(.2,1.2,.2,1);
  --t-fast: 160ms;
  --t-med: 260ms;
}

/* Better default typography & smoothing */
body.bg{
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
}

/* Subtle animated background (very light) */
body.bg::before{
  content:"";
  position:fixed;
  inset:-80px;
  z-index:-1;
  opacity:.9;
  animation: bgFloat 14s var(--ease-out) infinite alternate;
}
@keyframes bgFloat{
  from{ transform: translate3d(0,0,0) scale(1); }
  to{ transform: translate3d(0,-14px,0) scale(1.02); }
}

/* Container spacing improves a lot on mobile */
.container{
  max-width: 1180px;
  margin: 34px auto;
  padding: 0 16px;
}
@media (max-width: 820px){
  .container{ margin: 18px auto; padding: 0 12px; }
}

/* Sticky topbar: glass + nicer separation */
.topbar{
  backdrop-filter: blur(10px);
  background: rgba(15,24,34,.72);
  border-bottom: 1px solid rgba(255,255,255,.10);
}

/* Nav links: underline animation */
nav a{
  position:relative;
  padding: 8px 6px;
  border-radius: 10px;
  transition: background var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}
nav a::after{
  content:"";
  position:absolute;
  left:10px; right:10px;
  bottom:4px;
  height:2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t-med) var(--ease-out);
  border-radius: 999px;
  opacity:.9;
}
nav a:hover{
  background: rgba(255,255,255,.06);
}
nav a:hover::after{
  transform: scaleX(1);
}
nav a.active::after{
  transform: scaleX(1);
}

/* Cards: glass + hover lift */
.card{
  background: rgba(15,24,34,.78);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  box-shadow: rgba(176,158,128,.12);
  transition: transform var(--t-med) var(--ease-out), box-shadow var(--t-med) var(--ease-out), border-color var(--t-fast) var(--ease-out);
}
.card:hover{
  transform: translateY(-3px);
  box-shadow: var(--shadow2);
  border-color: rgba(255,255,255,.16);
}

/* Buttons: nicer press, glow, disabled */
button, .btn, .btn-secondary{
  transition:
    transform var(--t-fast) var(--ease-out),
    filter var(--t-fast) var(--ease-out),
    box-shadow var(--t-fast) var(--ease-out),
    background var(--t-fast) var(--ease-out);
  will-change: transform;
}
button:active, .btn:active, .btn-secondary:active{
  transform: translateY(1px) scale(.99);
}
.btn, button{
  box-shadow: 0 10px 24px rgba(176,158,128,.12);
}
.btn:hover, button:hover{
  box-shadow: 0 14px 34px rgba(176,158,128,.18);
}
button:disabled, .btn.disabled{
  opacity:.55;
  cursor:not-allowed;
  box-shadow:none;
}

/* Inputs: focus ring + subtle lift */
input, select, textarea{
  transition: border-color var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out);
}
input:focus, select:focus, textarea:focus{
  outline:none;
  border-color: rgba(176,158,128,.55);
  box-shadow: 0 0 0 4px rgba(176,158,128,.12);
  transform: translateY(-1px);
}

/* KPI tiles feel “interactive” */
.kpi{
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: var(--radius-md);
  transition: transform var(--t-med) var(--ease-out), border-color var(--t-fast) var(--ease-out);
}
.kpi:hover{
  transform: translateY(-2px);
  border-color: rgba(255,255,255,.16);
}

/* Table rows: hover highlight */
.table tr{
  transition: background var(--t-fast) var(--ease-out);
}
.table tbody tr:hover{
  background: rgba(255,255,255,.035);
}

/* Scrollbars (nice but subtle) */
*::-webkit-scrollbar{ width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.14);
  border-radius: 999px;
  border: 2px solid rgba(0,0,0,0);
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover{ background: rgba(255,255,255,.20); }

/* Reveal animation helpers */
.reveal{
  opacity:0;
  transform: translateY(10px);
}
.reveal.is-in{
  opacity:1;
  transform: translateY(0);
  transition: opacity 520ms var(--ease-out), transform 520ms var(--ease-out);
}

/* Reduce motion accessibility */
@media (prefers-reduced-motion: reduce){
  *{ animation: none !important; transition: none !important; scroll-behavior:auto !important; }
  body.bg::before{ display:none; }
}
/* Mobile nav: slide down animation */
@media (max-width: 820px){
  nav{
    transform-origin: top;
    transform: scaleY(.96);
    opacity: 0;
    transition: transform 180ms var(--ease-out), opacity 180ms var(--ease-out);
  }
  .nav-toggle:checked + nav{
    opacity: 1;
    transform: scaleY(1);
  }
}
/* =========================================================
   ui-enhanced.css (LOAD AFTER styles.css)
   Safe overrides + consistent layout + animations
========================================================= */

/* tokens */
:root{
  --bg0:#0b1220;
  --bg1:#0f1822;
  --bg2:#162232;

  --stroke: rgba(255,255,255,.10);
  --stroke2: rgba(255,255,255,.16);

  --shadow1: 0 10px 30px rgba(0,0,0,.22);
  --shadow2: 0 18px 60px rgba(0,0,0,.35);

  --radius-lg: 18px;
  --radius-md: 14px;

  --ease-out: cubic-bezier(.2,.8,.2,1);
  --t-fast: 160ms;
  --t-med: 260ms;
}

/* background alive (light) */
body.bg{
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body.bg::before{
  content:"";
  position:fixed;
  inset:-80px;
  z-index:-1;
  opacity:.95;
  animation: bgFloat 14s var(--ease-out) infinite alternate;
}
@keyframes bgFloat{
  from{ transform: translate3d(0,0,0) scale(1); }
  to{ transform: translate3d(0,-16px,0) scale(1.02); }
}

/* container spacing */
.container{
  max-width: 1180px !important;
  margin: 28px auto !important;
  padding: 0 16px !important;
}
@media (max-width: 820px){
  .container{ margin: 18px auto !important; padding: 0 12px !important; }
}

/* topbar glass */
.topbar{
  backdrop-filter: blur(10px);
  background: rgba(15,24,34,.72) !important;
  border-bottom: 1px solid rgba(255,255,255,.10) !important;
}

/* nav underline animation (keeps active style) */
nav a{
  position:relative;
  padding: 8px 8px !important;
  border-radius: 10px !important;
  transition: background var(--t-fast) var(--ease-out);
}
nav a::after{
  content:"";
  position:absolute;
  left:10px; right:10px;
  bottom:4px;
  height:2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t-med) var(--ease-out);
  border-radius: 999px;
  opacity:.9;
}
nav a:hover{ background: rgba(255,255,255,.06); }
nav a:hover::after{ transform: scaleX(1); }
nav a.active::after{ transform: scaleX(1); }

/* cards everywhere */
.card{
  background: rgba(15,24,34,.78) !important;
  border: 1px solid var(--stroke) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow1) !important;
  transition: transform var(--t-med) var(--ease-out), box-shadow var(--t-med) var(--ease-out), border-color var(--t-fast) var(--ease-out);
}
.card:hover{
  transform: translateY(-3px);
  box-shadow: var(--shadow2) !important;
  border-color: rgba(255,255,255,.16) !important;
}

/* buttons feel alive */
button, .btn, .btn-secondary{
  transition: transform var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out), filter var(--t-fast) var(--ease-out);
  will-change: transform;
}
button:active, .btn:active, .btn-secondary:active{
  transform: translateY(1px) scale(.99);
}
.btn, button{
  box-shadow: 0 10px 24px rgba(176,158,128,.12);
}
.btn:hover, button:hover{
  box-shadow: 0 14px 34px rgba(176,158,128,.18);
}

/* inputs focus ring */
input, select, textarea{
  transition: border-color var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out);
}
input:focus, select:focus, textarea:focus{
  outline:none;
  border-color: rgba(176,158,128,.55) !important;
  box-shadow: 0 0 0 4px rgba(176,158,128,.12) !important;
  transform: translateY(-1px);
}

/* tables */
.table-wrap{
  border: 1px solid rgba(255,255,255,.10) !important;
  border-radius: 12px !important;
  overflow: hidden;
  background: rgba(255,255,255,.02);
}
.table tbody tr:hover{ background: rgba(255,255,255,.035); }

/* page fade-in + reveal */
.page{
  animation: pageIn 260ms var(--ease-out) both;
}
@keyframes pageIn{
  from{ opacity:0; transform: translateY(6px); }
  to{ opacity:1; transform: translateY(0); }
}
.reveal{ opacity:0; transform: translateY(10px); }
.reveal.is-in{
  opacity:1;
  transform: translateY(0);
  transition: opacity 520ms var(--ease-out), transform 520ms var(--ease-out);
}

/* auth page helpers (optional wrapper) */
.auth-shell{
  min-height: calc(100vh - 220px);
  display:grid;
  place-items:center;
}
.auth-card{ width: min(520px, 100%); }
.auth-title{ margin:0 0 6px; font-size:26px; }
.auth-sub{ opacity:.75; margin:0 0 14px; }

/* mobile nav smooth open */
@media (max-width: 820px){
  nav{
    transform-origin: top;
    transform: scaleY(.96);
    opacity: 0;
    transition: transform 180ms var(--ease-out), opacity 180ms var(--ease-out);
  }
  .nav-toggle:checked + nav{
    opacity: 1;
    transform: scaleY(1);
  }
}

/* reduce motion */
@media (prefers-reduced-motion: reduce){
  *{ animation:none !important; transition:none !important; }
  body.bg::before{ display:none; }
}



/* =====================================================================
   2026 Responsive + Motion Upgrade (global)
   - Better on mobile/webview ("mobile application")
   - Cleaner animations + micro-interactions
   - Fix: tables on mobile now scroll horizontally by default
   ===================================================================== */

:root{
  --surface: rgba(15,24,34,0.92);
  --surface-2: rgba(22,34,50,0.78);
  --border: rgba(255,255,255,.10);
  --border-2: rgba(255,255,255,.16);
  --shadow: 0 18px 50px rgba(0,0,0,.35);
  --radius: 16px;
  --radius-sm: 12px;
  --ease: cubic-bezier(.2,.8,.2,1);
}

html{ -webkit-text-size-adjust:100%; text-size-adjust:100%; }
body.bg{ min-height: 100dvh; }

/* Safer for "app" mode on iOS/Android (notches) */
.topbar{ padding-top: calc(14px + env(safe-area-inset-top)); }
.footer{ padding-bottom: calc(20px + env(safe-area-inset-bottom)); }

/* A bit more fluid spacing on all devices */
.container{
  width:100%;
  max-width: 1200px;
  padding-left: clamp(12px, 3vw, 20px);
  padding-right: clamp(12px, 3vw, 20px);
}

/* Mobile nav: animate open/close (keeps your checkbox toggle) */
@media (max-width: 820px){
  nav{
    display: block !important;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height .28s var(--ease), opacity .2s var(--ease);
  }
  .nav-toggle:checked + nav{
    max-height: 70vh;
    opacity: 1;
  }
}

/* Better focus ring (keyboard users) */
:focus-visible{
  outline: 2px solid rgba(176,158,128,.95);
  outline-offset: 2px;
}

/* Interactive cards */
.card{ transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease); }
@media (hover:hover) and (pointer:fine){
  .card:hover{ transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-2); }
}

/* Buttons: smoother + touch feedback */
button, .btn, .btn-secondary{
  transition: transform .12s var(--ease), filter .18s var(--ease), box-shadow .18s var(--ease);
}
button:active, .btn:active, .btn-secondary:active{ transform: translateY(1px) scale(.99); }

/* Ripple (used by ui-effects.js) */
.ui-ripple-host{ position:relative; overflow:hidden; }
.ui-ripple{
  position:absolute;
  left:0; top:0;
  width:14px; height:14px;
  border-radius:999px;
  background: rgba(255,255,255,.35);
  transform: translate(-50%,-50%) scale(0);
  opacity:.35;
  pointer-events:none;
  animation: uiRipple .55s var(--ease) forwards;
}
@keyframes uiRipple{
  to{ transform: translate(-50%,-50%) scale(18); opacity:0; }
}

/* Reveal animations (used by ui-effects.js) */
.reveal{ opacity:0; transform: translateY(10px); transition: opacity .55s var(--ease), transform .55s var(--ease); }
.reveal.in-view{ opacity:1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce){
  .reveal{ opacity:1 !important; transform:none !important; transition:none !important; }
  button, .btn, .btn-secondary, .card{ transition:none !important; }
}

/* =====================================================================
   Tables on mobile
   - Old behavior collapsed tables into "cards" which breaks tables that
     don't have td[data-label] (most of yours).
   - New default: keep tables as tables and allow horizontal scroll.
   - If you still want card-style: add class="table table-cards".
   ===================================================================== */

.table-wrap{ position:relative; overflow-x:auto; -webkit-overflow-scrolling: touch; }
.table-wrap::-webkit-scrollbar{ height:10px; }
.table-wrap::-webkit-scrollbar-thumb{ background: rgba(255,255,255,.18); border-radius:999px; }

/* Scroll hint on mobile when the table is wider than its container */
.table-wrap.has-x::before{
  content:"";
  position:absolute;
  top:0; right:0; bottom:0;
  width:46px;
  background: linear-gradient(to right, rgba(15,24,34,0), rgba(15,24,34,.95));
  pointer-events:none;
}
.table-wrap.has-x::after{
  content:"Swipe →";
  position:absolute;
  top:10px;
  right:10px;
  font-size:12px;
  font-weight:800;
  letter-spacing:.2px;
  color: rgba(255,255,255,.85);
  background: rgba(15,24,34,.85);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  padding: 6px 10px;
  pointer-events:none;
}
@media (min-width: 821px){
  .table-wrap.has-x::before,
  .table-wrap.has-x::after{ display:none; }
}

/* Force "real table" rendering on mobile */
@media (max-width: 820px){
  .table{ display: table !important; width: 100% !important; }
  .table thead{ display: table-header-group !important; }
  .table tbody{ display: table-row-group !important; }
  .table tr{ display: table-row !important; background: transparent !important; border: 0 !important; margin:0 !important; padding:0 !important; }
  .table th, .table td{ display: table-cell !important; }
  .table td[data-label]::before{ content: none !important; }
  .table-wrap .table{ min-width: 720px; } /* gives swipe space */
}

/* Optional: card-style tables (add class="table table-cards") */
@media (max-width: 820px){
  .table.table-cards{ display:block !important; min-width:0 !important; }
  .table.table-cards thead{ display:none !important; }
  .table.table-cards tbody, .table.table-cards tr, .table.table-cards td{ display:block !important; width:100% !important; }
  .table.table-cards tr{
    background: #0f1822 !important;
    border: 1px solid rgba(255,255,255,.10) !important;
    border-radius: var(--radius) !important;
    padding: 12px !important;
    margin: 12px 0 !important;
  }
  .table.table-cards td{ border:none !important; padding: 8px 0 !important; }
  .table.table-cards td[data-label]::before{
    content: attr(data-label) !important;
    display:block;
    font-size: 12px;
    opacity:.72;
    margin-bottom: 4px;
  }
}
/* ===========================
   App Shell: Sidebar + Topbar
   =========================== */

.app-shell{
  min-height: 100vh;
  display: flex;
  background: var(--navy);
}

.app-sidebar{
  position: sticky;
  top: 0;
  height: 100vh;
  width: 260px;
  background: #0f1822;
  border-right: 1px solid rgba(255,255,255,0.08);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 50;
}

.app-sidebar-top{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.app-brand{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: rgba(255,255,255,0.95);
  font-weight: 900;
  letter-spacing: 0.4px;
}
.app-brand-text span{ color: var(--gold); }

.icon-btn{
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(22,34,50,0.55);
  color: rgba(255,255,255,0.92);
  cursor: pointer;
}
.icon-btn.ghost{ background: transparent; }
.icon-btn:hover{ filter: brightness(1.08); }

.app-nav{ display:flex; flex-direction:column; gap: 6px; }
.app-nav-group{
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  margin: 8px 6px 4px;
}

.app-link{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 14px;
  text-decoration: none;
  color: rgba(255,255,255,0.88);
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(22,34,50,0.65);
  transition: transform .15s ease, filter .15s ease;
}
.app-link:hover{ filter: brightness(1.06); transform: translateY(-1px); }
.app-link.active{
  border-color: rgba(176,158,128,0.75);
  box-shadow: 0 0 0 2px rgba(176,158,128,0.15) inset;
}
.app-ico{ width: 20px; text-align:center; }
.app-txt{ font-weight: 750; }

.app-badge{
  margin-left: auto;
  min-width: 26px;
  height: 22px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255,80,80,0.95);
  color: #111;
  font-weight: 900;
  font-size: 12px;
}

.app-sidebar-bottom{
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.app-main{ flex: 1; min-width: 0; }

.app-topbar{
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(15,24,34,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.app-topbar-title{ font-weight: 900; letter-spacing: 0.2px; }
.app-topbar-right{ margin-left: auto; display:flex; align-items:center; gap:10px; }

.app-mobile-menu{ display:none; }
.app-content{ padding: 18px 18px 28px; }

/* Collapsed sidebar */
.app-shell.sidebar-collapsed .app-sidebar{ width: 86px; }
.app-shell.sidebar-collapsed .app-txt,
.app-shell.sidebar-collapsed .app-nav-group,
.app-shell.sidebar-collapsed .app-brand-text,
.app-shell.sidebar-collapsed .app-badge{ display:none; }
.app-shell.sidebar-collapsed .app-link{ justify-content:center; }

/* Mobile overlay sidebar */
.app-sidebar-backdrop{
  display:none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 45;
}
.app-sidebar-backdrop.show{ display:block; }

@media (max-width: 920px){
  .app-mobile-menu{ display:inline-flex; }
  .app-sidebar{
    position: fixed;
    left: -290px;
    top: 0;
    width: 270px;
    height: 100vh;
    transition: left .2s ease;
  }
  .app-sidebar.mobile-open{ left: 0; }
  .app-shell.sidebar-collapsed .app-sidebar{ width: 270px; }
  .app-shell.sidebar-collapsed .app-txt,
  .app-shell.sidebar-collapsed .app-nav-group,
  .app-shell.sidebar-collapsed .app-brand-text,
  .app-shell.sidebar-collapsed .app-badge{ display: initial; }
}
/* Reports hub (mail-style) */
.reports-hub{
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 14px;
  min-height: calc(100vh - 130px);
}
.reports-list{
  padding: 12px;
  overflow: auto;
  max-height: calc(100vh - 170px);
}
.report-item{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 10px 12px;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,0.08);
  background: rgba(22,34,50,0.7);
  cursor: pointer;
  margin-bottom: 10px;
}
.report-item:hover{ filter: brightness(1.06); }
.report-item.active{
  border-color: rgba(176,158,128,0.75);
  box-shadow: 0 0 0 2px rgba(176,158,128,0.15) inset;
}
.report-title{ font-weight: 850; }
.report-meta{ font-size: 12px; opacity: .75; margin-top: 2px; }

.pin-btn{
  margin-left: auto;
  width: 38px; height: 38px;
  border-radius: 12px;
  border:1px solid rgba(255,255,255,0.10);
  background: rgba(15,24,34,0.3);
  color: rgba(255,255,255,0.92);
  cursor:pointer;
}
.pin-btn.pinned{
  background: rgba(176,158,128,0.95);
  color: #111;
  border: none;
}

.reports-preview{
  display:flex;
  flex-direction: column;
  gap: 12px;
  min-width:0;
}
.reports-preview .iframe-wrap iframe{ height: 76vh; }

@media (max-width: 1100px){
  .reports-hub{ grid-template-columns: 1fr; }
  .reports-list{ max-height: none; }
  .reports-preview .iframe-wrap iframe{ height: 72vh; }
}
.filters-row{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
}

.seg{
  display:inline-flex;
  gap:6px;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(22,34,50,0.55);
}
.seg-btn{
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(15,24,34,0.35);
  color: rgba(255,255,255,0.92);
  border-radius: 12px;
  padding: 8px 10px;
  cursor:pointer;
  font-weight: 800;
}
.seg-btn.active{
  background: rgba(176,158,128,0.95);
  color: #111;
  border: none;
}

.kpi-grid{
  display:grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}
.kpi-card{
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(22,34,50,0.65);
  border-radius: 16px;
  padding: 12px;
}
.kpi-label{ font-size: 12px; opacity: .75; font-weight: 900; letter-spacing:.6px; text-transform: uppercase; }
.kpi-value{ font-size: 22px; font-weight: 950; margin-top: 6px; }

.two-col{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.t-right{ text-align:right; }
.row-strong td{ border-top: 1px solid rgba(255,255,255,0.14); padding-top: 10px; }

@media (max-width: 1100px){
  .kpi-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col{ grid-template-columns: 1fr; }
}
