:root {
  --bg-primary: #0a0c10;
  --bg-card: rgba(18, 22, 31, 0.75);
  --bg-card-hover: rgba(24, 30, 42, 0.85);
  --border-color: rgba(255, 255, 255, 0.1);
  --border-focus: #4f46e5;
  --primary-accent: #6366f1;
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --success-color: #10b981;
  --error-color: #ef4444;
  --warning-color: #f59e0b;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.background-decor {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.25;
}

.blob-1 {
  width: 450px;
  height: 450px;
  background: #6366f1;
  top: -100px;
  right: -50px;
}

.blob-2 {
  width: 500px;
  height: 500px;
  background: #a855f7;
  bottom: -150px;
  left: -100px;
}

.app-container {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

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

.logo-icon {
  font-size: 1.8rem;
  background: var(--primary-gradient);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.brand-text h1 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  padding: 2px 8px;
  border-radius: 99px;
  border: 1px solid rgba(99, 102, 241, 0.4);
  letter-spacing: 0.05em;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: 99px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
}

.status-dot.online {
  background: var(--success-color);
  box-shadow: 0 0 10px var(--success-color);
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.card-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.card-header p {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 1.5rem;
  line-height: 1.4;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

/* Dropzone */
.dropzone {
  border: 2px dashed rgba(99, 102, 241, 0.4);
  background: rgba(99, 102, 241, 0.03);
  border-radius: var(--radius-md);
  padding: 2.5rem 1.5rem;
  text-align: center;
  transition: all 0.25s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--primary-accent);
  background: rgba(99, 102, 241, 0.08);
  transform: translateY(-2px);
}

.dropzone-icon {
  color: var(--primary-accent);
}

.dropzone-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.primary-prompt {
  font-weight: 600;
  font-size: 0.95rem;
}

.secondary-prompt {
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* Buttons */
.btn {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: var(--primary-gradient);
  color: white;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

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

.btn-icon {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  padding: 8px;
  border-radius: var(--radius-sm);
}

.btn-icon:hover {
  color: white;
  background: rgba(255, 255, 255, 0.12);
}

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

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

/* Paste accordion */
.paste-section {
  margin-top: 1.5rem;
}

.accordion-toggle {
  background: none;
  border: none;
  color: var(--primary-accent);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
}

.accordion-toggle:hover {
  text-decoration: underline;
}

.accordion-content {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-input, .form-textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.form-input:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary-accent);
}

/* Alert box */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-top: 1rem;
  font-size: 0.88rem;
  line-height: 1.4;
}

.alert.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

.alert.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

/* Files List */
.files-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}

.files-list::-webkit-scrollbar {
  width: 6px;
}

.files-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 99px;
}

.file-item {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
}

.file-item:hover {
  border-color: rgba(99, 102, 241, 0.5);
  background: var(--bg-card-hover);
}

.file-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.file-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-main);
  word-break: break-all;
}

.file-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
}

.cookie-tag {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.file-actions {
  display: flex;
  gap: 6px;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.subtext {
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-card {
  background: #11141c;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 700px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

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

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

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

.modal-body pre {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #a5b4fc;
  white-space: pre-wrap;
  word-break: break-all;
}

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

.hidden {
  display: none !important;
}

/* Header Right Layout */
.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.admin-profile-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.4);
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 0.85rem;
  color: #e9d5ff;
}

.admin-email-text {
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.btn-logout {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  margin-left: 4px;
  transition: all 0.2s ease;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.4);
  color: white;
}

/* ==========================================================================
   Admin Portal Overlay & Card (Matches User Reference Design)
   ========================================================================== */

.admin-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(8, 6, 16, 0.92);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 1.5rem;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.admin-card {
  width: 100%;
  max-width: 440px;
  background: #0f0c1d;
  border: 2px solid #8b5cf6;
  border-radius: 24px;
  padding: 2.5rem 2.25rem;
  box-shadow: 
    0 0 40px rgba(139, 92, 246, 0.35),
    0 20px 60px rgba(0, 0, 0, 0.8);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  animation: adminCardPop 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes adminCardPop {
  0% {
    opacity: 0;
    transform: scale(0.92) translateY(20px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.admin-card-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.shield-badge {
  width: 64px;
  height: 64px;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.4);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c084fc;
  margin-bottom: 1.25rem;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.25);
}

.admin-card-header h2 {
  font-size: 1.85rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}

.admin-card-header .subtitle {
  font-size: 0.92rem;
  color: #94a3b8;
  font-weight: 500;
}

/* Form Styles */
#adminLoginForm {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: -0.01em;
}

.input-wrapper {
  position: relative;
}

.admin-input {
  width: 100%;
  background: #17132a;
  border: 1px solid #2d234d;
  border-radius: 14px;
  padding: 14px 18px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: #f8fafc;
  transition: all 0.2s ease;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.admin-input::placeholder {
  color: #64748b;
}

.admin-input:focus {
  outline: none;
  border-color: #a855f7;
  background: #1d1836;
  box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.2);
}

.admin-alert {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  text-align: center;
}

/* Authenticate Button */
.btn-authenticate {
  width: 100%;
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
  border: none;
  border-radius: 14px;
  padding: 15px 24px;
  font-weight: 700;
  font-size: 1rem;
  font-family: var(--font-sans);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.45);
  transition: all 0.25s ease;
  margin-top: 0.5rem;
}

.btn-authenticate:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(139, 92, 246, 0.6);
  background: linear-gradient(135deg, #9333ea 0%, #7e22ce 100%);
}

.btn-authenticate:active {
  transform: translateY(0);
}

.btn-authenticate:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.admin-footer-note {
  text-align: center;
  font-size: 0.78rem;
  color: #64748b;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 1rem;
  margin-top: -0.5rem;
}

.admin-footer-note code {
  color: #c084fc;
  background: rgba(139, 92, 246, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
}

/* User Management Table & Form Styles */
.add-user-container {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  animation: fadeIn 0.3s ease;
}

.add-user-grid {
  display: grid;
  grid-template-columns: 2fr 1.5fr 1fr 1fr auto;
  gap: 1rem;
  align-items: end;
}

@media (max-width: 900px) {
  .add-user-grid {
    grid-template-columns: 1fr;
  }
}

.form-actions-inline {
  display: flex;
  gap: 8px;
}

.users-table-container {
  overflow-x: auto;
  margin-top: 1rem;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.users-table th, .users-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}

.users-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(0, 0, 0, 0.2);
}

.users-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.user-email-cell {
  font-weight: 600;
  color: var(--text-main);
}

.user-pass-code {
  font-family: var(--font-mono);
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 6px;
  border-radius: 4px;
  color: #a5b4fc;
  font-size: 0.8rem;
}

.days-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 99px;
  font-weight: 700;
  font-size: 0.75rem;
}

.days-pill.active {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.days-pill.expired {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.device-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(99, 102, 241, 0.15);
  color: #c7d2fe;
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 3px 8px;
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 600;
}

.device-pill.full {
  background: rgba(245, 158, 11, 0.15);
  color: #fde68a;
  border-color: rgba(245, 158, 11, 0.4);
}

.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.status-badge.active {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.status-badge.blocked {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.user-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-sm {
  padding: 4px 8px;
  font-size: 0.75rem;
}

.text-center {
  text-align: center;
  color: var(--text-muted);
}

