/* ============================================================
   ADMIN PANEL — STYLESHEET
   ============================================================ */

.admin-body {
  background: #080814;
  overflow: hidden;
}

/* ── LOGIN ──────────────────────────────────────────────────── */
.admin-login-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg-primary);
  display: flex; align-items: center; justify-content: center;
}
.admin-login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  width: 100%; max-width: 400px;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  animation: fadeInDown 0.5s ease;
}
.admin-login-logo {
  display: flex; align-items: center; gap: 0.6rem;
  font-size: 1.4rem; font-weight: 800;
  margin-bottom: 1.5rem; justify-content: center;
}
.admin-login-card h2 { text-align: center; font-size: 1.5rem; font-weight: 800; margin-bottom: 0.4rem; }
.admin-login-card > p { text-align: center; color: var(--text-2); font-size: 0.9rem; margin-bottom: 1.5rem; }
.btn-full { width: 100%; justify-content: center; }
.login-hint { text-align: center; margin-top: 1rem; font-size: 0.8rem; color: var(--text-3); }

/* ── LAYOUT ─────────────────────────────────────────────────── */
.admin-panel {
  display: grid;
  grid-template-columns: 240px 1fr;
  height: 100vh;
  overflow: hidden;
}

/* ── SIDEBAR ─────────────────────────────────────────────────── */
.admin-sidebar {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 1.25rem;
  gap: 0.25rem;
  overflow-y: auto;
}
.admin-logo {
  display: flex; align-items: center; gap: 0.6rem;
  font-size: 1.2rem; font-weight: 800;
  padding: 0.5rem 0.75rem;
  margin-bottom: 1.25rem;
}
.admin-nav { display: flex; flex-direction: column; gap: 0.25rem; flex: 1; }
.admin-nav-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem; font-weight: 600;
  color: var(--text-2);
  transition: var(--transition);
  text-align: left; border: none; cursor: pointer;
  background: none; width: 100%;
}
.admin-nav-item:hover { background: var(--bg-card); color: var(--text-1); }
.admin-nav-item.active { background: rgba(242,108,42,0.15); color: #f97316; }
.admin-sidebar-footer { border-top: 1px solid var(--border); padding-top: 0.75rem; margin-top: 1rem; display: flex; flex-direction: column; gap: 0.25rem; }
.logout-btn { color: var(--text-3); }
.logout-btn:hover { color: #ef4444; background: rgba(239,68,68,0.08); }

/* ── MAIN ───────────────────────────────────────────────────── */
.admin-main {
  overflow-y: auto;
  display: flex; flex-direction: column;
  background: var(--bg-primary);
}
.admin-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.75rem 2rem;
  border-bottom: 1px solid var(--border);
  gap: 1rem; flex-wrap: wrap;
  position: sticky; top: 0; z-index: 10;
  background: var(--bg-primary);
}
.admin-header h1 { font-size: 1.5rem; font-weight: 800; }
.admin-header p { font-size: 0.85rem; color: var(--text-3); }
.admin-header-actions { display: flex; gap: 0.75rem; }

.admin-tab { padding: 2rem; flex: 1; }

/* ── DASHBOARD ──────────────────────────────────────────────── */
.dashboard-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem; margin-bottom: 2rem;
}
.dash-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex; align-items: center; gap: 1rem;
  transition: var(--transition);
}
.dash-stat-card:hover { border-color: var(--border-strong); }
.dash-stat-icon { font-size: 2rem; }
.dash-stat-value { font-size: 2rem; font-weight: 900; line-height: 1; }
.dash-stat-label { font-size: 0.8rem; color: var(--text-3); margin-top: 0.25rem; }

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

.recent-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}
.recent-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; color: var(--text-2); }
.no-data { color: var(--text-3); font-size: 0.9rem; }

.recent-order-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.7rem 0; border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}
.recent-order-item:last-child { border-bottom: none; }
.order-status {
  padding: 0.25rem 0.6rem; border-radius: 100px;
  font-size: 0.72rem; font-weight: 700;
}
.order-status.pending { background: rgba(245,158,11,0.15); color: #f59e0b; }
.order-status.confirmed { background: rgba(16,185,129,0.15); color: #10b981; }

.recent-product-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.6rem 0; border-bottom: 1px solid var(--border);
}
.recent-product-item:last-child { border-bottom: none; }
.rp-img {
  width: 42px; height: 42px;
  border-radius: var(--radius-sm); object-fit: cover;
  background: var(--bg-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; flex-shrink: 0;
}
.rp-info { flex: 1; }
.rp-name { font-size: 0.88rem; font-weight: 600; }
.rp-price { font-size: 0.8rem; color: var(--text-3); }

/* ── ADMIN TOOLBAR ──────────────────────────────────────────── */
.admin-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap;
}
.admin-toolbar .search-bar { max-width: 340px; flex: 1; }

/* ── TABLE ──────────────────────────────────────────────────── */
.admin-products-table-wrapper { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--border); }
.admin-table { width: 100%; border-collapse: collapse; background: var(--bg-card); }
.admin-table th {
  background: var(--bg-secondary);
  padding: 0.85rem 1rem;
  text-align: left; font-size: 0.8rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.admin-table td { padding: 0.85rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; font-size: 0.9rem; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--bg-card-hover); }

.table-img {
  width: 48px; height: 48px; border-radius: var(--radius-sm);
  object-fit: cover; background: var(--bg-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
}
.table-product-name { font-weight: 600; }
.stock-badge {
  padding: 0.25rem 0.6rem; border-radius: 100px;
  font-size: 0.78rem; font-weight: 700;
  display: inline-block;
}
.stock-ok { background: rgba(16,185,129,0.12); color: #10b981; }
.stock-low { background: rgba(245,158,11,0.12); color: #f59e0b; }
.stock-out { background: rgba(239,68,68,0.12); color: #ef4444; }

.table-actions { display: flex; gap: 0.5rem; }
.tbl-btn {
  padding: 0.4rem 0.75rem; border-radius: 6px;
  font-size: 0.8rem; font-weight: 600; cursor: pointer;
  transition: var(--transition); border: 1px solid transparent;
}
.tbl-btn-edit {
  background: rgba(242,108,42,0.12); color: var(--accent-1);
  border-color: rgba(242,108,42,0.25);
}
.tbl-btn-edit:hover { background: rgba(242,108,42,0.22); }
.tbl-btn-delete {
  background: rgba(239,68,68,0.12); color: #ef4444;
  border-color: rgba(239,68,68,0.25);
}
.tbl-btn-delete:hover { background: rgba(239,68,68,0.22); }

/* ── ORDERS ─────────────────────────────────────────────────── */
.admin-orders-list { display: flex; flex-direction: column; gap: 1.25rem; }
.admin-order-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.5rem;
  display: flex; flex-direction: column; gap: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.admin-order-card:hover { border-color: var(--border-strong); }
.admin-order-header {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 0.85rem; border-bottom: 1px solid var(--border);
  flex-wrap: wrap; gap: 0.5rem;
}
.admin-order-id { font-weight: 800; font-family: monospace; color: var(--accent-1); font-size: 1.05rem; margin-right: 0.75rem; }
.admin-order-date { font-size: 0.8rem; color: var(--text-3); }

.admin-status-actions {
  display: flex; align-items: center; gap: 0.5rem;
}
.admin-status-select {
  padding: 0.35rem 0.75rem; border-radius: 100px;
  font-size: 0.82rem; font-weight: 700;
  border: 1px solid var(--border-strong);
  background: var(--bg-secondary); color: var(--text-1);
  outline: none; cursor: pointer; transition: var(--transition);
}
.admin-status-select.pending   { border-color: rgba(245,158,11,0.5); color: #f59e0b; background: rgba(245,158,11,0.1); }
.admin-status-select.confirmed { border-color: rgba(16,185,129,0.5); color: #10b981; background: rgba(16,185,129,0.1); }
.admin-status-select.shipped   { border-color: rgba(59,130,246,0.5); color: #3b82f6; background: rgba(59,130,246,0.1); }
.admin-status-select.delivered { border-color: rgba(168,85,247,0.5); color: #a855f7; background: rgba(168,85,247,0.1); }

.btn-delete-order {
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.3);
  color: #ef4444; font-size: 0.85rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: var(--transition);
}
.btn-delete-order:hover {
  background: #ef4444; color: #fff; transform: scale(1.1);
}

.admin-order-body {
  display: grid; grid-template-columns: 1fr 1.1fr; gap: 1.5rem;
}
@media (max-width: 768px) {
  .admin-order-body { grid-template-columns: 1fr; }
}

.admin-order-col {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
}
.admin-section-sub {
  font-size: 0.82rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-2); margin-bottom: 0.75rem;
}

.admin-order-items-list { display: flex; flex-direction: column; gap: 0.4rem; font-size: 0.85rem; }
.admin-order-item-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.3rem 0; border-bottom: 1px dashed rgba(255,255,255,0.06);
}
.admin-order-item-row:last-child { border-bottom: none; }

.admin-shipping-details { display: flex; flex-direction: column; gap: 0.45rem; font-size: 0.85rem; }
.shipping-field { display: flex; align-items: baseline; gap: 0.5rem; }
.field-label { color: var(--text-3); font-size: 0.78rem; min-width: 80px; flex-shrink: 0; }
.field-val { color: var(--text-1); word-break: break-word; }
.admin-link { color: var(--accent-1); text-decoration: none; }
.admin-link:hover { text-decoration: underline; }

.admin-order-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 0.85rem; border-top: 1px solid var(--border);
  flex-wrap: wrap; gap: 1rem;
}
.admin-order-tx-box { display: flex; flex-direction: column; gap: 0.35rem; flex: 1; min-width: 240px; }
.tx-hash-display { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.tx-code {
  font-family: monospace; font-size: 0.78rem; background: var(--bg-secondary);
  padding: 0.3rem 0.6rem; border-radius: 4px; border: 1px solid var(--border);
  color: #38bdf8; word-break: break-all; max-width: 420px;
}
.explorer-link {
  font-size: 0.78rem; font-weight: 700; color: var(--accent-1);
  background: rgba(242,108,42,0.12); padding: 0.25rem 0.6rem;
  border-radius: 4px; text-decoration: none; transition: var(--transition);
  border: 1px solid rgba(242,108,42,0.25); white-space: nowrap;
}
.explorer-link:hover { background: rgba(242,108,42,0.25); }
.tx-missing { font-size: 0.8rem; color: var(--text-3); font-style: italic; }

.admin-order-total-box { text-align: right; }
.admin-order-crypto { color: var(--accent-3); font-weight: 800; font-size: 1.05rem; }
.admin-order-fiat { font-size: 0.82rem; color: var(--text-3); font-weight: 600; }

/* ── WALLET ─────────────────────────────────────────────────── */
.wallet-settings { max-width: 600px; }
.wallet-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 2rem;
}
.wallet-card h2 { font-size: 1.3rem; font-weight: 800; margin-bottom: 0.5rem; }
.wallet-card > p { color: var(--text-2); font-size: 0.9rem; margin-bottom: 1.5rem; }
.wallet-form { display: flex; flex-direction: column; gap: 1rem; }
.wallet-field label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text-2); margin-bottom: 0.4rem; }
.wallet-field input {
  width: 100%; padding: 0.7rem 0.9rem;
  background: var(--bg-secondary); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-1);
  font-size: 0.9rem; font-family: monospace; outline: none; transition: var(--transition);
}
.wallet-field input:focus { border-color: var(--accent-1); }

/* ── MODAL ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(6,6,18,0.85); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  width: 100%; max-width: 620px;
  max-height: 90vh; overflow-y: auto;
  animation: modalPop 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.modal-sm { max-width: 400px; }
@keyframes modalPop { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.modal-header h2 { font-size: 1.2rem; font-weight: 800; }
.modal-close {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg-card); color: var(--text-2);
  font-size: 1.4rem; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: var(--transition);
  line-height: 1;
}
.modal-close:hover { background: rgba(239,68,68,0.15); color: #ef4444; }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.75rem; margin-top: 1.5rem; }

.product-form { display: flex; flex-direction: column; gap: 1rem; }
.checkbox-label { display: flex; align-items: center; gap: 0.6rem; cursor: pointer; font-size: 0.9rem; }
.checkbox-label input { accent-color: var(--accent-1); width: 16px; height: 16px; cursor: pointer; }

.file-upload-zone {
  position: relative;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 1.5rem 1rem;
  text-align: center;
  background: rgba(255,255,255,0.02);
  transition: var(--transition);
  cursor: pointer;
}
.file-upload-zone:hover {
  border-color: var(--accent-1);
  background: rgba(242,108,42,0.04);
}
.file-input {
  position: absolute; inset: 0; opacity: 0;
  width: 100%; height: 100%; cursor: pointer; z-index: 2;
}
.file-upload-prompt {
  display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
  color: var(--text-2); pointer-events: none;
}
.file-upload-prompt svg { color: var(--accent-1); }
.file-upload-prompt span { font-size: 0.9rem; }
.file-upload-prompt strong { color: var(--accent-1); text-decoration: underline; }
.file-upload-prompt small { font-size: 0.75rem; color: var(--text-3); }

.image-preview { margin-top: 0.75rem; }
.preview-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
}
.preview-wrapper img {
  width: 100%; max-height: 180px; object-fit: cover;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
}
.btn-remove-preview {
  position: absolute; top: 8px; right: 8px;
  background: rgba(239,68,68,0.9); color: white;
  border: none; border-radius: 6px;
  padding: 0.35rem 0.75rem; font-size: 0.75rem; font-weight: 700;
  cursor: pointer; transition: var(--transition);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.btn-remove-preview:hover { background: #dc2626; transform: scale(1.05); }

.btn-secondary-action {
  padding: 0.7rem 1.5rem; border-radius: var(--radius-sm);
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-2); font-weight: 600; cursor: pointer;
  transition: var(--transition);
}
.btn-secondary-action:hover { background: var(--bg-card-hover); color: var(--text-1); }

.btn-danger {
  padding: 0.7rem 1.5rem; border-radius: var(--radius-sm);
  background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.4);
  color: #ef4444; font-weight: 700; cursor: pointer; transition: var(--transition);
}
.btn-danger:hover { background: rgba(239,68,68,0.25); }

/* ── GENERATORE LANDING PAGE ───────────────────────────────── */
.generator-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.generator-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
}

.toolbar-section {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.toolbar-section label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-2);
}

.gen-select {
  padding: 0.6rem 0.9rem;
  background: var(--bg-card-hover);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  font-size: 0.9rem;
  outline: none;
  cursor: pointer;
  min-width: 260px;
}
.gen-select:focus {
  border-color: var(--accent-1);
}

.preset-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-preset {
  padding: 0.5rem 0.85rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-preset:hover {
  background: rgba(245, 166, 35, 0.15);
  border-color: var(--accent-1);
  color: var(--accent-1);
  transform: translateY(-1px);
}

.generator-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

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

.generator-form-card,
.generator-preview-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.generator-form-card input,
.generator-form-card textarea,
.generator-form-card select {
  width: 100%;
  padding: 0.6rem 0.85rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  font-size: 0.88rem;
  font-family: inherit;
  transition: var(--transition);
}
.generator-form-card input:focus,
.generator-form-card textarea:focus,
.generator-form-card select:focus {
  outline: none;
  border-color: var(--accent-1);
  box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.15);
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.preview-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.preview-mode-switch {
  display: flex;
  background: rgba(0,0,0,0.3);
  border-radius: 8px;
  padding: 3px;
  border: 1px solid var(--border);
}

.btn-device-mode {
  padding: 0.35rem 0.75rem;
  border: none;
  background: transparent;
  color: var(--text-2);
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}
.btn-device-mode.active {
  background: var(--accent-1);
  color: #000;
  box-shadow: 0 2px 6px rgba(245, 166, 35, 0.3);
}

.preview-frame-container {
  width: 100%;
  height: 520px;
  background: #0b0f19;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  transition: all 0.3s ease;
}

.preview-frame-container.mobile-mode {
  width: 340px;
  height: 580px;
  margin: 0 auto;
  border: 6px solid #2a2f3d;
  border-radius: 28px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.preview-frame-container iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.generator-export-actions {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.btn-export {
  width: 100%;
  justify-content: center;
  padding: 0.85rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.btn-whatsapp-copy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #25D366, #128C7E);
  color: white;
  border: none;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.25);
}
.btn-whatsapp-copy:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-gen-order {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  background: linear-gradient(135deg, rgba(245, 166, 35, 0.2), rgba(255, 107, 107, 0.2));
  border: 1px solid var(--accent-1);
  color: var(--accent-1);
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}
.btn-gen-order:hover {
  background: var(--accent-1);
  color: #000;
  transform: scale(1.03);
}

