/* ============================================
   IBL Cloud - Design System
   Dark Navy Theme + Tech Background
   ============================================ */

:root {
  /* Colors - Dark Navy (Blue Theme - Default) */
  --bg-primary: #080c14;
  --bg-secondary: #0d1424;
  --bg-card: rgba(13, 20, 40, 0.85);
  --bg-card-hover: rgba(20, 30, 55, 0.9);
  --bg-input: rgba(10, 16, 32, 0.95);
  --bg-sidebar: rgba(8, 12, 22, 0.97);

  --border-color: rgba(56, 92, 168, 0.25);
  --border-active: rgba(59, 130, 246, 0.5);

  --text-primary: #e8edf5;
  --text-secondary: #8899b8;
  --text-muted: #596882;

  --accent-primary: #3b82f6;
  --accent-secondary: #6366f1;
  --accent-gradient: linear-gradient(135deg, #3b82f6, #6366f1, #8b5cf6);

  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;

  /* Neon / Brand */
  --neon-color: #00e5ff;
  --neon-glow: 0 0 7px rgba(0, 229, 255, 0.6), 0 0 20px rgba(0, 229, 255, 0.3), 0 0 40px rgba(0, 229, 255, 0.15);
  --neon-muted: rgba(0, 229, 255, 0.5);

  /* Theme-specific assets */
  --theme-bg: url('/img/tech-bg.webp');
  --theme-console-bg: url('/img/console-bg.webp');
  --theme-logo: '/img/logotipo.webp';

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 30px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 25px rgba(59, 130, 246, 0.2);

  /* Glass */
  --glass-bg: rgba(13, 20, 40, 0.7);
  --glass-blur: blur(24px);
  --glass-border: 1px solid rgba(56, 92, 168, 0.2);

  /* Spacing */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 400ms ease;
}

/* ============ LIGHT THEME ============ */
[data-theme="light"] {
  --bg-primary: #f0f2f5;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.92);
  --bg-card-hover: rgba(240, 242, 248, 0.95);
  --bg-input: rgba(245, 247, 250, 0.98);
  --bg-sidebar: rgba(255, 255, 255, 0.97);
  --border-color: rgba(0, 0, 0, 0.12);
  --border-active: rgba(0, 0, 0, 0.3);
  --text-primary: #1a1a2e;
  --text-secondary: #4a5568;
  --text-muted: #8896a6;
  --accent-primary: #1a1a2e;
  --accent-secondary: #2d2d44;
  --accent-gradient: linear-gradient(135deg, #1a1a2e, #2d2d44, #3d3d5c);
  --neon-color: #1a1a2e;
  --neon-glow: 0 0 7px rgba(26, 26, 46, 0.3), 0 0 20px rgba(26, 26, 46, 0.15);
  --neon-muted: rgba(26, 26, 46, 0.5);
  --theme-bg: url('/img/tech-bg2.webp');
  --theme-console-bg: url('/img/console-bg2.webp');
  --theme-logo: '/img/logotipo2.webp';
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 20px 30px rgba(0, 0, 0, 0.15);
  --shadow-glow: 0 0 25px rgba(26, 26, 46, 0.1);
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: 1px solid rgba(0, 0, 0, 0.1);
}

/* ============ DARK THEME ============ */
[data-theme="dark"] {
  --bg-primary: #000000;
  --bg-secondary: #050505;
  --bg-card: rgba(5, 5, 5, 0.95);
  --bg-card-hover: rgba(12, 12, 12, 0.98);
  --bg-input: rgba(0, 0, 0, 0.98);
  --bg-sidebar: rgba(0, 0, 0, 0.99);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-active: rgba(255, 255, 255, 0.2);
  --text-primary: #e0e0e0;
  --text-secondary: #888888;
  --text-muted: #555555;
  --accent-primary: #e0e0e0;
  --accent-secondary: #aaaaaa;
  --accent-gradient: linear-gradient(135deg, #1a1a1a, #0a0a0a);
  --neon-color: #ffffff;
  --neon-glow: 0 0 5px rgba(255, 255, 255, 0.3), 0 0 15px rgba(255, 255, 255, 0.1);
  --neon-muted: rgba(255, 255, 255, 0.35);
  --theme-bg: url('/img/tech-bg3.webp');
  --theme-console-bg: url('/img/console-bg3.webp');
  --theme-logo: '/img/logotipo3.webp';
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.8);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.8);
  --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.9);
  --shadow-xl: 0 20px 30px rgba(0, 0, 0, 0.95);
  --shadow-glow: 0 0 15px rgba(255, 255, 255, 0.05);
  --glass-bg: rgba(0, 0, 0, 0.9);
  --glass-border: 1px solid rgba(255, 255, 255, 0.06);

  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #e0e0e0;
}

/* Dark theme — pure black buttons & elements */
[data-theme="dark"] .btn-primary {
  background: #000000;
  color: #e0e0e0;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .btn-primary:hover {
  background: #0a0a0a;
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .btn-secondary {
  background: #000000;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e0e0e0;
}

[data-theme="dark"] .btn-secondary:hover {
  background: #0a0a0a;
  border-color: rgba(255, 255, 255, 0.18);
}

[data-theme="dark"] .sidebar-user-avatar {
  background: #000000;
  color: #e0e0e0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .sidebar-link.active {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

[data-theme="dark"] .server-tab.active {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

[data-theme="dark"] .server-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .card:hover {
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .console-send-btn {
  background: #000000;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e0e0e0;
}

[data-theme="dark"] .console-send-btn:hover {
  background: #0a0a0a;
  border-color: rgba(255, 255, 255, 0.2);
}

/* ============ RED NEON THEME ============ */
[data-theme="red"] {
  --bg-primary: #0a0000;
  --bg-secondary: #140808;
  --bg-card: rgba(25, 8, 8, 0.88);
  --bg-card-hover: rgba(40, 12, 12, 0.92);
  --bg-input: rgba(18, 5, 5, 0.95);
  --bg-sidebar: rgba(10, 2, 2, 0.97);
  --border-color: rgba(239, 68, 68, 0.2);
  --border-active: rgba(239, 68, 68, 0.5);
  --text-primary: #fce4e4;
  --text-secondary: #c09090;
  --text-muted: #7a5050;
  --accent-primary: #ef4444;
  --accent-secondary: #dc2626;
  --accent-gradient: linear-gradient(135deg, #ef4444, #dc2626, #b91c1c);
  --neon-color: #ff3333;
  --neon-glow: 0 0 7px rgba(255, 51, 51, 0.6), 0 0 20px rgba(255, 51, 51, 0.3), 0 0 40px rgba(255, 51, 51, 0.15);
  --neon-muted: rgba(255, 51, 51, 0.5);
  --theme-bg: url('/img/tech-bg4.webp');
  --theme-console-bg: url('/img/console-bg4.webp');
  --theme-logo: '/img/logotipo4.webp';
  --shadow-glow: 0 0 25px rgba(239, 68, 68, 0.2);
  --glass-bg: rgba(20, 5, 5, 0.75);
  --glass-border: 1px solid rgba(239, 68, 68, 0.15);
  --info: #ef4444;
}

/* ============ GREEN NEON THEME ============ */
[data-theme="green"] {
  --bg-primary: #000a00;
  --bg-secondary: #081408;
  --bg-card: rgba(8, 25, 8, 0.88);
  --bg-card-hover: rgba(12, 40, 12, 0.92);
  --bg-input: rgba(5, 18, 5, 0.95);
  --bg-sidebar: rgba(2, 10, 2, 0.97);
  --border-color: rgba(34, 197, 94, 0.2);
  --border-active: rgba(34, 197, 94, 0.5);
  --text-primary: #e4fce8;
  --text-secondary: #90c0a0;
  --text-muted: #507a58;
  --accent-primary: #22c55e;
  --accent-secondary: #16a34a;
  --accent-gradient: linear-gradient(135deg, #22c55e, #16a34a, #15803d);
  --neon-color: #00ff55;
  --neon-glow: 0 0 7px rgba(0, 255, 85, 0.6), 0 0 20px rgba(0, 255, 85, 0.3), 0 0 40px rgba(0, 255, 85, 0.15);
  --neon-muted: rgba(0, 255, 85, 0.5);
  --theme-bg: url('/img/tech-bg5.webp');
  --theme-console-bg: url('/img/console-bg5.webp');
  --theme-logo: '/img/logotipo5.webp';
  --shadow-glow: 0 0 25px rgba(34, 197, 94, 0.2);
  --glass-bg: rgba(5, 20, 5, 0.75);
  --glass-border: 1px solid rgba(34, 197, 94, 0.15);
  --info: #22c55e;
}

/* ============ Reset & Base ============ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  background-image: var(--theme-bg);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse 600px 600px at 10% 10%, color-mix(in srgb, var(--accent-primary) 8%, transparent), transparent),
    radial-gradient(ellipse 800px 800px at 90% 90%, color-mix(in srgb, var(--accent-secondary) 6%, transparent), transparent);
  pointer-events: none;
  z-index: 0;
}

[data-theme="dark"] body::before {
  background: rgba(0, 0, 0, 0.55);
}

[data-theme="light"] body::before {
  display: none;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
}

a:hover {
  color: var(--accent-secondary);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(75, 85, 99, 0.5);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--accent-primary) 50%, transparent);
}

/* ============ Login Page ============ */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.login-container {
  width: 100%;
  max-width: 420px;
  padding: 2rem;
}

.login-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  box-shadow: var(--shadow-xl);
  animation: fadeInUp 0.5s ease;
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--neon-color);
  text-shadow: var(--neon-glow);
  -webkit-text-fill-color: unset;
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
  letter-spacing: 1px;
}

.login-logo p {
  color: var(--neon-muted);
  margin-top: 0.5rem;
  font-size: 0.9rem;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.auth-switch {
  text-align: center;
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.auth-switch p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0;
}

.auth-switch-link {
  color: var(--accent-primary) !important;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
}

.auth-switch-link:hover {
  color: var(--neon-color) !important;
  text-shadow: var(--neon-glow);
}

/* ============ Pending Verification Page ============ */
.pending-verify-icon {
  position: relative;
  width: 72px;
  height: 72px;
  margin: 0 auto 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pending-verify-icon > i {
  font-size: 2rem;
  color: var(--accent-primary);
  position: relative;
  z-index: 1;
  animation: pendingBounce 2s ease-in-out infinite;
}

.pending-verify-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent-primary) 15%, transparent);
  animation: pendingPulse 2s ease-in-out infinite;
}

@keyframes pendingBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@keyframes pendingPulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.3); opacity: 0.2; }
}

.pending-verify-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.7rem 1rem;
}

/* ============ Form Elements ============ */
.form-group {
  margin-bottom: 1.2rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.form-input {
  width: 100%;
  padding: 0.7rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}

.form-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-primary) 15%, transparent);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-select {
  width: 100%;
  padding: 0.7rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  outline: none;
}

.form-select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-primary) 15%, transparent);
}

textarea.form-input {
  resize: vertical;
  min-height: 80px;
  font-family: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  font-size: 0.85rem;
}

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.3rem;
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  outline: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
}

.btn-secondary {
  background: color-mix(in srgb, var(--accent-primary) 8%, transparent);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: color-mix(in srgb, var(--accent-primary) 15%, transparent);
  border-color: color-mix(in srgb, var(--accent-primary) 30%, transparent);
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover {
  background: #059669;
}

.btn-danger {
  background: var(--error);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-warning {
  background: var(--warning);
  color: #111;
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 0.85rem 2rem;
  font-size: 1rem;
}

.btn-full {
  width: 100%;
  justify-content: center;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

/* ============ Layout ============ */
.layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  border-right: var(--glass-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  backdrop-filter: var(--glass-blur);
  transition: transform var(--transition-normal);
}

.sidebar-brand {
  padding: 1.5rem;
  border-bottom: var(--glass-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.3rem;
}

.sidebar-brand img {
  display: block;
  margin: 0 auto;
}

.sidebar-brand h1 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--neon-color);
  text-shadow: var(--neon-glow);
  -webkit-text-fill-color: unset;
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
  letter-spacing: 1px;
}

.sidebar-brand span {
  font-size: 0.65rem;
  color: var(--neon-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
  overflow-y: auto;
}

.sidebar-section {
  padding: 0 1rem;
  margin-bottom: 1.2rem;
}

.sidebar-section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  padding: 0 0.8rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 400;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.sidebar-link:hover {
  background: color-mix(in srgb, var(--accent-primary) 8%, transparent);
  color: var(--text-primary);
}

.sidebar-link.active {
  background: color-mix(in srgb, var(--accent-primary) 15%, transparent);
  color: var(--accent-primary);
  font-weight: 500;
}

.sidebar-link i {
  width: 20px;
  font-size: 0.95rem;
  text-align: center;
}

.sidebar-user {
  padding: 1rem 1.5rem;
  border-top: var(--glass-border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: white;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-info .name {
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-info .role {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.sidebar-user .logout-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
}

.sidebar-user .logout-btn:hover {
  color: var(--error);
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 260px;
  padding: 2rem;
  min-height: 100vh;
  overflow-x: hidden;
  max-width: calc(100vw - 260px);
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.page-header .breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.page-header .breadcrumb a {
  color: var(--text-secondary);
}

.page-header .breadcrumb a:hover {
  color: var(--accent-primary);
}

/* ============ Cards ============ */
.card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-normal);
}

.card:hover {
  border-color: color-mix(in srgb, var(--accent-primary) 20%, transparent);
}

.card-header {
  padding: 1.2rem 1.5rem;
  border-bottom: var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.card-header h3 {
  font-size: 1rem;
  font-weight: 600;
}

.card-body {
  padding: 1.5rem;
}

/* Server Card */
.server-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.2rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.server-card:hover {
  background: var(--bg-card-hover);
  border-color: color-mix(in srgb, var(--accent-primary) 30%, transparent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.server-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--accent-primary) 10%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--accent-primary);
  flex-shrink: 0;
}

.server-card-info {
  flex: 1;
  min-width: 0;
}

.server-card-info .name {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

.server-card-info .meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.server-card-status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  flex-shrink: 0;
}

.status-online {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.status-offline {
  background: rgba(107, 114, 128, 0.15);
  color: var(--text-muted);
}

.status-starting {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.status-stopping {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.status-installing {
  background: color-mix(in srgb, var(--info) 15%, transparent);
  color: var(--info);
}

.status-error {
  background: rgba(239, 68, 68, 0.15);
  color: var(--error);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.status-online .status-dot {
  animation: pulse 2s infinite;
}

/* Stat cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.stat-card-icon.purple {
  background: color-mix(in srgb, var(--accent-primary) 15%, transparent);
  color: var(--accent-primary);
}

.stat-card-icon.green {
  background: color-mix(in srgb, var(--success) 15%, transparent);
  color: var(--success);
}

.stat-card-icon.blue {
  background: color-mix(in srgb, var(--info) 15%, transparent);
  color: var(--info);
}

.stat-card-icon.orange {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.stat-card-info .label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.stat-card-info .value {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 0.1rem;
}

/* ============ Grid Layouts ============ */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.server-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

/* ============ Table ============ */
.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

table th {
  text-align: left;
  padding: 0.8rem 1rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: var(--glass-border);
}

table td {
  padding: 0.8rem 1rem;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

table tr:hover td {
  background: color-mix(in srgb, var(--accent-primary) 3%, transparent);
}

/* ============ Console/Terminal ============ */
.console-container {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

#xtermContainer {
  position: relative;
  overflow: hidden;
  background: var(--theme-console-bg) center center / cover no-repeat !important;
}

#xtermContainer .xterm {
  max-width: 100% !important;
  overflow: hidden !important;
}

#xtermContainer .xterm-screen {
  background: transparent !important;
  max-width: 100% !important;
  overflow: hidden !important;
}

#xtermContainer .xterm-viewport {
  background: color-mix(in srgb, var(--bg-primary) 55%, transparent) !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
}

#xtermContainer .xterm-rows {
  max-width: 100% !important;
  overflow: hidden !important;
}

.console-container {
  max-width: 100%;
  overflow: hidden;
}

.console-header {
  background: color-mix(in srgb, var(--bg-primary) 85%, transparent);
  padding: 0.8rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}

.console-header .dots {
  display: flex;
  gap: 6px;
}

.console-header .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.console-header .dot.red {
  background: #ff5f57;
}

.console-header .dot.yellow {
  background: #febc2e;
}

.console-header .dot.green {
  background: #28c840;
}

.console-output {
  padding: 1rem;
  font-family: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  min-height: 400px;
  max-height: 60vh;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: #c9d1d9;
}

.console-input-container {
  display: flex;
  border-top: var(--glass-border);
}

.console-input {
  flex: 1;
  background: color-mix(in srgb, var(--bg-primary) 85%, transparent);
  border: none;
  padding: 0.8rem 1rem;
  color: var(--text-primary);
  font-family: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  font-size: 0.85rem;
  outline: none;
}

.console-input::placeholder {
  color: var(--text-muted);
}

.console-send-btn {
  background: var(--accent-primary);
  border: none;
  padding: 0 1.2rem;
  color: white;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.console-send-btn:hover {
  background: var(--accent-secondary);
}

/* Power buttons */
.power-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ============ File Explorer ============ */
.file-explorer {
  background: var(--bg-card);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.file-toolbar {
  padding: 0.8rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: var(--glass-border);
  flex-wrap: wrap;
}

.file-path {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  min-width: 200px;
}

.file-path button {
  background: none;
  border: none;
  color: var(--accent-primary);
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.85rem;
}

.file-path button:hover {
  background: color-mix(in srgb, var(--accent-primary) 10%, transparent);
}

.file-path .separator {
  color: var(--text-muted);
}

.file-list {
  max-height: 500px;
  overflow-y: auto;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.6rem 1rem;
  cursor: pointer;
  transition: background var(--transition-fast);
  border-bottom: 1px solid var(--border-color);
}

.file-item:hover {
  background: color-mix(in srgb, var(--accent-primary) 5%, transparent);
}

.file-item i {
  width: 20px;
  text-align: center;
  font-size: 0.95rem;
}

.file-item i.fa-folder {
  color: var(--warning);
}

.file-item i.fa-file {
  color: var(--text-muted);
}

.file-item i.fa-file-code {
  color: var(--accent-primary);
}

.file-item i.fa-file-image {
  color: var(--success);
}

.file-item .name {
  flex: 1;
  font-size: 0.9rem;
}

.file-item .size {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.file-item .modified {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.file-item .actions {
  display: flex;
  gap: 0.3rem;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.file-item:hover .actions {
  opacity: 1;
}

.file-drop-zone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  transition: all var(--transition-fast);
  margin: 1rem;
}

.file-drop-zone.active {
  border-color: var(--accent-primary);
  background: color-mix(in srgb, var(--accent-primary) 5%, transparent);
  color: var(--accent-primary);
}

/* ============ Modal ============ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--bg-secondary);
  border: var(--glass-border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: fadeInUp 0.3s ease;
}

.modal-lg {
  max-width: 700px;
}

.modal-header {
  padding: 1.5rem;
  border-bottom: var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.4rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
}

.modal-close:hover {
  color: var(--error);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* ============ Tabs ============ */
.tabs {
  display: flex;
  border-bottom: var(--glass-border);
  margin-bottom: 1.5rem;
  gap: 0;
}

.tab {
  padding: 0.8rem 1.5rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: color var(--transition-fast);
}

.tab:hover {
  color: var(--text-primary);
}

.tab.active {
  color: var(--accent-primary);
}

.tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-gradient);
  border-radius: 2px 2px 0 0;
}

/* ============ Toast / Notifications ============ */
.toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--bg-secondary);
  border: var(--glass-border);
  border-radius: var(--radius-md);
  padding: 0.8rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: var(--shadow-xl);
  animation: slideInRight 0.3s ease;
  min-width: 280px;
  max-width: 400px;
}

.toast-success {
  border-left: 3px solid var(--success);
}

.toast-error {
  border-left: 3px solid var(--error);
}

.toast-info {
  border-left: 3px solid var(--info);
}

.toast-warning {
  border-left: 3px solid var(--warning);
}

.toast-message {
  flex: 1;
  font-size: 0.85rem;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem;
}

/* ============ Badges ============ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-admin {
  background: color-mix(in srgb, var(--accent-primary) 15%, transparent);
  color: var(--accent-primary);
}

.badge-user {
  background: rgba(107, 114, 128, 0.15);
  color: var(--text-secondary);
}

/* ============ Progress Bar ============ */
.progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(75, 85, 99, 0.3);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width var(--transition-normal);
}

.progress-bar-fill.green {
  background: var(--success);
}

.progress-bar-fill.yellow {
  background: var(--warning);
}

.progress-bar-fill.red {
  background: var(--error);
}

.progress-bar-fill.purple {
  background: var(--accent-gradient);
}

/* ============ Empty States ============ */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.3;
}

.empty-state h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.empty-state p {
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}

/* ============ Loading ============ */
.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-color);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}

/* ============ Animations ============ */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

/* ============ Responsive ============ */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
    padding: 1rem;
    max-width: 100vw;
    width: 100%;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Mobile menu toggle */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 101;
  background: var(--bg-card);
  border: var(--glass-border);
  color: var(--text-primary);
  padding: 0.6rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 1.2rem;
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: flex;
  }
}

/* ============ Server Page Tabs Layout ============ */
.server-page {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.server-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.server-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  background: var(--bg-card);
  border: var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.server-tab:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.server-tab.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.3);
  color: var(--accent-primary);
}

/* ============ Resource Meters ============ */
.resource-meters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.resource-meter {
  background: var(--bg-card);
  border: var(--glass-border);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.resource-meter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.resource-meter-header .label {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.resource-meter-header .value {
  font-size: 0.85rem;
  font-weight: 600;
}

/* ============ Editor Overlay — see IDE section at bottom ============ */

/* ============ Utilities ============ */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-1 {
  gap: 0.5rem;
}

.gap-2 {
  gap: 1rem;
}

.gap-3 {
  gap: 1.5rem;
}

.mt-1 {
  margin-top: 0.5rem;
}

.mt-2 {
  margin-top: 1rem;
}

.mt-3 {
  margin-top: 1.5rem;
}

.mb-1 {
  margin-bottom: 0.5rem;
}

.mb-2 {
  margin-bottom: 1rem;
}

.text-center {
  text-align: center;
}

.text-sm {
  font-size: 0.85rem;
}

.text-xs {
  font-size: 0.75rem;
}

.text-muted {
  color: var(--text-muted);
}

.text-secondary {
  color: var(--text-secondary);
}

.w-full {
  width: 100%;
}

.hidden {
  display: none !important;
}

/* ============ Progress Bar ============ */
.progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(75, 85, 99, 0.3);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.progress-bar-fill.green {
  background: var(--success);
}

.progress-bar-fill.red {
  background: var(--error);
}

.progress-bar-fill.purple {
  background: var(--accent-gradient);
}

.progress-bar-fill.blue {
  background: var(--info);
}

/* ============ Console Header Actions ============ */
.console-header-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.console-title-text {
  flex: 1;
  text-align: center;
}

/* ============ Mobile Responsive ============ */

/* Tablets */
@media (max-width: 1024px) {
  .server-page {
    gap: 1rem;
  }

  .resource-meters {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
  }

  .resource-meter {
    padding: 0.7rem;
  }

  .resource-meter-header .label {
    font-size: 0.75rem;
  }

  .resource-meter-header .value {
    font-size: 0.75rem;
  }

  .power-buttons {
    flex-wrap: wrap;
    gap: 0.4rem;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .layout {
    flex-direction: column;
  }

  .sidebar {
    position: fixed;
    left: -280px;
    width: 260px;
    height: 100vh;
    z-index: 100;
    transition: left 0.3s ease;
  }

  .sidebar.open {
    left: 0;
  }

  .main-content {
    margin-left: 0 !important;
    max-width: 100vw !important;
    width: 100% !important;
    padding: 0.8rem;
    padding-top: 3.5rem;
  }

  .page-header {
    flex-direction: column;
    gap: 0.6rem;
    align-items: flex-start;
  }

  .page-header h2 {
    font-size: 1.2rem;
  }

  .breadcrumb {
    font-size: 0.75rem;
  }

  .power-buttons {
    width: 100%;
    flex-wrap: wrap;
    gap: 0.3rem;
  }

  .power-buttons .btn {
    font-size: 0.75rem;
    padding: 0.35rem 0.6rem;
  }

  .resource-meters {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .resource-meter {
    padding: 0.5rem;
  }

  .resource-meter-header .label {
    font-size: 0.7rem;
  }

  .resource-meter-header .value {
    font-size: 0.7rem;
  }

  .server-tabs {
    gap: 0.3rem;
  }

  .server-tab {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }

  .console-header {
    padding: 0.5rem 0.8rem;
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .console-title-text {
    display: none;
  }

  .console-header-actions .btn {
    font-size: 0.7rem;
    padding: 0.3rem 0.5rem;
  }

  .console-input-container {
    padding: 0.4rem;
  }

  .console-input {
    font-size: 0.8rem;
    padding: 0.5rem;
  }

  /* File explorer */
  .files-list .file-item {
    font-size: 0.8rem;
    padding: 0.5rem;
  }

  .files-list .file-item .actions {
    gap: 0.2rem;
  }

  .files-header {
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  /* Dashboard cards */
  .servers-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .stat-card {
    padding: 0.8rem;
    min-width: 0;
  }

  .stat-card .stat-value {
    font-size: 1.3rem;
  }

  .stat-card .stat-label {
    font-size: 0.65rem;
  }

  /* Admin pages */
  .admin-card {
    padding: 1rem;
  }

  .admin-toolbar {
    flex-direction: column;
    gap: 0.5rem;
  }

  /* Form elements */
  .form-group label {
    font-size: 0.8rem;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    font-size: 0.85rem;
    padding: 0.5rem;
  }

  .btn {
    font-size: 0.8rem;
    padding: 0.45rem 0.9rem;
  }
}

/* Small phones */
@media (max-width: 480px) {
  .main-content {
    padding: 0.5rem;
    padding-top: 3.5rem;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.3rem;
  }

  .stat-card {
    padding: 0.6rem;
  }

  .stat-card .stat-value {
    font-size: 1.1rem;
  }

  .resource-meter {
    padding: 0.4rem;
  }

  .resource-meter-header .value {
    font-size: 0.65rem;
  }

  .power-buttons .btn span,
  .power-buttons .btn i+span {
    display: none;
  }

  .power-buttons .btn i {
    margin: 0;
  }

  .page-header h2 {
    font-size: 1rem;
  }

  .server-tab {
    padding: 0.35rem 0.6rem;
    font-size: 0.75rem;
  }

  .console-container {
    border-radius: var(--radius-sm);
  }
}

/* ============ ENHANCED MOCKUP STYLES ============ */

.resource-meter {
  backdrop-filter: var(--glass-blur);
  transition: all var(--transition-normal);
  padding: 1rem 1.2rem;
}

.resource-meter:hover {
  border-color: rgba(59, 130, 246, 0.35);
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

.resource-meter-header .label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.5px;
}

.resource-meter-header .value {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.progress-bar {
  height: 8px;
  border-radius: 4px;
  background: rgba(30, 50, 90, 0.5);
}

.progress-bar-fill {
  border-radius: 4px;
}

.progress-bar-fill.purple {
  background: linear-gradient(90deg, #6366f1, #a78bfa);
}

.progress-bar-fill.green {
  background: linear-gradient(90deg, #22c55e, #4ade80);
}

.progress-bar-fill.blue {
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.progress-bar-fill.red {
  background: linear-gradient(90deg, #ef4444, #f87171);
}

.sidebar {
  background: var(--bg-sidebar);
  border-right-color: rgba(56, 92, 168, 0.15);
}

.sidebar-brand h1 {
  background: linear-gradient(135deg, #60a5fa, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-link {
  border-radius: var(--radius-md);
  transition: all var(--transition-normal);
}

.sidebar-link:hover {
  background: rgba(59, 130, 246, 0.1);
}

.sidebar-link.active {
  background: rgba(59, 130, 246, 0.15);
  border-left: 3px solid var(--accent-primary);
  color: var(--accent-primary);
}

.btn-success {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  border: none;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.btn-success:hover {
  background: linear-gradient(135deg, #16a34a, #15803d);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

.btn-warning {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border: none;
  color: #fff;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.btn-warning:hover {
  background: linear-gradient(135deg, #d97706, #b45309);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border: none;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.btn-primary {
  background: var(--accent-gradient);
  border: none;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent-primary) 30%, transparent);
}

.btn-primary:hover {
  box-shadow: 0 4px 12px color-mix(in srgb, var(--accent-primary) 40%, transparent);
}

.btn-secondary {
  background: color-mix(in srgb, var(--bg-primary) 60%, transparent);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: color-mix(in srgb, var(--accent-primary) 12%, transparent);
  border-color: color-mix(in srgb, var(--accent-primary) 30%, transparent);
}

.console-container {
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.console-header {
  background: color-mix(in srgb, var(--bg-primary) 90%, transparent);
  border-bottom: 1px solid var(--border-color);
}

.server-card {
  backdrop-filter: var(--glass-blur);
  transition: all var(--transition-normal);
}

.server-card:hover {
  border-color: color-mix(in srgb, var(--accent-primary) 30%, transparent);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), var(--shadow-glow);
  transform: translateY(-2px);
}

.server-tab {
  backdrop-filter: var(--glass-blur);
  transition: all var(--transition-normal);
}

.server-tab.active {
  background: color-mix(in srgb, var(--accent-primary) 15%, transparent);
  border-color: color-mix(in srgb, var(--accent-primary) 35%, transparent);
  color: var(--accent-primary);
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent-primary) 15%, transparent);
}

.console-input-container {
  display: flex;
  gap: 0.5rem;
  padding: 0.6rem;
  background: color-mix(in srgb, var(--bg-primary) 80%, transparent);
  border-top: 1px solid var(--border-color);
}

.console-input {
  flex: 1;
  background: color-mix(in srgb, var(--bg-primary) 90%, transparent);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 0.6rem 0.8rem;
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 0.85rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.console-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-primary) 20%, transparent);
}

.console-send-btn {
  background: var(--accent-gradient);
  border: none;
  color: white;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.console-send-btn:hover {
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent-primary) 40%, transparent);
}

.page-header h2 {
  font-weight: 700;
  letter-spacing: -0.5px;
}

.main-content {
  background: color-mix(in srgb, var(--bg-primary) 60%, transparent);
}

/* ============ Multi-Select / Bulk Actions ============ */
.file-checkbox-area {
  display: flex;
  align-items: center;
  width: 20px;
  flex-shrink: 0;
}

.file-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

.file-item.selected {
  background: color-mix(in srgb, var(--accent-primary) 10%, transparent) !important;
}

.bulk-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  background: color-mix(in srgb, var(--accent-primary) 8%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--accent-primary) 20%, transparent);
  animation: fadeIn 0.2s ease;
}

.bulk-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.bulk-buttons {
  display: flex;
  gap: 0.5rem;
}

/* ============ IDE Mode — VS Code Layout ============ */
.ide-container {
  display: flex;
  height: calc(100vh - 220px);
  min-height: 500px;
  background: #1e1e1e;
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.ide-sidebar {
  width: 300px;
  min-width: 240px;
  background: #252526;
  border-right: 1px solid #3c3c3c;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ide-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.8rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #bbbbbb;
  border-bottom: 1px solid #3c3c3c;
  flex-shrink: 0;
}

.ide-sidebar-header .btn-icon {
  color: #bbbbbb;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.3rem;
  border-radius: 4px;
  font-size: 0.8rem;
}

.ide-sidebar-header .btn-icon:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.ide-tree {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.3rem 0;
}

.ide-tree::-webkit-scrollbar {
  width: 6px;
}

.ide-tree::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

/* Tree Items */
.tree-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  font-size: 0.82rem;
  color: #cccccc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: none;
  transition: background 0.1s;
}

.tree-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.tree-item.active {
  background: rgba(99, 102, 241, 0.2);
  color: white;
}

.tree-arrow {
  font-size: 0.6rem;
  color: #888;
  transition: transform 0.15s ease;
  flex-shrink: 0;
  width: 10px;
}

.tree-arrow.rotated {
  transform: rotate(90deg);
}

.tree-icon {
  font-size: 0.85rem;
  flex-shrink: 0;
  width: 16px;
  text-align: center;
}

.folder-icon {
  color: #dcb67a;
}

/* Colored file icons */
.file-icon-js {
  color: #f1e05a;
}

.file-icon-ts {
  color: #3178c6;
}

.file-icon-react {
  color: #61dafb;
}

.file-icon-py {
  color: #3572a5;
}

.file-icon-java {
  color: #b07219;
}

.file-icon-html {
  color: #e34c26;
}

.file-icon-css {
  color: #563d7c;
}

.file-icon-json {
  color: #f1e05a;
}

.file-icon-md {
  color: #083fa1;
}

.file-icon-yml {
  color: #cb171e;
}

.file-icon-xml {
  color: #0060ac;
}

.file-icon-img {
  color: #a97bff;
}

.file-icon-zip {
  color: #f4b93e;
}

.file-icon-sh {
  color: #89e051;
}

.file-icon-env {
  color: #ecd53f;
}

.file-icon-lock {
  color: #888;
}

.file-icon-log {
  color: #666;
}

.file-icon-txt {
  color: #999;
}

.file-icon-default {
  color: #777;
}

/* IDE Main Area */
.ide-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #1e1e1e;
}

/* Editor Tabs */
.ide-tabs {
  display: flex;
  align-items: center;
  background: #252526;
  border-bottom: 1px solid #3c3c3c;
  overflow-x: auto;
  min-height: 36px;
  flex-shrink: 0;
}

.ide-tabs::-webkit-scrollbar {
  height: 3px;
}

.ide-tabs::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
}

.ide-tabs-empty {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  color: #666;
}

.ide-tab {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.8rem;
  font-size: 0.8rem;
  color: #969696;
  cursor: pointer;
  border-right: 1px solid #3c3c3c;
  white-space: nowrap;
  transition: background 0.1s;
  position: relative;
  flex-shrink: 0;
}

.ide-tab:hover {
  background: #2d2d2d;
}

.ide-tab.active {
  background: #1e1e1e;
  color: #ffffff;
  border-bottom: 2px solid var(--accent-primary);
}

.ide-tab .tab-icon {
  font-size: 0.75rem;
}

.tab-close {
  background: none;
  border: none;
  color: transparent;
  cursor: pointer;
  padding: 0.15rem;
  border-radius: 3px;
  font-size: 0.65rem;
  margin-left: 0.3rem;
  transition: all 0.1s;
}

.ide-tab:hover .tab-close {
  color: #969696;
}

.tab-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white !important;
}

/* IDE Editor Container */
.ide-editor {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
}

.ide-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #555;
}

/* ============ Editor Overlay (updated for Monaco) ============ */
.editor-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #1e1e1e;
  z-index: 500;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.15s ease;
}

.editor-header {
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #3c3c3c;
  background: #252526;
  flex-shrink: 0;
}

.editor-header .filename {
  font-family: 'Cascadia Code', 'Fira Code', monospace;
  font-size: 0.85rem;
  color: #cccccc;
}

.editor-header .filename i {
  margin-right: 0.4rem;
  color: var(--accent-primary);
}

/* ============ IDE Mobile Responsive ============ */
@media (max-width: 768px) {
  .ide-container {
    flex-direction: column;
    height: calc(100vh - 180px);
  }

  .ide-sidebar {
    width: 100%;
    max-height: 200px;
    border-right: none;
    border-bottom: 1px solid #3c3c3c;
  }

  .iblcode-fullscreen .ide-container {
    height: calc(100vh - 44px);
  }
}

/* ============ IBLCode Fullscreen Mode ============ */
.iblcode-fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 400;
  display: flex;
  flex-direction: column;
  background: #1e1e1e;
}

.iblcode-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.8rem;
  background: #181818;
  border-bottom: 1px solid #3c3c3c;
  flex-shrink: 0;
  height: 44px;
  box-sizing: border-box;
}

.iblcode-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: #cccccc;
}

.iblcode-brand i {
  color: var(--accent-primary);
}

.iblcode-topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.iblcode-autosave-badge {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: #888;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.iblcode-no-radius {
  border-radius: 0 !important;
  border: none !important;
  flex: 1;
  min-height: 0;
}

.iblcode-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: calc(100vh - 44px);
}

/* ============ Integrated Terminal Panel ============ */
.iblcode-terminal-panel {
  display: flex;
  flex-direction: column;
  height: 250px;
  min-height: 120px;
  max-height: 600px;
  background: #0d1117;
  border-top: 2px solid #3c3c3c;
  flex-shrink: 0;
}

.iblcode-terminal-panel.hidden {
  display: none !important;
}

.iblcode-terminal-resize {
  height: 4px;
  background: transparent;
  cursor: ns-resize;
  flex-shrink: 0;
  transition: background 0.2s;
}

.iblcode-terminal-resize:hover {
  background: var(--accent-primary);
}

.iblcode-terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.3rem 0.8rem;
  background: #161b22;
  border-bottom: 1px solid #30363d;
  flex-shrink: 0;
}

.iblcode-terminal-header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #8b949e;
}

.iblcode-terminal-header-actions {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.iblcode-terminal-body {
  flex: 1;
  min-height: 0;
  padding: 4px;
  overflow: hidden;
}

.iblcode-terminal-input-container {
  display: flex;
  align-items: center;
  padding: 0.3rem 0.5rem;
  background: #161b22;
  border-top: 1px solid #30363d;
  flex-shrink: 0;
}

.iblcode-terminal-input {
  flex: 1;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 4px;
  padding: 0.4rem 0.6rem;
  color: #c9d1d9;
  font-family: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  font-size: 0.85rem;
  outline: none;
}

.iblcode-terminal-input:focus {
  border-color: var(--accent-primary);
}

.iblcode-terminal-send {
  background: var(--accent-primary);
  border: none;
  border-radius: 4px;
  color: white;
  padding: 0.4rem 0.6rem;
  margin-left: 0.3rem;
  cursor: pointer;
  transition: opacity 0.2s;
}

.iblcode-terminal-send:hover {
  opacity: 0.8;
}

/* Extra small button */
.btn-xs {
  padding: 0.15rem 0.4rem;
  font-size: 0.7rem;
  border-radius: 3px;
}

/* ============ Status Bar (VS Code style) ============ */
.iblcode-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 22px;
  padding: 0 0.6rem;
  background: #007acc;
  color: #fff;
  font-size: 0.7rem;
  font-family: 'Inter', -apple-system, sans-serif;
  flex-shrink: 0;
  z-index: 10;
}

.iblcode-statusbar-left,
.iblcode-statusbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.iblcode-statusbar span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  cursor: default;
  padding: 0 0.3rem;
  height: 22px;
  transition: background 0.15s;
}

.iblcode-statusbar span:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* ============ Breadcrumb ============ */
.ide-breadcrumb {
  display: flex;
  align-items: center;
  padding: 0.2rem 0.8rem;
  background: #1e1e1e;
  border-bottom: 1px solid #2d2d2d;
  font-size: 0.75rem;
  color: #8b949e;
  overflow-x: auto;
  flex-shrink: 0;
  min-height: 24px;
}

.ide-breadcrumb:empty {
  display: none;
}

.ide-breadcrumb-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
  cursor: pointer;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  transition: background 0.15s;
}

.ide-breadcrumb-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #c9d1d9;
}

.ide-breadcrumb-item:last-child {
  color: #c9d1d9;
}

.ide-breadcrumb-sep {
  margin: 0 0.15rem;
  font-size: 0.55rem;
  color: #555;
}

/* ============ Sidebar Actions ============ */
.ide-sidebar-header {
  justify-content: space-between !important;
}

.ide-sidebar-actions {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.ide-sidebar-btn {
  background: transparent;
  border: none;
  color: #8b949e;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0.2rem 0.35rem;
  border-radius: 3px;
  transition: all 0.15s;
}

.ide-sidebar-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #c9d1d9;
}

/* ============ Ctrl+P Quick Open ============ */
.iblcode-quickopen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 500;
  display: flex;
  justify-content: center;
  padding-top: 15vh;
}

.iblcode-quickopen.hidden {
  display: none !important;
}

.iblcode-quickopen-box {
  width: 550px;
  max-width: 90vw;
  background: #252526;
  border: 1px solid #3c3c3c;
  border-radius: 6px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  max-height: 400px;
  display: flex;
  flex-direction: column;
}

.iblcode-quickopen-input {
  width: 100%;
  padding: 0.7rem 1rem;
  background: #3c3c3c;
  border: none;
  color: #c9d1d9;
  font-size: 0.95rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  border-bottom: 1px solid #4c4c4c;
}

.iblcode-quickopen-results {
  overflow-y: auto;
  max-height: 320px;
}

.iblcode-quickopen-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  color: #c9d1d9;
  transition: background 0.1s;
}

.iblcode-quickopen-item:hover {
  background: #2a2d2e;
}

.iblcode-quickopen-item i {
  font-size: 0.85rem;
  flex-shrink: 0;
}

.iblcode-quickopen-name {
  font-size: 0.85rem;
  font-weight: 500;
  flex-shrink: 0;
}

.iblcode-quickopen-path {
  font-size: 0.72rem;
  color: #6a737d;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.iblcode-quickopen-empty {
  padding: 1.5rem;
  text-align: center;
  color: #6a737d;
  font-size: 0.85rem;
}

/* ============ Activity Bar (VS Code style) ============ */
.iblcode-activitybar {
  display: flex;
  flex-direction: column;
  width: 48px;
  min-width: 48px;
  background: #181818;
  border-right: 1px solid #2d2d2d;
  align-items: center;
  padding-top: 0.3rem;
  gap: 0;
  flex-shrink: 0;
}

.activitybar-btn {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: #858585;
  font-size: 1.25rem;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: all 0.15s;
  position: relative;
}

.activitybar-btn:hover {
  color: #c9d1d9;
}

.activitybar-btn.active {
  color: #fff;
  border-left-color: var(--accent-primary);
}

/* ============ Sidebar Panels ============ */
.ide-sidebar-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.ide-sidebar-panel.hidden {
  display: none !important;
}

/* ============ Search & Replace Panel ============ */
.ide-search-panel {
  display: flex;
  flex-direction: column;
  padding: 0.5rem;
  gap: 0.4rem;
  overflow-y: auto;
  flex: 1;
}

.ide-search-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #3c3c3c;
  border: 1px solid #4c4c4c;
  border-radius: 4px;
  padding: 0.3rem 0.5rem;
}

.ide-search-field:focus-within {
  border-color: var(--accent-primary);
}

.ide-search-field i {
  font-size: 0.75rem;
  color: #8b949e;
  flex-shrink: 0;
}

.ide-search-field input {
  flex: 1;
  background: transparent;
  border: none;
  color: #c9d1d9;
  font-size: 0.85rem;
  outline: none;
  font-family: inherit;
}

.ide-search-options {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.2rem 0;
  flex-wrap: wrap;
}

.ide-search-options label {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.72rem;
  color: #8b949e;
  cursor: pointer;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  border: 1px solid #4c4c4c;
  background: #3c3c3c;
  transition: all 0.15s;
}

.ide-search-options label:hover {
  background: #4c4c4c;
}

.ide-search-results {
  margin-top: 0.3rem;
  overflow-y: auto;
  flex: 1;
}

.ide-search-empty {
  padding: 1rem;
  text-align: center;
  color: #6a737d;
  font-size: 0.8rem;
}

.ide-search-result {
  padding: 0.3rem 0.5rem;
  cursor: pointer;
  border-radius: 3px;
  transition: background 0.1s;
}

.ide-search-result:hover {
  background: #2a2d2e;
}

.ide-search-result-file {
  font-size: 0.78rem;
  color: #c9d1d9;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.ide-search-result-line {
  color: #6a737d;
  font-size: 0.7rem;
}

.ide-search-result-text {
  font-size: 0.72rem;
  color: #8b949e;
  margin-top: 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-left: 1rem;
}

.ide-search-count {
  padding: 0.4rem 0.5rem;
  font-size: 0.72rem;
  color: #58a6ff;
  border-top: 1px solid #30363d;
  margin-top: 0.3rem;
}

/* ============ Modal ============ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--bg-secondary);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: fadeInUp 0.3s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 1.5rem;
  border-bottom: var(--glass-border);
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
}

.modal-close:hover {
  color: var(--error);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* ============ Toggle Switch ============ */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(75, 85, 99, 0.5);
  border-radius: 22px;
  transition: 0.3s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
}

.toggle-switch input:checked+.toggle-slider {
  background: var(--accent-primary);
}

.toggle-switch input:checked+.toggle-slider::before {
  transform: translateX(18px);
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 0;
  border-bottom: 1px solid rgba(75, 85, 99, 0.15);
  cursor: pointer;
  font-size: 0.9rem;
}

.toggle-row:last-child {
  border-bottom: none;
}

/* ============ Badges ============ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-success {
  background: rgba(34, 197, 94, 0.2);
  color: var(--success);
}

.badge-secondary {
  background: rgba(107, 114, 128, 0.2);
  color: var(--text-muted);
}

.badge-info {
  background: rgba(59, 130, 246, 0.2);
  color: var(--accent-primary);
}

/* ============ Schedule Cards ============ */
.schedule-card {
  background: var(--bg-card);
  border: var(--glass-border);
  border-radius: var(--radius-md);
  margin-bottom: 0.8rem;
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.schedule-card:hover {
  border-color: rgba(99, 102, 241, 0.3);
}

.schedule-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  cursor: pointer;
  gap: 1rem;
  transition: background var(--transition-fast);
}

.schedule-header:hover {
  background: rgba(99, 102, 241, 0.04);
}

.schedule-info {
  flex: 1;
  min-width: 0;
}

.schedule-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.3rem;
}

.schedule-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.schedule-chevron {
  color: var(--text-muted);
  font-size: 0.75rem;
  transition: transform 0.2s;
}

.schedule-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.schedule-meta span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.schedule-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.schedule-body {
  border-top: var(--glass-border);
  background: rgba(0, 0, 0, 0.15);
  padding: 1rem 1.2rem;
}

.schedule-tasks-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}

.schedule-tasks-header h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.schedule-tasks-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* ============ Task Items ============ */
.schedule-task-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem 0.8rem;
  background: var(--bg-card);
  border: 1px solid rgba(75, 85, 99, 0.15);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition-fast);
}

.schedule-task-item:hover {
  border-color: rgba(99, 102, 241, 0.25);
}

.task-sequence {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

.task-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  min-width: 0;
}

.task-action-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  flex-shrink: 0;
}

.action-command {
  background: rgba(59, 130, 246, 0.15);
  color: #58a6ff;
}

.action-power {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.action-backup {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.task-payload {
  font-family: 'Fira Code', monospace;
  font-size: 0.82rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-delay {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.task-continue {
  color: var(--accent-primary);
  font-size: 0.8rem;
}

.task-actions {
  display: flex;
  gap: 0.3rem;
  flex-shrink: 0;
}

/* Form controls used in modals */
.form-control {
  width: 100%;
  padding: 0.6rem 0.8rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.form-control:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

code {
  background: rgba(99, 102, 241, 0.1);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-family: 'Fira Code', monospace;
  font-size: 0.82rem;
  color: var(--accent-primary);
}

/* Responsive schedule */
@media (max-width: 768px) {
  .schedule-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .schedule-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .schedule-task-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .task-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* ============ Backup Cards ============ */
.backup-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 1rem;
  background: var(--bg-card);
  border: 1px solid rgba(75, 85, 99, 0.15);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  transition: border-color var(--transition-fast);
}

.backup-card:hover {
  border-color: rgba(99, 102, 241, 0.3);
}

.backup-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.backup-info {
  flex: 1;
  min-width: 0;
}

.backup-name {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
}

.backup-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.backup-meta span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.backup-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .backup-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .backup-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* ============ Backup Folder Cards ============ */
.backup-folder-card {
  background: var(--bg-card);
  border: 1px solid rgba(75, 85, 99, 0.15);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.backup-folder-card:hover {
  border-color: rgba(99, 102, 241, 0.3);
}

.backup-folder-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.2rem;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.backup-folder-header:hover {
  background: rgba(99, 102, 241, 0.04);
}

.backup-folder-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(99, 102, 241, 0.05));
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.backup-folder-info {
  flex: 1;
  min-width: 0;
}

.backup-folder-name {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.backup-folder-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.backup-folder-meta span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.backup-folder-arrow {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.backup-folder-arrow i {
  transition: transform 0.2s ease;
}

.backup-folder-content {
  border-top: 1px solid rgba(75, 85, 99, 0.1);
  background: rgba(0, 0, 0, 0.08);
}

/* ============ AI Chat - Antigravity Style ============ */
.ide-chat-panel {
  width: 420px;
  min-width: 320px;
  max-width: 50%;
  display: flex;
  flex-direction: column;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, rgba(13, 17, 23, 0.97) 0%, rgba(13, 17, 23, 0.99) 100%);
  backdrop-filter: blur(20px);
  overflow: hidden;
  flex-shrink: 0;
}

.ide-chat-panel.hidden {
  display: none;
}

#aiChatToggleBtn.active {
  background: rgba(99, 102, 241, 0.2) !important;
  color: var(--accent-primary) !important;
  border-color: var(--accent-primary) !important;
}

/* Header */
.ide-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.ide-chat-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ide-chat-title {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.ide-chat-model-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: 0.65rem;
  font-weight: 600;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.15));
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 12px;
  color: #a78bfa;
  letter-spacing: 0.02em;
}

.ide-chat-model-badge i {
  font-size: 0.55rem;
  color: #c084fc;
}

.ide-chat-header-actions {
  display: flex;
  gap: 2px;
}

.ide-chat-header-actions button {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition: all 0.15s ease;
}

.ide-chat-header-actions button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.ide-chat-header-actions button.active {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-primary);
}

/* History */
.ide-chat-history {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.15);
  max-height: 250px;
  overflow-y: auto;
}

.ide-chat-history.hidden {
  display: none;
}

.ide-chat-history-label {
  padding: 8px 14px;
  font-weight: 600;
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.ide-chat-history-list {
  padding: 0 8px 8px;
}

.ai-history-empty {
  padding: 12px;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-align: center;
}

.ide-chat-history-item {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  gap: 8px;
  font-size: 0.8rem;
}

.ide-chat-history-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.ide-chat-history-item.active {
  background: rgba(99, 102, 241, 0.1);
  border-left: 2px solid var(--accent-primary);
}

.ide-chat-history-info {
  flex: 1;
  min-width: 0;
}

.ide-chat-history-name {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ide-chat-history-date {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.ide-chat-history-delete {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  opacity: 0;
  transition: all 0.15s;
}

.ide-chat-history-item:hover .ide-chat-history-delete {
  opacity: 1;
}

.ide-chat-history-delete:hover {
  color: var(--error);
  background: rgba(239, 68, 68, 0.1);
}

/* Messages */
.ide-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ide-chat-messages::-webkit-scrollbar {
  width: 4px;
}

.ide-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
}

/* Welcome Screen */
.ai-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  padding: 24px;
  gap: 6px;
}

.ai-welcome-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: #a78bfa;
  margin-bottom: 8px;
}

.ai-welcome-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.ai-welcome-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 0 16px;
}

.ai-welcome-suggestions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 280px;
}

.ai-suggestion-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.ai-suggestion-card:hover {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.2);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.ai-suggestion-card i {
  color: var(--accent-primary);
  width: 16px;
  text-align: center;
  font-size: 0.85rem;
}

/* Message Styles */
.ai-msg {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ai-msg-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.ai-msg-label i {
  font-size: 0.65rem;
}

.ai-msg-user .ai-msg-label {
  color: #818cf8;
}

.ai-msg-model .ai-msg-label {
  color: #a78bfa;
}

.ai-msg-bubble-user {
  padding: 10px 14px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.12);
  border-radius: 12px;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}

.ai-msg-content {
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text-primary);
  word-break: break-word;
}

.ai-msg-content strong {
  color: #e2e8f0;
  font-weight: 600;
}

/* Tool Actions (step-style like Antigravity) */
.ai-tool-actions {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 4px 0 8px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.ai-tool-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.ai-tool-step-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  flex-shrink: 0;
}

.ai-tool-step-icon.success {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.ai-tool-step-icon.pending {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.ai-tool-step-icon.error {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.ai-tool-step-info {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.ai-tool-step-info i {
  color: var(--accent-primary);
  font-size: 0.7rem;
  width: 14px;
  text-align: center;
}

.ai-tool-step-info span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-tool-step.clickable {
  cursor: pointer;
  border-radius: 6px;
  padding: 4px 6px;
  margin: 0 -6px;
  transition: background 0.15s ease;
}

.ai-tool-step.clickable:hover {
  background: rgba(99, 102, 241, 0.1);
}

.ai-tool-open-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
  cursor: pointer;
  font-size: 0.65rem;
  font-weight: 600;
  font-family: inherit;
  padding: 3px 8px;
  border-radius: 4px;
  transition: all 0.15s ease;
  flex-shrink: 0;
  margin-left: auto;
}

.ai-tool-step.clickable:hover .ai-tool-open-btn {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.4);
}

.ai-tool-open-btn:hover {
  background: rgba(99, 102, 241, 0.15);
  transform: scale(1.15);
}

/* Code Blocks (Antigravity style with header) */
.ai-codeblock {
  border-radius: 10px;
  overflow: hidden;
  margin: 8px 0;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.3);
}

.ai-codeblock-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 500;
}

.ai-codeblock-copy {
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
}

.ai-codeblock-copy:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.ai-codeblock-body {
  padding: 12px;
  overflow-x: auto;
  font-family: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  font-size: 0.75rem;
  line-height: 1.55;
  color: #e2e8f0;
  margin: 0;
  background: transparent;
}

.ai-codeblock-body code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.ai-inline-code {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.12);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: 'Fira Code', monospace;
  font-size: 0.82em;
  color: #a78bfa;
}

/* Typing Indicator */
.ai-typing-indicator {
  display: flex;
  gap: 5px;
  padding: 6px 2px;
  align-items: center;
}

.ai-typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #a78bfa);
  opacity: 0.4;
  animation: aiTypingPulse 1.4s ease-in-out infinite;
}

.ai-typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.ai-typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes aiTypingPulse {

  0%,
  100% {
    opacity: 0.3;
    transform: scale(0.85);
  }

  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

/* Input Area */
.ide-chat-input-area {
  padding: 10px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.ide-chat-input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 6px 6px 6px 14px;
  transition: all 0.2s ease;
}

.ide-chat-input-wrapper:focus-within {
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.08);
}

#aiChatInput {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.82rem;
  resize: none;
  outline: none;
  max-height: 120px;
  padding: 4px 0;
  line-height: 1.45;
}

#aiChatInput::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.ide-chat-send-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  transition: all 0.2s ease;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.ide-chat-send-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}

.ide-chat-send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Diff Review */
.ide-diff-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(99, 102, 241, 0.06);
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.ide-diff-files {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  flex: 1;
}

.ide-diff-tag {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.18);
  border-radius: 10px;
  font-size: 0.65rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.ide-diff-tag:hover {
  background: rgba(99, 102, 241, 0.15);
}

.ide-diff-tag.active {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.ide-diff-tag.accepted {
  color: var(--success);
  border-color: var(--success);
  opacity: 0.6;
}

.ide-diff-tag.rejected {
  color: var(--error);
  text-decoration: line-through;
  opacity: 0.4;
}

.ide-diff-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.ide-diff-nav button {
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
}

.ide-diff-nav button:hover {
  background: rgba(99, 102, 241, 0.1);
}

.ide-diff-nav button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.ide-diff-actions {
  display: flex;
  gap: 3px;
}

.ide-diff-accept {
  padding: 2px 8px;
  border: none;
  border-radius: 4px;
  font-size: 0.65rem;
  font-family: inherit;
  cursor: pointer;
  font-weight: 500;
  background: var(--success);
  color: white;
}

.ide-diff-reject {
  padding: 2px 8px;
  border: none;
  border-radius: 4px;
  font-size: 0.65rem;
  font-family: inherit;
  cursor: pointer;
  font-weight: 500;
  background: rgba(239, 68, 68, 0.15);
  color: var(--error);
}

.ide-diff-view {
  margin: 0 8px 6px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  max-height: 200px;
  display: flex;
  flex-direction: column;
}

.ide-diff-view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.68rem;
  color: var(--text-secondary);
  position: sticky;
  top: 0;
}

.ide-diff-view-body {
  overflow-y: auto;
  padding: 2px 6px;
  font-family: 'Fira Code', monospace;
  font-size: 0.68rem;
  line-height: 1.55;
  background: rgba(0, 0, 0, 0.15);
}

.diff-add {
  color: var(--success);
  background: rgba(34, 197, 94, 0.06);
}

.diff-del {
  color: var(--error);
  background: rgba(239, 68, 68, 0.06);
}

.diff-ctx {
  color: var(--text-muted);
}

/* Inline Diff Bar (Monaco Editor) */
.ide-diff-inline-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(139, 92, 246, 0.08));
  border-bottom: 1px solid rgba(99, 102, 241, 0.15);
  flex-shrink: 0;
}

.ide-diff-inline-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
}

.ide-diff-inline-info i {
  color: #a78bfa;
  font-size: 0.85rem;
}

.ide-diff-inline-badge {
  padding: 2px 8px;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 10px;
  font-size: 0.65rem;
  font-weight: 600;
  color: #c084fc;
}

.ide-diff-inline-actions {
  display: flex;
  gap: 6px;
}

.ide-diff-inline-accept {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  border: none;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  transition: all 0.15s ease;
  box-shadow: 0 2px 6px rgba(34, 197, 94, 0.3);
}

.ide-diff-inline-accept:hover {
  transform: scale(1.03);
  box-shadow: 0 3px 10px rgba(34, 197, 94, 0.4);
}

.ide-diff-inline-reject {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  border: none;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  transition: all 0.15s ease;
}

.ide-diff-inline-reject:hover {
  background: rgba(239, 68, 68, 0.2);
}

#ideDiffEditorContainer {
  min-height: 0;
}

/* ============ Theme Picker (Top-Right Floating) ============ */
.theme-picker-wrapper {
  position: fixed;
  top: 1.2rem;
  right: 1.5rem;
  z-index: 999;
}

.theme-picker-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  color: var(--accent-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-md);
}

.theme-picker-btn:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
  transform: scale(1.1);
}

.theme-picker-btn:hover .theme-picker-icon {
  animation: spin-bounce 0.6s ease;
}

@keyframes spin-bounce {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.2); }
  100% { transform: rotate(360deg) scale(1); }
}

.theme-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 200px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.95);
  transition: all 0.2s ease;
  pointer-events: none;
}

.theme-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.theme-dropdown-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  padding: 0.4rem 0.8rem 0.5rem;
  font-weight: 600;
}

.theme-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.55rem 0.8rem;
  background: none;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.theme-dropdown-item:hover {
  background: color-mix(in srgb, var(--accent-primary) 10%, transparent);
  color: var(--text-primary);
}

.theme-dropdown-item.active {
  background: color-mix(in srgb, var(--accent-primary) 12%, transparent);
  color: var(--accent-primary);
  font-weight: 500;
}

.theme-dropdown-color {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.theme-dropdown-item-icon {
  width: 16px;
  text-align: center;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.theme-dropdown-name {
  flex: 1;
}

.theme-dropdown-check {
  font-size: 0.7rem;
  color: var(--accent-primary);
  margin-left: auto;
}

/* Mobile: adjust position */
@media (max-width: 768px) {
  .theme-picker-wrapper {
    top: 0.8rem;
    right: 4rem;
  }
}

/* ============ Auth Legal Links ============ */
.auth-legal-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.auth-legal-links a {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-decoration: none;
  transition: color 0.2s;
}

.auth-legal-links a:hover {
  color: var(--accent-primary);
}

.auth-legal-links span {
  color: var(--text-muted);
  font-size: 0.6rem;
}

/* ============ Onboarding Modal ============ */
.onboarding-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.onboarding-overlay.active {
  opacity: 1;
}

.onboarding-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2.5rem 2rem 2rem;
  max-width: 440px;
  width: 100%;
  position: relative;
  animation: onboardSlideIn 0.4s ease;
  box-shadow: var(--shadow-xl);
  text-align: center;
}

@keyframes onboardSlideIn {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.onboarding-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--border-color);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  overflow: hidden;
}

.onboarding-progress-fill {
  height: 100%;
  transition: width 0.4s ease;
  border-radius: 3px;
}

.onboarding-skip {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.3rem;
  transition: color 0.2s;
}

.onboarding-skip:hover {
  color: var(--text-primary);
}

.onboarding-icon {
  width: 70px;
  height: 70px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.5rem auto 1.2rem;
  font-size: 1.8rem;
  color: #fff;
  animation: onboardIconPulse 2s ease-in-out infinite;
}

@keyframes onboardIconPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.onboarding-title {
  color: var(--text-primary);
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0 0 0.3rem;
}

.onboarding-subtitle {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0 0 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.onboarding-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0 0 1rem;
}

.onboarding-highlight {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  background: color-mix(in srgb, var(--accent-primary) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent-primary) 15%, transparent);
  border-radius: var(--radius-md);
  padding: 0.8rem 1rem;
  margin: 0 0 1.2rem;
  text-align: left;
}

.onboarding-highlight span {
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.5;
}

.onboarding-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 0 0 1.2rem;
}

.onboarding-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-color);
  transition: all 0.3s ease;
}

.onboarding-dot.active {
  width: 24px;
  border-radius: 4px;
}

.onboarding-buttons {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
}

.onboarding-btn-prev,
.onboarding-btn-next {
  flex: 1;
  padding: 0.7rem 1rem;
  font-size: 0.85rem;
}

.onboarding-btn-next {
  color: #fff !important;
  border: none !important;
}

.onboarding-counter {
  color: var(--text-muted);
  font-size: 0.7rem;
  margin: 0.8rem 0 0;
}

/* Onboarding theme picker */
.ob-theme-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  margin: 0 0 1rem;
}

.ob-theme-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.6rem 0.3rem;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.ob-theme-option:hover {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

.ob-theme-option.selected {
  border-color: var(--accent-primary);
  background: color-mix(in srgb, var(--accent-primary) 10%, transparent);
}

.ob-theme-swatch {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  transition: box-shadow 0.3s ease;
}

.ob-theme-emoji {
  font-size: 0.95rem;
  line-height: 1;
}

.ob-theme-name {
  color: var(--text-muted);
  font-size: 0.62rem;
  text-align: center;
  line-height: 1.2;
}

.ob-theme-option.selected .ob-theme-name {
  color: var(--text-primary);
  font-weight: 600;
}

/* ============ Legal Pages ============ */
.legal-page {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 100vh;
  position: relative;
  z-index: 1;
  padding: 2rem 1rem;
}

.legal-container {
  width: 100%;
  max-width: 720px;
}

.legal-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  box-shadow: var(--shadow-xl);
  animation: fadeInUp 0.5s ease;
}

.legal-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.legal-header-icon {
  font-size: 2rem;
  color: var(--accent-primary);
  flex-shrink: 0;
}

.legal-header h1 {
  color: var(--text-primary);
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0;
}

.legal-header p {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 0.25rem 0 0;
}

.legal-content section {
  margin-bottom: 1.8rem;
}

.legal-content h2 {
  color: var(--text-primary);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.legal-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent-primary) 15%, transparent);
  color: var(--accent-primary);
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.legal-content p {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.7;
  margin: 0 0 0.5rem;
}

.legal-content ul {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.8;
  margin: 0.5rem 0;
  padding-left: 1.3rem;
}

.legal-content li {
  margin-bottom: 0.3rem;
}

.legal-content a {
  color: var(--accent-primary);
}

.legal-footer-note {
  color: var(--text-muted) !important;
  font-size: 0.8rem !important;
  margin-top: 1rem !important;
  font-style: italic;
}

.legal-actions {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: center;
}

@media (max-width: 768px) {
  .legal-card {
    padding: 1.5rem;
  }
  .onboarding-card {
    padding: 2rem 1.5rem 1.5rem;
  }
}

/* ============ Store Pages ============ */
.store-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.store-header-info h1 {
  color: var(--text-primary);
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0 0 0.3rem;
}

.store-header-info h1 i {
  color: var(--accent-primary);
  margin-right: 0.4rem;
}

.store-header-info p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0;
}

.store-balance-card {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 0.8rem 1.2rem;
  min-width: 260px;
}

.store-balance-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.1rem;
}

.store-balance-label {
  color: var(--text-muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.store-balance-amount {
  color: var(--text-primary);
  font-size: 1.3rem;
  font-weight: 800;
}

.store-balance-amount small {
  font-size: 0.6rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* Plan Cards */
.store-plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.2rem;
  margin-bottom: 2rem;
}

.store-plan-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.store-plan-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--plan-color);
  opacity: 0.5;
  transition: opacity 0.3s;
}

.store-plan-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}

.store-plan-card:hover::before {
  opacity: 1;
}

.store-plan-card.popular {
  border-color: var(--plan-color);
  box-shadow: 0 0 20px color-mix(in srgb, var(--plan-color) 15%, transparent);
}

.plan-popular-badge {
  position: absolute;
  top: 12px;
  right: -32px;
  background: var(--plan-color);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 40px;
  transform: rotate(45deg);
  text-transform: uppercase;
}

.plan-icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.8rem;
  color: #fff;
  font-size: 1.3rem;
}

.plan-name {
  color: var(--text-primary);
  font-size: 1.2rem;
  font-weight: 800;
  margin: 0 0 0.3rem;
}

.plan-description {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin: 0 0 1rem;
  line-height: 1.4;
}

.plan-price {
  margin: 0 0 1rem;
}

.plan-price-amount {
  color: var(--text-primary);
  font-size: 2rem;
  font-weight: 900;
}

.plan-price-label {
  display: block;
  color: var(--text-muted);
  font-size: 0.7rem;
  margin-top: 0.1rem;
}

.plan-features {
  text-align: left;
  margin: 0 0 1.2rem;
}

.plan-feature {
  color: var(--text-secondary);
  font-size: 0.8rem;
  padding: 0.3rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.plan-feature i {
  color: var(--plan-color);
  width: 16px;
  text-align: center;
  font-size: 0.75rem;
}

.plan-buy-btn {
  width: 100%;
}

/* Recharge Page */
.recharge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.recharge-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.recharge-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-primary);
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

.recharge-card.promo {
  border-color: color-mix(in srgb, #f59e0b 50%, transparent);
}

.recharge-tag {
  position: absolute;
  top: 8px;
  right: 8px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
}

.recharge-credits {
  color: var(--text-primary);
  font-size: 2.2rem;
  font-weight: 900;
  line-height: 1;
}

.recharge-credits-label {
  color: var(--text-muted);
  font-size: 0.7rem;
  margin: 0.2rem 0 0.5rem;
}

.recharge-bonus {
  color: #22c55e;
  font-size: 0.75rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.recharge-price {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
}

.recharge-original {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-decoration: line-through;
}

.recharge-final {
  color: var(--accent-primary);
  font-size: 1.1rem;
  font-weight: 800;
}

.recharge-custom-section {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.recharge-custom-section h3 {
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 1rem;
}

.recharge-custom-row {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
}

.recharge-custom-preview {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.6rem 1rem;
  color: var(--accent-primary);
  font-weight: 700;
  font-size: 0.9rem;
}

/* Transaction History */
.tx-container {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: 2rem;
}

.tx-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 1.2rem;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.2s;
}

.tx-row:last-child { border-bottom: none; }
.tx-row:hover { background: var(--bg-hover); }

.tx-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.tx-info { flex: 1; min-width: 0; }

.tx-label {
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
}

.tx-desc {
  color: var(--text-muted);
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tx-date {
  color: var(--text-muted);
  font-size: 0.65rem;
}

.tx-amount {
  font-size: 1rem;
  font-weight: 800;
  flex-shrink: 0;
}

.tx-amount.positive { color: #22c55e; }
.tx-amount.negative { color: #ef4444; }

/* Payment Modal */
.payment-summary {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.payment-amount {
  color: var(--text-primary);
  font-size: 1.8rem;
  font-weight: 900;
}

.payment-price {
  color: var(--accent-primary);
  font-size: 1.2rem;
  font-weight: 700;
  margin-top: 0.3rem;
}

/* Store Footer Links */
.store-footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  padding: 1rem 0;
}

.store-footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.82rem;
  transition: color 0.2s;
}

.store-footer-links a:hover {
  color: var(--accent-primary);
}

.store-footer-links a i {
  margin-right: 0.3rem;
}

@media (max-width: 768px) {
  .store-header { flex-direction: column; }
  .store-balance-card { min-width: auto; width: 100%; }
  .recharge-custom-row { flex-direction: column; }
  .store-plans-grid { grid-template-columns: 1fr; }
  .recharge-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Settings Cards */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.2rem;
}

.settings-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
}

.settings-card-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.settings-card-header i { font-size: 1.2rem; }

.settings-card-header h3 {
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
}

.settings-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.settings-checkbox input[type="checkbox"] { accent-color: var(--accent-primary); }

.badge-success { background: rgba(34,197,94,0.15); color: #22c55e; }
.badge-danger { background: rgba(239,68,68,0.15); color: #ef4444; }
.btn-success { background: #22c55e; color: #fff; border: none; }
.btn-success:hover { background: #16a34a; }

/* Range Slider */
.form-range {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.1);
  outline: none;
  margin: 0.5rem 0;
}
.form-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-primary);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(99,102,241,0.4);
}
.form-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-primary);
  cursor: pointer;
  border: none;
}