/* ===========================
   PriceRobot — App-Specific Styles
   (Mantis template handles base styling)
   =========================== */

/* ── Dashboard DataTable ────────────────────────── */

/* Row status coloring */
#productsTable tr.row-cheaper td {
  background-color: rgba(82, 196, 26, 0.04);
}

#productsTable tr.row-expensive td {
  background-color: rgba(255, 77, 79, 0.04);
}

#productsTable tr.row-equal td {
  background-color: rgba(250, 173, 20, 0.04);
}

/* Pending decision row — yellow left accent */
#productsTable tr.row-pending td:first-child {
  border-left: 3px solid var(--bs-warning);
}

/* Decision button group — compact icon buttons */
.decision-btn-group {
  display: inline-flex;
}

.decision-btn-group .btn {
  padding: 0.2rem 0.45rem;
  line-height: 1;
}

/* NEW PRICE column — inline manual input with slide animation */
.new-price-cell {
  position: relative;
  min-width: 110px;
}

.new-price-cell .manual-price-input {
  display: none;
  width: 110px;
  text-align: right;
  margin-left: auto;
  font-size: 0.8rem;
  padding: 0.2rem 0.4rem;
  border: 1px solid var(--bs-warning);
  border-radius: var(--bs-border-radius);
  background-color: rgba(255, 193, 7, 0.06);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.new-price-cell .manual-price-input.show {
  display: block;
}

.new-price-cell .manual-price-input:focus {
  box-shadow: 0 0 0 0.15rem rgba(255, 193, 7, 0.25);
  border-color: var(--bs-warning);
  outline: none;
}

/* Hide computed price when manual input is visible */
.new-price-cell .manual-price-input.show ~ .computed-new-price {
  display: none;
}

/* DataTables integration — match Mantis look */
.dataTables_wrapper .dataTables_filter input {
  border-radius: var(--bs-border-radius);
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: var(--bs-border-radius) !important;
}

/* Stat cards — hover effect and active state */
.stat-card {
  transition: box-shadow 0.2s, border-color 0.2s;
  border: 2px solid transparent;
}

.stat-card:hover {
  box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.1);
}

.stat-card.stat-card-active {
  border-color: var(--bs-primary);
}

/* Compact pricing table */
.pricing-table thead th {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #8c8c8c;
  padding: 0.5rem 0.4rem;
  border-bottom: 2px solid var(--bs-border-color);
  white-space: nowrap;
}

.pricing-table tbody td {
  padding: 0.45rem 0.4rem;
  vertical-align: middle;
  font-size: 0.85rem;
}

/* Clickable table rows */
#productsTable tbody tr {
  cursor: pointer;
}

/* ── Product Detail Modal ───────────────────────── */

.own-price-box {
  background-color: var(--bs-gray-100);
  border-radius: var(--bs-border-radius);
  border: 1px solid var(--bs-border-color);
}

/* Competitor rows in modal — price coloring */
tr.price-higher td {
  background-color: rgba(82, 196, 26, 0.06);
}

tr.price-higher td strong {
  color: #389e0d;
}

tr.price-higher td span {
  color: #389e0d;
  font-weight: 500;
}

tr.price-lower td {
  background-color: rgba(255, 77, 79, 0.06);
}

tr.price-lower td strong {
  color: #cf1322;
}

tr.price-lower td span {
  color: #cf1322;
  font-weight: 500;
}

/* Clickable competitor rows in modal */
.modal-match-row {
  transition: background-color 0.15s;
}

.modal-match-row:hover td {
  background-color: rgba(24, 144, 255, 0.08) !important;
}

/* Selected competitor row in modal */
.modal-match-row-selected td {
  background-color: rgba(24, 144, 255, 0.12) !important;
  border-top: 2px solid var(--bs-primary);
  border-bottom: 2px solid var(--bs-primary);
}

.modal-match-row-selected td:first-child {
  border-left: 3px solid var(--bs-primary);
}

/* Decision area in modal */
.modal-decision-area .modal-decision-btn.active {
  pointer-events: auto;
}

/* ── Header App Links ─────────────────────────── */

.topbar-app-link {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  margin: 0 2px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--pc-header-color, #5b6b79);
  text-decoration: none;
  border-radius: var(--bs-border-radius);
  position: relative;
  white-space: nowrap;
}

.topbar-app-link i {
  font-size: 18px;
}

.topbar-app-link.active {
  color: var(--bs-primary) !important;
  font-weight: 600;
  background-color: rgba(var(--bs-primary-rgb), 0.08);
}

.topbar-app-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background-color: var(--bs-primary);
  border-radius: 2px;
}

.topbar-app-link:not(.disabled):not(.active):hover {
  color: var(--bs-primary);
  background-color: rgba(var(--bs-primary-rgb), 0.04);
}

.topbar-app-link.disabled {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}

/* ── General ────────────────────────────────────── */

/* Competitor rows in product form */
.competitor-row {
  border-radius: var(--bs-border-radius);
}

/* Badge inside buttons — keep normal case */
.btn .badge {
  text-transform: none;
}

/* Spinner inside buttons */
.spinner-border-sm {
  vertical-align: middle;
}

/* ===========================
   Service Module — Styles
   =========================== */

/* ── Status Timeline ─────────────────────────── */

.status-timeline {
  position: relative;
  padding-left: 20px;
}

.status-timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background-color: var(--bs-border-color);
}

.status-timeline-item {
  position: relative;
  padding-bottom: 16px;
  padding-left: 8px;
}

.status-timeline-item:last-child {
  padding-bottom: 0;
}

.status-timeline-item::before {
  content: '';
  position: absolute;
  left: -19px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--bs-border-color);
  border: 2px solid #fff;
}

.status-timeline-item.current::before {
  background-color: var(--bs-primary);
  box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.2);
}

/* ── Priority Row Accents ────────────────────── */

tr.priority-urgent td:first-child {
  border-left: 3px solid var(--bs-danger);
}

tr.priority-high td:first-child {
  border-left: 3px solid var(--bs-warning);
}

/* ── Service Cards ───────────────────────────── */

.card-footer {
  text-decoration: none;
  transition: background-color 0.15s;
}

a.card-footer:hover {
  background-color: rgba(var(--bs-primary-rgb), 0.04);
  text-decoration: none;
}

/* ── Filter Status Colors ────────────────────── */

.border-3 {
  border-width: 3px !important;
}

/* ===========================
   Orvix Logo
   =========================== */

.orvix-logo {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  padding: 0.6rem 1.2rem;
  border-radius: 0.75rem;
  transition: all 0.5s ease;
  text-decoration: none;
}

.orvix-logo:hover {
  transform: scale(1.05);
  text-decoration: none;
}

.orvix-logo-text {
  font-family: 'Orbitron', sans-serif;
  font-weight: 500;
  font-size: 42px;
  letter-spacing: 0.1em;
  line-height: 1;
}

.orvix-logo-line {
  height: 2px;
  width: 100%;
  margin-top: 2px;
  transform: scaleX(0);
  transition: transform 700ms ease-in-out;
  transform-origin: center;
}

.orvix-logo:hover .orvix-logo-line {
  transform: scaleX(1);
}

/* Light version (tenant sidebar — white background) */
.orvix-logo-light {
  background-color: transparent;
}

.orvix-logo-light .orvix-logo-text {
  color: #0f172a;
}

.orvix-logo-light .orvix-logo-line {
  background: linear-gradient(to right, transparent, #06b6d4, transparent);
}

/* Dark version (admin sidebar — dark background) */
.orvix-logo-dark {
  background-color: #0f172a;
}

.orvix-logo-dark .orvix-logo-text {
  color: #ffffff;
}

.orvix-logo-dark .orvix-logo-line {
  background: linear-gradient(to right, transparent, #06b6d4, transparent);
}

/* Admin sidebar dark background */
.pc-sidebar.sidebar-dark {
  background-color: #0f172a !important;
}

.pc-sidebar.sidebar-dark .navbar-content {
  background-color: #0f172a !important;
}

.pc-sidebar.sidebar-dark .pc-navbar .pc-link {
  color: rgba(255, 255, 255, 0.7);
}

.pc-sidebar.sidebar-dark .pc-navbar .pc-link:hover {
  color: #ffffff;
}

.pc-sidebar.sidebar-dark .pc-navbar .pc-item.active > .pc-link {
  color: #06b6d4;
}

.pc-sidebar.sidebar-dark .pc-caption label {
  color: rgba(255, 255, 255, 0.4);
}

.pc-sidebar.sidebar-dark .m-header {
  background-color: #0f172a;
}
