/* ═══════════════════════════════════
   AutoMaster Pro – styles.css v2.0
═══════════════════════════════════ */

:root {
  --bg:         #0a0e1a;
  --bg2:        #0f1422;
  --card:       #131929;
  --card2:      #1a2236;
  --border:     #1e2d47;
  --border2:    #243352;
  --accent:     #3b82f6;
  --accent-h:   #60a5fa;
  --success:    #22c55e;
  --warning:    #f59e0b;
  --danger:     #ef4444;
  --purple:     #a855f7;
  --orange:     #f97316;
  --text:       #e2e8f0;
  --text2:      #94a3b8;
  --text3:      #64748b;
  --radius:     12px;
  --radius-sm:  8px;
  --shadow:     0 4px 24px rgba(0,0,0,.4);
  --transition: .2s ease;
}

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

html, body { height: 100%; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  overflow: hidden;
}

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ─── LAYOUT ─── */
.app-container { display: flex; height: 100vh; overflow: hidden; }

/* ─── SIDEBAR ─── */
.sidebar {
  width: 230px;
  min-width: 230px;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 0;
  transition: width var(--transition), min-width var(--transition);
  overflow: hidden;
}

.sidebar.collapsed { width: 64px; min-width: 64px; }
.sidebar.collapsed .brand-name,
.sidebar.collapsed .nav-btn span,
.sidebar.collapsed .sidebar-footer .version,
.sidebar.collapsed .db-status span { display: none; }
.sidebar.collapsed .nav-btn { justify-content: center; }
.sidebar.collapsed .brand-icon { margin: 0 auto; }

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

.brand-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent), #6366f1);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: #fff;
  flex-shrink: 0;
  box-shadow: 0 0 16px rgba(59,130,246,.4);
}

.brand-name {
  font-size: 1.1rem; font-weight: 800; white-space: nowrap;
  color: var(--text);
}
.brand-name span { color: var(--accent); }
.brand-name em { font-style: normal; background: var(--accent); color: #fff; border-radius: 4px; padding: 0 5px; font-size: .65rem; font-weight: 700; margin-left: 4px; vertical-align: middle; }

.sidebar-nav {
  flex: 1;
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border: none;
  background: none;
  color: var(--text2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: .9rem;
  font-weight: 500;
  transition: var(--transition);
  width: 100%;
  text-align: left;
  white-space: nowrap;
}
.nav-btn i { font-size: 15px; width: 18px; text-align: center; flex-shrink: 0; }
.nav-btn:hover { background: var(--card2); color: var(--text); }
.nav-btn.active {
  background: linear-gradient(135deg, rgba(59,130,246,.2), rgba(99,102,241,.1));
  color: var(--accent-h);
  border-left: 3px solid var(--accent);
}

.sidebar-footer {
  padding: 16px 14px;
  border-top: 1px solid var(--border);
  font-size: .75rem;
  color: var(--text3);
}
.db-status {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 6px;
  font-size: .8rem;
  color: var(--success);
}
.pulse {
  width: 8px; height: 8px;
  background: var(--success);
  border-radius: 50%;
  flex-shrink: 0;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34,197,94,.4); }
  50% { opacity: .8; box-shadow: 0 0 0 5px rgba(34,197,94,0); }
}

/* ─── MAIN ─── */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ─── TOP BAR ─── */
.top-bar {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.top-bar-left { display: flex; align-items: center; gap: 16px; }
.top-bar-right { display: flex; align-items: center; gap: 16px; }

.sidebar-toggle {
  background: none; border: none; color: var(--text2);
  font-size: 18px; cursor: pointer; padding: 6px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.sidebar-toggle:hover { color: var(--text); background: var(--card2); }

.top-bar h1 { font-size: 1.1rem; font-weight: 600; }

.clock {
  font-size: .8rem;
  color: var(--text2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ─── PAGE WRAP ─── */
.page-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.page { display: none; animation: fadeIn .25s ease; }
.page.active { display: block; }

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

/* ─── CARDS ─── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.card-head h3 {
  font-size: .95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}
.card-head h3 i { color: var(--accent); }

/* ─── STATS ─── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}
.stat-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }

.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: #fff;
  flex-shrink: 0;
}
.stat-icon.blue { background: linear-gradient(135deg, #3b82f6, #6366f1); }
.stat-icon.green { background: linear-gradient(135deg, #22c55e, #16a34a); }
.stat-icon.purple { background: linear-gradient(135deg, #a855f7, #7c3aed); }
.stat-icon.orange { background: linear-gradient(135deg, #f97316, #dc2626); }

.stat-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat-label { font-size: .75rem; color: var(--text2); text-transform: uppercase; letter-spacing: .05em; }
.stat-value { font-size: 1.6rem; font-weight: 700; color: var(--text); line-height: 1.2; }
.stat-sub { font-size: .75rem; color: var(--text3); }

/* ─── CHARTS ─── */
.charts-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.chart-card canvas { max-height: 220px; }

/* ─── FORMS ─── */
.form-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-col { display: flex; flex-direction: column; gap: 0; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.full-span { grid-column: 1 / -1; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: .8rem; color: var(--text2); font-weight: 500; }

input, select, textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition);
  width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,130,246,.15); }
input::placeholder, textarea::placeholder { color: var(--text3); }
select option { background: var(--card2); }
textarea { resize: vertical; }

.req { color: var(--danger); font-size: .7rem; }

/* ─── CHECKBOX GROUP ─── */
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}
.chk {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  color: var(--text2);
  cursor: pointer;
  user-select: none;
}
.chk input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

/* ─── ADD ITEM ROW ─── */
.add-item-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.flex-grow { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }

/* ─── FILE ZONE ─── */
.file-zone {
  border: 2px dashed var(--border2);
  border-radius: var(--radius-sm);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.file-zone:hover { border-color: var(--accent); background: rgba(59,130,246,.05); }
.file-zone i { font-size: 26px; color: var(--text3); display: block; margin-bottom: 8px; }
.file-zone span { font-size: .8rem; color: var(--text3); }
.file-zone input[type="file"] {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  opacity: 0; cursor: pointer;
}

.file-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.file-pill {
  display: flex; align-items: center; gap: 6px;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: .78rem;
  color: var(--text2);
}
.file-pill i { color: var(--accent); }
.file-pill .rm { cursor: pointer; color: var(--danger); font-size: 11px; margin-left: 4px; }

/* ─── TOTAL ROW ─── */
.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0 0;
  border-top: 1px solid var(--border);
  margin-top: 10px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}
.total-row strong { font-size: 1.3rem; color: var(--accent); }

/* ─── TABLES ─── */
.table-wrap { overflow-x: auto; margin-top: 4px; }
.dtable { width: 100%; border-collapse: collapse; }
.dtable th, .dtable td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.dtable th { font-size: .75rem; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: .05em; background: var(--bg2); }
.dtable tbody tr { transition: background var(--transition); }
.dtable tbody tr:hover { background: var(--card2); }
.dtable tbody td { font-size: .875rem; }
.dtable tbody tr:last-child td { border-bottom: none; }

.table-footer {
  padding: 10px 0 0;
  font-size: .8rem;
  color: var(--text3);
}

/* ─── TOOLBAR ─── */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  flex: 1;
  min-width: 200px;
}
.search-box i { color: var(--text3); flex-shrink: 0; }
.search-box input {
  border: none; background: none; padding: 0; flex: 1;
  font-size: .875rem; color: var(--text);
}
.search-box input:focus { box-shadow: none; }

.filter-row { display: flex; gap: 8px; }
.filter-row select { width: auto; min-width: 140px; }

/* ─── CATALOG ─── */
.catalog-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 20px;
  align-items: start;
}
.catalog-list-card { overflow: hidden; }

.cat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.tab {
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border2);
  background: none;
  color: var(--text2);
  font-size: .78rem;
  cursor: pointer;
  transition: var(--transition);
}
.tab:hover { border-color: var(--accent); color: var(--accent-h); }
.tab.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }

.search-sm {
  width: 160px;
  padding: 6px 10px;
  font-size: .8rem;
  border-radius: var(--radius-sm);
}

/* ─── BACKUP ─── */
.backup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.db-summary { display: flex; flex-direction: column; gap: 12px; }
.db-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: .85rem;
}
.db-row span { color: var(--text2); }
.db-row strong { color: var(--accent); }

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn:active { transform: scale(.97); }
.btn-sm { padding: 6px 12px; font-size: .8rem; }
.btn-full { width: 100%; justify-content: center; padding: 13px; font-size: 1rem; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-h); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #16a34a; }
.btn-warning { background: var(--warning); color: #000; }
.btn-warning:hover { background: #d97706; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-ghost {
  background: var(--card2);
  color: var(--text2);
  border: 1px solid var(--border2);
}
.btn-ghost:hover { color: var(--text); border-color: var(--border2); background: var(--bg2); }
.btn-wa { background: #25d366; color: #fff; }
.btn-wa:hover { background: #128c7e; }
.btn-icon { padding: 7px 10px; }

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

/* ─── BADGE ─── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 600;
}
.badge-blue { background: rgba(59,130,246,.15); color: var(--accent-h); }
.badge-green { background: rgba(34,197,94,.15); color: #4ade80; }
.badge-orange { background: rgba(249,115,22,.15); color: #fb923c; }
.badge-purple { background: rgba(168,85,247,.15); color: #c084fc; }

/* ─── MODAL ─── */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.modal.open { display: flex; animation: fadeIn .2s ease; }

.modal-box {
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 30px;
  width: 90%;
  max-width: 660px;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.modal-sm { max-width: 400px; }

.modal-close {
  position: absolute;
  top: 14px; right: 16px;
  background: none; border: none;
  color: var(--text3);
  font-size: 18px;
  cursor: pointer;
  transition: var(--transition);
}
.modal-close:hover { color: var(--danger); }

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.confirm-text { font-size: .95rem; color: var(--text); text-align: center; padding: 10px 0; }
.confirm-text i { font-size: 2rem; color: var(--warning); display: block; margin-bottom: 12px; }

/* ─── TOAST ─── */
#toast-wrap {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
  pointer-events: none;
}
.toast {
  background: var(--card2);
  border: 1px solid var(--border2);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: .85rem;
  color: var(--text);
  box-shadow: var(--shadow);
  min-width: 260px;
  animation: slideIn .3s ease;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(40px); opacity: 0; } }

/* ─── MODAL DETAIL CONTENT ─── */
.detail-header { margin-bottom: 20px; }
.detail-plate {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: .1em;
  color: var(--text);
  background: var(--accent);
  display: inline-block;
  padding: 4px 16px;
  border-radius: var(--radius-sm);
}
.detail-meta { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 14px; }
.detail-meta-item { display: flex; flex-direction: column; gap: 2px; }
.detail-meta-item span:first-child { font-size: .72rem; color: var(--text3); text-transform: uppercase; }
.detail-meta-item span:last-child { font-size: .9rem; font-weight: 600; color: var(--text); }

.detail-section { margin-top: 18px; }
.detail-section h4 { font-size: .8rem; color: var(--text2); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px; border-bottom: 1px solid var(--border); padding-bottom: 6px; }

.detail-items { display: flex; flex-direction: column; gap: 6px; }
.detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: .875rem;
}
.detail-item .price { color: var(--accent); font-weight: 600; }

.detail-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: linear-gradient(135deg, rgba(59,130,246,.15), rgba(99,102,241,.1));
  border: 1px solid rgba(59,130,246,.3);
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 1rem;
  margin-top: 8px;
}
.detail-total .total-price { font-size: 1.2rem; color: var(--accent); }

.tuning-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tuning-tag {
  padding: 3px 10px;
  background: rgba(168,85,247,.15);
  color: #c084fc;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 600;
  border: 1px solid rgba(168,85,247,.3);
}

.detail-note {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: .875rem;
  color: var(--text2);
  line-height: 1.7;
  white-space: pre-wrap;
}

.detail-files-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.detail-file-thumb {
  width: 72px; height: 72px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 2px solid var(--border);
  transition: var(--transition);
}
.detail-file-thumb:hover { border-color: var(--accent); transform: scale(1.05); }
.detail-file-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .8rem;
  color: var(--accent-h);
  text-decoration: none;
}

/* ─── PRINT ─── */
@media print {
  body * { visibility: hidden; }
  #print-area, #print-area * { visibility: visible; }
  #print-area {
    position: fixed;
    inset: 0;
    display: block !important;
    padding: 30px;
    background: #fff;
    color: #000;
  }
  .no-print { display: none !important; }
}

/* ─── HELPERS ─── */
.hidden { display: none !important; }
.muted { color: var(--text2); font-size: .875rem; }
.text-danger { color: var(--danger); }
.text-accent { color: var(--accent); }
.mt-10 { margin-top: 10px; }
.mt-15 { margin-top: 15px; }
.mt-20 { margin-top: 20px; }

/* ─── EMPTY STATE ─── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text3);
}
.empty-state i { font-size: 3rem; margin-bottom: 16px; display: block; }
.empty-state p { font-size: .95rem; }

/* ─── PLATE BUTTON (clickable in customers table) ─── */
.plate-btn {
  display: inline-block;
  background: rgba(59,130,246,.15);
  color: var(--accent-h);
  border: 1px solid rgba(59,130,246,.35);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .06em;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition);
}
.plate-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59,130,246,.35);
}

/* ─── PLATE SERVICE CARD (in plate modal) ─── */
.plate-services-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.plate-service-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  transition: border-color var(--transition);
}
.plate-service-card:hover { border-color: var(--accent); }
.psc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
  flex-wrap: wrap;
  gap: 8px;
}
.psc-date {
  font-size: .8rem;
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 5px;
}
.psc-total {
  font-size: .95rem;
  font-weight: 700;
  color: var(--accent);
  margin-left: auto;
  margin-right: 12px;
}
/* ─── FILE THUMBNAILS (in form) ─── */
.file-thumb-item {
  position: relative;
  width: 80px;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.file-thumb-preview {
  width: 100%;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
}
.file-thumb-name {
  font-size: 10px;
  color: var(--text3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}
.file-thumb-rm {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  background: var(--danger);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* ─── LIGHTBOX (for inline preview) ─── */
#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 40px;
  backdrop-filter: blur(8px);
}
#lightbox.open { display: flex; animation: fadeIn .2s ease; }
#lightbox-content {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 40px rgba(0,0,0,0.5);
}
#lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: #fff;
  font-size: 30px;
  cursor: pointer;
  transition: var(--transition);
}
#lightbox-close:hover { color: var(--danger); transform: scale(1.1); }

/* ─── TOTAL PRICE EDITABLE ─── */
.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.total-row span {
  font-weight: 500;
  color: var(--text2);
}
.total-input-wrapper {
  display: flex;
  align-items: center;
  position: relative;
}
#f-total {
  background: var(--card2) !important;
  border: 1px solid var(--border) !important;
  color: var(--accent) !important;
  font-size: 1.5rem !important;
  font-weight: 800 !important;
  padding: 8px 40px 8px 14px !important;
  border-radius: var(--radius-sm) !important;
  width: 160px !important;
  text-align: right !important;
  transition: var(--transition);
}
#f-total:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15) !important;
  outline: none;
}
.currency-symbol {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  color: var(--accent);
  font-weight: 700;
  pointer-events: none;
}

/* ─── LOGIN OVERLAY ─── */
.login-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100vw" height="100vh"><rect width="100%" height="100%" fill="%230a0e1a"/><circle cx="50%" cy="50%" r="400" fill="%233b82f6" opacity="0.1" filter="blur(150px)"/><circle cx="80%" cy="20%" r="200" fill="%23a855f7" opacity="0.1" filter="blur(150px)"/></svg>') center/cover;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.login-box {
  background: rgba(19, 25, 41, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(59, 130, 246, 0.1);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  animation: slideUpFade 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}
.login-brand .brand-icon {
  width: 48px;
  height: 48px;
  font-size: 22px;
}
.login-brand .brand-name {
  font-size: 1.6rem;
}
.login-desc {
  text-align: center;
  color: var(--text3);
  font-size: 0.9rem;
  margin-bottom: 30px;
}

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