/* ═══════════════════════════════════════════════════════════
   QR FORGE — Premium Dark UI
   Aesthetic: Cyber-sleek with electric cyan accents on 
   deep obsidian surfaces. Sharp, precise, futuristic.
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&display=swap');

/* ─── Design Tokens ─── */
:root {
  /* Surfaces */
  --bg-root: #050508;
  --bg-sidebar: #08080c;
  --bg-card: #0c0c12;
  --bg-card-hover: #111118;
  --bg-input: #0a0a10;
  --bg-modal-overlay: rgba(0, 0, 0, 0.75);

  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-input: rgba(255, 255, 255, 0.1);
  --border-input-focus: #00e5ff;

  /* Text */
  --text-primary: #f0f0f5;
  --text-secondary: #7a7a8e;
  --text-tertiary: #4a4a5e;
  --text-inverse: #050508;

  /* Accents */
  --cyan: #00e5ff;
  --cyan-dim: rgba(0, 229, 255, 0.15);
  --cyan-glow: rgba(0, 229, 255, 0.4);
  --green: #3ddc84;
  --green-dim: rgba(61, 220, 132, 0.15);
  --emerald: #10b981;
  --emerald-dim: rgba(16, 185, 129, 0.15);
  --blue: #007aff;
  --blue-dim: rgba(0, 122, 255, 0.15);
  --red: #ff3b5c;
  --red-dim: rgba(255, 59, 92, 0.15);
  --amber: #f59e0b;
  --amber-dim: rgba(245, 158, 11, 0.15);

  /* Spacing */
  --sidebar-width: 260px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Transitions */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

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

body {
  font-family: 'DM Sans', -apple-system, sans-serif;
  background: var(--bg-root);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* Noise texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input { font-family: inherit; }

/* ═══════════════════════════════════════════════════════════
   LOGIN SCREEN
   ═══════════════════════════════════════════════════════════ */
.login-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-root);
  z-index: 10000;
  padding: 20px;
}

.login-screen.hidden {
  display: none;
}

.login-container {
  width: 100%;
  max-width: 420px;
  animation: loginAppear 0.6s var(--ease-out) both;
}

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

.login-brand {
  text-align: center;
  margin-bottom: 48px;
}

.login-brand-icon {
  width: 72px;
  height: 72px;
  background: var(--cyan-dim);
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  color: var(--cyan);
  position: relative;
}

.login-brand-icon::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 24px;
  background: radial-gradient(circle, var(--cyan-glow), transparent 70%);
  opacity: 0.3;
  animation: iconPulse 3s ease-in-out infinite;
}

@keyframes iconPulse {
  0%, 100% { opacity: 0.2; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.05); }
}

.login-brand h1 {
  font-family: 'Syne', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--cyan), #00b8d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-brand p {
  color: var(--text-secondary);
  margin-top: 6px;
  font-size: 0.9rem;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 36px;
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
}

.login-card h2 {
  font-family: 'Syne', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.login-card .login-subtitle {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 28px;
}

.login-error {
  background: var(--red-dim);
  border: 1px solid rgba(255, 59, 92, 0.3);
  color: var(--red);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 20px;
  display: none;
}

.login-error.show {
  display: block;
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* ═══════════════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.3s var(--ease-out);
}

.sidebar-brand {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: var(--cyan-dim);
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cyan);
  flex-shrink: 0;
}

.brand-name {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.3px;
  background: linear-gradient(135deg, var(--text-primary), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s var(--ease-out);
  position: relative;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--cyan-dim);
  color: var(--cyan);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--cyan);
  border-radius: 0 3px 3px 0;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-subtle);
}

.stats-mini {
  display: flex;
  gap: 16px;
}

.stat-mini-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-mini-value {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--cyan);
}

.stat-mini-label {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ═══════════════════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════════════════ */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  padding: 32px 40px;
  position: relative;
}

/* Mobile header */
.mobile-header {
  display: none;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.menu-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-name-mobile {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--cyan);
}

/* Page handling */
.page {
  display: none;
  animation: pageIn 0.4s var(--ease-out) both;
}

.page.active {
  display: block;
}

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

/* Page header */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  border: none;
  transition: all 0.2s var(--ease-out);
  white-space: nowrap;
}

.btn-primary {
  background: var(--cyan);
  color: var(--text-inverse);
}

.btn-primary:hover {
  background: #00d4ec;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--cyan-glow);
}

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

.btn-glow {
  box-shadow: 0 0 20px var(--cyan-dim);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-danger {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(255, 59, 92, 0.2);
}

.btn-danger:hover {
  background: rgba(255, 59, 92, 0.25);
  box-shadow: 0 4px 20px rgba(255, 59, 92, 0.2);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ═══════════════════════════════════════════════════════════
   FORM ELEMENTS
   ═══════════════════════════════════════════════════════════ */
.form-group {
  margin-bottom: 24px;
}

.form-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.form-label svg {
  color: var(--text-tertiary);
}

.optional-tag {
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-tertiary);
  background: rgba(255, 255, 255, 0.04);
  padding: 2px 8px;
  border-radius: 20px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: all 0.2s var(--ease-out);
  outline: none;
}

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

.form-input:focus {
  border-color: var(--border-input-focus);
  box-shadow: 0 0 0 3px var(--cyan-dim), 0 0 20px rgba(0, 229, 255, 0.1);
}

.form-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: 6px;
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
}

/* ═══════════════════════════════════════════════════════════
   STAT CARDS
   ═══════════════════════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.3s var(--ease-out);
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.15;
  transition: opacity 0.3s;
}

.stat-card:hover {
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.stat-card:hover::after {
  opacity: 0.25;
}

.stat-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-card-icon.cyan {
  background: var(--cyan-dim);
  color: var(--cyan);
}
.stat-card:has(.stat-card-icon.cyan)::after { background: var(--cyan); }

.stat-card-icon.green {
  background: var(--green-dim);
  color: var(--green);
}
.stat-card:has(.stat-card-icon.green)::after { background: var(--green); }

.stat-card-icon.emerald {
  background: var(--emerald-dim);
  color: var(--emerald);
}
.stat-card:has(.stat-card-icon.emerald)::after { background: var(--emerald); }

.stat-card-icon.blue {
  background: var(--blue-dim);
  color: var(--blue);
}
.stat-card:has(.stat-card-icon.blue)::after { background: var(--blue); }

.stat-card-value {
  font-family: 'Syne', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: block;
}

.stat-card-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  display: block;
  margin-top: 2px;
}

/* ═══════════════════════════════════════════════════════════
   DATA TABLE
   ═══════════════════════════════════════════════════════════ */
.table-container {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 12px;
}

.table-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
}

.table-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  color: var(--text-tertiary);
  transition: border-color 0.2s;
}

.table-search:focus-within {
  border-color: var(--cyan);
}

.table-search input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.85rem;
  width: 180px;
}

.table-search input::placeholder {
  color: var(--text-tertiary);
}

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

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

.data-table thead th {
  text-align: left;
  padding: 12px 20px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.data-table tbody tr {
  transition: background 0.15s;
}

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

.data-table tbody td {
  padding: 14px 20px;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

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

/* Cell styles */
.cell-name {
  font-weight: 600;
  color: var(--text-primary);
}

.cell-code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.82rem;
  background: rgba(0, 229, 255, 0.08);
  color: var(--cyan);
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-block;
}

.cell-scan {
  font-weight: 600;
  font-family: 'Syne', sans-serif;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-badge.active {
  background: var(--green-dim);
  color: var(--green);
}

.status-badge.inactive {
  background: var(--red-dim);
  color: var(--red);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.cell-date {
  color: var(--text-secondary);
  font-size: 0.82rem;
}

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

.action-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: all 0.2s;
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
}

.action-btn.danger:hover {
  background: var(--red-dim);
  color: var(--red);
  border-color: rgba(255, 59, 92, 0.3);
}

.action-btn.view-btn:hover {
  background: var(--cyan-dim);
  color: var(--cyan);
  border-color: rgba(0, 229, 255, 0.3);
}

/* Empty & Loading States */
.empty-state,
.loading-state {
  padding: 60px 20px;
  text-align: center;
}

.empty-icon {
  color: var(--text-tertiary);
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h3 {
  font-family: 'Syne', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.loader {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

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

.loading-state p {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* ═══════════════════════════════════════════════════════════
   CREATE PAGE LAYOUT
   ═══════════════════════════════════════════════════════════ */
.create-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 32px;
  align-items: start;
}

.create-form-container {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px;
}

.create-form {
  max-width: 560px;
}

/* QR Preview Panel */
.qr-preview-panel {
  position: sticky;
  top: 32px;
}

.preview-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.preview-card::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 50%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
}

.preview-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 20px;
  color: var(--text-secondary);
}

.qr-image-container {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 20px;
  display: inline-block;
  margin-bottom: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.qr-image-container img {
  width: 200px;
  height: 200px;
  display: block;
}

.preview-name {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 8px;
}

.preview-url {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.78rem;
  color: var(--cyan);
  background: var(--cyan-dim);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  word-break: break-all;
  margin-bottom: 20px;
}

.preview-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ═══════════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-modal-overlay);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease-out);
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.3s var(--ease-spring);
  position: relative;
}

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

.modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 30%;
  right: 30%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 0;
}

.modal-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
}

.modal-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--red-dim);
  color: var(--red);
  border-color: rgba(255, 59, 92, 0.3);
}

.modal-body {
  padding: 24px 28px 28px;
}

/* Modal detail view */
.detail-qr-section {
  text-align: center;
  margin-bottom: 24px;
}

.detail-qr-img {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 16px;
  display: inline-block;
  margin-bottom: 16px;
}

.detail-qr-img img {
  width: 160px;
  height: 160px;
  display: block;
}

.detail-info-grid {
  display: grid;
  gap: 16px;
}

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

.detail-info-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-info-value {
  font-size: 0.9rem;
  color: var(--text-primary);
  word-break: break-all;
}

.detail-info-value a {
  color: var(--cyan);
  transition: opacity 0.2s;
}

.detail-info-value a:hover {
  opacity: 0.8;
}

.detail-scans-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 8px;
}

.detail-scan-item {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
}

.detail-scan-value {
  font-family: 'Syne', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  display: block;
}

.detail-scan-label {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-top: 2px;
}

.detail-scan-item.android .detail-scan-value { color: var(--green); }
.detail-scan-item.ios .detail-scan-value { color: var(--blue); }
.detail-scan-item.other .detail-scan-value { color: var(--amber); }

.detail-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
}

/* ═══════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  min-width: 300px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  animation: toastIn 0.35s var(--ease-spring) both;
  position: relative;
  overflow: hidden;
}

.toast::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
}

.toast.success::before { background: var(--green); }
.toast.error::before { background: var(--red); }
.toast.info::before { background: var(--cyan); }

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

.toast.success .toast-icon { color: var(--green); }
.toast.error .toast-icon { color: var(--red); }
.toast.info .toast-icon { color: var(--cyan); }

.toast-message {
  font-size: 0.88rem;
  font-weight: 500;
}

.toast-close {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-tertiary);
  padding: 4px;
  cursor: pointer;
  transition: color 0.2s;
}

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

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(40px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.toast.removing {
  animation: toastOut 0.3s var(--ease-out) forwards;
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateX(40px) scale(0.95);
  }
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .create-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 8px 0 40px rgba(0, 0, 0, 0.5);
  }

  .main-content {
    margin-left: 0;
    padding: 20px;
  }

  .mobile-header {
    display: flex;
  }

  .page-header {
    flex-direction: column;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .table-search input {
    width: 120px;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .detail-scans-row {
    grid-template-columns: 1fr;
  }

  .detail-actions {
    flex-direction: column;
  }

  .detail-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

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

/* ═══════════════════════════════════════════════════════════
   SCROLLBAR
   ═══════════════════════════════════════════════════════════ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Selection */
::selection {
  background: var(--cyan);
  color: var(--text-inverse);
}
