/* ============================================================
   XENDOCARE ADMIN PANEL - GLOBAL DESIGN SYSTEM
   Theme: Dark Mode Premium Glassmorphism ERP
   ============================================================ */

:root {
  /* Colors */
  --bg-admin: #030712;
  --bg-surface: rgba(15, 23, 42, 0.75);
  --bg-surface-glass: rgba(15, 23, 42, 0.65);
  
  --primary: #00f2fe;         /* Neon Cyan */
  --primary-glow: rgba(0, 242, 254, 0.25);
  --secondary: #2563eb;       /* Royal Blue */
  --secondary-glow: rgba(37, 99, 235, 0.25);
  --accent: #7928ca;          /* Electric Purple */
  
  --success: #00c853;         /* Emerald Green */
  --success-glow: rgba(0, 200, 83, 0.25);
  --warning: #f59e0b;         /* Amber */
  --warning-glow: rgba(245, 158, 11, 0.2);
  --danger: #ef4444;          /* Coral Red */
  --danger-glow: rgba(239, 68, 68, 0.2);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dark: #0f172a;
  
  --border-color: rgba(255, 255, 255, 0.12);
  --border-glow: rgba(0, 242, 254, 0.35);
  
  /* Fonts & Shadows */
  --font-main: 'Outfit', sans-serif;
  --shadow-main: 0 20px 45px -10px rgba(0, 0, 0, 0.6);
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.15);
  
  /* Grid & Sizes */
  --sidebar-w: 260px;
  --header-h: 70px;
  --radius-lg: 20px;
  --radius-md: 12px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: var(--font-main);
  background-color: #030712;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(0, 242, 254, 0.15) 0%, transparent 42%),
    radial-gradient(circle at 90% 80%, rgba(0, 200, 83, 0.15) 0%, transparent 42%),
    radial-gradient(circle at 50% 50%, rgba(121, 40, 202, 0.12) 0%, transparent 50%),
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 44px 44px, 44px 44px;
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  position: relative;
}

/* Floating Ambient Orbs */
body::before {
  content: '';
  position: fixed;
  top: -160px;
  left: -160px;
  width: 550px;
  height: 550px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 242, 254, 0.22) 0%, rgba(79, 172, 254, 0.22) 100%);
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  animation: floatOrbGlobal 18s ease-in-out infinite alternate;
}

body::after {
  content: '';
  position: fixed;
  bottom: -200px;
  right: -200px;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 200, 83, 0.2) 0%, rgba(0, 176, 255, 0.2) 100%);
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  animation: floatOrbGlobal 18s ease-in-out infinite alternate;
  animation-delay: -7s;
}

@keyframes floatOrbGlobal {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(70px, 45px) scale(1.12); }
  100% { transform: translate(-50px, -70px) scale(0.92); }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-admin);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* ============================================================
   APP LAYOUT
   ============================================================ */
.admin-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
  position: relative;
  z-index: 1;
}

.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 30px;
  transition: var(--transition);
}

/* ============================================================
   REUSABLE SIDEBAR NAVIGATION
   ============================================================ */
.sidebar {
  width: var(--sidebar-w);
  background: #ffffff !important;
  box-shadow: 4px 0 30px rgba(0, 0, 0, 0.2);
  border-right: 1px solid #e2e8f0 !important;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  padding: 25px 15px;
  z-index: 1000;
  transition: var(--transition);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding-bottom: 20px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 20px;
}

.sidebar-header img {
  max-width: 100%;
  height: auto;
}

.logo-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  box-shadow: 0 0 15px var(--primary-glow);
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #0f172a;
}

.logo-subtitle {
  font-size: 10px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.sidebar-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  overflow-y: auto;
  padding-right: 2px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: #475569;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
}

.sidebar-link i {
  font-size: 16px;
  width: 20px;
  text-align: center;
  color: #64748b;
}

.sidebar-link:hover {
  color: #0284c7;
  background: #f1f5f9;
}

.sidebar-link:hover i {
  color: #0284c7;
}

.sidebar-link.active {
  color: #ffffff !important;
  background: linear-gradient(135deg, #00f2fe 0%, #2563eb 100%) !important;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
  font-weight: 700;
  border-left: none;
}

.sidebar-link.active i {
  color: #ffffff !important;
}

.sidebar-footer {
  border-top: 1px solid #f1f5f9;
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-name {
  color: #0f172a !important;
}

/* ============================================================
   REUSABLE HEADER BAR
   ============================================================ */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--bg-surface-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 15px 30px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-main);
}

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

.page-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.page-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.admin-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.admin-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  object-fit: cover;
}

.admin-meta {
  display: flex;
  flex-direction: column;
}

.admin-name {
  font-size: 14px;
  font-weight: 600;
}

.admin-role {
  font-size: 11px;
  color: var(--primary);
  text-transform: uppercase;
  font-weight: 700;
}

/* ============================================================
   REUSABLE CARDS & GRID LAYOUTS
   ============================================================ */
.grid-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.card-glass {
  background: var(--bg-surface-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-main), var(--shadow-inset);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.card-accent-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, var(--primary), var(--secondary));
}

.metric-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.metric-details {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.metric-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.metric-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.metric-trend {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.trend-up { color: var(--success); }
.trend-down { color: var(--danger); }

.metric-icon-box {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--primary);
}

/* ============================================================
   REUSABLE TABLES & FILTERS
   ============================================================ */
.table-wrapper {
  overflow-x: auto;
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

.admin-table th {
  background: rgba(255, 255, 255, 0.02);
  padding: 14px 18px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border-color);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.admin-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  vertical-align: middle;
}

.admin-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.01);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-active {
  background: var(--success-glow);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-pending {
  background: var(--warning-glow);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.status-blocked, .status-expired, .status-inactive {
  background: var(--danger-glow);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Filter Bar controls */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  flex-wrap: wrap;
}

.filter-left, .filter-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ============================================================
   FORMS & BUTTONS
   ============================================================ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: inherit;
  font-size: 14px;
  transition: var(--transition);
}

select.form-control {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  line-height: normal !important;
  box-sizing: border-box !important;
}

select option {
  background-color: #0c1222 !important;
  color: #f8fafc !important;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 10px var(--primary-glow);
}

.form-control::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

.btn {
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  transition: var(--transition);
  border: none;
  text-decoration: none;
}

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

.btn-primary:hover {
  background: #00bca0;
  box-shadow: 0 0 15px var(--primary-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--secondary);
  color: #fff;
}

.btn-secondary:hover {
  background: #1d4ed8;
  box-shadow: 0 0 15px var(--secondary-glow);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--text-muted);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: #dc2626;
  box-shadow: 0 0 15px var(--danger-glow);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Mini Action Buttons for Tables */
.btn-action {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 6px;
  font-size: 13px;
}

/* ============================================================
   REUSABLE TOAST NOTIFICATION SYSTEM
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: 25px;
  right: 25px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}

.toast-alert {
  background: var(--bg-surface);
  border-left: 4px solid var(--primary);
  border-right: 1px solid var(--border-color);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-main);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
  animation: slideInLeft 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
  min-width: 300px;
  max-width: 450px;
}

.toast-success { border-left-color: var(--success); }
.toast-error { border-left-color: var(--danger); }
.toast-info { border-left-color: var(--secondary); }

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

/* ============================================================
   REUSABLE MODAL SYSTEM
   ============================================================ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(5, 7, 14, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 600px;
  padding: 30px;
  box-shadow: var(--shadow-main);
  display: flex;
  flex-direction: column;
  gap: 20px;
  transform: translateY(30px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-box {
  transform: translateY(0);
}

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

.modal-title {
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  transition: var(--transition);
}

.modal-close:hover {
  color: var(--danger);
  transform: rotate(90deg);
}

.modal-body {
  font-size: 14px;
  line-height: 1.6;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid var(--border-color);
  padding-top: 15px;
}

/* ============================================================
   RESPONSIVE DESIGN ADAPTATIONS
   ============================================================ */
@media (max-width: 992px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.active {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
    padding: 20px;
  }
  
  .menu-toggle-btn {
    display: flex !important;
  }
}

.menu-toggle-btn {
  display: none;
  width: 40px;
  height: 40px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-main);
  cursor: pointer;
}
