/* ============================================================
   Teymensel Support — Master Design System
   AMOLED TRUE BLACK THEME
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ============================================================
   CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   ============================================================ */
:root {
  /* Colors */
  --bg-main:          #000000;
  --bg-secondary:     #050505;
  --bg-card:          #0b0b0b;
  --bg-hover:         #0f0f0f;
  --bg-active:        #131313;
  --border:           #151515;
  --border-hover:     #1f1f1f;
  --border-focus:     #0948b3;

  /* Brand */
  --primary:          #0948b3;
  --primary-hover:    #0d5be0;
  --primary-light:    rgba(9, 72, 179, 0.12);
  --primary-glow:     rgba(9, 72, 179, 0.45);
  --purple:           #6d5dfc;
  --purple-light:     rgba(109, 93, 252, 0.12);
  --purple-glow:      rgba(109, 93, 252, 0.4);

  /* Text */
  --text:             #ffffff;
  --text-secondary:   #9ca3af;
  --text-muted:       #4b5563;
  --text-disabled:    #374151;

  /* State */
  --success:          #22c55e;
  --success-light:    rgba(34, 197, 94, 0.12);
  --warning:          #f59e0b;
  --warning-light:    rgba(245, 158, 11, 0.12);
  --danger:           #ef4444;
  --danger-light:     rgba(239, 68, 68, 0.12);
  --info:             #3b82f6;
  --info-light:       rgba(59, 130, 246, 0.12);

  /* Typography */
  --font:             'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  --font-mono:        'SF Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;

  /* Spacing */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;

  /* Border Radius */
  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  18px;
  --radius-xl:  22px;
  --radius-2xl: 28px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.6);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.5), 0 2px 6px rgba(0,0,0,0.7);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.6), 0 4px 12px rgba(0,0,0,0.8);
  --shadow-xl:  0 20px 60px rgba(0,0,0,0.7), 0 8px 24px rgba(0,0,0,0.9);
  --shadow-glow: 0 0 24px var(--primary-glow);
  --shadow-purple-glow: 0 0 24px var(--purple-glow);

  /* Transitions */
  --transition-fast:   150ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition:        250ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow:   400ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-spring: 600ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Sidebar */
  --sidebar-width:         260px;
  --sidebar-collapsed:     68px;
  --topbar-height:         60px;
  --content-max-width:     1400px;

  /* Z-index scale */
  --z-dropdown:   100;
  --z-sticky:     200;
  --z-overlay:    300;
  --z-modal:      400;
  --z-toast:      500;
  --z-command:    600;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  height: 100%;
  overflow-x: hidden;
}

img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

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

input, textarea, select, button {
  font-family: var(--font);
  font-size: 14px;
}

ul, ol { list-style: none; }

/* ============================================================
   APP LAYOUT
   ============================================================ */
.app-wrapper {
  display: flex;
  min-height: 100vh;
  background: var(--bg-main);
}

.app-sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: var(--z-sticky);
  transition: width var(--transition), transform var(--transition);
  overflow: hidden;
}

.app-sidebar.collapsed {
  width: var(--sidebar-collapsed);
}

.app-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--transition);
  background: var(--bg-main);
}

.app-sidebar.collapsed ~ .app-content,
.sidebar-collapsed .app-content {
  margin-left: var(--sidebar-collapsed);
}

.app-topbar {
  height: var(--topbar-height);
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  padding: 0 var(--space-6);
  gap: var(--space-4);
}

.app-main {
  flex: 1;
  padding: var(--space-6) var(--space-8);
  max-width: var(--content-max-width);
  width: 100%;
  margin: 0 auto;
}

/* ============================================================
   SIDEBAR INTERNALS
   ============================================================ */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-4);
  border-bottom: 1px solid var(--border);
  min-height: var(--topbar-height);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px var(--primary-glow);
  font-size: 18px;
  font-weight: 900;
  color: white;
}

.sidebar-logo-text {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: opacity var(--transition), width var(--transition);
}

.sidebar-logo-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
  white-space: nowrap;
}

.sidebar-logo-sub {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--space-3) var(--space-2);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.sidebar-section {
  margin-bottom: var(--space-2);
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: var(--space-3) var(--space-3) var(--space-1);
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--transition);
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 9px var(--space-3);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  position: relative;
  margin-bottom: 2px;
}

.sidebar-item:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.sidebar-item.active {
  color: var(--text);
  background: var(--primary-light);
}

.sidebar-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 3px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}

.sidebar-item-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-item-text {
  font-size: 13.5px;
  font-weight: 500;
  transition: opacity var(--transition);
  flex: 1;
}

.sidebar-item-badge {
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  min-width: 18px;
  text-align: center;
  transition: opacity var(--transition);
}

.sidebar-user {
  border-top: 1px solid var(--border);
  padding: var(--space-3) var(--space-2);
}

.sidebar-user-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
  overflow: hidden;
}

.sidebar-user-card:hover { background: var(--bg-hover); }

.sidebar-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  object-fit: cover;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: white;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar-toggle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}
.topbar-toggle:hover {
  background: var(--bg-card);
  color: var(--text);
}

.topbar-search {
  flex: 1;
  max-width: 480px;
  position: relative;
}

.topbar-search-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px var(--space-4);
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-secondary);
  font-size: 13px;
}

.topbar-search-btn:hover {
  border-color: var(--border-hover);
  background: var(--bg-hover);
  color: var(--text);
}

.topbar-search-shortcut {
  margin-left: auto;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
}

.topbar-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  position: relative;
  text-decoration: none;
}

.topbar-icon-btn:hover {
  background: var(--bg-card);
  color: var(--text);
}

.topbar-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 16px;
  height: 16px;
  background: var(--danger);
  border-radius: var(--radius-full);
  font-size: 9px;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-main);
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--transition);
}

.card-hover:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.card-body {
  padding: var(--space-5) var(--space-6);
}

.card-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border);
  background: rgba(255,255,255,0.015);
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.2px;
}

/* Stat Card */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-5) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--purple));
  opacity: 0;
  transition: opacity var(--transition);
}

.stat-card:hover::before { opacity: 1; }
.stat-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.stat-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-card-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -1px;
  line-height: 1;
}

.stat-card-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-card-change {
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-card-change.up   { color: var(--success); }
.stat-card-change.down { color: var(--danger); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 9px var(--space-5);
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  letter-spacing: -0.1px;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: white;
  opacity: 0;
  transition: opacity 150ms;
  pointer-events: none;
}

.btn:active::after { opacity: 0.08; }

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 6px 20px var(--primary-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
}

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

.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover {
  background: #dc2626;
  box-shadow: 0 4px 16px rgba(239,68,68,0.4);
}

.btn-purple {
  background: var(--purple);
  color: white;
  box-shadow: 0 4px 12px var(--purple-glow);
}
.btn-purple:hover {
  background: #5b4cfa;
  transform: translateY(-1px);
}

.btn-success {
  background: var(--success);
  color: #000;
}
.btn-success:hover {
  background: #16a34a;
}

.btn-sm {
  padding: 6px var(--space-3);
  font-size: 12.5px;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 12px var(--space-8);
  font-size: 15px;
  border-radius: var(--radius-lg);
}

.btn-xl {
  padding: 16px 40px;
  font-size: 16px;
  border-radius: var(--radius-lg);
  font-weight: 700;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-md);
}

.btn-icon-sm {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: var(--radius-sm);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.1px;
}

.form-label span {
  color: var(--danger);
  margin-left: 2px;
}

.form-input,
.form-textarea,
.form-select {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  padding: 10px var(--space-4);
  font-size: 14px;
  width: 100%;
  transition: all var(--transition-fast);
  outline: none;
}

.form-input::placeholder,
.form-textarea::placeholder { color: var(--text-muted); }

.form-input:hover,
.form-textarea:hover,
.form-select:hover {
  border-color: var(--border-hover);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(9,72,179,0.15);
  background: var(--bg-card);
}

.form-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 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.form-select option {
  background: var(--bg-card);
  color: var(--text);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}

.form-help {
  font-size: 12px;
  color: var(--text-secondary);
}

.form-error {
  font-size: 12px;
  color: var(--danger);
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.input-group {
  position: relative;
}

.input-group-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.input-group .form-input {
  padding-left: 40px;
}

/* ============================================================
   BADGES & TAGS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.badge-primary  { background: var(--primary-light);  color: var(--primary); }
.badge-success  { background: var(--success-light);  color: var(--success); }
.badge-warning  { background: var(--warning-light);  color: var(--warning); }
.badge-danger   { background: var(--danger-light);   color: var(--danger);  }
.badge-purple   { background: var(--purple-light);   color: var(--purple);  }
.badge-neutral  { background: rgba(255,255,255,0.06); color: var(--text-secondary); }

.badge-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

/* Status indicators */
.status-operational    { background: var(--success-light); color: var(--success); }
.status-degraded       { background: var(--warning-light); color: var(--warning); }
.status-partial_outage { background: var(--warning-light); color: var(--warning); }
.status-major_outage   { background: var(--danger-light);  color: var(--danger);  }
.status-maintenance    { background: var(--info-light);    color: var(--info);    }

/* Priority */
.priority-low    { background: var(--success-light); color: var(--success); }
.priority-medium { background: var(--info-light);    color: var(--info);    }
.priority-high   { background: var(--warning-light); color: var(--warning); }
.priority-urgent { background: var(--danger-light);  color: var(--danger);  }

/* ============================================================
   TABLE
   ============================================================ */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

thead tr {
  background: var(--bg-secondary);
}

th {
  padding: 12px var(--space-4);
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 13px var(--space-4);
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(21,21,21,0.8);
  vertical-align: middle;
}

tbody tr {
  transition: background var(--transition-fast);
  background: var(--bg-card);
}

tbody tr:hover { background: var(--bg-hover); }
tbody tr:last-child td { border-bottom: none; }

/* ============================================================
   HERO SECTION (DASHBOARD)
   ============================================================ */
.hero-section {
  background: linear-gradient(135deg, #050510 0%, #050505 40%, #050505 60%, #0a0510 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: var(--space-10) var(--space-10);
  margin-bottom: var(--space-8);
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(9,72,179,0.15) 0%, transparent 60%);
  pointer-events: none;
}

.hero-section::after {
  content: '';
  position: absolute;
  bottom: -30%;
  right: 5%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(109,93,252,0.1) 0%, transparent 60%);
  pointer-events: none;
}

.hero-greeting {
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: var(--space-2);
}

.hero-title {
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -1px;
  line-height: 1.2;
  margin-bottom: var(--space-3);
}

.hero-title span {
  background: linear-gradient(135deg, var(--primary-hover), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 500px;
}

.hero-actions {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-6);
  flex-wrap: wrap;
}

/* ============================================================
   GLASS CARD
   ============================================================ */
.glass-card {
  background: rgba(11,11,11,0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: var(--radius-xl);
}

/* ============================================================
   CHAT INTERFACE (Discord-like)
   ============================================================ */
.chat-wrapper {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--topbar-height) - 48px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--bg-card);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

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

.chat-message {
  display: flex;
  gap: var(--space-3);
  padding: 6px 8px;
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}

.chat-message:hover { background: rgba(255,255,255,0.02); }

.chat-message-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: white;
  overflow: hidden;
}

.chat-message-content {}

.chat-message-header {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin-bottom: 3px;
}

.chat-message-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.chat-message-name.agent { color: var(--primary); }
.chat-message-name.ai    { color: var(--purple); }

.chat-message-time {
  font-size: 11px;
  color: var(--text-muted);
}

.chat-message-body {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.chat-message-body p { margin-bottom: 8px; }
.chat-message-body p:last-child { margin-bottom: 0; }

.chat-message-body code {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.chat-message-body pre {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  overflow-x: auto;
  margin: var(--space-3) 0;
}

.chat-message-body pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
}

.chat-input-area {
  border-top: 1px solid var(--border);
  padding: var(--space-4);
  background: var(--bg-secondary);
}

.chat-input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: var(--space-3);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 10px var(--space-4);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.chat-input-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(9,72,179,0.12);
}

.chat-input-field {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 14px;
  resize: none;
  max-height: 200px;
  line-height: 1.5;
}

.chat-input-field::placeholder { color: var(--text-muted); }

.chat-input-actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-shrink: 0;
}

.typing-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 4px 0;
  color: var(--text-muted);
  font-size: 12px;
  font-style: italic;
  min-height: 20px;
}

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

.typing-dot {
  width: 5px;
  height: 5px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: typingDot 1.2s infinite;
}

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

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

/* ============================================================
   AI CHAT
   ============================================================ */
.ai-chat-wrapper {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--topbar-height) - 48px);
  gap: var(--space-4);
}

.ai-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.ai-messages::-webkit-scrollbar { width: 4px; }
.ai-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.ai-message {
  display: flex;
  gap: var(--space-4);
  max-width: 800px;
}

.ai-message.user {
  flex-direction: row-reverse;
  align-self: flex-end;
}

.ai-message-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.ai-message.assistant .ai-message-icon {
  background: linear-gradient(135deg, var(--purple), var(--primary));
  color: white;
}

.ai-message.user .ai-message-icon {
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.ai-bubble {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
  max-width: 600px;
}

.ai-message.user .ai-bubble {
  background: var(--primary-light);
  border-color: rgba(9,72,179,0.3);
  color: var(--text);
}

.ai-bubble pre {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  overflow-x: auto;
  margin: var(--space-3) 0;
}

.ai-bubble code {
  font-family: var(--font-mono);
  font-size: 13px;
}

/* ============================================================
   KNOWLEDGE BASE
   ============================================================ */
.kb-search {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-8) var(--space-10);
  text-align: center;
  margin-bottom: var(--space-8);
  position: relative;
  overflow: hidden;
}

.kb-search::before {
  content: '';
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(9,72,179,0.08) 0%, transparent 60%);
}

.kb-search-input-wrapper {
  position: relative;
  max-width: 560px;
  margin: var(--space-5) auto 0;
}

.kb-search-input {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text);
  padding: 14px 20px 14px 48px;
  font-size: 15px;
  outline: none;
  transition: all var(--transition-fast);
}

.kb-search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(9,72,179,0.12), var(--shadow-glow);
}

.kb-search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.kb-category-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-5) var(--space-6);
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  text-decoration: none;
  transition: all var(--transition);
  cursor: pointer;
}

.kb-category-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.kb-category-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
}

/* ============================================================
   STATUS PAGE
   ============================================================ */
.status-overall {
  border-radius: var(--radius-xl);
  padding: var(--space-5) var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  border: 1px solid;
}

.status-overall.all-good {
  background: var(--success-light);
  border-color: rgba(34,197,94,0.2);
}

.status-overall.issues {
  background: var(--warning-light);
  border-color: rgba(245,158,11,0.2);
}

.status-overall.outage {
  background: var(--danger-light);
  border-color: rgba(239,68,68,0.2);
}

.status-service-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  transition: all var(--transition-fast);
}

.status-service-card:hover { background: var(--bg-hover); }

/* Uptime bar */
.uptime-bar {
  display: flex;
  gap: 2px;
  align-items: center;
}

.uptime-segment {
  width: 6px;
  height: 24px;
  border-radius: 2px;
  background: var(--success);
  opacity: 0.8;
}

.uptime-segment.issue { background: var(--warning); }
.uptime-segment.outage { background: var(--danger); }

/* ============================================================
   COMMAND PALETTE
   ============================================================ */
.command-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: var(--z-command);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

.command-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.command-palette {
  background: var(--bg-card);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 580px;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  transform: scale(0.96) translateY(-8px);
  transition: transform var(--transition-spring);
}

.command-overlay.active .command-palette {
  transform: scale(1) translateY(0);
}

.command-input-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
}

.command-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 15px;
}

.command-input::placeholder { color: var(--text-muted); }

.command-results {
  max-height: 400px;
  overflow-y: auto;
  padding: var(--space-2);
}

.command-results::-webkit-scrollbar { width: 4px; }
.command-results::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.command-group-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: var(--space-2) var(--space-3) var(--space-1);
}

.command-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px var(--space-3);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
  text-decoration: none;
}

.command-item:hover,
.command-item.selected {
  background: var(--primary-light);
}

.command-item-icon {
  width: 32px;
  height: 32px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-secondary);
}

.command-item-text {
  flex: 1;
}

.command-item-name {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
}

.command-item-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.command-shortcut {
  font-size: 11px;
  font-family: var(--font-mono);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  color: var(--text-muted);
}

.command-footer {
  border-top: 1px solid var(--border);
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-size: 11.5px;
  color: var(--text-muted);
}

.command-footer-hint {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.command-footer-hint kbd {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

/* ============================================================
   TOASTS
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-width: 360px;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  box-shadow: var(--shadow-xl);
  pointer-events: all;
  animation: toastIn 300ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  position: relative;
  overflow: hidden;
}

.toast::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
}

.toast-success::before { background: var(--success); }
.toast-error::before   { background: var(--danger); }
.toast-warning::before { background: var(--warning); }
.toast-info::before    { background: var(--primary); }

.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

.toast-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.toast-body {
  font-size: 12.5px;
  color: var(--text-secondary);
}

.toast-close {
  margin-left: auto;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: color var(--transition-fast);
}

.toast-close:hover { color: var(--text); }

@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

@keyframes toastOut {
  from { transform: translateX(0);    opacity: 1; }
  to   { transform: translateX(110%); opacity: 0; }
}

/* ============================================================
   DROPDOWN / POPOVER
   ============================================================ */
.dropdown {
  position: relative;
  display: inline-flex;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-dropdown);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.96) translateY(-4px);
  transform-origin: top right;
  transition: all var(--transition-fast);
}

.dropdown-menu.open {
  opacity: 1;
  pointer-events: all;
  transform: scale(1) translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 9px var(--space-4);
  font-size: 13.5px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.dropdown-item:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: var(--danger-light); }

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-1) 0;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  width: 100%;
  max-width: 560px;
  box-shadow: var(--shadow-xl);
  transform: scale(0.95);
  transition: transform var(--transition-spring);
  overflow: hidden;
}

.modal-overlay.active .modal {
  transform: scale(1);
}

.modal-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

.modal-body {
  padding: var(--space-6);
}

.modal-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
}

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress {
  height: 4px;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--primary), var(--purple));
  transition: width 800ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* ============================================================
   AVATAR
   ============================================================ */
.avatar {
  border-radius: var(--radius-full);
  object-fit: cover;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.avatar-sm  { width: 28px; height: 28px; font-size: 11px; }
.avatar-md  { width: 36px; height: 36px; font-size: 13px; }
.avatar-lg  { width: 48px; height: 48px; font-size: 16px; }
.avatar-xl  { width: 64px; height: 64px; font-size: 20px; }
.avatar-2xl { width: 96px; height: 96px; font-size: 28px; }

.avatar-stack { display: flex; }
.avatar-stack .avatar { border: 2px solid var(--bg-main); margin-left: -8px; }
.avatar-stack .avatar:first-child { margin-left: 0; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-16) var(--space-8);
  gap: var(--space-4);
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.empty-state-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

.empty-state-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 340px;
  line-height: 1.7;
}

/* ============================================================
   GRID SYSTEM
   ============================================================ */
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.gap-3  { gap: var(--space-3); }
.gap-4  { gap: var(--space-4); }
.gap-5  { gap: var(--space-5); }
.gap-6  { gap: var(--space-6); }
.gap-8  { gap: var(--space-8); }

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.flex          { display: flex; }
.flex-col      { flex-direction: column; }
.items-center  { align-items: center; }
.items-start   { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.flex-1        { flex: 1; }
.flex-wrap     { flex-wrap: wrap; }
.flex-shrink-0 { flex-shrink: 0; }

.w-full   { width: 100%; }
.h-full   { height: 100%; }
.relative { position: relative; }
.absolute { position: absolute; }
.hidden   { display: none !important; }
.block    { display: block; }
.inline-flex { display: inline-flex; }

.text-center  { text-align: center; }
.text-right   { text-align: right; }
.font-bold    { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium  { font-weight: 500; }
.text-xs  { font-size: 11px; }
.text-sm  { font-size: 12.5px; }
.text-base { font-size: 14px; }
.text-lg  { font-size: 16px; }
.text-xl  { font-size: 18px; }
.text-2xl { font-size: 22px; }
.text-3xl { font-size: 28px; }
.text-4xl { font-size: 36px; }

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

.bg-primary-light { background: var(--primary-light); }
.bg-success-light { background: var(--success-light); }
.bg-warning-light { background: var(--warning-light); }
.bg-danger-light  { background: var(--danger-light); }

.rounded-sm   { 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-full { border-radius: var(--radius-full); }

.border  { border: 1px solid var(--border); }
.border-top { border-top: 1px solid var(--border); }

.overflow-hidden { overflow: hidden; }
.truncate        { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.line-clamp-2    { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3    { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.cursor-pointer { cursor: pointer; }
.select-none    { user-select: none; }

.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.mr-2 { margin-right: var(--space-2); }
.mr-3 { margin-right: var(--space-3); }
.ml-auto { margin-left: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }

.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-5 { padding: var(--space-5); }
.p-6 { padding: var(--space-6); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.py-3 { padding-top: var(--space-3);  padding-bottom: var(--space-3); }

.opacity-0 { opacity: 0; }
.opacity-50 { opacity: 0.5; }

/* ============================================================
   SECTION HEADERS
   ============================================================ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
  gap: var(--space-4);
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

.section-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
  margin-bottom: var(--space-8);
}

.page-title {
  font-size: clamp(20px, 2.5vw, 28px);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.8px;
  line-height: 1.2;
}

.page-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: var(--space-2);
  line-height: 1.6;
}

.page-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}

.page-breadcrumb a { color: var(--text-secondary); }
.page-breadcrumb a:hover { color: var(--text); }
.page-breadcrumb .sep { color: var(--text-muted); }

/* ============================================================
   TABS
   ============================================================ */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-6);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  padding: 10px var(--space-4);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}

.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--text); border-bottom-color: var(--primary); }

/* ============================================================
   SKELETON LOADER
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

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

/* ============================================================
   MARKDOWN CONTENT
   ============================================================ */
.prose {
  color: var(--text-secondary);
  line-height: 1.8;
  font-size: 14.5px;
}

.prose h1, .prose h2, .prose h3, .prose h4 {
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.3px;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

.prose h1 { font-size: 26px; }
.prose h2 { font-size: 20px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.prose h3 { font-size: 16px; }
.prose h4 { font-size: 14px; }

.prose p  { margin-bottom: 1em; }

.prose a { color: var(--primary); }
.prose a:hover { color: var(--primary-hover); text-decoration: underline; }

.prose code {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--purple);
}

.prose pre {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  overflow-x: auto;
  margin: 1.2em 0;
  position: relative;
}

.prose pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
  font-size: 13.5px;
}

.prose blockquote {
  border-left: 3px solid var(--primary);
  padding: var(--space-3) var(--space-4);
  background: var(--primary-light);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 1em 0;
  color: var(--text-secondary);
}

.prose ul, .prose ol {
  padding-left: 1.5em;
  margin-bottom: 1em;
}

.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin-bottom: 4px; }

.prose img {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  margin: 1em 0;
}

.prose table {
  font-size: 13.5px;
  width: 100%;
  margin: 1em 0;
}

/* ============================================================
   SCROLLBAR GLOBAL
   ============================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

/* Firefox */
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }

/* ============================================================
   FOCUS STYLES (Accessibility)
   ============================================================ */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ============================================================
   SELECTION
   ============================================================ */
::selection {
  background: rgba(9,72,179,0.3);
  color: var(--text);
}

/* ============================================================
   AUTH PAGES
   ============================================================ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-main);
  position: relative;
  overflow: hidden;
  padding: var(--space-5);
}

.auth-bg-effect {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.auth-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  animation: blobFloat 8s ease-in-out infinite;
}

.auth-blob-1 {
  width: 500px;
  height: 500px;
  background: rgba(9,72,179,0.15);
  top: -100px;
  left: -100px;
}

.auth-blob-2 {
  width: 400px;
  height: 400px;
  background: rgba(109,93,252,0.1);
  bottom: -50px;
  right: -50px;
  animation-delay: -4s;
}

@keyframes blobFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%       { transform: translate(30px, -20px) scale(1.05); }
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: var(--space-10) var(--space-10);
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow-xl);
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
}

.auth-logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px var(--primary-glow);
  font-size: 22px;
  font-weight: 900;
  color: white;
}

.auth-logo-text {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}

.auth-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.8px;
  margin-bottom: var(--space-2);
}

.auth-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: var(--space-6);
  line-height: 1.6;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-5) 0;
  color: var(--text-muted);
  font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  width: 100%;
  padding: 10px var(--space-4);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  margin-bottom: var(--space-3);
}

.social-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  color: var(--text);
}

.social-btn img {
  width: 18px;
  height: 18px;
  display: inline-block;
}

/* ============================================================
   ANNOUNCEMENT BANNER
   ============================================================ */
.announcement-banner {
  background: var(--primary-light);
  border: 1px solid rgba(9,72,179,0.2);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

/* ============================================================
   PRODUCT CARDS
   ============================================================ */
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  text-decoration: none;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.product-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--product-color, var(--primary)), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}

.product-card:hover::before { opacity: 1; }
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-hover);
}

.product-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

/* ============================================================
   NOTIFICATIONS CENTER
   ============================================================ */
.notification-item {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition-fast);
  text-decoration: none;
}

.notification-item:hover { background: var(--bg-hover); }
.notification-item.unread { background: rgba(9,72,179,0.04); }

.notification-item.unread .notification-dot {
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 6px;
}

/* ============================================================
   PARTICLES BACKGROUND
   ============================================================ */
#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

.app-wrapper { position: relative; z-index: 1; }
