/* ================================================================
   NetchX AI Studio — Blue Liquid Glass Theme
   Single CSS file for the entire application.
   ================================================================ */

/* ── CSS Custom Properties ─────────────────────────────────────── */
:root {
  --color-bg-deep: #0a0e27;
  --color-bg-mid: #111640;
  --color-bg-surface: #1a1f4e;
  --color-primary: #3b82f6;
  --color-primary-hover: #60a5fa;
  --color-primary-dark: #2563eb;
  --color-secondary: #8b5cf6;
  --color-secondary-hover: #a78bfa;
  --color-danger: #ef4444;
  --color-danger-hover: #f87171;
  --color-warning: #f59e0b;
  --color-success: #22c55e;
  --color-info: #3b82f6;
  --color-text: #f8fafc;
  --color-text-secondary: #94a3b8;
  --color-text-tertiary: #64748b;
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-bg-hover: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-border-hover: rgba(255, 255, 255, 0.18);
  --glass-blur: blur(20px);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --sidebar-width: 280px;
  --navbar-height: 64px;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', Consolas, monospace;
}

/* ── Reset & Base ──────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  color: var(--color-text);
  background: var(--color-bg-deep);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover { color: var(--color-primary-hover); }

img, svg { max-width: 100%; display: block; }
button, input, select, textarea {
  font: inherit;
  color: inherit;
  outline: none;
}
button { cursor: pointer; }
ul, ol { list-style: none; }
::selection {
  background: rgba(59, 130, 246, 0.4);
  color: #fff;
}
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); }

/* ── Page Wrapper & Background Orbs ────────────────────────────── */
.page-wrapper {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--color-bg-deep) 0%, var(--color-bg-mid) 50%, var(--color-bg-surface) 100%);
  position: relative;
  overflow: hidden;
}

.glass-orb-1, .glass-orb-2, .glass-orb-3 {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(80px);
  opacity: 0.3;
  z-index: 0;
}
.glass-orb-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.4), transparent 70%);
  top: -150px; left: -100px;
  animation: float-orb-1 20s ease-in-out infinite;
}
.glass-orb-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.35), transparent 70%);
  bottom: -100px; right: -80px;
  animation: float-orb-2 25s ease-in-out infinite;
}
.glass-orb-3 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.25), transparent 70%);
  top: 40%; left: 50%;
  transform: translate(-50%, -50%);
  animation: float-orb-3 18s ease-in-out infinite;
}

@keyframes float-orb-1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(60px, 40px) scale(1.05); }
  66% { transform: translate(-30px, 80px) scale(0.95); }
}
@keyframes float-orb-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-50px, -60px) scale(1.08); }
  66% { transform: translate(40px, -30px) scale(0.92); }
}
@keyframes float-orb-3 {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-40%, -60%) scale(1.1); }
}

/* ── Container ─────────────────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

/* ── Glass Components ──────────────────────────────────────────── */
.glass-card, .glass-panel {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
}

.glass-card-hover {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.glass-card-hover:hover {
  transform: translateY(-4px);
  border-color: var(--glass-border-hover);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

/* ── Navbar ────────────────────────────────────────────────────── */
.glass-navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 14, 39, 0.8);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--glass-border);
  height: var(--navbar-height);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-text);
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
}
.nav-logo:hover { color: var(--color-text); }
.logo-icon { display: flex; align-items: center; }
.logo-text { white-space: nowrap; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav-link {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-link:hover { color: var(--color-text); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 4px;
}
.nav-mobile-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}
.nav-mobile-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-mobile-toggle.active span:nth-child(2) { opacity: 0; }
.nav-mobile-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.nav-user-menu { position: relative; }
.nav-user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  color: var(--color-text);
  transition: background 0.2s;
}
.nav-user-btn:hover { background: var(--glass-bg-hover); }
.user-name { font-size: 0.875rem; font-weight: 500; }

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: rgba(15, 20, 50, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  padding: 6px;
  display: none;
  z-index: 200;
}
.user-dropdown.show { display: block; }
.user-dropdown a {
  display: block;
  padding: 10px 14px;
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
}
.user-dropdown a:hover {
  background: var(--glass-bg-hover);
  color: var(--color-text);
}

/* ── Buttons ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  transition: all 0.2s;
  white-space: nowrap;
  line-height: 1.4;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: #fff;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--color-primary-hover), var(--color-primary));
  box-shadow: 0 6px 24px rgba(59, 130, 246, 0.4);
  color: #fff;
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(1px); box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25); }
.btn-primary:disabled, .btn-primary.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  color: var(--color-text);
  box-shadow: none;
}
.btn-secondary:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-hover);
  color: var(--color-text);
}
.btn-secondary:active { transform: translateY(1px); }

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--color-danger);
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.5);
  color: var(--color-danger-hover);
}

.btn-ghost {
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
}
.btn-ghost:hover { color: var(--color-text); background: var(--glass-bg); }

.btn-sm { padding: 6px 14px; font-size: 0.8rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 14px 28px; font-size: 1rem; border-radius: var(--radius-lg); }
.btn-icon {
  padding: 8px;
  border-radius: var(--radius-sm);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--color-text-secondary);
  transition: all 0.2s;
}
.btn-icon:hover { background: var(--glass-bg-hover); color: var(--color-text); }

.btn-block { display: flex; width: 100%; }

/* ── Form Inputs ───────────────────────────────────────────────── */
.glass-input, .glass-select, .glass-textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-size: 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.glass-input::placeholder, .glass-textarea::placeholder {
  color: var(--color-text-tertiary);
}
.glass-input:focus, .glass-select:focus, .glass-textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.glass-input.error, .glass-textarea.error {
  border-color: var(--color-danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}
.glass-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%2394a3b8' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.glass-select option {
  background: var(--color-bg-deep);
  color: var(--color-text);
}
.glass-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-group {
  margin-bottom: 20px;
}
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
}
.form-hint {
  font-size: 0.78rem;
  color: var(--color-text-tertiary);
  margin-top: 4px;
}
.field-error {
  font-size: 0.78rem;
  color: var(--color-danger);
  margin-top: 4px;
  display: none;
}
.field-error.visible { display: block; }

/* ── Dashboard Layout ──────────────────────────────────────────── */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--color-bg-deep) 0%, var(--color-bg-mid) 50%, var(--color-bg-surface) 100%);
}

.dashboard-sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  border-radius: 0;
  border: none;
  border-right: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 50;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--glass-border);
}
.sidebar-logo {
  text-decoration: none;
  color: var(--color-text);
}
.sidebar-logo .logo-text {
  font-weight: 700;
  font-size: 1.05rem;
}
.sidebar-new-chat { white-space: nowrap; }

.sidebar-nav {
  flex: 1;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s;
  text-decoration: none;
}
.sidebar-link:hover {
  background: var(--glass-bg-hover);
  color: var(--color-text);
}
.sidebar-link.active {
  background: rgba(59, 130, 246, 0.12);
  color: var(--color-primary);
}
.sidebar-link svg { flex-shrink: 0; }

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--glass-border);
}
.sidebar-admin-link { color: var(--color-secondary); }
.sidebar-admin-link:hover { color: var(--color-secondary-hover); }
.sidebar-back-link { color: var(--color-text-tertiary); }

.sidebar-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-top: 6px;
}
.sidebar-user-details {
  flex: 1;
  min-width: 0;
}
.sidebar-user-name {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-email {
  display: block;
  font-size: 0.75rem;
  color: var(--color-text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-logout {
  color: var(--color-text-tertiary);
  padding: 4px;
  transition: color 0.2s;
}
.sidebar-logout:hover { color: var(--color-danger); }

.dashboard-main {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  height: 100vh;
  padding: 32px;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}
.dashboard-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
}

/* ── Stat Cards ────────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color 0.2s;
}
.stat-card:hover { border-color: var(--glass-border-hover); }
.stat-label {
  font-size: 0.8rem;
  color: var(--color-text-tertiary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--color-text);
}
.stat-change {
  font-size: 0.78rem;
  margin-top: 4px;
}
.stat-change.up { color: var(--color-success); }
.stat-change.down { color: var(--color-danger); }

/* ── Chat UI ───────────────────────────────────────────────────── */
.chat-layout {
  display: flex;
  height: 100vh;
}

.chat-sidebar {
  width: 280px;
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  background: rgba(10, 14, 39, 0.5);
  flex-shrink: 0;
}
.chat-sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.chat-sidebar-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}
.chat-sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
  text-decoration: none;
}
.chat-sidebar-item:hover {
  background: var(--glass-bg-hover);
  color: var(--color-text);
}
.chat-sidebar-item.active {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.2);
  color: var(--color-text);
}
.chat-sidebar-item-title {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-sidebar-item-time {
  font-size: 0.7rem;
  color: var(--color-text-tertiary);
  white-space: nowrap;
}
.chat-sidebar-item-actions {
  display: none;
  gap: 4px;
}
.chat-sidebar-item:hover .chat-sidebar-item-actions { display: flex; }
.chat-sidebar-item-actions button {
  background: none;
  border: none;
  padding: 2px;
  color: var(--color-text-tertiary);
  transition: color 0.15s;
  display: flex;
}
.chat-sidebar-item-actions button:hover { color: var(--color-text); }

.chat-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  height: 100%;
  position: relative;
}

.chat-header {
  padding: 14px 24px;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10, 14, 39, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  flex-shrink: 0;
}
.chat-model-selector {
  display: flex;
  align-items: center;
  gap: 8px;
}
.chat-model-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  scroll-behavior: smooth;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
}
.chat-empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  opacity: 0.8;
}
.chat-empty h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.chat-empty p {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  max-width: 400px;
}

.chat-message {
  display: flex;
  gap: 14px;
  max-width: 800px;
  width: 100%;
  animation: fadeIn 0.3s ease;
}
.chat-message-user {
  flex-direction: row-reverse;
  margin-left: auto;
}
.chat-message-assistant {
  margin-right: auto;
}

.chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}
.chat-message-user .chat-avatar {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: #fff;
}
.chat-message-assistant .chat-avatar {
  background: linear-gradient(135deg, var(--color-secondary), #6d28d9);
  color: #fff;
}

.chat-bubble {
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  font-size: 0.9rem;
  line-height: 1.65;
  min-width: 60px;
  position: relative;
}
.chat-message-user .chat-bubble {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-top-right-radius: 4px;
}
.chat-message-assistant .chat-bubble {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-top-left-radius: 4px;
}

.chat-bubble-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: none;
  gap: 4px;
}
.chat-bubble:hover .chat-bubble-actions { display: flex; }
.chat-bubble-actions button {
  background: rgba(0, 0, 0, 0.3);
  border: none;
  padding: 4px 6px;
  border-radius: 4px;
  color: var(--color-text-tertiary);
  font-size: 0.7rem;
  transition: all 0.15s;
}
.chat-bubble-actions button:hover {
  background: rgba(0, 0, 0, 0.5);
  color: var(--color-text);
}

.chat-input-area {
  padding: 16px 24px;
  border-top: 1px solid var(--glass-border);
  background: rgba(10, 14, 39, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  flex-shrink: 0;
}
.chat-input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  max-width: 800px;
  margin: 0 auto;
}
.chat-input {
  flex: 1;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  color: var(--color-text);
  font-size: 0.9rem;
  resize: none;
  min-height: 48px;
  max-height: 200px;
  line-height: 1.5;
  transition: border-color 0.2s;
}
.chat-input::placeholder { color: var(--color-text-tertiary); }
.chat-input:focus { border-color: var(--color-primary); }

.chat-send-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
}
.chat-send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 24px rgba(59, 130, 246, 0.4);
}
.chat-send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.chat-stop-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--color-danger);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.chat-stop-btn:hover {
  background: rgba(239, 68, 68, 0.3);
}

/* ── Typing Indicator ──────────────────────────────────────────── */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}
.typing-dots {
  display: flex;
  gap: 4px;
}
.typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-primary);
  animation: typing-bounce 1.4s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
.typing-label {
  font-size: 0.8rem;
  color: var(--color-text-tertiary);
  font-style: italic;
}

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* ── Skeleton Loading ──────────────────────────────────────────── */
.skeleton-line {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}
.skeleton-line + .skeleton-line { margin-top: 10px; }
.skeleton-line.short { width: 60%; }
.skeleton-line.medium { width: 80%; }

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Spinner ───────────────────────────────────────────────────── */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner-sm { width: 14px; height: 14px; border-width: 2px; }
.spinner-lg { width: 32px; height: 32px; border-width: 3px; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Animations ────────────────────────────────────────────────── */
.fade-in { animation: fadeIn 0.3s ease forwards; }
.slide-up { animation: slideUp 0.3s ease forwards; }
.scale-in { animation: scaleIn 0.2s ease forwards; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* ── Markdown Content (Chat Messages) ──────────────────────────── */
.markdown-content { word-wrap: break-word; overflow-wrap: break-word; }
.markdown-content p { margin-bottom: 12px; }
.markdown-content p:last-child { margin-bottom: 0; }
.markdown-content h1 { font-size: 1.5rem; font-weight: 700; margin: 20px 0 10px; }
.markdown-content h2 { font-size: 1.3rem; font-weight: 700; margin: 18px 0 8px; }
.markdown-content h3 { font-size: 1.1rem; font-weight: 600; margin: 16px 0 6px; }
.markdown-content h4 { font-size: 1rem; font-weight: 600; margin: 14px 0 6px; }
.markdown-content h5 { font-size: 0.9rem; font-weight: 600; margin: 12px 0 4px; }
.markdown-content h6 { font-size: 0.85rem; font-weight: 600; margin: 10px 0 4px; color: var(--color-text-secondary); }

.markdown-content a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.markdown-content a:hover { color: var(--color-primary-hover); }

.markdown-content strong { font-weight: 700; }
.markdown-content em { font-style: italic; }

.markdown-content ul, .markdown-content ol {
  margin: 8px 0 12px;
  padding-left: 24px;
}
.markdown-content ul { list-style: disc; }
.markdown-content ol { list-style: decimal; }
.markdown-content li { margin-bottom: 4px; }
.markdown-content li > ul, .markdown-content li > ol { margin-top: 4px; margin-bottom: 4px; }

.markdown-content pre {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 16px;
  overflow-x: auto;
  margin: 12px 0;
  position: relative;
}
.markdown-content pre code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.6;
  background: none;
  padding: 0;
  border: none;
  color: var(--color-text);
}
.markdown-content code {
  font-family: var(--font-mono);
  font-size: 0.84em;
  background: rgba(255, 255, 255, 0.07);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--glass-border);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  margin: 12px 0 0;
}
.code-block-header + pre {
  margin-top: 0;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}
.code-block-lang {
  font-size: 0.75rem;
  color: var(--color-text-tertiary);
  font-weight: 500;
}
.code-copy-btn {
  background: none;
  border: none;
  color: var(--color-text-tertiary);
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 4px;
  transition: all 0.15s;
  cursor: pointer;
}
.code-copy-btn:hover { background: rgba(255,255,255,0.08); color: var(--color-text); }

.markdown-content blockquote {
  border-left: 3px solid var(--color-primary);
  background: rgba(59, 130, 246, 0.06);
  padding: 10px 16px;
  margin: 12px 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--color-text-secondary);
}

.markdown-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 0.85rem;
}
.markdown-content th {
  background: rgba(255, 255, 255, 0.06);
  text-align: left;
  padding: 10px 14px;
  font-weight: 600;
  border-bottom: 1px solid var(--glass-border);
}
.markdown-content td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.markdown-content tr:hover td { background: rgba(255, 255, 255, 0.02); }

.markdown-content hr {
  border: none;
  border-top: 1px solid var(--glass-border);
  margin: 16px 0;
}

.markdown-content img {
  max-width: 100%;
  border-radius: var(--radius-md);
  margin: 8px 0;
}

/* ── Glass Table (Admin) ───────────────────────────────────────── */
.glass-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
}
.glass-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.glass-table th {
  background: rgba(255, 255, 255, 0.05);
  text-align: left;
  padding: 14px 18px;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--glass-border);
  white-space: nowrap;
}
.glass-table td {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--color-text);
}
.glass-table tbody tr {
  transition: background 0.15s;
}
.glass-table tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
.glass-table tbody tr:last-child td { border-bottom: none; }

.table-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 0;
}
.pagination-btn {
  min-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--color-text-secondary);
  font-size: 0.85rem;
  transition: all 0.15s;
}
.pagination-btn:hover {
  background: var(--glass-bg-hover);
  color: var(--color-text);
}
.pagination-btn.active {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.3);
  color: var(--color-primary);
}
.pagination-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ── Badges ────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.badge-admin   { background: rgba(139, 92, 246, 0.15); color: #a78bfa; border: 1px solid rgba(139, 92, 246, 0.25); }
.badge-user    { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.25); }
.badge-success { background: rgba(34, 197, 94, 0.12); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.2); }
.badge-warning { background: rgba(245, 158, 11, 0.12); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.2); }
.badge-danger  { background: rgba(239, 68, 68, 0.12); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.2); }
.badge-info    { background: rgba(59, 130, 246, 0.12); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.2); }

/* ── Alerts ────────────────────────────────────────────────────── */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}
.alert-success { background: rgba(34, 197, 94, 0.1); border: 1px solid rgba(34, 197, 94, 0.2); color: #4ade80; }
.alert-danger  { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.2); color: #f87171; }
.alert-warning { background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.2); color: #fbbf24; }
.alert-info    { background: rgba(59, 130, 246, 0.1); border: 1px solid rgba(59, 130, 246, 0.2); color: #60a5fa; }

/* ── Avatar ────────────────────────────────────────────────────── */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: #fff;
  flex-shrink: 0;
}
.avatar-sm { width: 32px; height: 32px; font-size: 0.75rem; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.2rem; }
.avatar-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: #fff;
  flex-shrink: 0;
}

/* ── Toast Notifications ───────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  min-width: 300px;
  max-width: 420px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInRight 0.3s ease;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
.toast-success { background: rgba(34, 197, 94, 0.15); border: 1px solid rgba(34, 197, 94, 0.3); color: #4ade80; }
.toast-error   { background: rgba(239, 68, 68, 0.15); border: 1px solid rgba(239, 68, 68, 0.3); color: #f87171; }
.toast-warning { background: rgba(245, 158, 11, 0.15); border: 1px solid rgba(245, 158, 11, 0.3); color: #fbbf24; }
.toast-info    { background: rgba(59, 130, 246, 0.15); border: 1px solid rgba(59, 130, 246, 0.3); color: #60a5fa; }
.toast-dismiss {
  margin-left: auto;
  background: none;
  border: none;
  color: inherit;
  opacity: 0.6;
  padding: 2px;
  cursor: pointer;
}
.toast-dismiss:hover { opacity: 1; }
.toast-exit { animation: slideOutRight 0.3s ease forwards; }

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(60px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes slideOutRight {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(60px); }
}

/* ── Modal ─────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}
.modal {
  background: rgba(15, 20, 55, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  max-width: 500px;
  width: 100%;
  animation: scaleIn 0.2s ease;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-lg { max-width: 700px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--glass-border);
}
.modal-title { font-size: 1.1rem; font-weight: 600; }
.modal-close {
  background: none;
  border: none;
  color: var(--color-text-tertiary);
  padding: 4px;
  transition: color 0.15s;
}
.modal-close:hover { color: var(--color-text); }
.modal-body { padding: 24px; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--glass-border);
}

/* ── Tab Navigation ────────────────────────────────────────────── */
.tab-nav {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: 24px;
  overflow-x: auto;
}
.tab-nav-item {
  padding: 12px 20px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-tertiary);
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
  cursor: pointer;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
.tab-nav-item:hover { color: var(--color-text-secondary); }
.tab-nav-item.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

/* ── Tooltip ───────────────────────────────────────────────────── */
.tooltip {
  position: relative;
}
.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.85);
  color: var(--color-text);
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 1000;
}
.tooltip:hover::after { opacity: 1; }

/* ── Auth Pages (Login, Register, etc.) ────────────────────────── */
.auth-page {
  min-height: calc(100vh - var(--navbar-height));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.auth-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--glass-shadow);
  width: 100%;
  max-width: 440px;
  padding: 40px;
}
.auth-header {
  text-align: center;
  margin-bottom: 32px;
}
.auth-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.auth-header p {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  color: var(--color-text-tertiary);
  font-size: 0.8rem;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--glass-border);
}
.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}
.auth-footer a { font-weight: 600; }

/* ── Error Page ────────────────────────────────────────────────── */
.error-page {
  min-height: calc(100vh - var(--navbar-height));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.error-container {
  text-align: center;
  padding: 60px 40px;
  max-width: 500px;
}
.error-code {
  font-size: 5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 16px;
}
.error-message {
  color: var(--color-text-secondary);
  font-size: 1.1rem;
  margin-bottom: 28px;
}

/* ── Landing / Public Page Sections ────────────────────────────── */
.hero-section {
  padding: 100px 0 80px;
  text-align: center;
  position: relative;
  z-index: 1;
}
.hero-title {
  font-size: 3.2rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #fff 30%, var(--color-primary) 70%, var(--color-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-subtitle {
  font-size: 1.15rem;
  color: var(--color-text-secondary);
  max-width: 560px;
  margin: 0 auto 36px;
  line-height: 1.6;
}
.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.section {
  padding: 80px 0;
  position: relative;
  z-index: 1;
}
.section-header {
  text-align: center;
  margin-bottom: 48px;
}
.section-header h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.section-header p {
  color: var(--color-text-secondary);
  font-size: 1.05rem;
  max-width: 520px;
  margin: 0 auto;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.feature-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: transform 0.3s, border-color 0.3s;
}
.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--glass-border-hover);
}
.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: rgba(59, 130, 246, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: var(--color-primary);
}
.feature-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.feature-card p {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
}
.pricing-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 36px;
  text-align: center;
  transition: transform 0.3s, border-color 0.3s;
  position: relative;
}
.pricing-card:hover {
  transform: translateY(-4px);
  border-color: var(--glass-border-hover);
}
.pricing-card.featured {
  border-color: rgba(59, 130, 246, 0.3);
  box-shadow: 0 0 40px rgba(59, 130, 246, 0.08);
}
.pricing-card.featured::before {
  content: 'Popular';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 16px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.pricing-name { font-size: 1.1rem; font-weight: 600; margin-bottom: 8px; }
.pricing-price { font-size: 2.5rem; font-weight: 800; margin-bottom: 6px; }
.pricing-price span { font-size: 1rem; font-weight: 400; color: var(--color-text-secondary); }
.pricing-desc { font-size: 0.85rem; color: var(--color-text-secondary); margin-bottom: 24px; }
.pricing-features { text-align: left; margin-bottom: 28px; }
.pricing-features li {
  padding: 6px 0;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  gap: 10px;
}
.pricing-features li::before {
  content: '✓';
  color: var(--color-success);
  font-weight: 700;
}

/* ── Footer ────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--glass-border);
  padding: 40px 0;
  position: relative;
  z-index: 1;
}
.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  text-align: center;
}
.footer-logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 6px;
}
.footer-tagline {
  font-size: 0.85rem;
  color: var(--color-text-tertiary);
  margin-bottom: 20px;
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 20px;
}
.footer-links a {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}
.footer-links a:hover { color: var(--color-text); }
.footer-copyright {
  font-size: 0.78rem;
  color: var(--color-text-tertiary);
}

/* ── Admin-specific layout ─────────────────────────────────────── */
.admin-sidebar .sidebar-header {
  background: rgba(139, 92, 246, 0.05);
}
.admin-layout .dashboard-main { background: transparent; }

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.admin-search {
  max-width: 300px;
}

/* ── Utility Classes ── Flexbox ─────────────────────────────────── */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.items-stretch { align-items: stretch; }
.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.self-start { align-self: flex-start; }
.self-center { align-self: center; }
.self-end { align-self: flex-end; }

.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }
.gap-6 { gap: 24px; }
.gap-8 { gap: 32px; }

/* ── Utility Classes ── Grid ───────────────────────────────────── */
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ── Utility Classes ── Spacing ────────────────────────────────── */
.p-0 { padding: 0; }
.p-1 { padding: 4px; }
.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.p-5 { padding: 20px; }
.p-6 { padding: 24px; }
.p-8 { padding: 32px; }

.px-1 { padding-left: 4px; padding-right: 4px; }
.px-2 { padding-left: 8px; padding-right: 8px; }
.px-3 { padding-left: 12px; padding-right: 12px; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.px-5 { padding-left: 20px; padding-right: 20px; }
.px-6 { padding-left: 24px; padding-right: 24px; }
.px-8 { padding-left: 32px; padding-right: 32px; }

.py-1 { padding-top: 4px; padding-bottom: 4px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-3 { padding-top: 12px; padding-bottom: 12px; }
.py-4 { padding-top: 16px; padding-bottom: 16px; }
.py-5 { padding-top: 20px; padding-bottom: 20px; }
.py-6 { padding-top: 24px; padding-bottom: 24px; }
.py-8 { padding-top: 32px; padding-bottom: 32px; }

.pt-1 { padding-top: 4px; }  .pt-2 { padding-top: 8px; }
.pt-3 { padding-top: 12px; } .pt-4 { padding-top: 16px; }
.pt-5 { padding-top: 20px; } .pt-6 { padding-top: 24px; }
.pt-8 { padding-top: 32px; }

.pb-1 { padding-bottom: 4px; }  .pb-2 { padding-bottom: 8px; }
.pb-3 { padding-bottom: 12px; } .pb-4 { padding-bottom: 16px; }
.pb-5 { padding-bottom: 20px; } .pb-6 { padding-bottom: 24px; }
.pb-8 { padding-bottom: 32px; }

.pl-1 { padding-left: 4px; }  .pl-2 { padding-left: 8px; }
.pl-3 { padding-left: 12px; } .pl-4 { padding-left: 16px; }
.pl-5 { padding-left: 20px; } .pl-6 { padding-left: 24px; }

.pr-1 { padding-right: 4px; }  .pr-2 { padding-right: 8px; }
.pr-3 { padding-right: 12px; } .pr-4 { padding-right: 16px; }
.pr-5 { padding-right: 20px; } .pr-6 { padding-right: 24px; }

.m-0 { margin: 0; }
.m-1 { margin: 4px; }
.m-2 { margin: 8px; }
.m-3 { margin: 12px; }
.m-4 { margin: 16px; }
.m-5 { margin: 20px; }
.m-6 { margin: 24px; }
.m-8 { margin: 32px; }
.m-auto { margin: auto; }

.mx-1 { margin-left: 4px; margin-right: 4px; }
.mx-2 { margin-left: 8px; margin-right: 8px; }
.mx-3 { margin-left: 12px; margin-right: 12px; }
.mx-4 { margin-left: 16px; margin-right: 16px; }
.mx-auto { margin-left: auto; margin-right: auto; }

.my-1 { margin-top: 4px; margin-bottom: 4px; }
.my-2 { margin-top: 8px; margin-bottom: 8px; }
.my-3 { margin-top: 12px; margin-bottom: 12px; }
.my-4 { margin-top: 16px; margin-bottom: 16px; }
.my-5 { margin-top: 20px; margin-bottom: 20px; }
.my-6 { margin-top: 24px; margin-bottom: 24px; }

.mt-1 { margin-top: 4px; }  .mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 20px; } .mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }

.mb-1 { margin-bottom: 4px; }  .mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; } .mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }

.ml-1 { margin-left: 4px; }  .ml-2 { margin-left: 8px; }
.ml-3 { margin-left: 12px; } .ml-4 { margin-left: 16px; }
.ml-auto { margin-left: auto; }

.mr-1 { margin-right: 4px; }  .mr-2 { margin-right: 8px; }
.mr-3 { margin-right: 12px; } .mr-4 { margin-right: 16px; }
.mr-auto { margin-right: auto; }

/* ── Utility Classes ── Typography ─────────────────────────────── */
.text-xs   { font-size: 0.75rem; }
.text-sm   { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg   { font-size: 1.125rem; }
.text-xl   { font-size: 1.25rem; }
.text-2xl  { font-size: 1.5rem; }
.text-3xl  { font-size: 1.875rem; }
.text-4xl  { font-size: 2.25rem; }

.font-light    { font-weight: 300; }
.font-normal   { font-weight: 400; }
.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }
.font-extrabold { font-weight: 800; }

.text-left    { text-align: left; }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.leading-tight  { line-height: 1.25; }
.leading-normal { line-height: 1.5; }
.leading-relaxed { line-height: 1.625; }

.text-white     { color: var(--color-text); }
.text-muted     { color: var(--color-text-secondary); }
.text-tertiary  { color: var(--color-text-tertiary); }
.text-primary   { color: var(--color-primary); }
.text-secondary { color: var(--color-secondary); }
.text-danger    { color: var(--color-danger); }
.text-success   { color: var(--color-success); }
.text-warning   { color: var(--color-warning); }

.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.uppercase { text-transform: uppercase; }
.capitalize { text-transform: capitalize; }
.tracking-wide { letter-spacing: 0.05em; }

/* ── Utility Classes ── Width / Height ─────────────────────────── */
.w-full { width: 100%; }
.w-auto { width: auto; }
.h-full { height: 100%; }
.h-auto { height: auto; }
.min-h-screen { min-height: 100vh; }
.max-w-xs  { max-width: 320px; }
.max-w-sm  { max-width: 384px; }
.max-w-md  { max-width: 448px; }
.max-w-lg  { max-width: 512px; }
.max-w-xl  { max-width: 576px; }
.max-w-2xl { max-width: 672px; }
.max-w-3xl { max-width: 768px; }
.max-w-4xl { max-width: 896px; }
.max-w-5xl { max-width: 1024px; }

/* ── Utility Classes ── Display ────────────────────────────────── */
.hidden  { display: none; }
.block   { display: block; }
.inline  { display: inline; }
.inline-block { display: inline-block; }

/* ── Utility Classes ── Overflow ───────────────────────────────── */
.overflow-hidden { overflow: hidden; }
.overflow-auto   { overflow: auto; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }
.overflow-y-scroll { overflow-y: scroll; }

/* ── Utility Classes ── Position ───────────────────────────────── */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed    { position: fixed; }
.sticky   { position: sticky; }
.inset-0  { top: 0; right: 0; bottom: 0; left: 0; }
.top-0    { top: 0; }
.left-0   { left: 0; }
.right-0  { right: 0; }
.bottom-0 { bottom: 0; }
.z-0  { z-index: 0; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-30 { z-index: 30; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }

/* ── Utility Classes ── Borders ────────────────────────────────── */
.rounded     { border-radius: var(--radius-sm); }
.rounded-md  { border-radius: var(--radius-md); }
.rounded-lg  { border-radius: var(--radius-lg); }
.rounded-xl  { border-radius: var(--radius-xl); }
.rounded-2xl { border-radius: 32px; }
.rounded-full { border-radius: 9999px; }
.rounded-none { border-radius: 0; }
.border      { border: 1px solid var(--glass-border); }
.border-glass { border: 1px solid var(--glass-border); }
.border-none { border: none; }
.border-b    { border-bottom: 1px solid var(--glass-border); }
.border-t    { border-top: 1px solid var(--glass-border); }

/* ── Utility Classes ── Transitions ────────────────────────────── */
.transition     { transition-property: color, background-color, border-color, box-shadow; transition-duration: 0.15s; transition-timing-function: ease; }
.transition-all { transition: all 0.15s ease; }
.duration-200 { transition-duration: 0.2s; }
.duration-300 { transition-duration: 0.3s; }
.duration-500 { transition-duration: 0.5s; }

/* ── Utility Classes ── Opacity ────────────────────────────────── */
.opacity-0   { opacity: 0; }
.opacity-25  { opacity: 0.25; }
.opacity-50  { opacity: 0.5; }
.opacity-70  { opacity: 0.7; }
.opacity-75  { opacity: 0.75; }
.opacity-100 { opacity: 1; }

/* ── Utility Classes ── Misc ───────────────────────────────────── */
.cursor-pointer { cursor: pointer; }
.pointer-events-none { pointer-events: none; }
.select-none { user-select: none; }
.whitespace-nowrap { white-space: nowrap; }
.break-words { word-break: break-word; }
.object-cover { object-fit: cover; }
.shadow-glass { box-shadow: var(--glass-shadow); }
.backdrop-blur { backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); }
.bg-glass { background: var(--glass-bg); }

/* ── Responsive ── Mobile (<768px) ─────────────────────────────── */
@media (max-width: 767px) {
  .hero-title { font-size: 2rem; }
  .hero-subtitle { font-size: 1rem; }
  .hero-section { padding: 60px 0 50px; }

  .nav-links { display: none; }
  .nav-mobile-toggle { display: flex; }

  .nav-links.mobile-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--navbar-height);
    left: 0;
    right: 0;
    background: rgba(10, 14, 39, 0.95);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--glass-border);
    padding: 20px;
    gap: 12px;
    z-index: 99;
  }

  .dashboard-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    background: rgba(10, 14, 39, 0.98);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
  }
  .dashboard-sidebar.mobile-open { transform: translateX(0); }
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 199;
  }
  .sidebar-overlay.visible { display: block; }

  .dashboard-main { padding: 20px 16px; height: auto; min-height: 100vh; }

  .chat-layout { flex-direction: column; }
  .chat-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 200;
    width: 280px;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    background: rgba(10, 14, 39, 0.98);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
  }
  .chat-sidebar.mobile-open { transform: translateX(0); }

  .chat-messages { padding: 16px; }
  .chat-input-area { padding: 12px 16px; }

  .grid-cols-2, .grid-cols-3, .grid-cols-4 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
  .features-grid { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }

  .section { padding: 50px 0; }
  .section-header h2 { font-size: 1.5rem; }

  .auth-card { padding: 28px 24px; }

  .modal { margin: 12px; }
  .modal-body { padding: 20px; }

  .toast-container { left: 12px; right: 12px; }
  .toast { min-width: auto; width: 100%; }

  .footer-links { flex-wrap: wrap; gap: 16px; }

  .glass-table-wrapper { font-size: 0.82rem; }
  .glass-table th, .glass-table td { padding: 10px 12px; }

  .admin-toolbar { flex-direction: column; align-items: stretch; }

  .user-dropdown {
    right: -20px;
  }

  .hidden-mobile { display: none !important; }
}

/* ── Responsive ── Tablet (768px - 1023px) ─────────────────────── */
@media (min-width: 768px) and (max-width: 1023px) {
  .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
  .hero-title { font-size: 2.5rem; }
  .hidden-tablet { display: none !important; }
}

/* ── Responsive ── Desktop (1024px+) ───────────────────────────── */
@media (min-width: 1024px) {
  .hidden-desktop { display: none !important; }
}

/* ── Print ─────────────────────────────────────────────────────── */
@media print {
  .glass-navbar, .dashboard-sidebar, .chat-input-area,
  .toast-container, .modal-backdrop, .nav-mobile-toggle { display: none !important; }
  body { background: #fff; color: #000; }
  .glass-card, .glass-panel { background: #f9f9f9; border: 1px solid #ddd; }
}
