/* ==========================================================================
   OPS.BULBA.AL — Catalog, Price & Photo Operations Console Stylesheet
   ========================================================================== */

:root {
  --bg-page: #f5f2e9;
  --bg-masthead: #18361c;
  --bg-card: #ffffff;
  --bg-table-head: #f2efe4;
  --bg-upload: #f6f4eb;
  --green-dark: #1b3d20;
  --green-hover: #25522b;
  --green-pill: #254f2b;
  --green-dot: #4cd964;
  --terracotta: #b54830;
  --terracotta-light: #fdf2ef;
  --text-main: #161f17;
  --text-secondary: #48544a;
  --text-muted: #6c776e;
  --border-color: #dfdcd0;
  --border-input: #d2cfc2;
  --shadow-card: 0 2px 10px rgba(22, 31, 23, 0.05);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-pill: 999px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Georgia', 'Times New Roman', serif;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

button, input, select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

a {
  color: inherit;
  text-decoration: none;
}

/* 1. TOP OPERATIONS HEADER */
.ops-header {
  background-color: var(--bg-masthead);
  color: #ffffff;
  height: 76px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ops-header-inner {
  width: 100%;
  max-width: 1340px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.ops-logo-icon {
  width: 34px;
  height: 50px;
  color: #ffffff;
  flex-shrink: 0;
}

.ops-brand-titles {
  display: flex;
  flex-direction: column;
}

.ops-brand-name {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.05;
}

.ops-brand-sub {
  font-size: 12px;
  color: #c8d6ca;
  margin-top: 2px;
}

.ops-role-pill {
  background: rgba(255, 255, 255, 0.12);
  color: #e2ece3;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  margin-left: 4px;
}

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

.sync-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--green-pill);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #eef5ee;
  font-size: 12px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green-dot);
  display: inline-block;
}

.btn-view-store {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 15px;
  border-radius: 8px;
  transition: background 0.15s ease;
}

.btn-view-store:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-new-product {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  color: #162e19;
  font-size: 12.5px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  transition: background 0.15s ease, transform 0.1s ease;
}

.btn-new-product:hover {
  background: #f0f4f0;
}

.btn-logout-ops {
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #e6efe7;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 11px;
  border-radius: 8px;
  transition: background 0.15s ease;
}

.btn-logout-ops:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* OPS Auth Gate Overlay */
.ops-auth-gate {
  position: fixed;
  inset: 0;
  background: rgba(22, 31, 23, 0.72);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.ops-auth-gate[hidden] {
  display: none;
}

.ops-auth-card {
  width: 100%;
  max-width: 390px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.28);
}

.ops-auth-brand {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 800;
  color: var(--green-dark);
  margin-bottom: 4px;
}

.ops-auth-card h2 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}

.ops-auth-sub {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-bottom: 14px;
  line-height: 1.45;
}

.ops-auth-label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  margin-bottom: 4px;
}

.ops-auth-error {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--terracotta);
  min-height: 16px;
}

/* 2. MAIN CONTAINER */
.ops-container {
  max-width: 1340px;
  margin: 0 auto;
  padding: 18px 24px 32px;
}

/* KPI METRIC STRIPS */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 14px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  height: 52px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-card);
}

.kpi-label {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-main);
}

.kpi-badge {
  background: var(--terracotta);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 6px;
}

.kpi-badge.-muted {
  background: #5f6660;
}

.kpi-card-discount {
  justify-content: space-between;
  gap: 6px;
  padding: 0 12px;
}

.kpi-card-discount .kpi-label {
  font-size: 13.5px;
  white-space: nowrap;
}

.kpi-card-discount .kpi-badge {
  font-size: 12px;
  padding: 3px 8px;
  white-space: nowrap;
}

.kpi-disc-master {
  margin-left: 2px;
  flex-shrink: 0;
}

/* 3. TOOLBAR ROW (Search + Category Filter + Bulk Save) */
.toolbar-row {
  display: grid;
  grid-template-columns: 1fr 200px auto;
  gap: 12px;
  margin-bottom: 14px;
}

.ops-search-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-input);
  border-radius: 7px;
  height: 36px;
  padding: 0 12px;
}

.ops-search-wrap svg {
  width: 15px;
  height: 15px;
  color: var(--text-muted);
  margin-right: 8px;
  flex-shrink: 0;
}

.ops-search-input {
  width: 100%;
  border: none;
  outline: none;
  font-size: 13px;
  background: transparent;
}

.ops-cat-select {
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border-input);
  border-radius: 7px;
  background: var(--bg-card);
  font-size: 13px;
  font-weight: 500;
}

.btn-bulk-save {
  height: 36px;
  padding: 0 18px;
  background: var(--green-dark);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 7px;
  transition: background 0.15s ease;
}

.btn-bulk-save:hover {
  background: var(--green-hover);
}

/* 4. SPLIT WORKSPACE (Table Left + Form Right) */
.workspace-grid {
  display: grid;
  grid-template-columns: 1fr 345px;
  gap: 18px;
  align-items: start;
}

/* Left Panel: Product & Price Table */
.table-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.panel-header {
  padding: 14px 18px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.ops-tabs {
  display: inline-flex;
  align-items: center;
  background: #f2efe4;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 3px;
  gap: 4px;
}

.ops-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  transition: background 0.15s ease, color 0.15s ease;
}

.ops-tab-btn.active {
  background: var(--green-dark);
  color: #ffffff;
}

.ops-tab-badge {
  background: var(--terracotta);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
}

.ops-table-wrap[hidden] {
  display: none;
}

.order-status-select {
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--border-input);
  border-radius: 6px;
  background: #ffffff;
  font-size: 11.5px;
  font-weight: 600;
}

.panel-title {
  font-size: 16.5px;
  font-weight: 800;
  color: var(--text-main);
}

.ops-table-wrap {
  width: 100%;
  overflow-x: auto;
  max-height: 510px;
  overflow-y: auto;
}

.ops-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.ops-table thead th {
  background: var(--bg-table-head);
  color: #222c23;
  font-weight: 700;
  font-size: 11.5px;
  padding: 9px 8px;
  text-align: left;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 5;
  white-space: nowrap;
}

.ops-table tbody tr {
  border-bottom: 1px solid #ece9df;
  transition: background 0.12s ease;
}

.ops-table tbody tr:hover,
.ops-table tbody tr.selected-row {
  background: #f9f8f3;
}

.ops-table tbody tr.dirty-row {
  background: #fff9ef;
}

.act-btn.-dirty {
  color: var(--terracotta);
  font-weight: 800;
}

.ops-table td {
  padding: 8px 6px;
  vertical-align: middle;
}

.col-idx {
  width: 28px;
  text-align: center;
  font-weight: 600;
  color: var(--text-secondary);
}

.row-thumb {
  width: 56px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  display: block;
  border: 1px solid var(--border-color);
  cursor: pointer;
}

.prod-cell-title {
  font-weight: 700;
  font-size: 12.5px;
  color: var(--text-main);
  line-height: 1.25;
  cursor: pointer;
}

.prod-cell-title:hover {
  color: var(--green-dark);
  text-decoration: underline;
}

.prod-cell-sku {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 1px;
}

.pack-cell {
  font-weight: 500;
  white-space: nowrap;
}

/* Inline Price & Discount Inputs inside Table */
.inline-price-box {
  display: inline-flex;
  align-items: center;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 5px;
  padding: 2px 4px;
  font-weight: 600;
  width: 94px;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.inline-price-box:hover,
.inline-price-box:focus {
  border-color: var(--border-input);
  background: #ffffff;
  outline: none;
}

.inline-discount-cell {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.inline-discount-box {
  width: 60px;
  text-align: center;
  color: var(--terracotta);
  font-weight: 700;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 5px;
  padding: 2px 3px;
}

.inline-discount-box.-off {
  color: #5f6660;
  text-decoration: line-through;
}

.inline-discount-box:hover,
.inline-discount-box:focus {
  border-color: var(--terracotta);
  background: #ffffff;
  outline: none;
}

.disc-switch {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 44px;
  height: 20px;
  border-radius: var(--radius-pill);
  padding: 2px 4px;
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.18s ease;
  user-select: none;
}

.disc-switch.on {
  background: var(--terracotta);
  color: #ffffff;
}

.disc-switch.off {
  background: #5c635d;
  color: #ffffff;
  flex-direction: row-reverse;
}

.disc-switch .switch-knob {
  width: 13px;
  height: 13px;
}

.inspector-disc-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.inspector-disc-wrap .vitrine-switch {
  flex-shrink: 0;
  height: 31px;
  width: 58px;
}

.inspector-disc-wrap .vitrine-switch.on {
  background: var(--terracotta);
}

/* Vitrinë ON / OFF Toggle Switch */
.vitrine-switch {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 52px;
  height: 24px;
  border-radius: var(--radius-pill);
  padding: 2px 5px;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.18s ease;
  user-select: none;
}

.vitrine-switch.on {
  background: var(--green-dark);
  color: #ffffff;
}

.vitrine-switch.off {
  background: #5c635d;
  color: #ffffff;
  flex-direction: row-reverse;
}

.switch-knob {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  display: inline-block;
}

/* Table Row Actions */
.row-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  font-size: 11.5px;
}

.act-btn {
  font-weight: 600;
  color: var(--text-main);
  padding: 3px 5px;
  border-radius: 4px;
  transition: background 0.12s ease;
}

.act-btn:hover {
  background: #ece9df;
}

.act-btn.-delete {
  color: var(--terracotta);
}

.act-btn.-delete:hover {
  background: var(--terracotta-light);
}

/* Right Panel: Inspector Form Card */
.inspector-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px 18px 18px;
  box-shadow: var(--shadow-card);
}

.inspector-title {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 12px;
}

/* Photo Upload Dropzone */
.upload-box {
  background: var(--bg-upload);
  border: 1.5px dashed #bfbbb0;
  border-radius: var(--radius-md);
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.upload-box.dragover {
  border-color: var(--green-dark);
  background: #e9f2e6;
}

.upload-preview {
  width: 78px;
  height: 74px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border-color);
  background: #e2dfd5;
}

.upload-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
}

.upload-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.3;
}

.upload-btn-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-choose-file {
  background: var(--green-dark);
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 13px;
  border-radius: 6px;
}

.btn-choose-file:hover {
  background: var(--green-hover);
}

.btn-toggle-url {
  background: #ffffff;
  border: 1px solid var(--border-input);
  color: var(--text-main);
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
}

.btn-toggle-url:hover {
  background: #ece9df;
}

/* Form Inputs */
.ops-field {
  margin-bottom: 9px;
}

.ops-field label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 3px;
}

.ops-input {
  width: 100%;
  height: 31px;
  padding: 0 10px;
  border: 1px solid var(--border-input);
  border-radius: 6px;
  background: #ffffff;
  font-size: 12.5px;
  font-weight: 500;
}

.ops-input:focus {
  outline: none;
  border-color: var(--green-dark);
  box-shadow: 0 0 0 2px rgba(27, 61, 32, 0.12);
}

.ops-input.-tinted {
  background: #e8e6df;
  color: #364037;
}

.ops-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* Category Checkboxes */
.cat-checks-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px 8px;
  margin-top: 4px;
}

.cat-check-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.cat-check-label input {
  accent-color: var(--green-dark);
  width: 14px;
  height: 14px;
}

/* Inspector Bottom Buttons */
.inspector-actions {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.btn-save-product {
  height: 36px;
  background: var(--green-dark);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  border-radius: 7px;
}

.btn-save-product:hover {
  background: var(--green-hover);
}

.btn-delete-product {
  height: 36px;
  background: #ffffff;
  border: 1px solid #d49587;
  color: var(--terracotta);
  font-size: 12px;
  font-weight: 700;
  border-radius: 7px;
}

.btn-delete-product:hover {
  background: var(--terracotta-light);
}

/* Toast Notification */
.ops-toast {
  position: fixed;
  bottom: 20px;
  right: 24px;
  background: var(--bg-masthead);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  transform: translateY(80px);
  transition: transform 0.22s ease;
  z-index: 200;
}

.ops-toast.show {
  transform: translateY(0);
}

@media (max-width: 1080px) {
  .ops-header {
    height: auto;
    padding: 12px 0;
  }
  .ops-header-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .ops-role-pill {
    display: none;
  }
  .ops-header-actions {
    width: 100%;
    flex-wrap: wrap;
  }
  .kpi-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .workspace-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .ops-header {
    height: auto;
    padding: 10px 0;
  }
  .ops-header-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .ops-role-pill {
    display: none;
  }
  .ops-header-actions {
    width: 100%;
    flex-wrap: wrap;
  }
  .kpi-row {
    grid-template-columns: 1fr;
  }
  .toolbar-row {
    grid-template-columns: 1fr;
  }
}
