/**
 * Tema biru CCTV ERP — override Bootstrap / AdminLTE primary
 */
:root {
  --bs-primary: #1565c0;
  --bs-primary-rgb: 21, 101, 192;
  --cctv-accent: #0d47a1;
  --cctv-surface: #e3f2fd;
}

.btn-primary {
  --bs-btn-bg: #1565c0;
  --bs-btn-border-color: #0d47a1;
  --bs-btn-hover-bg: #0d47a1;
  --bs-btn-hover-border-color: #0a3a7a;
  --bs-btn-active-bg: #0a3a7a;
  --bs-btn-active-border-color: #082e5c;
}

.bg-primary {
  background-color: #1565c0 !important;
}

.text-primary-emphasis {
  color: #0d47a1 !important;
}

.border-primary {
  border-color: #1565c0 !important;
}

.app-sidebar.sidebar-dark,
aside.app-sidebar[data-bs-theme="dark"] {
  --lte-sidebar-bg: #0d3b66;
}

.app-header.navbar {
  background: linear-gradient(90deg, #e3f2fd 0%, #bbdefb 100%) !important;
}

.brand-link .brand-text {
  letter-spacing: 0.02em;
}

.card.border-start.border-primary {
  border-left-color: #1565c0 !important;
}

/* —— Dashboard (modern) —— */
.dashboard-hero {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  padding: 1.75rem 1.5rem;
  background: linear-gradient(135deg, #0d47a1 0%, #1565c0 42%, #1976d2 100%);
  color: #fff;
  box-shadow: 0 12px 40px rgba(13, 71, 161, 0.28);
}
.dashboard-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 100% 0%, rgba(255, 255, 255, 0.18), transparent 55%);
  pointer-events: none;
}
.dashboard-hero .hero-inner {
  position: relative;
  z-index: 1;
}
.dashboard-hero .hero-stat {
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.dashboard-kpi {
  border: none;
  border-radius: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}
.dashboard-kpi:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(21, 101, 192, 0.12) !important;
}
.dashboard-kpi .kpi-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}
.dashboard-kpi .kpi-label {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  opacity: 0.72;
}
.dashboard-kpi .kpi-value {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.dashboard-panel {
  border: none;
  border-radius: 1rem;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
}
.dashboard-panel .card-header {
  border-radius: 1rem 1rem 0 0 !important;
  padding: 1rem 1.25rem;
}
.dashboard-quick {
  border-radius: 0.85rem;
  border: 1px solid rgba(21, 101, 192, 0.12);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.dashboard-quick:hover {
  background: rgba(21, 101, 192, 0.06);
  border-color: rgba(21, 101, 192, 0.25);
  transform: translateX(2px);
  color: inherit;
}
.dashboard-quick .dq-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  color: #fff;
}
.dashboard-flow .flow-step {
  position: relative;
  padding-left: 2.25rem;
  padding-bottom: 1.1rem;
}
.dashboard-flow .flow-step:last-child {
  padding-bottom: 0;
}
.dashboard-flow .flow-step::before {
  content: "";
  position: absolute;
  left: 0.55rem;
  top: 0.35rem;
  bottom: -0.35rem;
  width: 2px;
  background: linear-gradient(180deg, #1565c0, rgba(21, 101, 192, 0.15));
}
.dashboard-flow .flow-step:last-child::before {
  display: none;
}
.dashboard-flow .flow-dot {
  position: absolute;
  left: 0;
  top: 0.2rem;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: #1565c0;
  box-shadow: 0 0 0 4px rgba(21, 101, 192, 0.2);
}
.dashboard-chart-wrap {
  position: relative;
  height: 220px;
}
@media (min-width: 992px) {
  .dashboard-chart-wrap {
    height: 260px;
  }
}

/* —— POS / Kasir —— */
.pos-page {
  --pos-radius: 1rem;
  --pos-shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
}
.pos-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.pos-search-wrap {
  flex: 1;
  min-width: 220px;
  max-width: 480px;
  position: relative;
}
.pos-search-wrap .bi {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  font-size: 1.1rem;
  pointer-events: none;
}
.pos-search-wrap input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.75rem;
  border: 1px solid rgba(21, 101, 192, 0.2);
  border-radius: 999px;
  background: #fff;
  font-size: 0.95rem;
  box-shadow: 0 2px 12px rgba(21, 101, 192, 0.06);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.pos-search-wrap input:focus {
  outline: none;
  border-color: #1565c0;
  box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.15);
}
.pos-badge-count {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(21, 101, 192, 0.1);
  color: #0d47a1;
}
.pos-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 1rem;
}
@media (min-width: 1200px) {
  .pos-product-grid {
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  }
}
.pos-product-card {
  background: #fff;
  border-radius: var(--pos-radius);
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: var(--pos-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.pos-product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(21, 101, 192, 0.12);
}
.pos-product-card.is-out {
  opacity: 0.55;
}
.pos-product-card .pos-p-visual {
  height: 88px;
  background: linear-gradient(145deg, #e3f2fd 0%, #bbdefb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1565c0;
  font-size: 2rem;
}
.pos-product-card .pos-p-body {
  padding: 0.85rem 0.9rem 0.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.pos-product-card .pos-p-sku {
  font-size: 0.65rem;
  font-family: ui-monospace, monospace;
  color: #64748b;
  letter-spacing: 0.02em;
}
.pos-product-card .pos-p-name {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
  color: #0f172a;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.2em;
  margin-bottom: 0.35rem;
}
.pos-product-card .pos-p-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin-top: auto;
}
.pos-product-card .pos-p-price {
  font-weight: 700;
  font-size: 0.88rem;
  color: #0d47a1;
}
.pos-product-card .pos-p-stock {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
}
.pos-stock-ok {
  background: #e8f5e9;
  color: #2e7d32;
}
.pos-stock-low {
  background: #fff8e1;
  color: #f57f17;
}
.pos-stock-out {
  background: #ffebee;
  color: #c62828;
}
.pos-product-card .pos-p-add {
  margin-top: 0.65rem;
}
.pos-product-card .pos-p-add .btn {
  width: 100%;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.45rem;
}
.pos-cart-panel {
  border-radius: var(--pos-radius);
  border: none;
  box-shadow: var(--pos-shadow);
  overflow: hidden;
  background: #fff;
}
.pos-cart-sticky {
  position: sticky;
  top: 1rem;
  z-index: 5;
}
.pos-cart-head {
  background: linear-gradient(135deg, #0d47a1 0%, #1565c0 100%);
  color: #fff;
  padding: 1rem 1.15rem;
}
.pos-cart-head h2 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}
.pos-cart-head .text-white-50 {
  font-size: 0.78rem;
  opacity: 0.88;
}
.pos-cart-body {
  padding: 1rem 1.15rem;
  max-height: min(52vh, 420px);
  overflow-y: auto;
}
.pos-cart-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: #94a3b8;
}
.pos-cart-empty .bi {
  font-size: 2.5rem;
  opacity: 0.5;
  margin-bottom: 0.5rem;
}
.pos-line {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}
.pos-line:last-of-type {
  border-bottom: none;
}
.pos-line-info {
  flex: 1;
  min-width: 0;
}
.pos-line-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: #0f172a;
  line-height: 1.3;
}
.pos-line-sub {
  font-size: 0.75rem;
  color: #64748b;
}
.pos-line-qty {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.pos-line-qty input[type="number"] {
  width: 3.25rem;
  text-align: center;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.25rem;
}
.pos-line-remove .btn {
  border-radius: 8px;
  padding: 0.25rem 0.45rem;
}
.pos-line-total {
  font-weight: 700;
  font-size: 0.82rem;
  color: #0d47a1;
  white-space: nowrap;
}
.pos-checkout {
  background: linear-gradient(180deg, #f8fafc 0%, #fff 40%);
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  padding: 1rem 1.15rem 1.15rem;
}
.pos-checkout .form-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 0.25rem;
}
.pos-checkout .form-control,
.pos-checkout .form-select {
  border-radius: 10px;
  border-color: #e2e8f0;
  font-size: 0.9rem;
}
.pos-total-bar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 0.75rem 0 1rem;
  padding: 0.65rem 0.85rem;
  background: #e3f2fd;
  border-radius: 12px;
  border: 1px solid rgba(21, 101, 192, 0.15);
}
.pos-total-bar .lbl {
  font-size: 0.75rem;
  font-weight: 600;
  color: #1565c0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pos-total-bar .val {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0d47a1;
  letter-spacing: -0.02em;
}
.pos-btn-pay {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 0.85rem 1rem;
  font-weight: 700;
  font-size: 0.95rem;
  background: linear-gradient(135deg, #2e7d32 0%, #43a047 100%);
  color: #fff;
  box-shadow: 0 8px 24px rgba(46, 125, 50, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.pos-btn-pay:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(46, 125, 50, 0.4);
}
.pos-btn-clear {
  border-radius: 10px;
  font-size: 0.8rem;
}
.pos-no-match {
  display: none;
  text-align: center;
  padding: 2rem;
  color: #94a3b8;
  grid-column: 1 / -1;
}
.pos-no-match.show {
  display: block;
}
