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

:root {
  --bg-color: #0b0c10;
  --panel-bg: rgba(22, 27, 34, 0.7);
  --card-bg: rgba(30, 39, 50, 0.4);
  --border-color: rgba(255, 255, 255, 0.08);
  --glow-color: rgba(0, 119, 255, 0.15);
  --text-primary: #f0f6fc;
  --text-secondary: #8b949e;
  --primary-accent: #0077ff;
  --secondary-accent: #8a2be2;
  --success: #39d353;
  --warning: #f1e05a;
  --danger: #f85149;
  --sidebar-width: 260px;
}

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

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  background-image: 
    radial-gradient(at 10% 20%, rgba(0, 119, 255, 0.05) 0px, transparent 50%),
    radial-gradient(at 90% 80%, rgba(138, 43, 226, 0.05) 0px, transparent 50%);
}

/* Glassmorphism Panel */
.glass-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Super Admin Layout */
.saas-container {
  max-width: 1200px;
  margin: 40px auto;
  padding: 24px;
}

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

.saas-logo {
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(45deg, var(--primary-accent), var(--secondary-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Grid Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

/* KPI Card */
.kpi-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.kpi-card:hover {
  transform: translateY(-5px);
  border-color: rgba(0, 119, 255, 0.3);
  box-shadow: 0 10px 20px var(--glow-color);
}

.kpi-title {
  color: var(--text-secondary);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.kpi-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Sidebar Dashboard Layout */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: rgba(15, 17, 23, 0.9);
  border-right: 1px solid var(--border-color);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  overflow-y: auto;
}

/* Custom Scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
  width: 6px;
}
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
}

.main-content {
  margin-left: var(--sidebar-width);
  flex-grow: 1;
  padding: 40px;
  min-height: 100vh;
}

.sidebar-menu {
  list-style: none;
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.menu-item.active a, .menu-item a:hover {
  color: var(--text-primary);
  background: rgba(0, 119, 255, 0.15);
  border-left: 3px solid var(--primary-accent);
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 20px;
}

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

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 15px;
  transition: all 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-accent);
  box-shadow: 0 0 10px var(--glow-color);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-family: inherit;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-accent), var(--secondary-accent));
  color: #fff;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 119, 255, 0.4);
}

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

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* Tables */
.table-container {
  width: 100%;
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  margin-top: 24px;
}

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

.admin-table th {
  background: rgba(0, 0, 0, 0.3);
  padding: 16px;
  color: var(--text-secondary);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
}

.admin-table td {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 15px;
}

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

.status-badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.status-active {
  background: rgba(57, 211, 83, 0.15);
  color: var(--success);
}

.status-pending {
  background: rgba(241, 224, 90, 0.15);
  color: var(--warning);
}

.status-inactive {
  background: rgba(248, 81, 73, 0.15);
  color: var(--danger);
}

/* Alert notifications */
.alert {
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 24px;
  font-weight: 500;
}

.alert-success {
  background: rgba(57, 211, 83, 0.1);
  border: 1px solid rgba(57, 211, 83, 0.3);
  color: var(--success);
}

.alert-danger {
  background: rgba(248, 81, 73, 0.1);
  border: 1px solid rgba(248, 81, 73, 0.3);
  color: var(--danger);
}


/* Mobile Responsiveness */
.mobile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: var(--panel-bg);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(16px);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 900;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 950;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
  display: block;
  opacity: 1;
}

@media (max-width: 991px) {
  .sidebar {
    transform: translateX(-100%);
    z-index: 1000;
    transition: transform 0.3s ease;
  }
  
  .sidebar.show {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
    padding: 20px;
    padding-top: 80px; /* Space for the mobile header */
  }

  /* Make tables scrollable horizontally on small screens */
  .table-container {
    overflow-x: auto;
  }
}
