/* ============================================================
   Invoice Pro — Styles
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #1d4ed8;
  --primary-dark: #1e3a8a;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #f59e0b;
  --bg: #f5f5f0;
  --bg-card: #fff;
  --ink: #1a1a18;
  --muted: #6b6b65;
  --border: #e5e3dc;
  --border-strong: #d4d2ca;
}

body {
  font-family: 'Rubik', 'Heebo', sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.5;
}

.hidden { display: none !important; }

/* ─── Auth screens (setup/login) ──────────────────────────── */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, #f5f5f0 0%, #e5e3dc 100%);
}
.auth-card {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  max-width: 420px;
  width: 100%;
}

.brand {
  text-align: center;
  margin-bottom: 24px;
}
.brand-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  border-radius: 18px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.brand-icon svg { width: 30px; height: 30px; }
.brand h1 { font-size: 24px; font-weight: 800; color: var(--ink); margin-bottom: 4px; }
.brand p { font-size: 13px; color: var(--muted); }

.welcome-box {
  background: #eff6ff;
  border: 1px solid #c7d2fe;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 18px;
}
.welcome-box h2 { font-size: 16px; color: var(--primary-dark); margin-bottom: 6px; }
.welcome-box p { font-size: 13px; color: #475569; line-height: 1.5; }

.form-group { margin-bottom: 12px; }
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 5px;
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: #faf9f5;
  transition: all 0.15s;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(29,78,216,0.1);
}
.form-group textarea { resize: vertical; min-height: 60px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

button.primary {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  margin-top: 4px;
}
button.primary:hover { opacity: 0.95; }
button.primary:disabled { opacity: 0.5; cursor: not-allowed; }

button.secondary {
  width: 100%;
  padding: 11px;
  background: #fff;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
button.secondary:hover { background: #f5f5f0; }

.error {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #991b1b;
  padding: 10px 13px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 12px;
}

/* ─── Admin Dashboard ──────────────────────────────────────── */
.app-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
}
.brand-small { display: flex; align-items: center; gap: 10px; }
.brand-icon-mini {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.brand-icon-mini svg { width: 20px; height: 20px; }
.brand-small h1 { font-size: 16px; font-weight: 700; line-height: 1.1; }
.brand-small p { font-size: 11px; color: var(--muted); }

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-btn:hover { background: #f5f5f0; }
.icon-btn svg { width: 18px; height: 18px; }

.admin-body { max-width: 900px; margin: 24px auto; padding: 0 20px; }
.admin-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.admin-toolbar h2 { font-size: 22px; font-weight: 700; }

.primary-btn {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.primary-btn:hover { opacity: 0.95; }

.tenants-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tenant-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.15s;
}
.tenant-card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 10px rgba(29,78,216,0.08);
}
.tenant-card.suspended { opacity: 0.6; }

.tenant-card-top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}
.tenant-name { font-size: 17px; font-weight: 700; margin-bottom: 2px; }
.tenant-meta { font-size: 12px; color: var(--muted); }

.status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.status-active { background: #dcfce7; color: #166534; }
.status-suspended { background: #fee2e2; color: #991b1b; }
.status-trial { background: #fef3c7; color: #78350f; }

.tenant-stats {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #f0efe9;
  font-size: 12px;
  color: var(--muted);
}
.tenant-stats span strong { color: var(--ink); font-weight: 700; }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.empty-state h3 { font-size: 18px; margin-bottom: 6px; color: var(--ink); }
.empty-state p { font-size: 13px; }

/* ─── Modals ──────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-card {
  background: #fff;
  border-radius: 16px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-card.large { max-width: 640px; }
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 18px; font-weight: 700; }
.modal-body { padding: 18px 20px 20px; }
.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}
.modal-actions button { flex: 1; margin: 0; }

.section-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  margin: 14px 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.section-label:first-child { margin-top: 0; }

.warning-box {
  background: #fef3c7;
  border: 1px solid #fbbf24;
  color: #78350f;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 14px;
}

.key-display {
  background: #1e293b;
  color: #fef3c7;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  padding: 12px;
  border-radius: 10px;
  word-break: break-all;
  margin-bottom: 12px;
  user-select: all;
}

/* ─── Tenant details modal sections ───────────────────────── */
.td-section {
  background: #faf9f5;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
}
.td-section h4 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.td-list { display: flex; flex-direction: column; gap: 6px; }
.td-row {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}
.td-row .meta { color: var(--muted); font-size: 11px; }

.btn-mini {
  padding: 5px 10px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink);
  font-family: inherit;
}
.btn-mini:hover { background: #f5f5f0; }
.btn-mini.danger { color: var(--danger); border-color: #fca5a5; }
.btn-mini.danger:hover { background: #fee2e2; }
.btn-mini.primary { color: #fff; background: var(--primary); border-color: var(--primary); }
.btn-mini.primary:hover { opacity: 0.9; background: var(--primary); }

/* ─── Toast ───────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 200;
  max-width: 90vw;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

/* ─── Mobile responsive ───────────────────────────────────── */
@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
  .admin-toolbar h2 { font-size: 18px; }
  .modal-card { max-height: 95vh; }
}

/* ─── Tenant App Tabs ───────────────────────────────────── */
.tabs {
  display: flex;
  gap: 4px;
  padding: 0 14px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  max-width: 1200px;
  margin: 0 auto;
}
.tab {
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  margin-bottom: -1px;
  transition: all 0.15s;
}
.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.tab-panel { display: none; padding: 16px 14px; max-width: 1000px; margin: 0 auto; }
.tab-panel.active { display: block; }

/* Upload card (new invoice initial state) */
.upload-card {
  background: #fff;
  border: 2px dashed var(--border-strong);
  border-radius: 16px;
  padding: 40px 20px;
  text-align: center;
}
.upload-icon { margin: 0 auto 14px; color: var(--primary); }
.upload-icon svg { width: 56px; height: 56px; }
.upload-card h2 { font-size: 18px; margin-bottom: 6px; }
.upload-card p { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.upload-buttons { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.btn-camera, .btn-upload {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 10px; font-size: 14px;
  font-weight: 600; font-family: inherit; cursor: pointer;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff; border: none;
}
.btn-upload { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn-camera svg, .btn-upload svg { width: 18px; height: 18px; }

/* Pages section (after upload) */
.pages-section { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 16px; }
.pages-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.pages-count { font-size: 14px; font-weight: 600; }
.pages-count .badge { display: inline-block; background: #fef3c7; color: #78350f; padding: 2px 8px; border-radius: 999px; font-size: 11px; margin-right: 6px; }
.add-page-btn { background: transparent; border: 1px solid var(--border); padding: 6px 12px; border-radius: 8px; font-size: 12px; cursor: pointer; }
.pages-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 8px; margin-bottom: 14px; }
.page-thumb { position: relative; aspect-ratio: 3/4; border-radius: 8px; overflow: hidden; background: #f0efe9; }
.page-thumb img { width: 100%; height: 100%; object-fit: cover; }
.page-num { position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,0.6); color: #fff; font-size: 11px; padding: 1px 6px; border-radius: 4px; }
.page-remove { position: absolute; top: 4px; left: 4px; background: rgba(255,255,255,0.9); border: none; width: 22px; height: 22px; border-radius: 50%; cursor: pointer; }
.page-remove svg { width: 12px; height: 12px; }
.scan-btn {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px; background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff; border: none; border-radius: 10px; font-size: 15px; font-weight: 700;
  font-family: inherit; cursor: pointer;
}
.scan-btn svg { width: 18px; height: 18px; }

/* Invoice editor */
.invoice-meta {
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 12px; margin-bottom: 12px;
}
.invoice-meta-label { font-size: 11px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.invoice-meta-input {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 14px; font-family: inherit; background: #faf9f5;
}
.invoice-meta-input.title { font-size: 16px; font-weight: 700; }
.invoice-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }

.products-header {
  display: flex; justify-content: space-between; align-items: center;
  margin: 14px 0 10px;
}
.products-header h3 { font-size: 16px; font-weight: 700; }
.products-header h3 span { font-weight: 400; color: var(--muted); }
.meta-text { font-size: 12px; color: var(--muted); }

.products-list { display: flex; flex-direction: column; gap: 10px; }
.product-card {
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 12px;
}
.product-card.has-price { border-color: #86efac; }
.product-row1 { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.product-num { background: #f5f5f0; color: var(--muted); width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.product-fields { flex: 1; min-width: 0; }
.product-name { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; font-family: inherit; font-weight: 500; }
.product-remove { background: transparent; border: none; cursor: pointer; padding: 4px; color: var(--danger); }
.product-remove svg { width: 18px; height: 18px; }
.product-grid {
  display: grid; grid-template-columns: 80px 1fr 1fr; gap: 8px; margin-bottom: 8px;
}
.product-grid label { font-size: 11px; color: var(--muted); display: block; margin-bottom: 3px; font-weight: 600; }
.product-grid input { width: 100%; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; font-family: inherit; }
.input-wrap { position: relative; }
.input-wrap .has-currency { padding-left: 24px; }
.currency-symbol { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; font-size: 12px; }
.currency-symbol.amber { color: var(--warning); }
.customer-price.filled { background: #f0fdf4; border-color: #86efac; }

.product-cat-row, .product-barcode-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px;
}
.product-cat-row label, .product-barcode-row label {
  font-size: 11px; color: var(--muted); display: block; margin-bottom: 3px; font-weight: 600;
}
.product-cat-row select, .product-cat-row input, .product-barcode-row input {
  width: 100%; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; font-family: inherit; background: #fff;
}

.product-markup {
  display: flex; gap: 6px; align-items: center; padding: 6px 10px;
  background: #f5f5f0; border-radius: 8px; margin-top: 8px; font-size: 12px;
}
.product-markup .label { color: var(--muted); font-weight: 600; }
.product-markup .value { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; }
.product-markup .value.positive { color: var(--success); }
.product-markup .value.negative { color: var(--danger); }
.product-markup svg { width: 12px; height: 12px; }

/* Master match banner */
.master-match-banner {
  background: #fef3c7; border: 1px solid #fbbf24; border-radius: 10px;
  padding: 10px 12px; margin-bottom: 10px; font-size: 13px;
}
.master-match-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: #d1fae5; border: 1px solid #6ee7b7; border-radius: 999px;
  padding: 3px 10px; margin-bottom: 8px; font-size: 11px;
  color: #065f46; font-weight: 600;
}

/* Bulk markup card */
.bulk-card {
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 12px; margin-bottom: 10px;
}
.bulk-card-label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.bulk-card-label svg { width: 14px; height: 14px; }
.bulk-row { display: flex; gap: 6px; }
.bulk-row input { flex: 1; padding: 8px; border: 1px solid var(--border); border-radius: 8px; font-family: inherit; }
.bulk-row button { padding: 8px 16px; background: var(--primary); color: #fff; border: none; border-radius: 8px; font-weight: 600; cursor: pointer; }
.add-product-btn {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px; background: #fff; border: 1px dashed var(--border-strong);
  border-radius: 10px; font-family: inherit; color: var(--muted); font-size: 13px; cursor: pointer;
}

/* Summary bar */
.summary-bar { margin-top: 14px; }
.summary-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.summary-stats { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.summary-stat { flex: 1; text-align: center; }
.summary-stat .label { font-size: 11px; color: var(--muted); }
.summary-stat .value { font-size: 17px; font-weight: 800; }
.summary-stat .value.positive { color: var(--success); }
.summary-stat .value.negative { color: var(--danger); }
.summary-divider { width: 1px; height: 30px; background: var(--border); }
.summary-actions { display: flex; gap: 8px; }
.btn-summary {
  flex: 1; padding: 11px; border-radius: 8px; font-size: 13px; font-weight: 700;
  cursor: pointer; font-family: inherit; display: flex; align-items: center; justify-content: center; gap: 4px;
}
.btn-summary.primary { background: linear-gradient(135deg, var(--primary-dark), var(--primary)); color: #fff; border: none; }
.btn-summary.secondary { background: #fff; color: var(--muted); border: 1px solid var(--border); }
.btn-summary svg { width: 14px; height: 14px; }

/* History */
.search-bar {
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  padding: 8px 12px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px;
}
.search-bar svg { width: 16px; height: 16px; color: var(--muted); }
.search-bar input { flex: 1; border: none; outline: none; font-size: 14px; background: transparent; font-family: inherit; }
.filter-pills { display: flex; gap: 6px; margin-bottom: 12px; }
.pill {
  padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: #fff; font-size: 12px; font-weight: 600; cursor: pointer;
  font-family: inherit; color: var(--muted);
}
.pill.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.history-list { display: flex; flex-direction: column; gap: 8px; }
.history-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 12px; cursor: pointer; }
.history-card:hover { border-color: var(--primary); }
.history-card-top { display: flex; justify-content: space-between; align-items: start; gap: 8px; }
.history-supplier { font-size: 15px; font-weight: 700; }
.history-invoice-num { font-size: 11px; color: var(--muted); margin-top: 2px; }
.history-status { padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.status-draft { background: #f3f4f6; color: #4b5563; }
.status-ready { background: #dbeafe; color: #1e40af; }
.status-imported { background: #dcfce7; color: #166534; }
.history-card-bottom { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; }
.history-meta { color: var(--muted); }
.history-meta span { margin-left: 8px; }
.history-totals { font-weight: 700; }
.history-totals .green { color: var(--success); margin-right: 6px; }

/* Entity management lists */
.cat-add-row { display: flex; gap: 6px; margin-bottom: 12px; }
.cat-add-row input { flex: 1; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-family: inherit; }
.entity-list { display: flex; flex-direction: column; gap: 4px; max-height: 50vh; overflow-y: auto; }
.entity-item {
  background: #faf9f5; padding: 8px 12px; border-radius: 8px;
  display: flex; justify-content: space-between; align-items: center; font-size: 13px;
}
.entity-item button { background: transparent; border: none; color: var(--danger); cursor: pointer; padding: 4px; }
.entity-item button svg { width: 14px; height: 14px; }

/* Master products modal */
.info-card { background: #f5f5f0; border-radius: 12px; padding: 16px; text-align: center; }
.info-card .big-num { font-size: 32px; font-weight: 800; color: var(--primary); }
.info-card .label { font-size: 13px; color: var(--muted); margin-top: 4px; }
.info-text { font-size: 13px; color: var(--muted); margin: 10px 0; }
.warning-text { font-size: 12px; color: var(--danger); margin: 8px 0 14px; }
.progress-bar { background: #e5e3dc; border-radius: 8px; height: 8px; overflow: hidden; margin-top: 12px; }
.progress-fill { background: var(--primary); height: 100%; width: 0%; transition: width 0.3s; }
.meta-line { font-size: 12px; color: var(--muted); text-align: center; margin-top: 6px; }

/* Loading overlay */
.loading-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center; z-index: 200;
}
.loader-card { background: #fff; padding: 24px 32px; border-radius: 12px; text-align: center; }
.loader-spinner {
  width: 36px; height: 36px; border: 3px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin 0.8s linear infinite; margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.alert-error {
  background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b;
  padding: 10px 14px; border-radius: 10px; font-size: 13px;
  display: flex; align-items: center; gap: 8px;
}
.alert-error svg { width: 16px; height: 16px; flex-shrink: 0; }

.icon-btn { width: 36px; height: 36px; }

/* Product flag buttons (קיים / חדש / מדבקה / דלג / רק מדבקה) */
.product-flags {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.flag-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  white-space: nowrap;
}
.flag-btn:hover { background: #f5f5f0; }
.flag-btn.active { background: #1a1a18; color: #fff; border-color: #1a1a18; }
.flag-btn.active.green { background: #fff; color: var(--success); border-color: var(--success); }
.flag-btn.active.amber { background: #fff; color: var(--warning); border-color: var(--warning); }
.flag-btn.active.blue { background: var(--primary); color: #fff; border-color: var(--primary); }
.flag-btn.active.red { background: #fff; color: var(--danger); border-color: var(--danger); }
.flag-btn .dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
}
.flag-btn .dot.green { background: var(--success); }
.flag-btn .dot.amber { background: var(--warning); }

/* Bulk import row inside categories/suppliers modals */
.bulk-import-row {
  margin: 12px 0 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.bulk-import-row button {
  width: 100%;
}
.secondary-btn {
  width: 100%;
  padding: 9px 14px;
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.secondary-btn:hover {
  background: #eff6ff;
}
.bulk-result-box {
  margin: 10px 0;
  padding: 10px 14px;
  background: #f5f5f0;
  border-radius: 10px;
  font-size: 13px;
  text-align: center;
}

/* Center logo in app header */
.header-logo-center {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 12px;
  pointer-events: none;
  user-select: none;
}
.header-logo-center img {
  max-height: 44px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.05));
}

/* On narrow screens (mobile) — smaller logo, hide on very small */
@media (max-width: 600px) {
  .header-logo-center img {
    max-height: 32px;
  }
}
@media (max-width: 400px) {
  .header-logo-center {
    display: none;
  }
}
