/* Nexus Tune Portal - Cyber-Luxe Dark Responsive System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Unbounded:wght@400;600;700;800&display=swap');

:root {
  --bg-main: #07090e;
  --bg-surface: #0e131d;
  --bg-card: rgba(18, 24, 38, 0.75);
  --bg-card-hover: rgba(26, 35, 54, 0.9);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(87, 255, 82, 0.5);
  
  --color-primary: #57ff52;
  --color-primary-glow: rgba(87, 255, 82, 0.25);
  --color-secondary: #00f2fe;
  --color-accent: #00f2fe;
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  
  --badge-live: #10b981;
  --badge-pending: #f59e0b;
  --badge-rejected: #ef4444;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --sidebar-width: 260px;
  --header-height: 70px;
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  width: 100%;
}

/* Ambient Glows */
body::before {
  content: '';
  position: fixed;
  top: -15vw;
  left: 20vw;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, rgba(87, 255, 82, 0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  bottom: -15vw;
  right: 10vw;
  width: 45vw;
  height: 45vw;
  background: radial-gradient(circle, rgba(0, 242, 254, 0.03) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

h1, h2, h3, h4, h5, .brand-font {
  font-family: 'Unbounded', sans-serif;
  letter-spacing: -0.02em;
}

a {
  color: inherit;
  text-decoration: none;
}

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

/* App Layout */
.app-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* Backdrop for Mobile Sidebar - Clean Overlay without page-locking blur */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 99980;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

@media (max-width: 1024px) {
  .sidebar-backdrop.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }
}

@media (min-width: 1025px) {
  .sidebar-backdrop,
  .sidebar-backdrop.active {
    display: none !important;
    pointer-events: none !important;
    opacity: 0 !important;
  }
}

/* Sidebar */
.app-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-surface);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 99999;
  backdrop-filter: blur(16px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.sidebar-close-btn {
  display: none;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
}

.sidebar-close-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 14px 12px 6px;
  letter-spacing: 0.08em;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}

.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
  color: #fff;
  background: rgba(87, 255, 82, 0.12);
  border: 1px solid rgba(87, 255, 82, 0.25);
  box-shadow: 0 0 20px rgba(87, 255, 82, 0.08);
}

.nav-item.active .nav-icon {
  color: var(--color-primary);
}

.nav-icon {
  width: 20px;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  transition: var(--transition);
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--color-primary);
  color: #000;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.nav-badge.danger {
  background: #ef4444;
  color: #fff;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.25);
}

.user-snippet {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1f293d, #374151);
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--color-primary);
  overflow: hidden;
  flex-shrink: 0;
}

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

.user-name {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
}

.user-role-badge {
  font-size: 10px;
  color: var(--color-primary);
  background: rgba(87, 255, 82, 0.1);
  padding: 1px 6px;
  border-radius: 4px;
  display: inline-block;
  text-transform: uppercase;
  font-weight: 600;
}

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

/* Header */
.app-header {
  height: var(--header-height);
  background: rgba(14, 19, 29, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
  gap: 12px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.mobile-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
}

.mobile-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

.page-title {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.header-btn-link {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.03);
  transition: var(--transition);
  white-space: nowrap;
}

.header-btn-link:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

/* Page Body */
.page-body {
  padding: 28px;
  flex: 1;
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
}

/* Alerts */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.alert-success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.alert-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.alert-info {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #60a5fa;
}

/* Metrics Grid */
.grid-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 26px;
  width: 100%;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  transition: var(--transition);
}

.metric-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.metric-icon-box {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 14px;
}

.icon-green {
  background: rgba(87, 255, 82, 0.12);
  color: var(--color-primary);
  border: 1px solid rgba(87, 255, 82, 0.3);
}

.icon-cyan {
  background: rgba(0, 242, 254, 0.12);
  color: var(--color-secondary);
  border: 1px solid rgba(0, 242, 254, 0.3);
}

.icon-purple,
.icon-blue {
  background: rgba(0, 242, 254, 0.12);
  color: var(--color-secondary);
  border: 1px solid rgba(0, 242, 254, 0.3);
}

.icon-amber {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.metric-label {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 4px;
}

.metric-value {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  font-family: 'Unbounded', sans-serif;
  word-break: break-all;
}

.metric-sub {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.trend-up {
  color: var(--color-primary);
}

/* Glass Card */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(10px);
  margin-bottom: 26px;
  width: 100%;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.card-title {
  font-size: 15.5px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Responsive Grid Layouts */
.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-items: start;
}

.grid-split-view {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 22px;
  align-items: start;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-primary);
  color: #0d0e12;
  box-shadow: 0 4px 15px var(--color-primary-glow);
}

.btn-primary:hover {
  background: #6eff69;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(87, 255, 82, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.3);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

/* Forms */
.form-group {
  margin-bottom: 18px;
  width: 100%;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 7px;
  color: #e5e7eb;
}

.form-control {
  width: 100%;
  padding: 12px 14px;
  background: rgba(10, 15, 24, 0.85);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 13.5px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(87, 255, 82, 0.15);
  background: rgba(15, 22, 35, 0.95);
}

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

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
  min-width: 600px;
}

.table th {
  padding: 13px 15px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--text-dim);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

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

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

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
  white-space: nowrap;
}

.badge-live {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-pending {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-rejected {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-admin {
  background: rgba(0, 242, 254, 0.12);
  color: var(--color-secondary);
  border: 1px solid rgba(0, 242, 254, 0.3);
}

/* Auth Cards */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  position: relative;
  z-index: 1;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: rgba(15, 20, 32, 0.9);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.auth-title {
  font-size: 21px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

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

.demo-credentials {
  margin-top: 22px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  font-size: 12px;
}

.demo-btn-group {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.demo-btn-group .btn {
  flex: 1;
  min-width: 130px;
}

/* ==========================================================================
   Responsive Breakpoints & Mobile Touch Ergonomics
   ========================================================================== */

/* Tablet & Smaller Laptops (<= 1024px) */
@media (max-width: 1024px) {
  .app-sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }
  
  .app-sidebar.open {
    transform: translateX(0);
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.9);
  }

  .sidebar-close-btn {
    display: flex;
  }

  .app-main {
    margin-left: 0;
  }

  .mobile-toggle {
    display: flex;
  }

  .page-body {
    padding: 22px 18px;
  }

  .app-header {
    padding: 0 18px;
  }

  .grid-2col {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .grid-split-view {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

/* Mobile Phones (<= 768px) */
@media (max-width: 768px) {
  .page-title {
    font-size: 15px;
  }

  .header-btn-link span {
    display: none;
  }

  .header-btn-link {
    padding: 7px 10px;
  }

  .grid-metrics {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .metric-card {
    padding: 16px;
  }

  .metric-value {
    font-size: 20px;
  }

  .glass-card {
    padding: 18px 14px;
    border-radius: var(--radius-md);
  }

  .card-header {
    margin-bottom: 16px;
  }

  .card-title {
    font-size: 14.5px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .auth-card {
    padding: 28px 18px;
    border-radius: var(--radius-md);
  }

  .auth-title {
    font-size: 19px;
  }
}

/* Small Phones (<= 480px) */
@media (max-width: 480px) {
  .grid-metrics {
    grid-template-columns: 1fr;
  }

  .page-body {
    padding: 16px 12px;
  }

  .app-header {
    padding: 0 12px;
  }

  .btn {
    padding: 9px 14px;
    font-size: 12.5px;
  }
}
