:root {
  --bg: #07111f;
  --panel: rgba(255, 255, 255, 0.08);
  --panel-strong: rgba(255, 255, 255, 0.95);
  --panel-soft: rgba(255, 255, 255, 0.12);
  --border: rgba(255, 255, 255, 0.1);
  --border-light: #e3eafb;
  --text: #edf3ff;
  --text-dark: #142443;
  --muted: #9daac4;
  --muted-dark: #677691;
  --primary: #4285ff;
  --primary-deep: #6958ff;
  --accent: #26d3a2;
  --danger: #d64545;
  --success: #1f9d63;
  --shadow: 0 24px 80px rgba(4, 10, 26, 0.34);
  --radius-lg: 30px;
  --radius-md: 22px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(66, 133, 255, 0.26), transparent 20%),
    radial-gradient(circle at top right, rgba(105, 88, 255, 0.32), transparent 28%),
    radial-gradient(circle at 18% 82%, rgba(38, 211, 162, 0.14), transparent 18%),
    linear-gradient(180deg, #122547 0%, #09142b 36%, #050c18 100%);
  min-height: 100vh;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(circle at center, black 34%, transparent 84%);
  pointer-events: none;
  opacity: 0.38;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

.app-shell {
  max-width: 1360px;
  margin: 0 auto;
  padding: 24px 28px 42px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 22px;
  margin-bottom: 26px;
  background: linear-gradient(180deg, rgba(88, 102, 145, 0.48), rgba(66, 79, 118, 0.36));
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 16px;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand strong,
.brand small {
  display: block;
}

.brand-mark {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.32), transparent 32%),
    linear-gradient(135deg, #398fff, #6958ff);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.26);
}

.brand-bolt {
  font-size: 1.6rem;
  color: #0b1327;
  line-height: 1;
}

.brand-copy strong {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
}

.brand-copy strong span {
  color: #ffffff;
}

.brand-copy strong em {
  color: #83d8ff;
  font-style: normal;
}

.brand-copy small {
  color: rgba(237, 243, 255, 0.72);
}

.topbar-nav {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.topbar-nav a {
  color: #f3f6ff;
  font-weight: 700;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.topbar-nav a:hover {
  background: linear-gradient(135deg, rgba(66, 133, 255, 0.28), rgba(105, 88, 255, 0.26));
}

.page {
  display: grid;
  gap: 24px;
}

.hero-card,
.panel,
.auth-card,
.chat-panel,
.sidebar-card,
.stat-card {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.hero-card,
.chat-panel,
.sidebar-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(78, 92, 137, 0.34), rgba(26, 38, 66, 0.48));
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
}

.hero-card::before,
.chat-panel::before,
.sidebar-card::before,
.auth-copy::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.09), transparent 46%);
  pointer-events: none;
}

.hero-card::after,
.hero-mini::after,
.auth-copy::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  right: -80px;
  bottom: -120px;
  background: radial-gradient(circle, rgba(255, 209, 91, 0.18), transparent 60%);
  pointer-events: none;
}

.hero-card {
  padding: 38px 40px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
}

.hero-copy {
  max-width: 760px;
}

.hero-copy .subtle {
  max-width: 680px;
  color: #b8c4dc;
}

.hero-side {
  min-width: 220px;
  display: grid;
  justify-items: end;
  gap: 16px;
}

.hero-badge-card {
  min-width: 190px;
  padding: 18px 20px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-badge-card span,
.hero-badge-card small {
  display: block;
  color: #afbdd8;
}

.hero-badge-card strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 1.4rem;
  color: #ffffff;
}

.hero-card.compact {
  padding: 26px 30px;
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: #90defe;
  font-size: 0.72rem;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2.6rem, 4.5vw, 4.5rem);
  line-height: 0.98;
  margin-bottom: 14px;
  letter-spacing: -0.05em;
}

h2 {
  font-size: 1.7rem;
  margin-bottom: 6px;
  letter-spacing: -0.03em;
}

.subtle,
.label,
.bubble span,
.history-card span,
small,
.tip-list,
.mini-metrics span,
.empty-state,
.data-table td,
.data-table th {
  color: var(--muted);
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.delete-btn,
.auth-form button,
.chat-form button {
  border: 0;
  border-radius: 999px;
  padding: 14px 22px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.primary-btn,
.auth-form button,
.chat-form button {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  box-shadow: 0 18px 34px rgba(56, 109, 255, 0.3);
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #f2f6ff;
}

.ghost-btn {
  background: rgba(38, 211, 162, 0.14);
  color: #86f5d1;
}

.delete-btn {
  background: rgba(214, 69, 69, 0.14);
  color: #ffd4d4;
  align-self: center;
}

button:hover,
.primary-btn:hover,
.secondary-btn:hover,
.ghost-btn:hover,
.delete-btn:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.stat-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.stat-card {
  padding: 26px 24px;
  background: linear-gradient(180deg, #ffffff, #eef3ff);
  border: 1px solid #dfe7fb;
}

.stat-card span {
  display: block;
  margin-bottom: 14px;
  color: #7382a0;
  font-weight: 600;
}

.stat-card strong {
  font-size: 2.55rem;
  color: #192a49;
}

.panel {
  padding: 30px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 247, 255, 0.96));
  border: 1px solid #d8e2f8;
  box-shadow: 0 18px 38px rgba(8, 14, 34, 0.14);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.history-list,
.notification-list,
.manage-chat-list {
  display: grid;
  gap: 16px;
}

.history-card,
.notification-card,
.manage-chat-card {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #ffffff, #f5f8ff);
  border: 1px solid var(--border-light);
  box-shadow: 0 12px 24px rgba(22, 34, 62, 0.08);
}

.notification-card.unread {
  border-color: rgba(66, 133, 255, 0.28);
  box-shadow: inset 0 0 0 1px rgba(66, 133, 255, 0.16), 0 12px 24px rgba(22, 34, 62, 0.08);
}

.history-card h3,
.notification-card h3,
.manage-chat-card h3 {
  font-size: 1rem;
  margin-bottom: 8px;
  color: #18294a;
}

.history-card p,
.notification-card p,
.manage-chat-card p {
  margin-bottom: 10px;
  color: #697894;
}

.auth-page {
  min-height: calc(100vh - 140px);
  display: grid;
  place-items: center;
}

.auth-card {
  width: min(1100px, 100%);
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  overflow: hidden;
  min-height: 590px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-copy {
  padding: 56px 52px;
  position: relative;
  background:
    radial-gradient(circle at top left, rgba(66, 133, 255, 0.26), transparent 32%),
    radial-gradient(circle at 85% 15%, rgba(105, 88, 255, 0.22), transparent 22%),
    linear-gradient(135deg, rgba(12, 27, 60, 0.96), rgba(17, 37, 76, 0.9));
}

.auth-form {
  padding: 50px 42px;
  display: grid;
  gap: 18px;
  background: rgba(255, 255, 255, 0.98);
}

.auth-form-centered {
  align-content: center;
  min-height: 100%;
}

.auth-form label {
  display: grid;
  gap: 8px;
  font-weight: 600;
}

.auth-form input,
.chat-form textarea {
  width: 100%;
  padding: 15px 18px;
  border-radius: 18px;
  border: 1px solid rgba(17, 32, 58, 0.12);
  background: rgba(245, 248, 255, 0.98);
  color: var(--text-dark);
}

.auth-form input:focus,
.chat-form textarea:focus {
  outline: none;
  border-color: rgba(15, 95, 255, 0.38);
  box-shadow: 0 0 0 4px rgba(15, 95, 255, 0.08);
}

.auth-feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.auth-feature-list span {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #eef4ff;
  font-size: 0.92rem;
  font-weight: 600;
}

.auth-copy-metric {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.auth-copy-metric div {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.auth-copy-metric strong {
  display: block;
  color: #ffffff;
  margin-bottom: 6px;
  font-size: 1.04rem;
}

.auth-copy-metric span {
  color: #a9b6d0;
  font-size: 0.92rem;
}

.google-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 17px 20px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #d7dff0;
  color: #152543;
  font-weight: 700;
  box-shadow: 0 14px 28px rgba(21, 37, 67, 0.1);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.google-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 32px rgba(21, 37, 67, 0.14);
}

.google-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffffff, #eef3ff);
  border: 1px solid #d7dff0;
  color: #4285f4;
  font-size: 1rem;
  font-weight: 800;
}

.chat-shell {
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr);
  gap: 22px;
}

.chat-sidebar {
  display: grid;
  gap: 18px;
}

.sidebar-card {
  padding: 22px;
}

.hero-mini {
  background:
    radial-gradient(circle at 100% 0, rgba(66, 133, 255, 0.3), transparent 38%),
    radial-gradient(circle at 0% 100%, rgba(38, 211, 162, 0.16), transparent 28%),
    linear-gradient(160deg, rgba(14, 24, 53, 0.96), rgba(18, 37, 74, 0.9));
}

.sidebar-card strong {
  display: block;
  font-size: 2rem;
  margin: 8px 0;
  color: #ffffff;
}

.mini-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.mini-metrics div {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.mini-metrics strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 4px;
  color: #ffffff;
}

.mini-metrics span {
  color: var(--muted);
  font-size: 0.9rem;
}

.tip-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  font-size: 0.95rem;
}

.chat-panel {
  padding: 24px;
  display: grid;
  grid-template-rows: auto auto minmax(440px, 1fr) auto;
  gap: 18px;
  background:
    linear-gradient(180deg, rgba(67, 81, 118, 0.42), rgba(35, 47, 78, 0.5)),
    rgba(255, 255, 255, 0.06);
}

.message-list {
  min-height: 440px;
  max-height: 68vh;
  overflow-y: auto;
  display: grid;
  gap: 16px;
  padding: 8px 8px 8px 2px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(10, 18, 37, 0.22), rgba(11, 20, 40, 0.1));
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.message-row {
  display: flex;
}

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

.message-row.bot {
  justify-content: flex-start;
}

.bubble {
  max-width: min(78%, 700px);
  padding: 18px 20px;
  border-radius: 24px;
  line-height: 1.65;
  box-shadow: 0 16px 30px rgba(8, 12, 28, 0.18);
}

.user-bubble {
  background: linear-gradient(180deg, #4585ff, #5d5bf5);
  color: white;
  border-bottom-right-radius: 10px;
}

.bot-bubble {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-bottom-left-radius: 10px;
  color: #eef4ff;
}

.formatted-output {
  white-space: normal;
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 10px;
  border-radius: 999px;
  background: rgba(10, 18, 37, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.chat-form textarea {
  min-height: 58px;
  max-height: 220px;
  resize: none;
  border-radius: 999px;
  padding: 17px 22px;
}

.typing-bubble {
  display: grid;
  gap: 10px;
}

.typing-dots {
  display: flex;
  gap: 8px;
}

.typing-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #79c9ff;
  animation: typingBounce 1s infinite ease-in-out;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.16s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.32s;
}

.alert {
  padding: 16px 18px;
  border-radius: 18px;
  font-weight: 600;
}

.alert.error {
  background: rgba(214, 69, 69, 0.14);
  color: #ffd1d1;
}

.alert.success {
  background: rgba(31, 157, 99, 0.14);
  color: #9ff0c7;
}

.hidden {
  display: none;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 240px;
  text-align: center;
  padding: 28px;
  border: 1px dashed #dbe4f8;
  border-radius: var(--radius-md);
  background:
    radial-gradient(circle at 50% 20%, rgba(66, 133, 255, 0.08), transparent 32%),
    #f8fbff;
  color: #71809c;
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 16px 14px;
  border-bottom: 1px solid rgba(16, 36, 69, 0.08);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 700;
}

.status-pill.success {
  background: rgba(31, 157, 99, 0.14);
  color: #1a7b4f;
}

.status-pill.danger {
  background: rgba(214, 69, 69, 0.14);
  color: #b23d3d;
}

.auth-form,
.auth-form h2,
.auth-form label span,
.auth-form .subtle,
.auth-form a,
.auth-form .alert,
.panel,
.panel h2,
.panel h3,
.stat-card,
.stat-card strong,
.stat-card span,
.chat-form,
.chat-form textarea::placeholder,
.history-card span,
.notification-card span,
.manage-chat-card span {
  color: var(--text-dark);
}

.page-dashboard .hero-card,
.page-chat .chat-panel,
.page-chat .sidebar-card,
.page-admin .hero-card.compact {
  color: #eef4ff;
}

.inline-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

code,
pre {
  font-family: "Source Code Pro", monospace;
}

@keyframes typingBounce {
  0%, 80%, 100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  40% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

@media (max-width: 980px) {
  .topbar {
    border-radius: 30px;
    align-items: flex-start;
    position: static;
    padding: 18px;
  }

  .topbar,
  .hero-card,
  .panel-head,
  .auth-card {
    flex-direction: column;
  }

  .auth-card {
    display: block;
    min-height: auto;
  }

  .mini-metrics,
  .auth-copy-metric {
    grid-template-columns: 1fr;
  }

  .hero-side {
    width: 100%;
    justify-items: start;
  }

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

  .chat-sidebar {
    order: 2;
  }

  .chat-panel {
    order: 1;
  }

  .panel-head {
    align-items: flex-start;
  }

  .bubble {
    max-width: 92%;
  }

  .notification-card,
  .manage-chat-card {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding: 14px 14px 28px;
  }

  body::before {
    background-size: 48px 48px;
  }

  .topbar-nav {
    gap: 10px;
    width: 100%;
  }

  .topbar-nav a {
    width: 100%;
    text-align: center;
    padding: 12px 14px;
  }

  .hero-card,
  .panel,
  .sidebar-card,
  .chat-panel,
  .auth-copy,
  .auth-form {
    padding: 18px;
    border-radius: 24px;
  }

  .brand {
    width: 100%;
    gap: 12px;
  }

  .brand-mark {
    width: 48px;
    height: 48px;
  }

  .brand-copy strong {
    font-size: 1.65rem;
  }

  h1 {
    font-size: clamp(2.1rem, 11vw, 3.1rem);
    line-height: 1.02;
  }

  h2 {
    font-size: 1.32rem;
  }

  .auth-page {
    min-height: auto;
  }

  .auth-copy {
    padding-bottom: 22px;
  }

  .auth-form {
    gap: 16px;
  }

  .auth-feature-list,
  .auth-copy-metric {
    margin-top: 18px;
  }

  .auth-feature-list span,
  .auth-copy-metric div {
    width: 100%;
  }

  .hero-card {
    gap: 18px;
  }

  .hero-badge-card,
  .hero-side,
  .hero-side .primary-btn {
    width: 100%;
  }

  .hero-side {
    justify-items: stretch;
  }

  .stat-grid {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }

  .stat-card {
    padding: 20px 18px;
  }

  .stat-card strong {
    font-size: 2rem;
  }

  .panel-head form,
  .panel-head .secondary-btn,
  .panel-head .ghost-btn {
    width: 100%;
  }

  .chat-shell {
    gap: 16px;
  }

  .chat-panel {
    grid-template-rows: auto auto minmax(320px, 1fr) auto;
    padding: 16px;
  }

  .sidebar-card strong {
    font-size: 1.7rem;
  }

  .mini-metrics {
    grid-template-columns: 1fr;
  }

  .message-list {
    min-height: 360px;
    max-height: 52vh;
    padding: 8px 4px 8px 0;
    border-radius: 18px;
  }

  .bubble {
    max-width: 100%;
    padding: 15px 16px;
    font-size: 0.95rem;
  }

  .chat-form {
    grid-template-columns: 1fr;
    border-radius: 22px;
    padding: 10px;
  }

  .chat-form textarea {
    min-height: 54px;
    border-radius: 18px;
    padding: 15px 16px;
  }

  .chat-form button {
    width: 100%;
    min-height: 52px;
  }

  .notification-card,
  .manage-chat-card,
  .history-card {
    padding: 18px;
  }

  .delete-btn {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .topbar {
    padding: 14px;
    border-radius: 24px;
  }

  .brand-copy strong {
    font-size: 1.45rem;
  }

  .brand-copy small {
    font-size: 0.82rem;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }

  .hero-card,
  .panel,
  .sidebar-card,
  .chat-panel,
  .auth-copy,
  .auth-form {
    padding: 16px;
  }
}
