/* NLS Admin - NextLevelSites Brand Theme */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@200;300;400;500;600;700&display=swap');

:root {
  /* NLS Brand Colors */
  --bg-primary: #09090b;      /* Zinc 950 */
  --bg-secondary: #18181b;    /* Zinc 900 */
  --bg-tertiary: #27272a;     /* Zinc 800 */
  --bg-hover: #3f3f46;        /* Zinc 700 */
  --border-color: #27272a;    /* Zinc 800 */
  --border-light: #3f3f46;    /* Zinc 700 */
  
  --text-primary: #ffffff;
  --text-secondary: #d4d4d8;  /* Zinc 300 */
  --text-muted: #71717a;      /* Zinc 500 */
  
  /* Cyan/Teal accent */
  --accent: #06b6d4;          /* Cyan 500 */
  --accent-hover: #22d3ee;    /* Cyan 400 */
  --accent-dark: #0891b2;     /* Cyan 600 */
  --teal: #14b8a6;            /* Teal 500 */
  --teal-dark: #0d9488;       /* Teal 600 */
  
  --success: #10b981;         /* Emerald 500 */
  --warning: #f59e0b;         /* Amber 500 */
  --danger: #ef4444;          /* Red 500 */
  
  /* Gradients */
  --gradient-text: linear-gradient(to right, #22d3ee, #2dd4bf, #22d3ee);
  --gradient-btn: linear-gradient(to right, #0891b2, #0d9488);
  --gradient-btn-hover: linear-gradient(to right, #06b6d4, #14b8a6);
  
  /* Layout */
  --sidebar-width: 260px;
  --header-height: 64px;
  
  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  
  /* Transitions */
  --transition-fast: 100ms ease;
  --transition-normal: 200ms ease;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(6, 182, 212, 0.3);
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button {
  font-family: inherit;
  cursor: pointer;
}

input, select, textarea {
  font-family: inherit;
}

/* ===========================================
   LAYOUT
   =========================================== */

.layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: rgba(24, 24, 27, 0.95);
  border-right: 1px solid rgba(39, 39, 42, 0.6);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.sidebar-header {
  height: var(--header-height);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(39, 39, 42, 0.6);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.sidebar-logo img {
  height: 22px;
  width: auto;
}

.sidebar-logo .logo-brand {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 1.5rem 0;
  overflow-y: auto;
}

.nav-group {
  margin-bottom: 2rem;
}

.nav-group-title {
  padding: 0 1.5rem 0.75rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.75rem 1.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  text-decoration: none;
}

.nav-item.active {
  background: rgba(6, 182, 212, 0.1);
  color: var(--accent);
  border-left-color: var(--accent);
}

.nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.8;
}

.nav-item.active svg {
  opacity: 1;
}

.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 36px;
  height: 36px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
}

.user-details {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Main Content */
.main {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.header {
  height: var(--header-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-title {
  font-size: 1.125rem;
  font-weight: 600;
}

.header-subtitle {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.content {
  flex: 1;
  padding: 2rem;
}

/* ===========================================
   COMPONENTS
   =========================================== */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  border-radius: 0.5rem;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

.btn-primary {
  background: var(--gradient-btn);
  color: white;
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.3);
}

.btn-primary:hover:not(:disabled) {
  background: var(--gradient-btn-hover);
  box-shadow: 0 4px 20px rgba(6, 182, 212, 0.4);
}

.btn-secondary {
  background: rgba(39, 39, 42, 0.6);
  color: var(--text-secondary);
  border: 1px solid rgba(63, 63, 70, 0.6);
  backdrop-filter: blur(4px);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(63, 63, 70, 0.6);
  border-color: rgba(82, 82, 91, 0.6);
}

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

.btn-danger:hover:not(:disabled) {
  background: #dc2626;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.btn-sm {
  padding: 0.5rem 0.875rem;
  font-size: 0.8125rem;
}

.btn-icon {
  padding: 0.5rem;
  border-radius: 0.375rem;
}

/* Cards */
.card {
  background: rgba(24, 24, 27, 0.6);
  border: 1px solid rgba(39, 39, 42, 0.6);
  border-radius: 0.75rem;
  overflow: hidden;
  backdrop-filter: blur(4px);
}

.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(39, 39, 42, 0.6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
}

.card-body {
  padding: 1.5rem;
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1.5rem;
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.stat-icon svg {
  width: 20px;
  height: 20px;
}

.stat-icon.blue { background: rgba(59, 130, 246, 0.15); color: var(--accent); }
.stat-icon.green { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.stat-icon.yellow { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.stat-icon.red { background: rgba(239, 68, 68, 0.15); color: var(--danger); }

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.form-label.required::after {
  content: ' *';
  color: var(--danger);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  background: rgba(24, 24, 27, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  color: var(--text-primary);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  backdrop-filter: blur(4px);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: rgba(6, 182, 212, 0.5);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.form-error {
  font-size: 0.8125rem;
  color: var(--danger);
  margin-top: 0.375rem;
}

.form-hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.375rem;
}

/* Tables */
.table-container {
  overflow-x: auto;
}

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

.table th,
.table td {
  padding: 1rem 1.25rem;
  text-align: left;
}

.table th {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.table td {
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.table tbody tr {
  transition: background var(--transition-fast);
}

.table tbody tr:hover {
  background: var(--bg-tertiary);
}

.table-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-color);
}

.pagination-info {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.pagination-buttons {
  display: flex;
  gap: 0.5rem;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.badge-info {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent);
}

.badge-gray {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.95) translateY(10px);
  transition: transform var(--transition-normal);
}

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

.modal-lg {
  max-width: 720px;
}

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

.modal-title {
  font-size: 1.125rem;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 0.25rem;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-close svg {
  width: 20px;
  height: 20px;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

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

/* Toast */
.toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  min-width: 320px;
  max-width: 420px;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toastIn 0.3s ease;
}

.toast.removing {
  animation: toastOut 0.2s ease forwards;
}

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

@keyframes toastOut {
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

.toast-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon { color: var(--danger); }
.toast-warning .toast-icon { color: var(--warning); }

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 600;
  margin-bottom: 0.125rem;
}

.toast-message {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Loading */
.loading-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--bg-tertiary);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

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

/* Login */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

/* NLS Background Effects */
.login-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.login-bg-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, #09090b, #18181b, #09090b);
}

.login-bg-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.15;
  background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8 8 L8 24 Q8 28 12 28 L16 28 L16 8' stroke='%2306b6d4' stroke-width='1' fill='none' opacity='0.5'/%3E%3C/svg%3E");
  background-size: 40px 40px;
}

.login-bg-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(6,182,212,0.2) 0%, rgba(20,184,166,0.1) 40%, transparent 70%);
  filter: blur(60px);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: rgba(24, 24, 27, 0.8);
  border: 1px solid rgba(39, 39, 42, 0.6);
  border-radius: 1rem;
  padding: 2.5rem;
  position: relative;
  z-index: 1;
  backdrop-filter: blur(12px);
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo-img {
  height: 40px;
  width: auto;
  margin: 0 auto 0.5rem;
}

.login-brand {
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.login-subtitle {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.login-btn {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.875rem 1.5rem;
}

.login-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}

.login-footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(39, 39, 42, 0.6);
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.login-footer-divider {
  margin: 0 0.5rem;
  color: rgba(63, 63, 70, 0.6);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}

.empty-state svg {
  width: 64px;
  height: 64px;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  opacity: 0.5;
}

.empty-state-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.empty-state-text {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

/* Search */
.search-input {
  position: relative;
}

.search-input input {
  padding-left: 2.75rem;
}

.search-input svg {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.tab {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  transition: color var(--transition-fast);
}

.tab:hover {
  color: var(--text-primary);
}

.tab.active {
  color: var(--accent);
}

.tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
}

/* Utilities */
.hidden { display: none !important; }
.text-muted { color: var(--text-secondary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.font-mono { font-family: ui-monospace, 'SF Mono', monospace; font-size: 0.875em; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* Responsive */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .main {
    margin-left: 0;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .header {
    padding: 0 1rem;
  }
  
  .content {
    padding: 1rem;
  }
}
