:root {
  --bg-dark: #090d16;
  --bg-card: rgba(18, 24, 38, 0.7);
  --bg-card-hover: rgba(28, 36, 56, 0.85);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);
  
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.35);
  
  --accent-purple: #a855f7;
  --accent-cyan: #06b6d4;
  --accent-green: #10b981;
  --accent-red: #ef4444;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-sub: #64748b;

  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;

  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;

  --shadow-glow: 0 10px 30px -10px rgba(99, 102, 241, 0.25);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Global */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(168, 85, 247, 0.12) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(6, 182, 212, 0.05) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* Helper Utilities */
.hidden { display: none !important; }
.text-right { text-align: right; }

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

.glass-bar {
  background: rgba(15, 21, 35, 0.75);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass);
}

/* Form Controls & Inputs */
.form-group {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 1rem;
  width: 20px;
  height: 20px;
  color: var(--text-sub);
  pointer-events: none;
  transition: var(--transition);
}

input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  background: rgba(10, 15, 26, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}

input[type="text"]:focus,
input[type="password"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

input[type="text"]:focus + .input-icon,
input[type="password"]:focus + .input-icon {
  color: var(--primary);
}

.icon-btn-inline {
  position: absolute;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--text-sub);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.icon-btn-inline:hover {
  color: var(--text-main);
}

.icon-btn-inline svg {
  width: 18px;
  height: 18px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent-purple) 100%);
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 35px -5px rgba(99, 102, 241, 0.4);
  filter: brightness(1.08);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border-color: var(--border-glass);
}

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

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

.btn-outline:hover {
  background: var(--primary-glow);
  color: #fff;
}

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

.btn-danger:hover {
  background: #dc2626;
}

.btn-sm {
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.btn-full {
  width: 100%;
}

.btn-icon {
  padding: 0.5rem;
  border-radius: var(--radius-sm);
}

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

.btn-arrow {
  width: 18px;
  height: 18px;
  transition: var(--transition);
}

.btn:hover .btn-arrow {
  transform: translateX(4px);
}

/* Alert Box */
.alert-box {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

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

/* AUTHENTICATION VIEW */
.auth-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  padding: 2.5rem;
}

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

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--primary);
  margin-bottom: 1.25rem;
}

.brand-icon {
  width: 18px;
  height: 18px;
}

.auth-header h1 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

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

.auth-footer {
  margin-top: 2rem;
  text-align: center;
}

.security-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--text-sub);
}

.security-badge svg {
  width: 14px;
  height: 14px;
}

/* DASHBOARD VIEW */
.dashboard-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 0.85rem 2rem;
}

.header-content {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.brand-icon-wrapper {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent-purple) 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.brand-icon-wrapper svg {
  width: 22px;
  height: 22px;
}

.brand-text h2 {
  font-size: 1.25rem;
  line-height: 1.2;
}

.brand-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

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

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem 0.35rem 0.4rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
}

.user-avatar {
  width: 28px;
  height: 28px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
}

.dashboard-main {
  max-width: 1280px;
  width: 100%;
  margin: 2rem auto;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.metric-card {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.metric-icon-box {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.metric-icon-box svg {
  width: 26px;
  height: 26px;
}

.metric-icon-box.blue {
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.metric-icon-box.purple {
  background: rgba(168, 85, 247, 0.15);
  color: var(--accent-purple);
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.metric-icon-box.green {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.metric-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.metric-value {
  font-size: 1.5rem;
  margin-top: 0.1rem;
}

.status-active {
  font-size: 1.15rem;
  color: var(--text-muted);
}

.status-active.enabled {
  color: var(--accent-green);
}

/* UPLOAD SECTION */
.upload-section {
  padding: 1.75rem;
}

.upload-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.section-title svg {
  width: 22px;
  height: 22px;
  color: var(--primary);
}

.section-title h3 {
  font-size: 1.25rem;
}

/* Switch Toggle Component */
.quick-drop-toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: 999px;
  cursor: pointer;
}

.toggle-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  user-select: none;
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: var(--transition);
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: var(--transition);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent-green);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* DROP ZONE */
.drop-zone {
  position: relative;
  border: 2px dashed rgba(99, 102, 241, 0.35);
  border-radius: var(--radius-md);
  padding: 3rem 2rem;
  text-align: center;
  background: rgba(10, 16, 28, 0.4);
  transition: var(--transition);
  cursor: pointer;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.08);
  box-shadow: 0 0 25px var(--primary-glow);
}

.file-input {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  opacity: 0;
  cursor: pointer;
}

.drop-icon-cloud {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem auto;
  background: rgba(99, 102, 241, 0.12);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  transition: var(--transition);
}

.drop-zone:hover .drop-icon-cloud {
  transform: scale(1.1);
  background: var(--primary);
  color: #fff;
}

.drop-icon-cloud svg {
  width: 32px;
  height: 32px;
}

.drop-zone-content h4 {
  font-size: 1.15rem;
  margin-bottom: 0.35rem;
}

.drop-zone-content p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

/* Progress Container */
.upload-progress-container {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: rgba(10, 15, 26, 0.7);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
}

.progress-batch-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.progress-bar-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent-purple) 100%);
  border-radius: 999px;
  transition: width 0.2s ease;
}

.individual-progress-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 200px;
  overflow-y: auto;
}

.individual-progress-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.825rem;
  color: var(--text-muted);
  padding: 0.35rem 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
}

/* FILES MANAGER SECTION */
.files-section {
  padding: 1.75rem;
}

.files-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.search-filter-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.search-wrapper {
  width: 280px;
}

.clear-btn {
  position: absolute;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--text-sub);
  font-size: 1.2rem;
  cursor: pointer;
}

/* Table styling */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

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

.files-table th {
  padding: 0.85rem 1rem;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.02);
}

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

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

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

.file-name-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 500;
}

.file-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.12);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.mime-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.action-buttons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}

.empty-state svg {
  width: 64px;
  height: 64px;
  color: var(--text-sub);
  margin-bottom: 1rem;
}

.empty-state h4 {
  font-size: 1.15rem;
  margin-bottom: 0.35rem;
  color: var(--text-main);
}

/* OVERLAY SCREEN (QUICK DROP FALLBACK) */
.overlay-screen {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(9, 13, 22, 0.92);
  backdrop-filter: blur(20px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.overlay-card {
  max-width: 480px;
  width: 100%;
  padding: 3rem 2rem;
  text-align: center;
}

.overlay-icon-success {
  width: 72px;
  height: 72px;
  background: rgba(16, 185, 129, 0.15);
  border: 2px solid var(--accent-green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-green);
  margin: 0 auto 1.5rem auto;
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.3);
}

.overlay-icon-success svg {
  width: 36px;
  height: 36px;
}

.overlay-card h2 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.overlay-msg {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.overlay-notice {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: #a5b4fc;
  margin-bottom: 2rem;
  text-align: left;
}

.overlay-notice svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* MODAL BACKDROP */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-card {
  max-width: 440px;
  width: 100%;
  padding: 2rem;
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.modal-icon-warning {
  width: 42px;
  height: 42px;
  background: rgba(239, 68, 68, 0.15);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-red);
}

.modal-icon-warning svg {
  width: 24px;
  height: 24px;
}

.modal-body p {
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.sub-warning {
  font-size: 0.8rem;
  color: var(--text-sub);
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

/* TOAST NOTIFICATIONS */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  background: rgba(18, 24, 38, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  font-size: 0.875rem;
  animation: toastSlideIn 0.3s ease forwards;
}

.toast-success { border-left: 4px solid var(--accent-green); }
.toast-error { border-left: 4px solid var(--accent-red); }
.toast-info { border-left: 4px solid var(--primary); }

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* RESPONSIVE DESIGN */
@media (max-width: 768px) {
  .dashboard-main { padding: 0 1rem; }
  .upload-header { flex-direction: column; align-items: flex-start; }
  .search-wrapper { width: 100%; }
  .search-filter-box { width: 100%; }
}
