:root {
  --gold: #d4af37;
  --navy: #071b3a;
  --blue: #0f5bd7;
  --light: #f6f8fc;
  --ink: #172033;
}

body {
  background: var(--light);
  color: var(--ink);
}

nav {
  background: #ffffff;
  border-bottom: 1px solid #e8edf5;
}

nav strong {
  color: var(--navy);
}

.hero {
  padding: 4rem 2rem;
  margin: 1.5rem 0 2rem;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(7, 27, 58, 0.96), rgba(15, 91, 215, 0.88));
  color: white;
}

.hero img {
  border-radius: 20px;
  margin-top: 1rem;
}

.hero h2 {
  color: var(--gold);
  font-size: 3rem;
}

section {
  padding: 2rem 0;
}

h2 {
  text-align: center;
  margin-bottom: 1.5rem;
}

.cards article,
.panel,
.login-cards article,
.stats article {
  background: #ffffff;
  padding: 1.4rem;
  border-radius: 20px;
  box-shadow: 0 12px 30px rgba(7, 27, 58, 0.08);
  height: 100%;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.tag {
  display: inline-block;
  background: #fff3c4;
  color: #7a5a00;
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  font-weight: 700;
  font-size: 0.8rem;
  margin-bottom: 0.75rem;
}

.result {
  padding: 1rem;
  background: #ecf3ff;
  border-left: 5px solid var(--blue);
  border-radius: 10px;
  margin-top: 1rem;
}

footer {
  padding-bottom: 2rem;
}

/* AI Chat Widget */
#ai-chat-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy), var(--blue));
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(7, 27, 58, 0.35);
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: transform 0.2s, box-shadow 0.2s;
}

#ai-chat-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 32px rgba(7, 27, 58, 0.45);
}

#ai-chat-window {
  position: fixed;
  bottom: 6rem;
  right: 2rem;
  width: 380px;
  max-height: 560px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(7, 27, 58, 0.2);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  overflow: hidden;
  border: 1px solid #e8edf5;
  transform: scale(0.95) translateY(10px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.2s, opacity 0.2s;
}

#ai-chat-window.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

#chat-header {
  background: linear-gradient(135deg, var(--navy), var(--blue));
  color: white;
  padding: 1rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#chat-header .chat-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1rem;
}

#chat-header .chat-title span.dot {
  width: 8px;
  height: 8px;
  background: #4ade80;
  border-radius: 50%;
  display: inline-block;
}

#chat-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

#chat-close:hover {
  color: white;
}

#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: #f6f8fc;
}

.chat-msg {
  max-width: 85%;
  padding: 0.65rem 0.9rem;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.5;
  word-break: break-word;
}

.chat-msg.user {
  background: linear-gradient(135deg, var(--navy), var(--blue));
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.chat-msg.assistant {
  background: white;
  color: var(--ink);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(7, 27, 58, 0.08);
}

.chat-msg.assistant.typing {
  color: #9ca3af;
}

#chat-input-row {
  display: flex;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  background: white;
  border-top: 1px solid #e8edf5;
}

#chat-input {
  flex: 1;
  border: 1px solid #dde3ee;
  border-radius: 10px;
  padding: 0.55rem 0.8rem;
  font-size: 0.9rem;
  outline: none;
  resize: none;
  font-family: inherit;
  transition: border-color 0.2s;
}

#chat-input:focus {
  border-color: var(--blue);
}

#chat-send {
  background: linear-gradient(135deg, var(--navy), var(--blue));
  color: white;
  border: none;
  border-radius: 10px;
  padding: 0.55rem 1rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: opacity 0.2s;
}

#chat-send:hover {
  opacity: 0.9;
}

#chat-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 500px) {
  #ai-chat-window {
    width: calc(100vw - 2rem);
    right: 1rem;
    bottom: 5.5rem;
  }
  #ai-chat-btn {
    right: 1rem;
    bottom: 1rem;
  }
}

@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .hero h2 {
    font-size: 2.2rem;
  }
}
