* {
  box-sizing: border-box;
}

:root {
  --bg: #080f1c;
  --panel: rgba(10, 18, 32, .92);
  --line: rgba(255,255,255,.08);
  --muted: #8f9db4;
  --text: #edf5ff;
  --blue: #4fa3ff;
  --cyan: #69dbff;
  --green: #71e58d;
  --orange: #ffb25f;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, Montserrat, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

button,
textarea,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.login-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 185, 91, .22), transparent 28%),
    radial-gradient(circle at 80% 80%, rgba(51, 211, 255, .16), transparent 34%),
    linear-gradient(135deg, #101522, #1e2435);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
  padding: 34px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 28px;
  background: rgba(22, 28, 42, .86);
  box-shadow: 0 30px 80px rgba(0,0,0,.42);
  backdrop-filter: blur(16px);
}

.login-logo {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border-radius: 22px;
  background: linear-gradient(135deg, #ffb85c, #4fd8ff);
  color: #111827;
  font-weight: 900;
  font-size: 26px;
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: 30px;
}

.login-card p {
  margin: 0 0 24px;
  color: #aeb8ca;
}

.login-error {
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 103, 103, .35);
  border-radius: 16px;
  color: #ffd1d1;
  background: rgba(255, 103, 103, .12);
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-form label {
  display: grid;
  gap: 8px;
  color: #cad3e3;
}

.login-form input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  color: #fff;
  background: rgba(255,255,255,.07);
  outline: none;
}

.login-form button {
  border: 0;
  border-radius: 16px;
  padding: 13px 18px;
  color: #171717;
  font-weight: 800;
  background: linear-gradient(135deg, #ffc66d, #48d9ff);
}

.app-body {
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 0, rgba(43, 115, 255, .16), transparent 26%),
    radial-gradient(circle at 82% 2%, rgba(255, 178, 95, .09), transparent 25%),
    linear-gradient(180deg, #07101d, #090f1b 52%, #07101d);
}

.topbar {
  height: 64px;
  display: grid;
  grid-template-columns: 1fr 360px;
  align-items: center;
  padding: 0 28px 0 30px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  background: rgba(6, 13, 25, .94);
  box-shadow: 0 14px 32px rgba(0,0,0,.22);
}

.brand,
.top-actions,
.admin-user,

.top-actions {
  justify-content: flex-end;
  gap: 18px;
}

.bell {
  position: relative;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
}

.bell::before {
  content: '♧';
  color: #d7e4f5;
  font-size: 25px;
}

.bell span {
  position: absolute;
  top: 3px;
  right: 2px;
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #1d1207;
  background: var(--orange);
  font-size: 10px;
  font-weight: 900;
}

.admin-user {
  gap: 9px;
  color: #edf5ff;
}

.admin-user b {
  font-size: 14px;
}

.admin-user i {
  color: #91a4bd;
  font-style: normal;
}

.avatar {
  display: inline-block;
  border-radius: 50%;
  background:
    radial-gradient(circle at 37% 48%, #141b2c 0 2px, transparent 3px),
    radial-gradient(circle at 64% 48%, #141b2c 0 2px, transparent 3px),
    radial-gradient(circle at 50% 69%, rgba(118,64,46,.9) 0 3px, transparent 4px),
    radial-gradient(circle at 50% 25%, #182036 0 12px, transparent 13px),
    #efba91;
  box-shadow:
    inset 0 -3px 0 rgba(0,0,0,.12),
    0 0 0 2px rgba(113,229,141,.22);
}

.avatar-admin {
  width: 31px;
  height: 31px;
}

.logout-btn {
  height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 11px;
  color: #cbd9eb;
  background: rgba(255,255,255,.04);
}

.dashboard-shell {
  height: calc(100vh - 64px);
  display: grid;
  grid-template-columns: 190px minmax(680px, 1fr) 360px;
  gap: 10px;
  padding: 10px;
  overflow: hidden;
}

.side-menu {
  display: grid;
  grid-template-rows: repeat(5, auto) auto 1fr auto;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: linear-gradient(180deg, rgba(11,25,46,.96), rgba(7,14,27,.96));
  box-shadow: 0 24px 70px rgba(0,0,0,.25);
  overflow: hidden;
}

.side-item {
  min-height: 60px;
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 12px;
  color: #aebbd0;
  text-align: left;
  background: rgba(255,255,255,.025);
}

.side-item span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #b9d7f5;
  background: rgba(79,163,255,.08);
  font-size: 18px;
  line-height: 1;
}

.side-item b {
  display: block;
  margin-bottom: 3px;
  color: #e3edf9;
  font-size: 13px;
  font-weight: 800;
}

.side-item small {
  display: block;
  color: #7f8fa8;
  font-size: 11px;
  line-height: 1.25;
}

.side-item.active,
.side-item:hover {
  color: #d9f0ff;
  border-left-color: var(--blue);
  background: rgba(79, 163, 255, .13);
}

.side-info {
  margin-top: 4px;
  padding: 12px;
  border: 1px solid rgba(113,229,141,.12);
  border-radius: 14px;
  background: rgba(113,229,141,.06);
}

.side-info strong {
  display: block;
  margin-bottom: 5px;
  color: #71e58d;
  font-size: 13px;
}

.side-info span {
  display: block;
  color: #9aacc3;
  font-size: 11px;
  line-height: 1.35;
}

.side-bottom {
  align-self: end;
  display: grid;
  gap: 10px;
}

.side-collapse {
  height: 34px;
  border: 0;
  color: #aebbd0;
  background: transparent;
}

.office-column {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 58px;
  gap: 8px;
}

.office-stage {
  position: relative;
  overflow: hidden;
  min-height: 0;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 34%, rgba(79,163,255,.08), transparent 42%),
    #111a29;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.025),
    0 26px 70px rgba(0,0,0,.30);
}

#officeCanvas {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: auto;
}

.scene-status {
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  color: #dbe8f9;
  background: rgba(8, 15, 28, .78);
  backdrop-filter: blur(8px);
  box-shadow: 0 14px 30px rgba(0,0,0,.20);
}

.scene-status span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 18px rgba(113,229,141,.72);
}

.scene-status b {
  font-size: 13px;
}

.office-footer {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1.6fr .95fr;
  min-height: 58px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(13,27,49,.95), rgba(9,18,33,.96));
  box-shadow: 0 18px 50px rgba(0,0,0,.18);
}

.footer-card {
  display: grid;
  grid-template-columns: 26px 1fr;
  align-content: center;
  column-gap: 9px;
  padding: 9px 14px;
  border-right: 1px solid rgba(255,255,255,.055);
}

.footer-card:last-child {
  border-right: 0;
}

.footer-icon {
  grid-row: span 2;
  align-self: center;
  width: 22px;
  height: 22px;
  border-radius: 9px;
  border: 1px solid rgba(165,190,220,.24);
  background: rgba(255,255,255,.035);
}

.footer-icon.online {
  box-shadow: inset 0 0 0 7px rgba(113,229,141,.16);
}

.footer-icon.tasks {
  box-shadow: inset 0 0 0 7px rgba(255,178,95,.16);
}

.footer-icon.done,
.footer-icon.system {
  box-shadow: inset 0 0 0 7px rgba(113,229,141,.16);
}

.footer-card small {
  display: block;
  color: #8796ad;
  font-size: 11px;
}

.footer-card b {
  display: block;
  margin-top: 2px;
  color: #edf5ff;
  font-size: 13px;
}

.footer-card.wide b {
  color: var(--green);
}

.chat-panel {
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(9,17,31,.96), rgba(8,15,28,.96));
  box-shadow: 0 26px 70px rgba(0,0,0,.32);
}

.chat-head {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 14px;
  padding: 18px 20px 14px;
}

.chat-avatar-wrap {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(79, 163, 255, .08);
  border: 1px solid rgba(79, 163, 255, .13);
}

.avatar-agent {
  width: 34px;
  height: 34px;
}

.chat-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-title-row h2 {
  margin: 0;
  font-size: 19px;
  letter-spacing: -.02em;
}

.chat-title-row b {
  color: #9fb0c7;
  font-size: 13px;
  font-weight: 700;
}

.online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 16px rgba(113,229,141,.68);
}

.chat-head p {
  margin: 12px 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.about-btn {
  height: 32px;
  padding: 0 13px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  color: #aebbd0;
  background: rgba(255,255,255,.035);
}

.today-line {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  padding: 0 22px 10px;
  color: #7f8ea4;
  font-size: 12px;
}

.today-line span {
  height: 1px;
  background: rgba(255,255,255,.08);
}

.chat-messages {
  overflow: auto;
  padding: 8px 14px 14px 14px;
}

.message {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.message.user {
  justify-content: flex-end;
}

.msg-avatar {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  margin-top: 3px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 37% 48%, #141b2c 0 1.6px, transparent 2.4px),
    radial-gradient(circle at 64% 48%, #141b2c 0 1.6px, transparent 2.4px),
    radial-gradient(circle at 50% 25%, #182036 0 10px, transparent 11px),
    #efba91;
}

.bubble {
  max-width: 250px;
  position: relative;
  padding: 13px 14px 18px;
  border-radius: 11px;
  color: #dce8f8;
  background: rgba(255,255,255,.06);
  font-size: 13px;
  line-height: 1.4;
}

.message.user .bubble {
  color: #f2f8ff;
  background: linear-gradient(135deg, #2461cb, #347fe5);
  box-shadow: 0 14px 28px rgba(36,97,203,.22);
}

.bubble small {
  position: absolute;
  right: 10px;
  bottom: 5px;
  color: rgba(220,232,248,.55);
  font-size: 10px;
}

.report-bubble b {
  display: block;
  margin-bottom: 9px;
}

.report-bubble ul {
  margin: 0 0 11px 0;
  padding-left: 14px;
}

.report-bubble li {
  margin: 4px 0;
}

.report-bubble button {
  width: 100%;
  height: 34px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  color: #aebbd0;
  background: rgba(255,255,255,.035);
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 4px 0 12px 40px;
}

.quick-actions button {
  height: 34px;
  padding: 0 13px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 9px;
  color: #c9d7e8;
  background: rgba(79, 163, 255, .08);
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr 34px 44px;
  gap: 8px;
  align-items: end;
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(255,255,255,.055);
  background: rgba(255,255,255,.01);
}

.chat-form textarea {
  min-height: 48px;
  max-height: 130px;
  resize: vertical;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.075);
  border-radius: 11px;
  color: #edf5ff;
  background: rgba(255,255,255,.045);
  outline: none;
}

.attach-btn,
.send-btn {
  height: 44px;
  border: 0;
  border-radius: 13px;
}

.attach-btn {
  color: #aebbd0;
  background: transparent;
  font-size: 20px;
}

.send-btn {
  color: #fff;
  background: linear-gradient(135deg, #3578f0, #5faeff);
  box-shadow: 0 12px 24px rgba(53,120,240,.25);
}

.send-btn:disabled,
.chat-form textarea:disabled {
  opacity: .55;
  cursor: not-allowed;
}

@media (max-width: 1350px) {
  .app-body {
    overflow: auto;
  }

  .topbar {
    grid-template-columns: 1fr 310px;
  }

  .dashboard-shell {
    height: auto;
    grid-template-columns: 180px minmax(760px, 1fr);
    overflow: visible;
  }

  .chat-panel {
    grid-column: 2;
    min-height: 620px;
  }

  .office-stage {
    min-height: 720px;
  }
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .topnav {
    display: none;
  }

  .dashboard-shell {
    grid-template-columns: 1fr;
  }

  .side-menu {
    display: none;
  }

  .chat-panel {
    grid-column: 1;
  }
}
