:root {
  --bg: #050915;
  --card: #0b1224;
  --accent: #6ce0ff;
  --accent-2: #a97bff;
  --text: #f4f6fb;
  --muted: #9fb0d1;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at 15% 20%, rgba(108, 224, 255, 0.18), transparent 32%),
    radial-gradient(circle at 85% 0%, rgba(169, 123, 255, 0.16), transparent 35%),
    linear-gradient(180deg, rgba(5, 9, 21, 0.95) 0%, #050915 36%);
  color: var(--text);
  min-height: 100vh;
}


.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 36px 22px 52px;
}

.hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  align-items: center;
  margin-bottom: 32px;
}

.hero-text {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hero h1 {
  font-size: clamp(32px, 4vw, 44px);
  margin: 12px 0;
}

.hero .lede {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 700;
  font-size: 12px;
  margin: 0;
}

.lede {
  font-size: 16px;
}

.hero-card {
  background: linear-gradient(135deg, rgba(108, 224, 255, 0.14), rgba(169, 123, 255, 0.18));
  border: 1px solid var(--border);
  padding: 20px;
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px 16px;
}

.badge {
  background: rgba(77, 208, 225, 0.15);
  color: var(--accent);
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.stat-number {
  margin: 4px 0;
  font-size: 24px;
  font-weight: 700;
}

.content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.card {
  background: rgba(15, 26, 50, 0.9);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.upload-card h2 {
  margin: 0 0 4px 0;
}

.muted {
  color: var(--muted);
  margin: 0;
}

.upload-form {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dropzone {
  border: 1.4px dashed var(--border);
  border-radius: 14px;
  padding: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
  transition: border 0.2s ease, transform 0.2s ease;
  cursor: pointer;
  text-align: center;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0 2px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  font-size: 13px;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--accent);
  box-shadow: 0 8px 30px rgba(108, 224, 255, 0.15);
  transform: translateY(-2px);
}

.drop-icon {
  font-size: 32px;
}

.drop-text {
  margin: 8px 0 4px;
  font-size: 16px;
}

.actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.button {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none;
  color: #061020;
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 10px 24px rgba(77, 208, 225, 0.35);
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.status {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.progress {
  display: flex;
  gap: 12px;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  padding: 10px 12px;
  border-radius: 12px;
}

.progress-track {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #4dd0e1, #8392ff);
  transition: width 0.15s ease;
}

.progress-label {
  margin: 0;
  font-weight: 600;
  color: var(--text);
  min-width: 44px;
  text-align: right;
}
.preview-box {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.preview-thumb {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.preview-note {
  margin: 4px 0 0;
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
}

.results {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.result-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.result-header h3 {
  margin: 6px 0 2px 0;
}

.result-body {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
  align-items: center;
}

.link-box,
.qr-box {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.link-box a {
  color: var(--text);
  word-break: break-all;
  font-weight: 600;
  text-decoration: none;
}

.link-box a:hover {
  color: var(--accent);
}

.qr-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.qr-box img {
  width: 150px;
  height: 150px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.small {
  font-size: 13px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.tab-controls {
  display: inline-flex;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
  margin-top: 16px;
}

.tab-button {
  background: transparent;
  border: none;
  color: var(--muted);
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.tab-button.active {
  background: linear-gradient(135deg, rgba(77, 208, 225, 0.18), rgba(131, 146, 255, 0.2));
  color: var(--text);
}

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

.tab-button[hidden] {
  display: none;
}

.tab-panels {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: grid;
  gap: 1rem;
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
  width: 100%;
}

.subcard {
  background: #121826;
  border: 1px solid #1f2937;
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.panel-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.filters {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filter-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  color: #e5e7eb;
}

.data-table th,
.data-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #1f2937;
}

.data-table th {
  color: #9ca3af;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.8rem;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.table-wrapper {
  overflow-x: auto;
}

.files-table-wrapper {
  max-height: 320px;
  overflow-y: auto;
}

.stat-card {
  background: #0f172a;
  border: 1px solid #1f2937;
  border-radius: 12px;
  padding: 1rem;
}

.notice {
  margin-top: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed var(--border);
  padding: 0.9rem 1rem;
  border-radius: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

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

.badge-danger {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
}

.compact .badge {
  margin-right: 6px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

input[type='text'],
input[type='password'],
input[type='date'] {
  background: #0b1220;
  border: 1px solid #1f2937;
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  color: #e5e7eb;
}

.admin-create {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-create-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  align-items: center;
}

.permissions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pill-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
}

.pill-toggle input {
  accent-color: #4dd0e1;
  width: 16px;
  height: 16px;
}

.admin-upload .dropzone {
  min-height: 200px;
}

.admin-result a {
  color: #60a5fa;
  word-break: break-all;
}

body.modal-open {
  overflow: hidden;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 999;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 16, 32, 0.7);
  backdrop-filter: blur(6px);
}

.modal-card {
  position: relative;
  background: rgba(15, 26, 50, 0.95);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  width: min(480px, 100%);
  z-index: 1;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.ghost-button {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: border 0.2s ease, color 0.2s ease;
}

.ghost-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.footer {
  margin-top: 24px;
  text-align: center;
}

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

  .result-body {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .page {
    padding: 20px 16px 32px;
  }

  .card,
  .hero-card {
    padding: 16px;
  }

  .actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .status {
    font-size: 13px;
  }
}
