@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Exact Design 3 Color System (Vercel/Linear dark theme) */
  --bg-primary: #09090b;      /* Dark black background */
  --bg-secondary: #121214;    /* Slightly lighter dark for sidebar */
  --card-bg: #18181b;         /* Zinc-900 card background */
  --glass-border: #27272a;    /* Zinc-800 border */
  --border-hover: #3f3f46;    /* Zinc-700 hover border */
  
  --text-primary: #fafafa;    /* Pure white/light text */
  --text-secondary: #a1a1aa;  /* Gray-400 secondary text */
  --text-muted: #71717a;      /* Gray-500 muted text */
  
  --primary: #ffffff;         /* Pure white accents */
  --success: #10b981;         /* Emerald green status */
  --warning: #f59e0b;         /* Amber warning status */
  --danger: #ef4444;          /* Red error status */
  
  /* Fonts */
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Spacing & Radii */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;
  
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

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

a:hover {
  color: var(--text-secondary);
}

/* Layout Architecture */
.dashboard-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  background: var(--bg-primary);
}

/* Sidebar styling matching Design 3 exactly */
.sidebar {
  background: var(--bg-secondary);
  border-right: 1px solid var(--glass-border);
  padding: 2rem 1.25rem 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 100;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 2rem;
  padding-left: 0.5rem;
}

.sidebar-logo-icon {
  background: #ffffff;
  color: #000000;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
}

.sidebar-logo-text {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.9rem;
  font-weight: 500;
}

.menu-item:hover {
  background: #1c1c1f;
  color: var(--text-primary);
}

.menu-item.active {
  background: #27272a;
  color: var(--text-primary);
}

.menu-icon {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}

.menu-item.active .menu-icon,
.menu-item:hover .menu-icon {
  opacity: 1;
}

.sidebar-bottom {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* User profile matching bottom-left of design image */
.sidebar-bottom-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  text-transform: uppercase;
  padding-left: 0.5rem;
  margin-bottom: -0.5rem;
}

.sidebar-brand-block {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding-left: 0.5rem;
}

.sidebar-brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-brand-text {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-primary);
}

.user-profile-block {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.5rem;
  border-top: 1px solid var(--glass-border);
  margin-top: 0.25rem;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #27272a;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  border: 1px solid var(--glass-border);
}

.user-info {
  flex-grow: 1;
  min-width: 0;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.logout-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.logout-btn:hover {
  color: var(--text-primary);
  background: #27272a;
}

/* Main Content Area */
.main-content {
  padding: 3rem 4rem;
  overflow-y: auto;
  height: 100vh;
}

/* Header style from image */
.dashboard-header {
  margin-bottom: 2rem;
}

.dashboard-title {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.dashboard-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* Metrics Cards (Design 3 style) */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
}

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

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 150px;
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.stat-value-container {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.stat-desc {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.stat-desc.success {
  color: var(--success);
}

.stat-desc.danger {
  color: var(--danger);
}

/* Mini sparkline charts for metric cards */
.sparkline-container {
  width: 90px;
  height: 35px;
}

.bar-sparkline {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 30px;
}

.bar-sparkline-item {
  width: 4px;
  background: var(--glass-border);
  border-radius: 1px;
}

.bar-sparkline-item.active {
  background: var(--text-primary);
}

/* Card components styles */
.glass-panel {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  margin-bottom: 2rem;
}

.glass-card {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

/* 3-Column Overview Layout (Design 3 structure) */
.overview-grid {
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  gap: 2rem;
  align-items: start;
}

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

/* Tables matching design */
.table-container {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: var(--card-bg);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th {
  background: #18181b;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--glass-border);
}

td {
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--glass-border);
  font-size: 0.85rem;
  color: var(--text-primary);
  font-weight: 400;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: #202024;
}

/* Custom Status indicator in table */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--success);
}

.status-pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
}

.status-pill.failed {
  color: var(--danger);
}

.status-pill.failed::before {
  background: var(--danger);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
}

.badge-success { background: rgba(16, 185, 129, 0.1); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.2); }
.badge-danger { background: rgba(239, 68, 68, 0.1); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.2); }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.2); }
.badge-info { background: rgba(59, 130, 246, 0.1); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.2); }

/* Right Column Widgets matching image */
.right-sidebar-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.right-widget {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.right-widget-title {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 1rem;
}

/* Support Channel styling */
.support-channel-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.support-channel-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  background: #1d1d21;
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: var(--transition);
}

.support-channel-item:hover {
  border-color: var(--border-hover);
  background: #252529;
}

.support-channel-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}

.support-channel-icon.vip {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.support-channel-info {
  flex-grow: 1;
}

.support-channel-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.support-channel-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.05rem;
}

/* Form inputs & panels */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.form-input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: var(--transition);
}

.form-input:focus {
  outline: none;
  border-color: var(--text-muted);
}

/* Copy Token Panel */
.token-panel {
  display: flex;
  background: var(--bg-primary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 0.5rem;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
}

.token-value {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding-left: 0.5rem;
  color: var(--text-primary);
}

/* Code Snippet integration box */
.code-container {
  margin-top: 1rem;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  padding: 1rem;
  position: relative;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  overflow-x: auto;
  line-height: 1.5;
  color: var(--text-primary);
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 0.5rem;
  margin-bottom: 0.75rem;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-bottom: 2px solid transparent;
  font-size: 0.85rem;
}

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

/* Charts container */
.chart-container {
  height: 250px;
  position: relative;
  width: 100%;
}

/* Key Rotation Banner */
.roll-key-banner {
  background: #1a1526;
  border: 1px solid #3c2f59;
  padding: 1.25rem 1.75rem;
  border-radius: var(--radius-md);
  margin-bottom: 2rem;
}

.roll-key-banner h4 {
  color: #c084fc;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

/* Quota gauges progress bar styling */
.progress-bar-container {
  background: #27272a;
  border-radius: var(--radius-full);
  height: 8px;
  width: 100%;
  margin-top: 1rem;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--text-primary);
  border-radius: var(--radius-full);
  width: 0%;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Terminal Output for playground */
.terminal-output {
  background: #09090b;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #34d399;
  max-height: 300px;
  overflow-y: auto;
  margin-top: 0.75rem;
  line-height: 1.5;
}

.error-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.error-spec {
  padding: 1.25rem;
  border-left: 3px solid var(--danger);
  background: var(--card-bg);
}

.error-spec h4 {
  font-size: 0.95rem;
  font-weight: 600;
}

/* Navbar / Login specific */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2rem;
  border-bottom: 1px solid var(--glass-border);
  background: var(--bg-secondary);
}

.login-container {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-weight: 500;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.85rem;
  gap: 0.5rem;
}

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

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

.btn-secondary {
  background: #18181b;
  color: var(--text-primary);
  border-color: var(--glass-border);
}

.btn-secondary:hover {
  background: #27272a;
  border-color: var(--border-hover);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

.btn-sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.75rem;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-up {
  animation: fadeInUp 0.4s ease-out forwards;
}

.delay-1 { animation-delay: 0.05s; }
.delay-2 { animation-delay: 0.1s; }
.delay-3 { animation-delay: 0.15s; }

.d-none {
  display: none !important;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid var(--glass-border);
    padding: 1.25rem 1.5rem;
  }
  .main-content {
    padding: 1.5rem;
    height: auto;
  }
}
