/* Letter Play - QR Code Ticket Studio, Print Engine & Admin Hub */
@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;600;700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
  --bg-gradient: linear-gradient(135deg, #090d16 0%, #0f172a 40%, #172554 100%);
  --panel-bg: rgba(30, 41, 59, 0.7);
  --panel-border: rgba(255, 255, 255, 0.12);
  --panel-glow: rgba(99, 102, 241, 0.15);
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --accent-gold: #f59e0b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --success: #10b981;
  --danger: #ef4444;
  --radius-card: 16px;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  padding: 24px;
  background-attachment: fixed;
}

/* ========================================================
   1. LOGIN OVERLAY GATE
   ======================================================== */
.login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 13, 22, 0.88);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}

.login-card {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  padding: 36px 32px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 40px var(--panel-glow);
  animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

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

.login-logo {
  width: 58px;
  height: 58px;
  object-fit: contain;
  background: white;
  padding: 6px;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  margin-bottom: 12px;
}

.login-title {
  font-family: 'Fredoka', cursive, sans-serif;
  font-size: 26px;
  font-weight: 700;
  background: linear-gradient(135deg, #fbbf24 0%, #f43f5e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.login-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 18px;
  font-weight: 500;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.form-group input {
  font-family: inherit;
  font-size: 14px;
  color: white;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 11px 14px;
  outline: none;
  transition: all 0.2s;
}

.form-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.login-actions {
  margin-top: 8px;
}

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

.login-hint {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
  color: var(--text-muted);
}

.btn-text {
  background: none;
  border: none;
  color: #818cf8;
  cursor: pointer;
  font-weight: 600;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
}
.btn-text:hover {
  text-decoration: underline;
}

/* ========================================================
   2. DASHBOARD MAIN LAYOUT & HEADER
   ======================================================== */
.dashboard-wrapper {
  max-width: 1400px;
  margin: 0 auto;
}

.studio-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  background: var(--panel-bg);
  backdrop-filter: blur(14px);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  padding: 16px 24px;
  margin-bottom: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 14px;
}

.studio-brand-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  background: #ffffff;
  padding: 4px;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  display: block;
}

.brand-title {
  font-family: 'Fredoka', cursive, sans-serif;
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, #fbbf24 0%, #f43f5e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

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

.session-user-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: #cbd5e1;
}

.user-avatar-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

/* ========================================================
   3. BUTTON STYLES
   ======================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  line-height: 1;
}

.btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-print {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}
.btn-print:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}

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

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.btn-ghost:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}

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

.btn-lg {
  padding: 14px 24px;
  font-size: 15px;
  border-radius: 12px;
}

/* ========================================================
   4. STATS BANNER
   ======================================================== */
.stats-banner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
}
.stat-card:hover {
  transform: translateY(-2px);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.stat-meta {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.stat-val {
  font-size: 24px;
  font-weight: 700;
  color: white;
  margin-top: 2px;
  font-family: 'Fredoka', sans-serif;
}

/* ========================================================
   5. TAB NAVIGATION BAR
   ======================================================== */
.tabs-nav {
  display: flex;
  gap: 8px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 6px;
  margin-bottom: 22px;
  overflow-x: auto;
}

.tab-nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.tab-nav-btn:hover {
  color: white;
  background: rgba(255, 255, 255, 0.05);
}

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

.tab-pane {
  display: none;
  animation: fadeIn 0.25s ease;
}
.tab-pane.active {
  display: block;
}

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

/* ========================================================
   6. SUB CONTROLS & COMPACT FIELDS
   ======================================================== */
.sub-controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 12px 20px;
  margin-bottom: 18px;
}

.sub-controls-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.field-compact {
  display: flex;
  align-items: center;
  gap: 8px;
}

.field-compact label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.field-compact select,
.field-compact input {
  font-family: inherit;
  font-size: 13px;
  color: white;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 6px 12px;
  outline: none;
  cursor: pointer;
  transition: border 0.2s;
}
.field-compact select:focus,
.field-compact input:focus {
  border-color: var(--primary);
}

/* ========================================================
   7. PAGINATION BAR (CARDS & TABLES)
   ======================================================== */
.pagination-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 12px 20px;
  margin-top: 20px;
}

.pagination-info {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pg-btn {
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.pg-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}
.pg-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.pg-numbers {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pg-num {
  min-width: 32px;
  height: 30px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.pg-num:hover {
  background: rgba(255, 255, 255, 0.1);
}
.pg-num.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.pg-ellipsis {
  padding: 0 4px;
  color: var(--text-muted);
  font-size: 12px;
}

.pagination-jump,
.pagination-pagesize {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}
.pagination-jump input,
.pagination-pagesize select {
  width: 60px;
  padding: 5px 8px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: white;
  font-size: 12px;
  outline: none;
}

/* ========================================================
   8. PRINT SHEET CONTAINER & CARDS GRID
   ======================================================== */
.sheet-container {
  background: white;
  color: #0f172a;
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  max-width: 1200px;
  margin: 0 auto;
}

.sheet-info-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 14px;
  margin-bottom: 20px;
}

.sheet-meta-title {
  font-size: 17px;
  font-weight: 700;
  color: #1e293b;
}

.sheet-meta-subtitle {
  font-size: 12px;
  color: #64748b;
  display: block;
  margin-top: 2px;
}

.sheet-meta-count {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  background: #f1f5f9;
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (min-width: 960px) {
  .cards-grid.layout-3x3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Individual Physical Ticket Card */
.ticket-card {
  position: relative;
  background: #ffffff;
  border: 2px dashed #94a3b8;
  border-radius: 16px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  page-break-inside: avoid;
  break-inside: avoid;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.ticket-card:hover {
  border-color: #6366f1;
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.12);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1.5px solid #e2e8f0;
  padding-bottom: 10px;
  margin-bottom: 12px;
}

.card-brand-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-brand-mark-wrap {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #4C6FFF 0%, #3451db 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-brand-mark-img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: block;
}

.card-brand-title {
  font-family: 'Fredoka', cursive, sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #1e1b4b;
  line-height: 1.2;
}

.card-brand-subtitle {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #d97706;
}

.card-batch-tag {
  font-size: 9px;
  font-weight: 700;
  background: #f1f5f9;
  color: #475569;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  text-transform: uppercase;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-main {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.qr-code-frame {
  flex-shrink: 0;
  width: 110px;
  height: 110px;
  background: white;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}
.qr-code-frame img,
.qr-code-frame svg {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.card-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.serial-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 4px 8px;
  width: fit-content;
}
.serial-label {
  font-size: 9px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
}
.serial-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: 0.5px;
}

.code-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  padding: 4px 8px;
  width: fit-content;
}
.code-label {
  font-size: 9px;
  font-weight: 700;
  color: #2563eb;
  text-transform: uppercase;
}
.code-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  color: #1d4ed8;
  letter-spacing: 0.5px;
}

.card-instruction {
  font-size: 10px;
  color: #64748b;
  line-height: 1.35;
  margin-top: 2px;
}

.card-bottom {
  border-top: 1.5px solid #e2e8f0;
  padding-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.security-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 9px;
  font-weight: 600;
  color: #059669;
}

.device-lock-note {
  font-size: 9px;
  font-weight: 600;
  color: #b45309;
}

.cut-mark {
  position: absolute;
  top: -8px;
  right: 12px;
  font-size: 11px;
  color: #94a3b8;
  background: white;
  padding: 0 4px;
}

/* ========================================================
   9. TABLE VIEW & FILTER TOOLBAR
   ======================================================== */
.table-controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 14px 20px;
  margin-bottom: 18px;
}

.table-search-group {
  position: relative;
  flex: 1;
  min-width: 280px;
  max-width: 460px;
}

.table-search-group input {
  width: 100%;
  font-family: inherit;
  font-size: 13px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 9px 36px 9px 36px;
  color: white;
  outline: none;
  transition: all 0.2s;
}
.table-search-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.btn-clear-search {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}

.table-filters-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.table-container {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  overflow-x: auto;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.data-table th {
  padding: 14px 16px;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--panel-border);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  background: rgba(15, 23, 42, 0.5);
  white-space: nowrap;
}

.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  vertical-align: middle;
}

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

.ip-pill {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.ip-pill.unbound {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* ========================================================
   10. BULK GENERATOR PANEL
   ======================================================== */
.generator-panel-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.generator-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 24px;
}

.panel-card-title {
  font-family: 'Fredoka', cursive, sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: white;
}

.panel-card-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
  max-width: 650px;
}

.badge-turbo {
  background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  color: white;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.generator-presets-wrap {
  margin-bottom: 24px;
}

.preset-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

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

.btn-preset {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-preset:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}
.btn-preset.active {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  border-color: #818cf8;
  color: white;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.generator-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-help {
  font-size: 11px;
  color: #64748b;
}

.generator-form-submit {
  grid-column: 1 / -1;
  margin-top: 10px;
}

.gen-progress-box {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 14px;
  padding: 16px 20px;
  margin-top: 24px;
  animation: fadeIn 0.3s ease;
}

.gen-progress-box h4 {
  font-size: 15px;
  color: #c7d2fe;
}
.gen-progress-box p {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 2px;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(99, 102, 241, 0.2);
  border-top-color: #818cf8;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========================================================
   11. MULTI-USER MANAGEMENT VIEW
   ======================================================== */
.users-view-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 24px;
}

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

.user-create-card,
.user-list-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.card-section-title {
  font-size: 17px;
  font-weight: 700;
  color: white;
}

.card-section-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  margin-bottom: 20px;
}

.create-user-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.user-list-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

/* Toast Message */
.toast-msg {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e1b4b;
  color: white;
  border: 1px solid #6366f1;
  padding: 12px 22px;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  font-size: 14px;
  font-weight: 600;
  display: none;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 99999;
}

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

/* ========================================================
   11. PRINT MODALS & MULTI-PAGE CONTROLS
   ======================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(9, 13, 22, 0.88);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  animation: fadeIn 0.25s ease;
}

.modal-card {
  background: #1e293b;
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  width: 100%;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.print-modal-card {
  max-width: 580px;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 22px;
  color: var(--text-main);
}

.modal-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

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

.modal-body {
  padding: 24px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  background: rgba(15, 23, 42, 0.5);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.print-summary-box {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 20px;
}

.summary-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.summary-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.summary-item strong {
  font-size: 14px;
  color: var(--text-main);
}

.print-scope-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.scope-radio-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: rgba(30, 41, 59, 0.6);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.scope-radio-card:hover {
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(30, 41, 59, 0.9);
}

.scope-radio-card.active,
.scope-radio-card:has(input:checked) {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.12);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.15);
}

.scope-radio-card input[type="radio"] {
  accent-color: var(--primary);
  margin-top: 3px;
  width: 18px;
  height: 18px;
}

.scope-radio-content {
  flex: 1;
}

.scope-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 15px;
  color: var(--text-main);
}

.scope-badge {
  font-size: 10px;
  background: var(--primary);
  color: #fff;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.scope-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.4;
}

/* Print Progress Loader Card */
.print-progress-card {
  max-width: 440px;
  padding: 32px 28px;
  text-align: center;
}

.spinner-large {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(99, 102, 241, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.progress-header h3 {
  font-family: 'Fredoka', sans-serif;
  font-size: 20px;
  color: var(--text-main);
  margin-bottom: 6px;
}

.progress-header p {
  font-size: 13px;
  color: var(--text-muted);
}

.progress-bar-wrap {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  height: 12px;
  overflow: hidden;
  margin: 20px 0 10px 0;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #a855f7);
  border-radius: 10px;
  transition: width 0.2s ease;
}

.progress-stats {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

/* Print Status Banner */
.print-status-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(168, 85, 247, 0.15));
  border: 1.5px solid var(--primary);
  border-radius: 16px;
  padding: 14px 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.25);
  animation: fadeIn 0.3s ease;
}

.print-status-content {
  display: flex;
  align-items: center;
  gap: 14px;
}

.print-status-icon {
  font-size: 28px;
}

.print-status-content strong {
  font-size: 15px;
  color: #fff;
}

.print-status-content p {
  font-size: 12.5px;
  color: #cbd5e1;
  margin-top: 2px;
}

.print-status-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.cards-grid.print-mode-multi {
  display: block !important;
}

/* Print Sheet Page Wrapper (Screen View) */
.print-sheet-page {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 2px dashed #cbd5e1;
  position: relative;
}

.print-sheet-page::before {
  content: attr(data-sheet-label);
  grid-column: 1 / -1;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  background: rgba(15, 23, 42, 0.6);
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-block;
  margin-bottom: 4px;
}

/* ========================================================
   12. PRINT STYLES: Flawless Multi-Page A4 Printing
   ======================================================== */
@media print {
  @page {
    size: A4 portrait;
    margin: 6mm 8mm;
  }

  body {
    background: white !important;
    color: black !important;
    padding: 0 !important;
  }

  .login-overlay,
  .studio-header,
  .stats-banner,
  .tabs-nav,
  .sub-controls-bar,
  .pagination-bar,
  .table-controls-bar,
  .toast-msg,
  .no-print,
  .modal-backdrop,
  .print-status-banner,
  .sheet-info-bar,
  #paneTable,
  #paneGenerator,
  #paneUsers {
    display: none !important;
  }

  #dashboardApp,
  #paneCards {
    display: block !important;
  }

  .sheet-container {
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
  }

  .print-sheet-page::before {
    display: none !important;
  }

  /* Each sheet page container breaks cleanly to the next A4 sheet */
  .print-sheet-page {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 5mm !important;
    margin: 0 0 0 0 !important;
    padding: 0 0 0 0 !important;
    border: none !important;
    page-break-after: always !important;
    break-after: page !important;
    height: 100% !important;
  }

  .print-sheet-page:last-child {
    page-break-after: auto !important;
    break-after: auto !important;
  }

  .cards-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6mm !important;
  }

  .cards-grid.print-mode-multi {
    display: block !important;
  }

  .cards-grid.layout-3x3,
  .print-sheet-page.layout-3x3 {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 4mm !important;
  }

  .ticket-card {
    border: 1.5px dashed #334155 !important;
    box-shadow: none !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    padding: 10px !important;
    background: #fff !important;
    color: #0f172a !important;
  }

  .qr-code-frame {
    border: 1px solid #94a3b8 !important;
    width: 90px !important;
    height: 90px !important;
  }
}
