/* ══════════════════════════════════════
   NAV BAR
   ══════════════════════════════════════ */
#kavi-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(15, 23, 42, 0.85);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  height: 64px;
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  text-decoration: none;
}
.nav-logo-text {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.04em;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.nav-link {
  color: #9CA3AF;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s;
}
.nav-link:hover { color: #F9FAFB; }
.nav-signin-btn {
  padding: 8px 20px;
  background: #10B981;
  color: #0F172A;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 0 20px rgba(16,185,129,0.25);
}
.nav-signin-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 30px rgba(16,185,129,0.4);
}

/* User pill (signed-in state) */
.nav-user-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 6px 14px 6px 8px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
  position: relative;
  transition: border-color 0.2s;
}
.nav-user-pill:hover {
  border-color: rgba(16, 185, 129, 0.3);
}
.nav-user-photo {
  width: 28px; height: 28px;
  border-radius: 50%;
  object-fit: cover;
}
.nav-user-initials {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.2);
  color: #10B981;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}
.nav-user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #F9FAFB;
}
.nav-user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: rgba(30, 41, 59, 0.95);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0,0,0,0.4);
  z-index: 60;
}
.nav-user-pill:hover .nav-user-dropdown,
.nav-user-pill:focus-within .nav-user-dropdown {
  display: block;
}
.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: #F9FAFB;
  text-decoration: none;
  transition: background 0.15s;
  border: none;
  background: none;
  width: 100%;
  cursor: pointer;
  font-family: inherit;
}
.nav-dropdown-item:hover {
  background: rgba(16, 185, 129, 0.1);
}
.nav-dropdown-item svg,
.nav-dropdown-item i {
  width: 16px; height: 16px;
  color: #9CA3AF;
}
.nav-dropdown-signout {
  border-top: 1px solid rgba(255,255,255,0.06);
  color: #EF4444;
}
.nav-dropdown-signout:hover {
  background: rgba(239, 68, 68, 0.1);
}

/* Hide nav links on mobile */
@media (max-width: 640px) {
  .nav-link { display: none; }
  .nav-user-name { display: none; }
}

/* ══════════════════════════════════════
   AUTH MODAL
   ══════════════════════════════════════ */
.auth-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.auth-modal-card {
  width: 100%;
  max-width: 420px;
  padding: 2.5rem;
  position: relative;
  animation: modalSlideIn 0.25s ease;
}
@keyframes modalSlideIn {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.auth-modal-close {
  position: absolute;
  top: 1rem; right: 1rem;
  background: none;
  border: none;
  color: #9CA3AF;
  font-size: 1.5rem;
  cursor: pointer;
  width: 32px; height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}
.auth-modal-close:hover {
  background: rgba(255,255,255,0.1);
  color: #F9FAFB;
}
.auth-modal-logo {
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  text-align: center;
  margin-bottom: 0.25rem;
}
.auth-modal-sub {
  text-align: center;
  color: #9CA3AF;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* Tabs */
.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.5rem;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.6);
  padding: 4px;
}
.auth-tab {
  flex: 1;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  background: none;
  border: none;
  color: #9CA3AF;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}
.auth-tab.active {
  background: rgba(16, 185, 129, 0.15);
  color: #10B981;
}

/* Messages */
.auth-message {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  text-align: center;
}
.auth-message.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #FCA5A5;
}
.auth-message.success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6EE7B7;
}

/* Inputs */
.auth-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: #F9FAFB;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}
.auth-input:focus {
  border-color: rgba(16, 185, 129, 0.5);
}
.auth-input::placeholder {
  color: #6B7280;
}

/* Buttons */
.btn-primary {
  width: 100%;
  padding: 0.75rem 1rem;
  background: #10B981;
  color: #0F172A;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 0 20px rgba(16,185,129,0.2);
  font-family: inherit;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 30px rgba(16,185,129,0.35);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-google {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  color: #F9FAFB;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: background 0.15s, border-color 0.15s;
  font-family: inherit;
}
.btn-google:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.25);
}
.btn-google svg {
  width: 18px; height: 18px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.25rem 0;
  color: #6B7280;
  font-size: 0.8rem;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.08);
}

.auth-text-btn {
  background: none;
  border: none;
  color: #9CA3AF;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0.5rem;
  transition: color 0.15s;
  font-family: inherit;
}
.auth-text-btn:hover {
  color: #10B981;
}

.auth-reset-info {
  color: #9CA3AF;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  text-align: center;
}

/* ══════════════════════════════════════
   DASHBOARD
   ══════════════════════════════════════ */
.dashboard-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 1rem;
  color: #9CA3AF;
}

.spinner {
  width: 36px; height: 36px;
  border: 3px solid rgba(16, 185, 129, 0.2);
  border-top-color: #10B981;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Profile card */
.dashboard-profile {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
.dash-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.dash-initials-avatar {
  background: rgba(16, 185, 129, 0.2);
  color: #10B981;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
}
.dash-profile-info {
  min-width: 0;
}
.tier-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.5rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

/* Stats grid */
.dashboard-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
@media (max-width: 640px) {
  .dashboard-stats-grid {
    grid-template-columns: 1fr;
  }
}
.stat-card {
  text-align: center;
  padding: 1.5rem 1rem;
}
.stat-icon {
  margin-bottom: 0.75rem;
}
.stat-icon i, .stat-icon svg {
  width: 28px; height: 28px;
}
.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: #F9FAFB;
  line-height: 1;
  margin-bottom: 0.35rem;
}
.stat-label {
  font-size: 0.8rem;
  color: #9CA3AF;
  font-weight: 500;
}

/* Usage bars */
.usage-row {
  margin-bottom: 1rem;
}
.usage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}
.usage-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: #F9FAFB;
}
.usage-value {
  font-size: 0.8rem;
  color: #9CA3AF;
  font-weight: 600;
}
.usage-bar-bg {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 99px;
  overflow: hidden;
}
.usage-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.6s ease;
}

/* CTA section on homepage */
.cta-primary-btn {
  padding: 14px 32px;
  background: #10B981;
  color: #0F172A;
  border: none;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 0 30px rgba(16,185,129,0.25);
  font-family: inherit;
}
.cta-primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 50px rgba(16,185,129,0.4);
}
.cta-secondary-btn {
  padding: 14px 32px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  color: #F9FAFB;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
}
.cta-secondary-btn:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.25);
}

/* Store button */
.store-btn {
  padding: 10px 24px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  color: #F9FAFB;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.store-btn:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.25);
}
