:root{
  --wa-green:#128C7E;
  --wa-green-2:#075E54;
  --wa-bg:#f4f6f8;
  --wa-surface:#ffffff;
  --wa-border:rgba(16,24,40,.10);
  --wa-shadow:0 8px 26px rgba(16,24,40,.08);
  --wa-radius:14px;
  --wa-topbar-h:56px;
  --wa-bottom-h:58px;
}

html, body { height: 100%; }
html, body { overflow-x: hidden; }
*, *::before, *::after { box-sizing: border-box; }
body.wa-app{
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background: var(--wa-bg);
  color: #0f172a;
}

.wa-topbar{
  position: sticky;
  top: 0;
  z-index: 1030;
  height: var(--wa-topbar-h);
  display:flex;
  align-items:center;
  background: linear-gradient(90deg, var(--wa-green-2), var(--wa-green));
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.wa-brand{
  color:#fff;
  text-decoration:none;
  font-weight: 700;
  letter-spacing: .2px;
  font-size: 16px;
}
.wa-user{ color: rgba(255,255,255,.9); font-size: 13px; max-width: 46vw; overflow:hidden; text-overflow: ellipsis; white-space: nowrap; }

.wa-shell{
  display:flex;
  min-height: calc(var(--vh, 1vh) * 100 - var(--wa-topbar-h));
  padding-bottom: var(--wa-bottom-h);
  overflow-x: hidden;
}
.wa-main{ flex:1; padding: 14px 14px 22px; min-width: 0; }
.wa-content{ max-width: 1240px; margin: 0 auto; min-width: 0; }
.wa-alert{ border: 0; border-radius: 12px; box-shadow: 0 8px 24px rgba(16,24,40,.08); }

.wa-sidenav{ width: 264px; padding: 14px; }
.wa-sidenav-inner{
  background: var(--wa-surface);
  border: 1px solid var(--wa-border);
  border-radius: var(--wa-radius);
  box-shadow: var(--wa-shadow);
  padding: 10px;
  position: sticky;
  top: calc(var(--wa-topbar-h) + 14px);
  height: calc(var(--vh, 1vh) * 100 - var(--wa-topbar-h) - 28px);
  overflow:auto;
}
.wa-nav-item{
  display:block;
  text-decoration:none;
  color:#0f172a;
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
}
.wa-nav-item:hover{ background: rgba(18,140,126,.06); }
.wa-nav-item.active{
  background: rgba(18,140,126,.12);
  color: var(--wa-green-2);
}

.wa-bottombar{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--wa-bottom-h);
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--wa-border);
  z-index: 1030;
  display:flex;
}
.wa-tab{
  flex:1;
  text-decoration:none;
  color: rgba(15,23,42,.74);
  font-size: 12px;
  font-weight: 600;
  display:flex;
  flex-direction: column;
  align-items:center;
  justify-content:center;
  gap: 4px;
}
.wa-tab.active{ color: var(--wa-green-2); }

.wa-tab-icon{
  width: 22px;
  height: 22px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.wa-tab-icon svg{
  width: 22px;
  height: 22px;
  fill: currentColor;
  opacity: .92;
}
.wa-tab-label{
  font-size: 11px;
  line-height: 1;
}

.card{
  border: 1px solid var(--wa-border);
  border-radius: var(--wa-radius);
  box-shadow: var(--wa-shadow);
}
.btn-success{
  background: var(--wa-green);
  border-color: var(--wa-green);
}
.btn-success:hover{
  background: var(--wa-green-2);
  border-color: var(--wa-green-2);
}
.form-control, .form-select{
  border-radius: 12px;
  border-color: rgba(16,24,40,.14);
}
.form-control:focus, .form-select:focus{
  border-color: rgba(18,140,126,.55);
  box-shadow: 0 0 0 .25rem rgba(18,140,126,.12);
}

.table > :not(caption) > * > * { padding: .55rem .75rem; }
.table thead th{ font-size: 12px; color: rgba(15,23,42,.75); }

.wa-chat-shell{ height: calc(var(--vh, 1vh) * 100 - var(--wa-topbar-h) - var(--wa-bottom-h) - 28px); min-height: 520px; }
.wa-sidebar { border-right: 1px solid var(--wa-border); background: #fff; }
.wa-chat { background: #efeae2; }
.wa-chat-header { background: #f0f2f5; border-bottom: 1px solid var(--wa-border); }
.wa-chat-body { overflow-y: auto; padding: 12px; }
.wa-chat-compose { background: #f0f2f5; border-top: 1px solid var(--wa-border); }

.wa-bubble { max-width: 78%; padding: 10px 12px; border-radius: 12px; box-shadow: 0 1px 1px rgba(0,0,0,.10); }
.wa-bubble-in { background: #fff; border-top-left-radius: 6px; }
.wa-bubble-out { background: #d9fdd3; border-top-right-radius: 6px; }
.wa-meta { font-size: 11px; color: rgba(15,23,42,.55); }
.wa-chat-list-item { cursor: pointer; }
.wa-chat-list-item.active { background: rgba(18,140,126,.10); }

@media (min-width: 992px){
  .wa-shell{ padding-bottom: 0; }
  .wa-chat-shell{ height: calc(var(--vh, 1vh) * 100 - var(--wa-topbar-h) - 28px); }
}
