:root {
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* HSL Harmonies */
  --bg-app: hsl(230, 25%, 7%);
  --bg-card: hsla(230, 20%, 12%, 0.6);
  --border-glass: hsla(230, 20%, 25%, 0.25);
  --border-focus: hsla(260, 80%, 65%, 0.5);
  
  --text-primary: hsl(0, 0%, 96%);
  --text-secondary: hsl(230, 15%, 70%);
  --text-muted: hsl(230, 12%, 50%);

  /* Accents */
  --accent-purple: hsl(260, 85%, 65%);
  --accent-purple-glow: hsla(260, 85%, 65%, 0.15);
  --accent-gold: hsl(38, 95%, 55%);
  --accent-gold-glow: hsla(38, 95%, 55%, 0.15);
  --accent-success: hsl(150, 75%, 45%);
  --accent-success-glow: hsla(150, 75%, 45%, 0.15);
  --accent-error: fill: hsl(355, 80%, 55%);
  --accent-error-glow: hsla(355, 80%, 55%, 0.15);
  
  --shadow-lg: 0 16px 36px -8px rgba(0, 0, 0, 0.5);
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-app);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 20%, hsla(260, 80%, 55%, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, hsla(230, 80%, 55%, 0.04) 0%, transparent 45%);
  background-attachment: fixed;
}

body.auth-open {
  overflow: hidden;
}

/* Glassmorphism utility */
.glass {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-lg);
}

.app-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: 100vh;
}

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    linear-gradient(135deg, hsla(230, 25%, 7%, 0.92), hsla(230, 25%, 5%, 0.98)),
    radial-gradient(circle at 50% 30%, hsla(38, 95%, 55%, 0.08), transparent 36%);
}

.auth-screen[hidden] {
  display: none;
}

.auth-card {
  width: min(420px, 100%);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  border-color: hsla(38, 95%, 55%, 0.22);
}

.auth-logo {
  width: 74px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 16px var(--accent-purple-glow));
}

.auth-copy h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
}

.auth-copy p {
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-field label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  font-weight: 600;
}

.auth-field input {
  background: hsla(230, 20%, 8%, 0.8);
  color: var(--text-primary);
  border: 1px solid var(--border-glass);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: var(--transition-smooth);
}

.auth-field input:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px var(--accent-gold-glow);
}

.auth-error {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: hsla(355, 80%, 55%, 0.12);
  color: hsl(355, 80%, 70%);
  border: 1px solid hsla(355, 80%, 55%, 0.22);
  font-size: 12px;
}

.btn-login {
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-purple));
  color: white;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  padding: 13px 16px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-login:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px hsla(38, 95%, 55%, 0.18);
}

.btn-login:disabled {
  opacity: 0.65;
  cursor: wait;
}

/* Header & Filters */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  padding: 16px 24px;
  background: hsla(230, 20%, 10%, 0.4);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-glass);
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  font-size: 24px;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 8px var(--accent-purple));
  animation: float 4s ease-in-out infinite;
}

.logo-img {
  height: 40px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 8px var(--accent-purple-glow));
  animation: float 4s ease-in-out infinite;
}

.logo-text h1 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.logo-text span {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 2px;
  display: block;
}

.filters-container {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.admin-session {
  min-height: 58px;
  display: flex;
  align-items: end;
  gap: 10px;
}

.admin-session span {
  max-width: 220px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  background: hsla(230, 20%, 8%, 0.6);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-group label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  font-weight: 600;
}

select {
  background: hsla(230, 20%, 8%, 0.8);
  color: var(--text-primary);
  border: 1px solid var(--border-glass);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  min-width: 180px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

select:focus:not(:disabled) {
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px var(--accent-purple-glow);
}

select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Main Layout */
.app-main {
  display: grid;
  grid-template-columns: 1fr 450px;
  gap: 24px;
  align-items: stretch;
}

@media (max-width: 1024px) {
  .app-main {
    grid-template-columns: 1fr;
  }
}

/* Dashboard Section */
.dashboard-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.section-title h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
}

.section-title p {
  font-size: 13px;
  color: var(--text-secondary);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.metric-card {
  padding: 20px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  transition: var(--transition-smooth);
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: hsla(230, 20%, 35%, 0.4);
}

.col-span-2 {
  grid-column: span 2;
}

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: hsla(230, 20%, 20%, 0.3);
  border: 1px solid var(--border-glass);
}

.card-content {
  flex: 1;
}

.card-content h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 500;
}

.metric-value {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.card-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Monthly Goal Card Inputs */
.goal-input-wrapper {
  display: flex;
  align-items: center;
  background: hsla(230, 20%, 8%, 0.8);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 4px 8px;
  max-width: 220px;
}

.currency-prefix {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-right: 4px;
}

#input-goal {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  width: 100%;
  outline: none;
}

#input-goal::-webkit-inner-spin-button, 
#input-goal::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.btn-mini {
  background: var(--accent-purple);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-mini:hover {
  filter: brightness(1.2);
  box-shadow: 0 0 10px var(--accent-purple-glow);
}

/* Progress bar styles */
.progress-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.status-badge {
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

.status-badge.behind {
  background: hsla(355, 80%, 55%, 0.15);
  color: hsl(355, 80%, 65%);
  border: 1px solid hsla(355, 80%, 55%, 0.2);
}

.status-badge.on_track {
  background: hsla(38, 95%, 55%, 0.15);
  color: hsl(38, 95%, 60%);
  border: 1px solid hsla(38, 95%, 55%, 0.2);
}

.status-badge.ahead {
  background: hsla(150, 75%, 45%, 0.15);
  color: hsl(150, 75%, 55%);
  border: 1px solid hsla(150, 75%, 45%, 0.2);
}

.progress-bar-container {
  width: 100%;
  height: 8px;
  background: hsla(230, 20%, 8%, 0.8);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border-glass);
}

.progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent-purple), var(--accent-gold));
  box-shadow: 0 0 8px var(--accent-purple-glow);
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Recommended Actions */
.actions-card {
  padding: 20px;
}

.actions-card h3 {
  font-size: 14px;
  margin-bottom: 12px;
  font-family: var(--font-display);
  font-weight: 600;
}

.actions-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.actions-list li {
  font-size: 12px;
  color: var(--text-secondary);
  padding: 8px 12px;
  background: hsla(230, 20%, 8%, 0.4);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent-purple);
  display: flex;
  align-items: center;
}

/* Chat Section / Simulator */
.chat-section {
  display: flex;
  flex-direction: column;
  height: 620px;
  overflow: hidden;
}

.chat-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.barber-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-purple-glow);
  border: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  overflow: hidden;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-details h3 {
  font-size: 14px;
  font-family: var(--font-display);
  font-weight: 600;
}

.status-indicator {
  font-size: 10px;
  color: var(--accent-success);
  display: block;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-outline:hover {
  background: hsla(230, 20%, 15%, 0.6);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: hsla(230, 25%, 5%, 0.4);
}

/* Chat bubble styling */
.message {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  font-size: 13px;
  line-height: 1.5;
  animation: pop 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.message.user {
  background: var(--accent-purple);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 12px var(--accent-purple-glow);
}

.message.assistant {
  background: hsla(230, 20%, 16%, 0.85);
  color: var(--text-primary);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border-glass);
}

.message.system {
  background: hsla(230, 20%, 10%, 0.6);
  color: var(--text-secondary);
  align-self: center;
  text-align: center;
  max-width: 90%;
  font-size: 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glass);
}

.message.typing {
  align-self: flex-start;
  background: hsla(230, 20%, 14%, 0.6);
  border: 1px solid var(--border-glass);
  padding: 10px 20px;
}

/* Loading Dots */
.typing-dots {
  display: flex;
  gap: 4px;
  align-items: center;
  height: 12px;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  background: var(--text-secondary);
  border-radius: 50%;
  animation: wave 1.2s infinite;
}

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

/* Quick Prompts */
.quick-prompts-container {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  overflow-x: auto;
  white-space: nowrap;
  border-top: 1px solid var(--border-glass);
  background: hsla(230, 20%, 10%, 0.2);
}

.quick-prompts-container::-webkit-scrollbar {
  height: 0px; /* Hide scrollbar */
}

.quick-prompt-btn {
  background: hsla(230, 20%, 14%, 0.7);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.quick-prompt-btn:hover {
  background: var(--accent-purple-glow);
  color: var(--accent-purple);
  border-color: var(--accent-purple);
}

/* Chat Input */
.chat-input-area {
  padding: 16px 20px;
  border-top: 1px solid var(--border-glass);
  display: flex;
  gap: 12px;
  background: hsla(230, 20%, 10%, 0.6);
}

#chat-input {
  flex: 1;
  background: hsla(230, 20%, 6%, 0.8);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  transition: var(--transition-smooth);
}

#chat-input:focus:not(:disabled) {
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px var(--accent-purple-glow);
}

#btn-send-message {
  width: 44px;
  height: 44px;
  background: var(--accent-purple);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

#btn-send-message:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 0 15px var(--accent-purple-glow);
}

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

/* Empty State Styles */
.empty-state-container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 40px;
}

.empty-state-card {
  padding: 60px;
  text-align: center;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  border-color: hsla(230, 20%, 20%, 0.4);
}

.empty-icon {
  font-size: 48px;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 12px var(--accent-purple-glow));
}

.empty-state-logo {
  height: 80px;
  width: auto;
  object-fit: contain;
  margin-bottom: 8px;
  filter: drop-shadow(0 0 16px var(--accent-purple-glow));
  animation: float 4s ease-in-out infinite;
}

.empty-state-card h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
}

.empty-state-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Animations */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@keyframes wave {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}

@keyframes pop {
  0% { transform: scale(0.95); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Custom Scrollbar for chat messages */
.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--border-glass);
  border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
