/* =========================================================================
   Brio — Design System. Dark sidebar + light command center.
   ========================================================================= */

:root {
  --blue: #1641FF;
  --blue-strong: #1237D8;
  --blue-soft: #E8EDFF;
  --blue-soft-2: #DCE3FF;
  --violet: #1641FF;
  --violet-soft: #E8EDFF;
  --mint: #12A97C;
  --mint-soft: #E4F6EE;
  --rose: #E5484D;
  --rose-soft: #FDEBEC;
  --amber: #F5B301;
  --amber-soft: #FFF4D6;
  --peach: #F07D3C;
  --peach-soft: #FDEEE3;
  --sky: #2FB7D6;
  --sky-soft: #E2F5FA;

  --bg: #ECEFF3;
  --surface: #FFFFFF;
  --surface-2: #FAFCFF;
  --border: #E3E7EE;
  --border-strong: #D8DCE2;

  --ink: #1A1B25;
  --ink-2: #3A3F47;
  --muted: #666D80;
  --muted-2: #A8ADB5;

  --sidebar-bg: #1A1B25;
  --sidebar-ink: #A7ADB8;
  --sidebar-ink-active: #FFFFFF;
  --sidebar-hover: #262833;

  --shadow-sm: 0 1px 2px rgba(26, 27, 37, .04), 0 1px 3px rgba(26, 27, 37, .05);
  --shadow-md: 0 4px 14px -4px rgba(26, 27, 37, .10);
  --shadow-lg: 0 18px 40px -16px rgba(26, 27, 37, .22);

  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --sidebar-w: 240px;
  --topbar-h: 64px;
  --font: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 14px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: inherit; }
img { max-width: 100%; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #D0D5DB; border-radius: 99px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #B8BEC7; }

/* ---------- Layout ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; background: var(--sidebar-bg);
  display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0;
  z-index: 40; transition: transform .25s cubic-bezier(.16,1,.3,1);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 20px 18px 16px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0;
  background: linear-gradient(135deg, #1641FF 0%, #1237D8 100%);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 17px; overflow: hidden;
}
.brand-mark img { width: 24px; height: 24px; }
.brand-name { color: #fff; font-weight: 800; font-size: 15.5px; letter-spacing: -.01em; }
.brand-sub { color: var(--sidebar-ink); font-size: 11px; }
.nav-scroll { flex: 1; overflow-y: auto; padding: 4px 12px 16px; }
.nav-section { color: #5A606B; font-size: 10.5px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; padding: 16px 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; text-decoration: none;
  color: var(--sidebar-ink); font-weight: 600; font-size: 13.5px;
  padding: 9px 11px; border-radius: 9px; margin-bottom: 2px; transition: background .13s, color .13s;
}
.nav-item .ic { display: inline-flex; opacity: .85; }
.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item.active { background: linear-gradient(135deg, #1641FF, #1237D8); color: #fff; box-shadow: 0 4px 14px -4px rgba(22, 65, 255, .45); }
.sidebar-foot {
  display: flex; align-items: center; gap: 10px; padding: 13px 16px;
  border-top: 1px solid #23262E; color: var(--sidebar-ink); font-size: 12px;
}
.avatar-sm {
  width: 32px; height: 32px; border-radius: 9px; background: #2A2E38; color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; flex-shrink: 0;
}
.main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  height: var(--topbar-h); background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px; padding: 0 24px; position: sticky; top: 0; z-index: 30;
}
.page-title { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -.02em; }
.page-crumb { color: var(--muted); font-size: 12px; }
.topbar-spacer { flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 8px; position: relative; }
.content { padding: 24px; flex: 1; }
.menu-toggle { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; border: 1px solid transparent;
  border-radius: 10px; padding: 9px 15px; font-size: 13px; font-weight: 700; font-family: inherit;
  cursor: pointer; text-decoration: none; transition: all .13s ease; line-height: 1.2;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-strong); box-shadow: var(--shadow-md); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--ink-2); }
.btn-ghost:hover { border-color: var(--border-strong); background: var(--surface-2); }
.btn-danger { background: var(--rose); color: #fff; }
.btn-danger:hover { background: #D23B40; }
.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 8px; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px;
  border: 1px solid var(--border); border-radius: 9px; background: var(--surface); cursor: pointer;
  color: var(--muted); transition: all .13s; flex-shrink: 0;
}
.icon-btn:hover { border-color: var(--border-strong); color: var(--ink); }

/* ---------- Inputs ---------- */
.input, .textarea, select.input {
  width: 100%; border: 1px solid var(--border); border-radius: 9px; background: var(--surface);
  padding: 9px 12px; font-size: 13.5px; font-family: inherit; color: var(--ink); transition: border .13s, box-shadow .13s;
}
.input:focus, .textarea:focus, select.input:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft);
}
.textarea { resize: vertical; min-height: 70px; }
.field { margin-bottom: 13px; }
.label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .3px; }
.tip {
  display: inline-block; margin-left: 4px; width: 14px; height: 14px; line-height: 14px; text-align: center;
  background: var(--muted-2); color: #fff; border-radius: 50%; font-size: 9px; font-weight: 800; cursor: help; vertical-align: 1px;
}

/* ---------- Cards / KPI ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); margin-bottom: 16px;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.card-title { font-weight: 800; font-size: 14.5px; letter-spacing: -.01em; }
.card-title .sub { display: block; font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 1px; }
.card-body { padding: 18px; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow-sm); border-top: 3px solid var(--blue);
  transition: transform .13s, box-shadow .13s;
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi.clickable { cursor: pointer; }
.kpi.clickable:hover { border-color: var(--blue-soft-2); }
.drill-item { padding: 10px 4px; border-bottom: 1px solid var(--border); cursor: pointer; border-radius: 8px; transition: background .12s; }
.drill-item:hover { background: var(--surface-2); padding-left: 10px; }
.drill-title { font-weight: 700; font-size: 13.5px; color: var(--ink); }
.drill-sub { font-size: 12px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.kpi-label { font-size: 12px; font-weight: 700; color: var(--muted); }
.kpi-icon { color: var(--muted-2); display: inline-flex; }
.kpi-value { font-size: 26px; font-weight: 800; letter-spacing: -.5px; line-height: 1.1; }
.kpi-delta { font-size: 11.5px; color: var(--muted-2); margin-top: 4px; font-weight: 600; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.row { display: flex; align-items: center; }
.row-between { display: flex; align-items: center; justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.text-sm { font-size: 12.5px; } .text-muted { color: var(--muted); }
.bold { font-weight: 700; }
.right { text-align: right; }
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- Table ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 11px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .4px; padding: 11px 16px; border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 13.5px; vertical-align: middle; }
.table tbody tr:hover { background: var(--surface-2); }
.table .right, .table th.right { text-align: right; }
.clickable { cursor: pointer; }

/* ---------- Badges / status ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; white-space: nowrap;
}
.badge-blue { background: var(--blue-soft); color: #1237D8; }
.badge-mint { background: var(--mint-soft); color: #0E8A64; }
.badge-rose { background: var(--rose-soft); color: #C63035; }
.badge-amber { background: var(--amber-soft); color: #9A6A00; }
.badge-violet { background: var(--violet-soft); color: #1237D8; }
.badge-gray { background: #EEF0F3; color: #6A7079; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); display: inline-block; animation: pulse 1.6s infinite; }
.offline-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted-2); display: inline-block; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(18,169,124,.4); } 50% { box-shadow: 0 0 0 5px rgba(18,169,124,0); } }

/* ---------- Empty / loading states ---------- */
.empty { text-align: center; color: var(--muted); padding: 40px 20px; }
.empty .e-ic { width: 52px; height: 52px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; color: var(--muted-2); margin-bottom: 10px; }
.skeleton { background: linear-gradient(90deg, #EEF0F3 25%, #F7F8FA 37%, #EEF0F3 63%); background-size: 400% 100%; animation: shimmer 1.3s infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ---------- Toast / notifications ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 11px; font-size: 13px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: all .22s cubic-bezier(.16,1,.3,1); z-index: 1000;
  display: flex; gap: 8px; align-items: center; box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.notif-pop {
  position: absolute; top: 46px; right: 0; width: 340px; max-width: 90vw; background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); z-index: 60;
  display: none; overflow: hidden;
}
.notif-pop.open { display: block; animation: popIn .15s ease; }
@keyframes popIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 13px 16px; border-bottom: 1px solid var(--border); font-weight: 800; font-size: 13px; }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-item { display: flex; gap: 11px; padding: 12px 16px; border-bottom: 1px solid var(--border); cursor: pointer; }
.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { background: #F7FAFF; }
.notif-ic { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.notif-title { font-size: 13px; font-weight: 700; }
.notif-msg { font-size: 12px; color: var(--muted); }
.notif-time { font-size: 11px; color: var(--muted-2); margin-top: 2px; }

/* ---------- Login (animated showcase) ---------- */
.login-body-anim { overflow-x: hidden; }
.login-page {
  min-height: 100vh; display: flex; align-items: stretch; justify-content: center;
  background: #0E0F16; position: relative; overflow: hidden;
}
.login-aurora { position: absolute; inset: 0; overflow: hidden; }
.login-aurora .orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; will-change: transform; }
.orb-1 { width: 520px; height: 520px; background: radial-gradient(circle at 30% 30%, #1641FF, transparent 65%); top: -120px; left: -80px; animation: drift1 18s ease-in-out infinite; }
.orb-2 { width: 460px; height: 460px; background: radial-gradient(circle at 60% 40%, #4C7DF0, transparent 65%); bottom: -140px; left: 38%; animation: drift2 22s ease-in-out infinite; }
.orb-3 { width: 380px; height: 380px; background: radial-gradient(circle at 40% 40%, #7C5CF0, transparent 65%); top: 30%; right: -100px; animation: drift3 20s ease-in-out infinite; }
@keyframes drift1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(70px, 50px) scale(1.15); } }
@keyframes drift2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-60px, -40px) scale(1.12); } }
@keyframes drift3 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-50px, 60px) scale(1.18); } }
.grid-fade {
  position: absolute; inset: 0; opacity: .08;
  background-image: linear-gradient(rgba(255,255,255,.6) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.6) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 0%, transparent 70%);
}
.login-particles { position: absolute; inset: 0; pointer-events: none; }
.login-particles span {
  position: absolute; bottom: -10px; border-radius: 50%;
  background: rgba(255,255,255,.5); animation: floatUp linear infinite;
}
@keyframes floatUp { 0% { transform: translateY(0); opacity: 0; } 10% { opacity: .7; } 90% { opacity: .2; } 100% { transform: translateY(-110vh); opacity: 0; } }

.login-wrap {
  position: relative; z-index: 2; width: 1080px; max-width: 100%;
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 0;
  align-items: stretch; margin: 0 auto;
}

/* --- left showcase --- */
.login-showcase {
  padding: 44px 56px 40px; color: #fff; display: flex; flex-direction: column;
  animation: reveal .6s cubic-bezier(.16,1,.3,1);
}
.brand-login { padding: 0; margin-bottom: 42px; }
.login-headline {
  margin: 0 0 14px; font-size: 42px; line-height: 1.12; font-weight: 800; letter-spacing: -.03em; max-width: 480px;
}
.hl-rotator {
  display: inline-block; color: #7C9BFF; transition: opacity .26s ease, transform .26s ease;
}
.login-lead { margin: 0 0 34px; font-size: 15px; color: rgba(255,255,255,.66); max-width: 440px; line-height: 1.6; }

.login-services { display: flex; flex-direction: column; gap: 10px; margin-bottom: 36px; }
.service-tile {
  display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 14px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  animation: tileIn .5s cubic-bezier(.16,1,.3,1) both; animation-delay: calc(var(--d) * 90ms + 250ms);
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
  max-width: 440px;
}
.service-tile:hover { transform: translateX(6px); background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.2); }
.service-ic {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1641FF, #1237D8); color: #fff;
}
.service-title { font-size: 13.5px; font-weight: 700; }
.service-desc { font-size: 12px; color: rgba(255,255,255,.55); }
@keyframes tileIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.login-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: auto; }
.stat-cell {
  animation: tileIn .5s cubic-bezier(.16,1,.3,1) both; animation-delay: calc(var(--d) * 90ms + 700ms);
}
.stat-num { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.stat-label { font-size: 11.5px; color: rgba(255,255,255,.5); margin-top: 2px; line-height: 1.3; }

/* --- right panel --- */
.login-panel { display: flex; align-items: center; justify-content: center; padding: 40px 32px; }
.login-card { width: 400px; max-width: 100%; background: #fff; border-radius: 20px; overflow: hidden; box-shadow: 0 30px 80px -20px rgba(0,0,0,.55); }
.login-card-head { padding: 28px 32px 4px; }
.login-card-title { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.login-card-sub { margin: 4px 0 0; font-size: 13.5px; color: var(--muted); }
.login-card .login-body { padding: 20px 32px 8px; }
.login-card-foot { padding: 12px 32px 22px; text-align: center; font-size: 12.5px; color: var(--muted); }
.login-foot-logo { margin-top: 8px; }
.login-foot-logo img { height: 13px; width: auto; max-width: 100%; display: inline-block; }

.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .input-ic {
  position: absolute; left: 13px; color: var(--muted-2); display: inline-flex; pointer-events: none;
}
.input-wrap .input { padding-left: 40px; padding-top: 11px; padding-bottom: 11px; }
.input-wrap .input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }

.login-btn {
  padding: 12px; font-size: 14px; margin-top: 8px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, #1641FF, #1237D8); transition: transform .15s ease, box-shadow .15s ease;
}
.login-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -6px rgba(22,65,255,.5); }
.login-btn:active { transform: translateY(0); }
.btn-arrow { transition: transform .15s ease; }
.login-btn:hover .btn-arrow { transform: translateX(4px); }

.login-error { background: var(--rose-soft); color: #C63035; border: 1px solid #F5C2C2; border-radius: 10px; padding: 10px 13px; font-size: 13px; margin-bottom: 14px; display: flex; gap: 8px; align-items: center; }
.reveal { animation: reveal .4s cubic-bezier(.16,1,.3,1); }
@keyframes reveal { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (max-width: 900px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-showcase { display: none; }
  .login-panel { padding: 24px 18px; min-height: 100vh; }
}

/* ---------- Footer ---------- */
.site-footer { margin-top: 8px; padding: 14px 24px; border-top: 1px solid var(--border); background: var(--surface); display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.site-footer .powered { display: flex; align-items: center; gap: 8px; }
.site-footer .powered .by { font-weight: 600; }
.site-footer img.env-logo { height: 15px; width: auto; opacity: .9; display: block; }
.site-footer a.brio-link { display: inline-flex; align-items: center; text-decoration: none; }
.site-footer a.brio-link img { height: 18px; width: auto; display: block; }
.site-footer a.brio-link:hover img { opacity: .8; }

/* ---------- Chat (WhatsApp-style) ---------- */
.chat-shell { display: grid; grid-template-columns: 320px 1fr 300px; gap: 0; height: calc(100vh - var(--topbar-h) - 48px); min-height: 520px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.chat-col { display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--border); }
.chat-col:last-child { border-right: 0; }
.chat-col-head { padding: 12px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.chat-col-head .t { font-weight: 800; font-size: 13.5px; }
.chat-col-head .s { font-size: 11.5px; color: var(--muted); }
.chat-list { flex: 1; overflow-y: auto; }
.chat-item { padding: 11px 14px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .12s; }
.chat-item:hover { background: var(--surface-2); }
.chat-item.active { background: var(--blue-soft); border-left: 3px solid var(--blue); }
.chat-item .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 3px; }
.chat-item .name { font-weight: 700; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item .time { font-size: 11px; color: var(--muted-2); flex-shrink: 0; }
.chat-item .preview { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unread-pill { background: var(--blue); color: #fff; border-radius: 999px; font-size: 10.5px; font-weight: 800; min-width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; }
.bubble-row { display: flex; margin-bottom: 8px; }
.bubble-row.in { justify-content: flex-end; }
.bubble-row.out { justify-content: flex-start; }
.bubble { max-width: 74%; padding: 8px 12px; border-radius: 14px; font-size: 13.5px; line-height: 1.5; word-wrap: break-word; position: relative; }
.bubble.in { background: var(--blue); color: #fff; border-bottom-right-radius: 4px; }
.bubble.out { background: #FFFFFF; color: var(--ink); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.bubble .meta { font-size: 10.5px; margin-top: 3px; opacity: .7; display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; background: #EDF0F5; }
.chat-composer { border-top: 1px solid var(--border); padding: 10px 12px; display: flex; gap: 8px; align-items: flex-end; background: var(--surface); }
.chat-composer textarea { flex: 1; resize: none; }
.sla-bar { height: 6px; border-radius: 99px; background: #EEF0F3; overflow: hidden; }
.sla-bar > i { display: block; height: 100%; border-radius: 99px; transition: width .4s ease; }
.sla-green { background: var(--mint); } .sla-amber { background: var(--amber); } .sla-red { background: var(--rose); } .sla-gray { background: #C3C9D2; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .menu-toggle { display: inline-flex; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr; }
}
