/* ============================================================
   ArabWay Dashboard — Modern Black Theme
   ============================================================ */

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

/* ============================================================
   CSS VARIABLES
   ============================================================ */
:root {
  /* Backgrounds */
  --bg-0: #000000;
  --bg-1: #0a0a0a;
  --bg-2: #111111;
  --bg-3: #181818;
  --bg-4: #222222;

  /* Borders */
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --border-active: rgba(255, 255, 255, 0.18);

  /* Text */
  --text-1: #ffffff;
  --text-2: #a0a0a0;
  --text-3: #666666;

  /* Accent — ArabWay royal purple & silver (matches the logo) */
  --accent: #a855f7;
  --accent-2: #d1d5db;
  --accent-dim: rgba(168, 85, 247, 0.10);
  --accent-glow: rgba(168, 85, 247, 0.20);
  --accent-gradient: linear-gradient(135deg, #9333ea 0%, #e5e7eb 100%);

  /* Status */
  --success: #4ade80;
  --success-bg: rgba(74, 222, 128, 0.08);
  --danger: #f87171;
  --danger-bg: rgba(248, 113, 113, 0.08);
  --warning: #fbbf24;
  --warning-bg: rgba(251, 191, 36, 0.08);
  --info: #60a5fa;
  --info-bg: rgba(96, 165, 250, 0.08);

  /* Layout */
  --sidebar-w: 240px;
  --sidebar-collapsed: 64px;
  --topnav-h: 56px;

  /* Radii */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 18px;

  /* Transitions */
  --t-fast: 120ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.7);

  /* Legacy aliases (keep views working) */
  --bg-dark: var(--bg-0);
  --bg-mid: var(--bg-1);
  --bg-light: var(--bg-2);
  --bg-elevated: var(--bg-3);
  --primary: var(--accent);
  --primary-glow: var(--accent-glow);
  --text-main: var(--text-1);
  --text-muted: var(--text-2);
  --text-secondary: #cccccc;
  --glass-bg: rgba(255,255,255,0.025);
  --glass-border: var(--border);
  --glass-hover: rgba(255,255,255,0.04);
  --radius-sm: var(--r-sm);
  --radius-md: var(--r-md);
  --radius-lg: var(--r-lg);
  --transition-base: var(--t-base);
  --transition-fast: var(--t-fast);
  --shadow-elevated: var(--shadow-md);
  --sidebar-width: var(--sidebar-w);
  --topnav-height: var(--topnav-h);
}

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

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

body {
  font-family: 'IBM Plex Sans Arabic', 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg-0);
  color: var(--text-1);
  height: 100vh;
  overflow: hidden;
  display: flex;
  direction: rtl;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.08);
  border-radius: 100px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(34, 211, 238, 0.35);
}

/* ============================================================
   TOP NAVIGATION
   ============================================================ */
.top-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topnav-h);
  background: var(--bg-0);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 1000;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

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

.sidebar-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-2);
  width: 34px;
  height: 34px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--t-fast);
  font-size: 0.95rem;
}
.sidebar-toggle:hover {
  background: var(--accent-dim);
  color: var(--text-1);
  border-color: var(--border-hover);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-1);
  text-decoration: none;
  letter-spacing: -0.2px;
  transition: opacity var(--t-fast);
}
.brand:hover { opacity: 0.75; }
.brand i { color: var(--accent); font-size: 1rem; }
.brand-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 0 6px var(--accent-glow));
}
.mobile-logo .brand-logo {
  width: 22px;
  height: 22px;
  vertical-align: middle;
  margin-inline-end: 4px;
}

.top-nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-icon-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-2);
  width: 34px;
  height: 34px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--t-fast);
  font-size: 0.9rem;
  position: relative;
}
.nav-icon-btn:hover {
  background: var(--accent-dim);
  color: var(--text-1);
  border-color: var(--border);
}
.nav-icon-btn .badge {
  position: absolute;
  top: 7px; right: 7px;
  width: 7px; height: 7px;
  background: var(--danger);
  border-radius: 50%;
  border: 1.5px solid var(--bg-0);
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 12px 5px 5px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all var(--t-fast);
  border: 1px solid transparent;
  text-decoration: none;
  color: var(--text-1);
}
.user-menu:hover {
  background: var(--accent-dim);
  border-color: var(--border);
}
.user-menu img {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
}
.user-menu span {
  font-size: 0.875rem;
  font-weight: 600;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.app-sidebar {
  position: fixed;
  top: var(--topnav-h); right: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-0);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 900;
  overflow: hidden;
  transition: width var(--t-slow);
}

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

.app-sidebar.collapsed .sidebar-text {
  opacity: 0;
  width: 0;
  overflow: hidden;
  white-space: nowrap;
}
.app-sidebar.collapsed .nav-link {
  justify-content: center;
  padding: 12px;
}
.app-sidebar.collapsed .nav-link i { margin: 0; font-size: 1.1rem; }
.app-sidebar.collapsed .sidebar-header,
.app-sidebar.collapsed .sidebar-footer,
.app-sidebar.collapsed .nav-divider,
.app-sidebar.collapsed .active-server-widget {
  opacity: 0;
  pointer-events: none;
  height: 0;
  padding: 0;
  margin: 0;
  border: 0;
  overflow: hidden;
}

.sidebar-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar-header h2 {
  font-size: 0.875rem;
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}
.sidebar-header h2 i { color: var(--text-2); font-size: 1rem; }

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 8px;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-menu li { margin: 0; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  color: var(--text-2);
  text-decoration: none;
  border-radius: var(--r-sm);
  font-weight: 500;
  font-size: 0.875rem;
  transition: all var(--t-fast);
  position: relative;
  white-space: nowrap;
}
.nav-link i {
  width: 18px;
  text-align: center;
  font-size: 0.9rem;
  flex-shrink: 0;
  transition: color var(--t-fast);
}
.nav-link:hover {
  background: rgba(34, 211, 238, 0.06);
  color: var(--text-1);
}
.nav-link.active {
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.14), rgba(99, 102, 241, 0.05));
  color: var(--text-1);
  border-left: 2px solid var(--accent);
  padding-right: 10px;
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.08);
}
.nav-link.active i { color: var(--accent); }

.nav-divider {
  color: var(--text-3);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin: 16px 8px 8px;
  font-weight: 700;
  display: block;
  padding: 0 4px;
}

.active-server-widget {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.06), rgba(99, 102, 241, 0.03));
  border: 1px solid rgba(34, 211, 238, 0.15);
  border-radius: var(--r-md);
  padding: 12px;
  text-align: center;
  margin-bottom: 10px;
  transition: border-color var(--t-fast);
}
.active-server-widget:hover { border-color: rgba(34, 211, 238, 0.3); }
.active-server-widget img {
  width: 56px; height: 56px;
  border-radius: var(--r-sm);
  margin: 0 auto 10px;
  border: 1px solid rgba(34, 211, 238, 0.25);
  display: block;
}
.active-server-widget .no-icon {
  width: 56px; height: 56px;
  border-radius: var(--r-sm);
  margin: 0 auto 10px;
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--text-1);
  border: 1px solid var(--border);
}
.active-server-widget strong {
  display: block;
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-1);
}

.sidebar-footer {
  padding: 12px 8px;
  border-top: 1px solid var(--border);
}

.user-profile-widget {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--r-sm);
  margin-bottom: 8px;
  transition: background var(--t-fast);
}
.user-profile-widget:hover { background: rgba(255,255,255,0.04); }
.user-profile-widget img {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  flex-shrink: 0;
}
.user-profile-info { display: flex; flex-direction: column; min-width: 0; }
.user-profile-info span {
  font-weight: 600;
  font-size: 0.875rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-profile-info small { color: var(--text-2); font-size: 0.7rem; }

/* ============================================================
   APP LAYOUT
   ============================================================ */
.app-wrapper {
  display: flex;
  width: 100%;
  height: 100vh;
  margin-right: var(--sidebar-w);
  transition: margin var(--t-slow);
}
.app-wrapper.sidebar-collapsed { margin-right: var(--sidebar-collapsed); }

.app-content {
  flex: 1;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px;
  padding-top: calc(var(--topnav-h) + 24px);
}

/* ============================================================
   PAGE TRANSITION
   ============================================================ */
.page-transition { display: none; }
.page-transition-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-0);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

/* ============================================================
   CONTENT HEADER
   ============================================================ */
.content-header { margin-bottom: 24px; }
.content-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-1);
  letter-spacing: -0.4px;
}
.content-header h1 i { color: var(--accent); font-size: 1.2rem; }
.content-header p {
  color: var(--text-2);
  font-size: 0.875rem;
  line-height: 1.5;
}

/* ============================================================
   GLASS PANELS / CARDS
   ============================================================ */
.glass-panel {
  background: rgba(20, 20, 35, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--r-lg);
  padding: 20px;
  margin-bottom: 14px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.37);
  transition: border-color var(--t-base), box-shadow var(--t-base);
  box-sizing: border-box;
  max-width: 100%;
}
.glass-panel:hover {
  border-color: rgba(34, 211, 238, 0.25);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(34, 211, 238, 0.05);
}

/* ============================================================
   BENTO GRID
   ============================================================ */
.bento-grid { display: grid; gap: 14px; margin-bottom: 18px; }
.bento-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.bento-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.bento-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.bento-grid .span-2 { grid-column: span 2; }
.bento-grid .span-3 { grid-column: span 3; }
.bento-grid .span-4 { grid-column: span 4; }

/* ============================================================
   METRIC CARDS
   ============================================================ */
.metric-card {
  background: rgba(20, 20, 35, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--r-lg);
  padding: 18px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transition: border-color var(--t-base), transform var(--t-base), box-shadow var(--t-base);
  cursor: default;
  box-sizing: border-box;
  max-width: 100%;
}
.metric-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, transparent 60%);
  pointer-events: none;
}
.metric-card:hover {
  border-color: rgba(34, 211, 238, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), 0 0 24px rgba(34, 211, 238, 0.08);
}
.metric-card .metric-icon {
  width: 38px; height: 38px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  margin-bottom: 14px;
  background: var(--accent-gradient);
  color: #04131a;
  border: 1px solid rgba(34, 211, 238, 0.3);
  box-shadow: 0 4px 14px rgba(34, 211, 238, 0.25);
}
.metric-card .metric-value {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 6px;
  color: var(--text-1);
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
}
.metric-card .metric-label {
  font-size: 0.8rem;
  color: var(--text-2);
  font-weight: 500;
  letter-spacing: 0.2px;
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  margin-bottom: 7px;
  font-weight: 600;
  color: var(--text-1);
  font-size: 0.85rem;
}
.form-group small {
  display: block;
  color: var(--text-2);
  margin-top: 5px;
  font-size: 0.78rem;
  line-height: 1.4;
}

.glass-input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-1);
  font-family: inherit;
  font-size: 0.875rem;
  transition: all var(--t-fast);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}
.glass-input::placeholder { color: var(--text-3); }
.glass-input:focus {
  border-color: var(--accent);
  background: rgba(34, 211, 238, 0.05);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}
.glass-input:hover:not(:focus) { border-color: var(--border-hover); }
.glass-input option {
  background: var(--bg-3);
  color: var(--text-1);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  padding: 10px 20px;
  border-radius: var(--r-md);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--t-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: inherit;
  font-size: 0.875rem;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  user-select: none;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--accent-gradient);
  color: #04131a;
  border-color: transparent;
  font-weight: 700;
}
.btn-primary:hover {
  filter: brightness(1.08);
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255,255,255,0.06);
  color: var(--text-1);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: rgba(255,255,255,0.10);
  border-color: var(--border-hover);
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: rgba(248,113,113,0.2);
}
.btn-danger:hover {
  background: rgba(248,113,113,0.15);
  border-color: rgba(248,113,113,0.35);
}

.btn-large { padding: 12px 24px; font-size: 0.95rem; width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 0.8rem; }
.btn-block { width: 100%; }

.disabled {
  opacity: 0.3;
  pointer-events: none;
}

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
  padding: 12px 16px;
  border-radius: var(--r-md);
  margin-bottom: 16px;
  font-weight: 500;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 9px;
  animation: slideDown 0.3s var(--t-fast) both;
  border: 1px solid;
}
.alert-success {
  background: var(--success-bg);
  border-color: rgba(74,222,128,0.2);
  color: var(--success);
}
.alert-danger {
  background: var(--danger-bg);
  border-color: rgba(248,113,113,0.2);
  color: var(--danger);
}

/* ============================================================
   GUILD CARDS
   ============================================================ */
.guild-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.guild-card {
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  text-align: center;
  transition: all var(--t-base);
  cursor: pointer;
}
.guild-card:hover {
  border-color: rgba(34, 211, 238, 0.3);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), 0 0 20px rgba(34, 211, 238, 0.1);
}
.guild-card img,
.guild-card .no-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  margin: 0 auto 12px;
  display: block;
  transition: transform var(--t-base);
}
.guild-card:hover img,
.guild-card:hover .no-icon {
  transform: scale(1.06);
}
.guild-card .no-icon {
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: bold;
  color: var(--text-1);
  border: 1px solid var(--border);
}
.guild-card h3 {
  font-size: 1rem;
  margin-bottom: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-1);
}

/* ============================================================
   LISTS & TABLES
   ============================================================ */
.list-item {
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--border);
  padding: 12px 14px;
  border-radius: var(--r-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  transition: border-color var(--t-fast);
}
.list-item:hover { border-color: var(--border-hover); }

.table { width: 100%; border-collapse: collapse; min-width: 500px; }
.table th {
  padding: 10px 12px;
  text-align: right;
  font-weight: 600;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.table td {
  padding: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 0.875rem;
  transition: background var(--t-fast);
}
.table tr:hover td { background: rgba(255,255,255,0.02); }

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  box-sizing: border-box;
}

/* ============================================================
   UTILITY
   ============================================================ */
.text-center { text-align: center; }
.text-muted { color: var(--text-2); }
.text-primary { color: var(--text-1); }
.text-secondary { color: var(--text-2); }
.text-main { color: var(--text-1); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.fw-bold { font-weight: 700; }
.opacity-70 { opacity: 0.7; }
.d-flex { display: flex; }
.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-grow-1 { flex-grow: 1; }
.align-items-center { align-items: center; }
.cursor-pointer { cursor: pointer; }
.gap-1 { gap: 8px; }
.gap-sm { gap: 6px; }
.gap-2 { gap: 14px; }
.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 14px; }
.mt-3 { margin-top: 22px; }
.mb-1 { margin-bottom: 6px; }
.mb-2 { margin-bottom: 14px; }

hr, .divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

.section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.section-title i { color: var(--text-2); }

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

code {
  background: rgba(255,255,255,0.07);
  padding: 2px 7px;
  border-radius: 4px;
  font-family: 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.82em;
  color: var(--text-1);
  border: 1px solid var(--border);
}

/* ============================================================
   GRIDS
   ============================================================ */
.grid-2col { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-2col-sm { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.grid-3col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-form-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }
.grid-form-1-2 { display: grid; grid-template-columns: 1fr 2fr; gap: 14px; }
.grid-form-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.grid-form-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-form-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.grid-form-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }

.sticky-preview {
  position: sticky;
  top: calc(var(--topnav-h) + 16px);
  align-self: start;
}
.preview-column {
  position: sticky;
  top: 20px;
  align-self: start;
}

.tickets-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 20px;
  align-items: start;
}

/* ============================================================
   SPECIAL COMPONENTS
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.chart-card {
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
}
.chart-card h3 {
  margin: 0 0 14px;
  font-size: 0.95rem;
  color: var(--text-1);
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}
.chart-container { position: relative; height: 240px; width: 100%; }

.role-row {
  background: rgba(255,255,255,0.025);
  padding: 14px;
  border-radius: var(--r-md);
  margin-bottom: 12px;
  border: 1px solid var(--border);
  position: relative;
  transition: border-color var(--t-fast);
}
.role-row:hover { border-color: var(--border-hover); }

.question-row {
  background: rgba(255,255,255,0.025);
  padding: 14px;
  border-radius: var(--r-md);
  margin-bottom: 12px;
  border: 1px solid var(--border);
  position: relative;
  transition: border-color var(--t-fast);
}
.question-row:hover { border-color: var(--border-hover); }

.preview-container {
  position: relative;
  width: 100%;
  max-width: 800px;
  height: 400px;
  background-color: rgba(255,255,255,0.025);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: top left;
  border: 1px dashed var(--border);
  border-radius: var(--r-md);
  margin-bottom: 16px;
  overflow: hidden;
  user-select: none;
}

.preview-avatar {
  position: absolute;
  border: 2px solid var(--success);
  border-radius: 50%;
  background-color: rgba(255,255,255,0.1);
  cursor: move;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.preview-username {
  position: absolute;
  cursor: move;
  font-family: 'CustomFont', sans-serif;
  font-weight: bold;
  white-space: nowrap;
}

.emoji-preview-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.log-card {
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--border);
  padding: 16px;
  border-radius: var(--r-md);
  margin-bottom: 0;
  transition: border-color var(--t-fast);
}
.log-card:hover { border-color: var(--border-hover); }

.info-box {
  padding: 13px 16px;
  border-radius: var(--r-md);
  background: var(--info-bg);
  border: 1px solid rgba(96,165,250,0.2);
  color: var(--info);
  font-size: 0.875rem;
}

/* Discord embed preview */
.discord-preview-container {
  background: var(--bg-2);
  border-radius: var(--r-md);
  padding: 14px;
  font-family: 'Inter', sans-serif;
  color: var(--text-2);
  margin-top: 16px;
  display: flex;
  border: 1px solid var(--border);
}
.discord-embed {
  background-color: var(--bg-3);
  border-radius: var(--r-sm);
  border-left: 4px solid #888;
  padding: 14px;
  display: flex;
  flex-direction: column;
  max-width: 520px;
  width: 100%;
}
.discord-button {
  background-color: #4f6fe0;
  color: white;
  padding: 9px 16px;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
}
.discord-select {
  background-color: #2b2d31;
  color: #dbdee1;
  border: 1px solid #3e4047;
  padding: 9px 12px;
  border-radius: 4px;
  font-size: 0.875rem;
  width: 100%;
  max-width: 400px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.embed-author { display: flex; align-items: center; margin-bottom: 7px; font-size: 14px; font-weight: 600; color: var(--text-1); }
.embed-author img { width: 24px; height: 24px; border-radius: 50%; margin-left: 7px; display: none; }
.embed-title { font-size: 15px; font-weight: 600; color: var(--text-1); margin-bottom: 7px; display: none; }
.embed-description { font-size: 14px; line-height: 1.375; white-space: pre-wrap; display: none; }
.embed-thumbnail { max-width: 80px; max-height: 80px; border-radius: 4px; margin-right: 14px; display: none; }
.embed-image { max-width: 100%; border-radius: 4px; margin-top: 14px; display: none; }
.embed-footer { display: flex; align-items: center; margin-top: 7px; font-size: 12px; color: var(--text-2); }
.embed-footer img { width: 20px; height: 20px; border-radius: 50%; margin-left: 7px; display: none; }
.embed-footer span { display: none; }
.embed-content-wrapper { display: flex; justify-content: space-between; }

/* ============================================================
   MOBILE NAVBAR
   ============================================================ */
.mobile-navbar { display: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .bento-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .bento-grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .bento-grid .span-2,
  .bento-grid .span-3,
  .bento-grid .span-4 { grid-column: span 2; }
}

@media (max-width: 768px) {
  body { overflow: hidden; height: 100vh; }

  .top-nav { display: none; }
  .brand span { display: none; }

  .mobile-navbar {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-0);
    border-bottom: 1px solid var(--border);
    padding: 0 16px;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--topnav-h);
    z-index: 1000;
  }

  .mobile-menu-btn {
    background: transparent;
    border: none;
    color: var(--text-1);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: var(--r-sm);
    transition: background var(--t-fast);
  }
  .mobile-menu-btn:hover { background: var(--accent-dim); }

  .mobile-logo {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-1);
    display: flex;
    align-items: center;
    gap: 7px;
  }
  .mobile-logo i { color: var(--text-2); }
  .mobile-spacer { width: 36px; }

  .app-sidebar {
    top: 0;
    right: -300px;
    bottom: 0;
    height: 100vh;
    width: 280px;
    z-index: 900;
    border-left: 1px solid var(--border);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -8px 0 24px rgba(0,0,0,0.85);
  }
  .app-sidebar.active { right: 0; }
  .app-sidebar.collapsed { width: 280px; }
  .app-sidebar.collapsed .sidebar-text { opacity: 1; width: auto; }
  .app-sidebar.collapsed .nav-link { justify-content: flex-start; padding: 10px 14px; }
  .app-sidebar.collapsed .nav-link i { margin: 0; font-size: 0.95rem; }
  .app-sidebar.collapsed .sidebar-header,
  .app-sidebar.collapsed .sidebar-footer,
  .app-sidebar.collapsed .nav-divider,
  .app-sidebar.collapsed .active-server-widget {
    opacity: 1;
    pointer-events: auto;
    height: auto;
    padding: 12px 16px;
    margin: 0;
    overflow: visible;
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 850;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--t-base), visibility var(--t-base);
  }
  .sidebar-overlay.active { opacity: 1; visibility: visible; }

  .app-wrapper { margin-right: 0 !important; padding-top: var(--topnav-h); }
  .app-content { 
    padding: 16px; 
    height: calc(100vh - var(--topnav-h)); 
    overflow-y: auto; 
    -webkit-overflow-scrolling: touch; 
  }

  .content-header h1 { font-size: 1.35rem; }
  .glass-panel { padding: 16px; border-radius: var(--r-md); }
  .btn { width: 100%; margin-bottom: 8px; }
  .guild-grid { grid-template-columns: 1fr; gap: 14px; }

  .grid-2col, .grid-2col-sm, .grid-3col { grid-template-columns: 1fr !important; gap: 14px !important; }
  .grid-form-2-1, .grid-form-1-2 { grid-template-columns: 1fr !important; gap: 12px !important; }
  .grid-form-2 { grid-template-columns: 1fr !important; gap: 12px !important; }
  .grid-form-3, .grid-form-4, .grid-form-5 { grid-template-columns: 1fr !important; gap: 12px !important; }

  .bento-grid.cols-4 { grid-template-columns: repeat(2, 1fr) !important; gap: 12px !important; }
  .bento-grid.cols-3 { grid-template-columns: repeat(2, 1fr) !important; gap: 12px !important; }
  .bento-grid.cols-2 { grid-template-columns: 1fr !important; gap: 12px !important; }
  .bento-grid .span-2,
  .bento-grid .span-3,
  .bento-grid .span-4 { grid-column: span 1; }

  .metric-card .metric-value { font-size: 1.4rem; }
  .sticky-preview, .preview-column { position: static !important; top: auto !important; }
  .tickets-layout { grid-template-columns: 1fr !important; }
  .tickets-layout .sticky-preview { position: static !important; }
  
  /* Discord preview responsive */
  .discord-preview-container {
    flex-direction: column !important;
    gap: 12px;
  }
  
  /* Welcome card canvas workspace scale container */
  .canvas-workspace {
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
  }
  .greet-canvas-container {
    min-width: 600px;
  }
}

@media (max-width: 480px) {
  .app-content { 
    padding: 10px; 
  }
  .glass-panel { 
    padding: 10px; 
  }
  
  .bento-grid.cols-4,
  .bento-grid.cols-3,
  .bento-grid.cols-2 { 
    grid-template-columns: 1fr !important; 
    gap: 10px !important; 
  }
  
  .metric-card {
    padding: 12px !important;
  }
  .metric-card .metric-value {
    font-size: 1.25rem !important;
  }
}



/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Staggered card entrance */
.metric-card,
.glass-panel,
.guild-card {
  animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.metric-card:nth-child(1), .glass-panel:nth-child(1), .guild-card:nth-child(1) { animation-delay: 0.03s; }
.metric-card:nth-child(2), .glass-panel:nth-child(2), .guild-card:nth-child(2) { animation-delay: 0.07s; }
.metric-card:nth-child(3), .glass-panel:nth-child(3), .guild-card:nth-child(3) { animation-delay: 0.11s; }
.metric-card:nth-child(4), .glass-panel:nth-child(4), .guild-card:nth-child(4) { animation-delay: 0.15s; }
.metric-card:nth-child(5), .glass-panel:nth-child(5), .guild-card:nth-child(5) { animation-delay: 0.19s; }
.metric-card:nth-child(6), .glass-panel:nth-child(6), .guild-card:nth-child(6) { animation-delay: 0.23s; }
.metric-card:nth-child(7), .glass-panel:nth-child(7), .guild-card:nth-child(7) { animation-delay: 0.27s; }
.metric-card:nth-child(8), .glass-panel:nth-child(8), .guild-card:nth-child(8) { animation-delay: 0.31s; }

.section-title {
  animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 0.08s;
}

.content-header {
  animation: fadeIn 0.4s ease both;
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Skeleton loading shimmer */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--r-sm);
}

/* Loading pulse */
.loading-pulse { animation: pulse 1.5s ease infinite; }

/* Logout & login buttons */
.logout-btn,
.login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
}
.logout-btn .sidebar-text,
.login-btn .sidebar-text { white-space: nowrap; }

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ============================================================
   DEV CREDIT / GLOBAL BRANDING BAR
   ============================================================ */
.dev-credit-bar {
  text-align: center;
  padding: 14px 20px 18px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: #06b6d4;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(6, 182, 212, 0.12);
  background: linear-gradient(180deg, transparent, rgba(6, 182, 212, 0.03));
}
.dev-credit-bar .dev-credit-dot { color: rgba(6, 182, 212, 0.4); }

/* Premium chip used across guild feature pages */
.premium-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.18), rgba(6, 182, 212, 0.06));
  color: #06b6d4;
  border: 1px solid rgba(6, 182, 212, 0.35);
  vertical-align: middle;
}

/* ============================================================
   SIDEBAR v2 — Grouped / collapsible navigation
   ============================================================ */
.nav-groups {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-group {
  border-radius: var(--r-sm);
}
.nav-group + .nav-group { margin-top: 1px; }

.nav-group-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  color: var(--text-2);
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  border-radius: var(--r-sm);
  list-style: none;
  user-select: none;
  transition: all var(--t-fast);
}
.nav-group-summary::-webkit-details-marker { display: none; }
.nav-group-summary:hover { background: rgba(255, 255, 255, 0.03); color: var(--text-1); }
.nav-group-summary i.nav-icon { width: 18px; text-align: center; font-size: 0.85rem; flex-shrink: 0; }
.nav-group-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-group-chevron {
  font-size: 0.65rem;
  color: var(--text-3);
  transition: transform var(--t-fast);
  flex-shrink: 0;
}
.nav-group[open] > .nav-group-summary .nav-group-chevron { transform: rotate(180deg); }
.nav-group[open] > .nav-group-summary { color: var(--text-1); }

.nav-group-premium .nav-group-summary { color: #06b6d4; }
.nav-group-crown { color: #06b6d4; font-size: 0.7rem; margin-left: 2px; }

.nav-submenu {
  padding-right: 14px;
  margin-top: 2px;
  border-right: 1px solid var(--border);
  margin-right: 20px;
  padding-right: 10px;
}
.nav-submenu .nav-link { font-size: 0.825rem; padding: 7px 10px; }

/* ============================================================
   TOPBAR breadcrumb (current guild context)
   ============================================================ */
.topbar-crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-2);
  padding: 0 4px;
  overflow: hidden;
  white-space: nowrap;
}
.topbar-crumb img {
  width: 20px; height: 20px;
  border-radius: 5px;
  flex-shrink: 0;
}
.topbar-crumb .crumb-sep { color: var(--text-3); }
.topbar-crumb .crumb-current {
  color: var(--text-1);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-crumb a { color: var(--text-2); text-decoration: none; transition: color var(--t-fast); }
.topbar-crumb a:hover { color: var(--accent); }

/* ============================================================
   QUICK LINKS grid (guild overview flagship page)
   ============================================================ */
.quick-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 6px;
}
.quick-link-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 14px;
  border-radius: var(--r-md);
  background: var(--glass-bg);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text-1);
  transition: all var(--t-fast);
}
.quick-link-card:hover {
  border-color: rgba(34, 211, 238, 0.35);
  background: rgba(34, 211, 238, 0.05);
  transform: translateY(-2px);
}
.quick-link-card i { font-size: 1.1rem; color: var(--accent); }
.quick-link-card span { font-size: 0.8rem; font-weight: 600; }

/* Overview stat tiles */
.overview-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.overview-tile {
  padding: 16px;
  border-radius: var(--r-md);
  background: var(--glass-bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.overview-tile-icon {
  width: 40px; height: 40px;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 1.1rem;
  flex-shrink: 0;
}
.overview-tile-value { font-size: 1.15rem; font-weight: 700; color: var(--text-1); line-height: 1.2; }
.overview-tile-label { font-size: 0.75rem; color: var(--text-2); }

/* ============================================================
   VISUAL POLISH PASS — ambient depth, richer glass, micro-interactions
   ============================================================ */

/* Ambient glow orbs behind the content area for depth */
.app-content { position: relative; isolation: isolate; }
.app-content::before,
.app-content::after {
  content: '';
  position: fixed;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.10;
  pointer-events: none;
  z-index: -1;
}
.app-content::before {
  top: -180px;
  left: -120px;
  background: var(--accent);
}
.app-content::after {
  bottom: -220px;
  right: -160px;
  background: var(--accent-2);
  opacity: 0.08;
}

/* Richer glass panels: subtle gradient top edge + deeper hover lift */
.glass-panel {
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(20,20,35,0.55));
}
.glass-panel::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(34,211,238,0.35), transparent);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.glass-panel:hover {
  transform: translateY(-2px);
  border-color: rgba(34, 211, 238, 0.3);
  box-shadow: 0 16px 44px rgba(0,0,0,0.5), 0 0 0 1px rgba(34, 211, 238, 0.08), 0 0 32px rgba(34, 211, 238, 0.06);
}

/* Section titles get a small glowing accent bar */
.section-title {
  position: relative;
  padding-right: 12px;
}
.section-title::before {
  content: '';
  position: absolute;
  right: 0;
  top: 2px;
  bottom: 2px;
  width: 3px;
  border-radius: 3px;
  background: var(--accent-gradient);
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.5);
}

/* Content header gets a soft gradient underline */
.content-header {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.content-header h1 {
  background: linear-gradient(90deg, var(--text-1) 60%, var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
}

/* Buttons: extra depth on primary, smoother hover on secondary */
.btn { transition: all var(--t-base); }
.btn-primary:hover { transform: translateY(-2px); }
.btn-secondary:hover { transform: translateY(-1px); }

/* Nav link active state — glowing pill indicator instead of flat bar */
.nav-link.active {
  position: relative;
  background: linear-gradient(90deg, rgba(34,211,238,0.14), rgba(99,102,241,0.05));
}
.nav-link.active::after {
  content: '';
  position: absolute;
  right: 0;
  top: 20%;
  bottom: 20%;
  width: 3px;
  border-radius: 3px;
  background: var(--accent-gradient);
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.6);
}
.nav-link {
  transition: background var(--t-base), color var(--t-base), padding var(--t-base);
}
.nav-link:hover:not(.active) {
  background: rgba(255,255,255,0.04);
  padding-right: 4px;
}

/* Stat/overview values get a subtle gradient treatment */
.overview-tile-value,
.stat-value {
  background: linear-gradient(90deg, var(--text-1), var(--accent) 130%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Custom scrollbar to match the theme */
.app-content::-webkit-scrollbar,
*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
  border-radius: 8px;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(34, 211, 238, 0.35); }

/* Inputs get a soft focus glow */
.glass-input:focus,
.form-input:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15);
}

/* Smoother staggered reveal for panels stacked on one page */
.glass-panel.reveal:nth-of-type(2) { transition-delay: 0.05s; }
.glass-panel.reveal:nth-of-type(3) { transition-delay: 0.1s; }
.glass-panel.reveal:nth-of-type(4) { transition-delay: 0.15s; }

@media (max-width: 768px) {
  .app-content::before, .app-content::after { display: none; }
}

/* Forms sub-navigation tabs (shared between forms.ejs and form-templates.ejs) */
.forms-subnav {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}
.forms-subnav-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--r-md) var(--r-md) 0 0;
  color: var(--text-2);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: all var(--t-base);
}
.forms-subnav-tab:hover { color: var(--text-1); background: rgba(255,255,255,0.03); }
.forms-subnav-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: var(--accent-dim);
}

/* Form template cards */
.template-card {
  background: rgba(20,20,35,0.5);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  margin-bottom: 12px;
}
.template-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.template-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
}
.template-badge.on { background: var(--success-bg); color: var(--success); }
.template-badge.off { background: var(--danger-bg); color: var(--danger); }
.template-type-badge { background: var(--accent-dim); color: var(--accent); padding: 3px 10px; border-radius: 20px; font-size: 0.7rem; font-weight: 700; }
/* ============================================================
   LUXURY THEME ENHANCEMENTS
   طبقة تحسينات فوق الثيم الأساسي — لمسة ذهبية فاخرة على العناصر
   الأساسية (الخلفية، البطاقات، الأزرار، الشعار) بدون كسر أي
   تصميم موجود، لأنها بس تضيف/تقوّي مو تستبدل.
   ============================================================ */
:root {
  --gold: #d4af37;
  --gold-light: #f4e5b2;
  --gold-dim: rgba(212, 175, 55, 0.10);
  --gold-glow: rgba(212, 175, 55, 0.35);
  --gold-gradient: linear-gradient(135deg, #b8860b 0%, #f4e5b2 45%, #d4af37 100%);
}

/* خلفية فخمة: تدرج داكن ثابت + هالة خفيفة متحركة ببطء بدل الأسود الفلات */
body {
  background:
    radial-gradient(ellipse 900px 500px at 15% -10%, rgba(168, 85, 247, 0.10), transparent 60%),
    radial-gradient(ellipse 900px 600px at 110% 10%, rgba(212, 175, 55, 0.07), transparent 55%),
    var(--bg-0);
  background-attachment: fixed;
}

/* شعار اللوحة: هالة ذهبية ناعمة حوله */
.brand-logo {
  box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.25), 0 0 18px rgba(212, 175, 55, 0.18);
  border-radius: 8px;
}
.brand span {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
  letter-spacing: 0.2px;
}

/* عناوين الصفحات: تدرج ذهبي خفيف بالنص */
.content-header h1 {
  background: linear-gradient(90deg, var(--text-1) 0%, var(--gold-light) 120%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* بطاقات زجاجية أفخم: حدّ ذهبي خفيف جداً + عمق أكبر + لمعة عند التحويم */
.glass-panel {
  background: linear-gradient(155deg, rgba(24, 22, 30, 0.72) 0%, rgba(14, 13, 18, 0.72) 100%);
  border-color: rgba(212, 175, 55, 0.10);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255,255,255,0.03);
  position: relative;
}
.glass-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(120deg, rgba(212,175,55,0.18), transparent 30%, transparent 70%, rgba(168,85,247,0.14));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.6;
}
.glass-panel:hover {
  border-color: rgba(212, 175, 55, 0.28);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(212, 175, 55, 0.08);
}

/* الأزرار الأساسية: تدرج ذهبي-بنفسجي فاخر بدل اللون المسطح */
.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--gold) 130%);
  color: #140a02;
}
.btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 26px rgba(212, 175, 55, 0.35), 0 0 14px rgba(168, 85, 247, 0.25);
}

/* لمسة فاخرة إضافية لأي عنصر يُعلّم بها صراحة (شعار اللوحة، إلخ) */
.luxury-panel {
  border-color: rgba(212, 175, 55, 0.20) !important;
}
.luxury-btn {
  position: relative;
  overflow: hidden;
}
.luxury-btn::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: -60%;
  width: 40%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.35), transparent);
  transform: skewX(-20deg);
  transition: left 0.6s ease;
}
.luxury-btn:hover::after { left: 130%; }

/* السايد بار: خط ذهبي رفيع على العنصر النشط بدل الاعتماد على اللون بس */
.app-sidebar .nav-link.active {
  box-shadow: inset 3px 0 0 var(--gold);
}

/* سكرول بار بلمسة ذهبية عند التحويم */
::-webkit-scrollbar-thumb:hover {
  background: rgba(212, 175, 55, 0.45);
}
