/* ── Protctus Admin Dashboard ── */
/* Ultra-premium dark theme tailored for Protctus */

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

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

:root {
  --bg-deep: #121010;
  --bg: #1C1919;
  --surface: #2A2B31;
  --surface-hover: #32333A;
  --surface-glass: rgba(42, 43, 49, 0.75);
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);
  
  --primary: #86A055;
  --primary-hover: #A3C268;
  --primary-glow: rgba(134, 160, 85, 0.25);
  
  /* Protctus core accent */
  --accent: #FACC15;
  
  /* Force semantic colors to map directly to User colors */
  --danger: #FACC15; /* Re-map to Accent */
  --warning: #FACC15;
  --success: #86A055; /* Re-map to Primary */
  --info: #86A055;
  
  --text: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 20px;
  
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.2), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 20px var(--primary-glow);
  
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg-deep);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .brand-font {
  font-family: 'Outfit', sans-serif;
}

/* ── Login Screen ── */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: radial-gradient(circle at top right, var(--surface) 0%, var(--bg-deep) 100%);
  position: relative;
}

.login-container::before {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  background: var(--primary-glow);
  filter: blur(120px);
  border-radius: 50%;
  top: -100px;
  right: -100px;
  pointer-events: none;
}

.login-card {
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 10;
  transform: translateY(0);
  animation: floatUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes floatUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-header-icon {
  text-align: center;
  margin-bottom: 16px;
  color: var(--primary);
}
.login-header-icon .shield-lg { width: 56px; height: 56px; stroke-width: 1.5px; }

.login-card h1 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 3px;
  text-align: center;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #fff 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-card .subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  letter-spacing: 0.5px;
}

.login-card .badge {
  display: inline-flex;
  background: rgba(134, 160, 85, 0.15);
  color: var(--primary);
  border: 1px solid rgba(134, 160, 85, 0.3);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
}

/* ── Form Controls & Icons ── */
.form-group { margin-bottom: 20px; position: relative; }

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.input-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon-wrapper i {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  width: 18px; height: 18px;
  transition: var(--transition);
}

.input-icon-wrapper input {
  padding-left: 42px !important;
}

.input-icon-wrapper input:focus + i, 
.input-icon-wrapper input:focus ~ i {
  color: var(--primary);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--primary);
  background: rgba(0, 0, 0, 0.3);
  box-shadow: 0 0 0 3px rgba(134, 160, 85, 0.1);
}

.form-group textarea { resize: vertical; min-height: 100px; line-height: 1.5; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.btn i { width: 18px; height: 18px; }

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(255,255,255,0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.btn:hover::after { opacity: 1; }

.btn-primary { 
  background: var(--primary); 
  color: #000; 
  box-shadow: 0 4px 14px rgba(134, 160, 85, 0.3);
}
.btn-primary:hover { 
  background: var(--primary-hover); 
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(134, 160, 85, 0.4);
}

.btn-danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.3); }
.btn-danger:hover { background: var(--danger); color: #fff; }

.btn-accent { background: rgba(59, 130, 246, 0.1); color: var(--accent); border: 1px solid rgba(59, 130, 246, 0.3); }
.btn-accent:hover { background: var(--accent); color: #fff; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.btn-ghost:hover { background: var(--surface-hover); color: var(--text); border-color: var(--border-hover); }

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: var(--transition);
}
.btn-close:hover {
  color: var(--text);
  background: rgba(255,255,255,0.1);
}

.btn-icon {
  padding: 8px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
}

.btn-icon:hover {
  color: var(--text);
  background: var(--surface-hover);
  border-color: var(--border-hover);
}
.btn-icon i { width: 16px; height: 16px; }

.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-full { width: 100%; }

.error-msg {
  color: var(--danger);
  font-size: 13px;
  text-align: center;
  margin-top: 14px;
  padding: 10px;
  background: rgba(239, 68, 68, 0.1);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(239, 68, 68, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* ── Dashboard Layout ── */
.app { display: flex; min-height: 100vh; background: var(--bg); }

.sidebar {
  width: 280px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: var(--transition);
}

.sidebar-header {
  padding: 32px 24px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.logo-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  color: var(--primary);
  width: 32px; height: 32px;
}

.sidebar-header h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 2px;
  background: linear-gradient(135deg, #fff, #9ca3af);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.admin-badge {
  display: inline-block;
  background: rgba(134, 160, 85, 0.1);
  border: 1px solid rgba(134, 160, 85, 0.2);
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  align-self: flex-start;
}

.sidebar-nav {
  padding: 24px 16px;
  flex: 1;
  overflow-y: auto;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.nav-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 10px 12px;
}

.nav-divider {
  height: 1px;
  background: rgba(255,255,255,0.05);
  margin: 16px 12px 24px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  margin-bottom: 4px;
  position: relative;
}

.nav-item::before {
  content: '';
  position: absolute;
  left: 0; top: 10%; bottom: 10%; width: 3px;
  background: var(--primary);
  border-radius: 0 4px 4px 0;
  transform: scaleY(0);
  transition: transform 0.2s ease;
  transform-origin: center;
}

.nav-item:hover { 
  background: rgba(255, 255, 255, 0.03); 
  color: var(--text); 
}
.nav-item.active { 
  background: linear-gradient(90deg, rgba(134, 160, 85, 0.1) 0%, transparent 100%);
  color: #fff; 
}
.nav-item.active::before { transform: scaleY(1); }
.nav-item .icon { font-size: 18px; width: 20px; height: 20px; }
.nav-item.active .icon { color: var(--primary); }

.sidebar-footer {
  padding: 24px;
  border-top: 1px solid rgba(255,255,255,0.03);
}

.main-content {
  margin-left: 280px;
  flex: 1;
  padding: 48px;
  min-height: 100vh;
  max-width: 1400px;
}

.page-section {
  animation: fadeIn 0.4s ease-out;
}

/* ── Page Header ── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 40px;
}

.page-header h1 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}

.header-subtitle {
  color: var(--text-secondary);
  font-size: 15px;
}

.page-header .actions { display: flex; gap: 12px; }

/* ── Stats Cards ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 20px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0; right: 0; width: 100px; height: 100px;
  background: radial-gradient(circle, rgba(255,255,255,0.03) 0%, transparent 70%);
  border-radius: 50%;
  transform: translate(30%, -30%);
}

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

.stat-icon-wrapper {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.05);
}

.stat-icon { width: 28px; height: 28px; }
.stat-icon.primary { color: var(--primary); }
.stat-icon.accent { color: var(--accent); }
.stat-icon.danger { color: var(--danger); }
.stat-icon.success { color: var(--success); }
.stat-icon.warning { color: var(--warning); }

.stat-info { display: flex; flex-direction: column; }

.stat-card .stat-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.stat-card .stat-value {
  font-size: 32px;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  color: var(--text);
  line-height: 1.1;
}

/* ── Table ── */
.data-table {
  width: 100%;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

.data-table table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 800px;
}

.data-table th {
  text-align: left;
  padding: 18px 24px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(0,0,0,0.15);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 16px 24px;
  font-size: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  vertical-align: middle;
  color: var(--text);
}

.data-table tbody tr { transition: background 0.2s; }
.data-table tbody tr:hover { background: rgba(255,255,255,0.02); }
.data-table tr:last-child td { border-bottom: none; }

.data-table code {
  background: rgba(0,0,0,0.3);
  padding: 4px 8px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: var(--text-muted);
  border: 1px solid rgba(255,255,255,0.05);
}

/* ── Status Badges ── */
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  text-transform: capitalize;
}

.status-indicator {
  width: 6px; height: 6px;
  border-radius: 50%;
}

.status-active, .status-open, .status-secure { 
  background: rgba(16,185,129,0.1); color: var(--success); border: 1px solid rgba(16,185,129,0.2); 
}
.status-active .status-indicator, .status-open .status-indicator, .status-secure .status-indicator { background: var(--success); box-shadow: 0 0 8px var(--success); }

.status-inactive, .status-closed, .status-banned, .status-compromised { 
  background: rgba(239,68,68,0.1); color: var(--danger); border: 1px solid rgba(239,68,68,0.2); 
}
.status-inactive .status-indicator, .status-closed .status-indicator, .status-banned .status-indicator, .status-compromised .status-indicator { background: var(--danger); }

.status-in_progress, .status-investigating, .status-vulnerable { 
  background: rgba(245,158,11,0.1); color: var(--warning); border: 1px solid rgba(245,158,11,0.2); 
}
.status-in_progress .status-indicator, .status-investigating .status-indicator, .status-vulnerable .status-indicator { background: var(--warning); }

.status-resolved { 
  background: rgba(59,130,246,0.1); color: var(--accent); border: 1px solid rgba(59,130,246,0.2); 
}
.status-resolved .status-indicator { background: var(--accent); }

.status-sent, .status-pro { 
  background: rgba(134,160,85,0.1); color: var(--primary); border: 1px solid rgba(134,160,85,0.3); 
}
.status-sent .status-indicator { background: var(--primary); }

.status-pending, .status-offline, .status-basic { 
  background: rgba(100,116,139,0.1); color: var(--text-secondary); border: 1px solid rgba(100,116,139,0.2); 
}
.status-pending .status-indicator, .status-offline .status-indicator { background: var(--text-secondary); }


/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal::-webkit-scrollbar { width: 6px; }
.modal::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.modal-header h2 { font-size: 22px; margin: 0; }

.modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 32px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,0.05); }

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

/* ── Ticket Detail ── */
.ticket-detail {
  background: rgba(0,0,0,0.2);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
  margin-bottom: 24px;
}

.ticket-detail p { color: var(--text-secondary); font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; }

.ticket-detail .ticket-issue {
  background: var(--bg-deep);
  padding: 16px;
  border-radius: var(--radius-sm);
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.03);
}

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-secondary);
}

.empty-state .empty-icon { 
  display: flex; align-items: center; justify-content: center;
  width: 80px; height: 80px;
  background: rgba(255,255,255,0.02);
  border-radius: 50%;
  margin: 0 auto 24px;
  color: var(--text-muted);
}
.empty-state .empty-icon i { width: 40px; height: 40px; stroke-width: 1.5px; }
.empty-state h3 { font-size: 20px; color: var(--text); margin-bottom: 8px; }
.empty-state p { font-size: 14px; max-width: 300px; margin: 0 auto; line-height: 1.6; }

/* ── Loading spinner ── */
.spinner-container {
  padding: 64px 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255,255,255,0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.btn .spinner { width: 16px; height: 16px; border-width: 2px; }

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

/* ── Responsive ── */
@media (max-width: 1024px) {
  .sidebar { width: 80px; }
  .sidebar-header h2, .sidebar-header .admin-badge, .nav-item span, .nav-label { display: none; }
  .nav-divider { margin: 16px 0; }
  .logo-wrapper { justify-content: center; }
  .nav-item { justify-content: center; padding: 14px; }
  .nav-item::before { display: none; }
  .main-content { margin-left: 80px; padding: 32px; }
}

@media (max-width: 768px) {
  .stats-grid { grid-template-columns: 1fr; }
  .main-content { padding: 20px; }
  .page-header { flex-direction: column; gap: 16px; }
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 32px;
  right: 32px;
  background: var(--surface-glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 24px;
  font-size: 14px;
  font-weight: 500;
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1), fadeOut 0.4s 3s forwards;
}

.toast i { width: 20px; height: 20px; }

.toast.success { border-left: 4px solid var(--success); }
.toast.success i { color: var(--success); }

.toast.error { border-left: 4px solid var(--danger); }
.toast.error i { color: var(--danger); }

.toast.info { border-left: 4px solid var(--primary); }
.toast.info i { color: var(--primary); }

@keyframes slideUp { from { transform: translateY(30px) scale(0.9); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; transform: translateY(-10px); pointer-events: none; } }

/* ── User Profile Details ── */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.profile-section {
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.profile-section h3 {
  font-size: 16px;
  color: var(--text);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  padding-bottom: 12px;
}
.profile-section h3 i { width: 18px; height: 18px; color: var(--primary); }

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(255,255,255,0.05);
  font-size: 14px;
}
.detail-row:last-child { border-bottom: none; }
.detail-row span:first-child { color: var(--text-secondary); }

.sub-table {
  background: var(--bg-deep);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.05);
  overflow-x: auto;
}

.sub-table table {
  width: 100%;
  border-collapse: collapse;
}

.sub-table th, .sub-table td {
  padding: 12px 16px;
  font-size: 13px;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.sub-table th {
  background: rgba(0,0,0,0.3);
  color: var(--text-secondary);
  font-weight: 500;
}
.sub-table tr:last-child td { border-bottom: none; }
.sub-table tr:hover td { background: rgba(255,255,255,0.02); }
