/* ===================================================================
   APOTEK ASR FARMA - APPLICATION STYLESHEET (app.css)
   Sistem Manajemen Apotek & Kasir POS
   Typography: Clean, Modern, Elegant (Tidak Tebal & Enak Dibaca)
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600&family=Inter:wght@300;400;500;600&display=swap');

:root {
  --primary: #007978;
  --primary-dark: #005f5e;
  --primary-light: #e6f4f4;
  --primary-subtle: #f0fdf9;
  --accent-orange: #f0643b;
  --accent-orange-hover: #d9532b;
  --text-heading: #0f172a;
  --text-dark: #1e293b;
  --text-body: #334155;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --border-focus: #007978;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #0284c7;
  --sidebar-width: 250px;
  --topbar-height: 64px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -2px rgba(0,0,0,0.03);
  --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.07);
}

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

body {
  font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-body);
  font-size: 13.5px;
  line-height: 1.6;
  height: 100vh;
  overflow: hidden;
  display: flex;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ================= APP LAYOUT ================= */
.app-sidebar {
  width: var(--sidebar-width);
  background-color: #006665; /* Farmacare deep teal signature theme */
  border-right: 1px solid rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100vh;
  z-index: 100;
  color: #ffffff;
}

.sidebar-header {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  padding: 0 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  gap: 10px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
}

.sidebar-brand-icon {
  width: 32px;
  height: 32px;
  background: #ffffff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #007978;
  font-size: 17px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
}

.sidebar-brand-title {
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sidebar-brand-title .badge {
  background: rgba(255, 255, 255, 0.2) !important;
  color: #ffffff !important;
}

.sidebar-brand-subtitle {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-nav {
  flex-grow: 1;
  padding: 14px 8px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-category {
  font-size: 10.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 10px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  gap: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  font-weight: 500;
  font-size: 13.5px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.nav-item.active {
  background-color: #ffffff;
  color: #005e5d;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.nav-item .icon {
  font-size: 16px;
  width: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-item span:not(.icon) {
  text-align: left;
}

/* ================= ACCORDION DROPDOWN "BARANG" (FARMACARE STYLE) ================= */
.sidebar-dropdown-group {
  margin: 1px 0;
}

.sidebar-dropdown-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: #ffffff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: left;
}

.sidebar-dropdown-toggle:hover {
  background-color: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.sidebar-dropdown-toggle .toggle-left {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}

.sidebar-dropdown-toggle .toggle-left .icon {
  width: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-dropdown-toggle .dropdown-chevron {
  transition: transform 0.25s ease;
  stroke: rgba(255, 255, 255, 0.85);
  flex-shrink: 0;
}

.sidebar-dropdown-group.open .dropdown-chevron {
  transform: rotate(0deg); /* points down */
}

.sidebar-dropdown-group:not(.open) .dropdown-chevron {
  transform: rotate(-90deg); /* points right */
}

.sidebar-submenu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 2px 0 4px 0;
  text-align: left;
}

.sidebar-dropdown-group:not(.open) .sidebar-submenu {
  display: none;
}

.submenu-item {
  display: block;
  padding: 7px 12px 7px 44px;
  margin: 1px 0;
  color: #ffffff;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.18s ease;
  cursor: pointer;
  text-align: left;
}

.submenu-item:hover {
  background-color: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.submenu-item.active {
  background-color: #ffffff !important;
  color: #005e5d !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background-color: rgba(0, 0, 0, 0.1);
  color: #ffffff;
  text-align: left;
}

.pharmacy-badge-info {
  text-align: left;
}
  color: #ffffff;
}

.pharmacy-badge-info .pharmacy-name-label {
  font-weight: 600;
  font-size: 13px;
  color: #ffffff;
}

.pharmacy-badge-info .pharmacy-sipa-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
}
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.pharmacy-badge-info .pharmacy-name-label {
  font-weight: 600;
  color: var(--text-heading);
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pharmacy-badge-info .pharmacy-sipa-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  font-weight: 400;
}

/* ================= MAIN CONTAINER ================= */
.app-main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg-body);
}

.app-topbar {
  height: var(--topbar-height);
  background-color: #ffffff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-title {
  font-size: 16.5px;
  font-weight: 600;
  color: var(--text-heading);
  letter-spacing: -0.01em;
}

.shift-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 500;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #10b981;
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 5px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.datetime-display {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 450;
  background: var(--bg-body);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

/* ================= VIEW CONTAINER ================= */
.app-content {
  flex-grow: 1;
  overflow-y: auto;
  padding: 22px;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadeIn 0.18s ease;
}

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

/* ================= BUTTONS & INPUTS ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 15px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.18s ease;
  text-decoration: none;
}

.btn-sm {
  padding: 4px 9px;
  font-size: 11.5px;
}

.btn-lg {
  padding: 11px 20px;
  font-size: 14px;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
}

.btn-orange {
  background-color: var(--accent-orange);
  color: #ffffff;
}

.btn-orange:hover {
  background-color: var(--accent-orange-hover);
}

.btn-outline {
  background-color: #ffffff;
  border: 1px solid var(--border);
  color: var(--text-body);
}

.btn-outline:hover {
  background-color: #f1f5f9;
  color: var(--text-heading);
  border-color: #cbd5e1;
}

.btn-danger {
  background-color: var(--danger);
  color: #ffffff;
}

.btn-danger:hover {
  background-color: #dc2626;
}

.btn-success {
  background-color: var(--success);
  color: #ffffff;
}

.btn-success:hover {
  background-color: #059669;
}

.form-control {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  color: var(--text-dark);
  background-color: #ffffff;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
  font-weight: 400;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 121, 120, 0.1);
}

/* ================= CARDS & GRIDS ================= */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-heading);
  letter-spacing: -0.01em;
}

/* ================= STATS WIDGETS ================= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}

.stat-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.stat-icon.teal { background-color: var(--primary-light); color: var(--primary); }
.stat-icon.green { background-color: #ecfdf5; color: #10b981; }
.stat-icon.orange { background-color: #fff7ed; color: #f97316; }
.stat-icon.red { background-color: #fef2f2; color: #ef4444; }

.stat-info .stat-value {
  font-size: 19px;
  font-weight: 600;
  color: var(--text-heading);
  letter-spacing: -0.015em;
}

.stat-info .stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 450;
}

/* ================= TABLES ================= */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.table th {
  background-color: #f8fafc;
  padding: 10px 12px;
  font-weight: 550;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  font-size: 11.5px;
  letter-spacing: 0.02em;
}

.table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text-body);
}

.table tbody tr:hover {
  background-color: #fcfcfd;
}

/* ================= BADGES ================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}

.badge-success { background: #dcfce7; color: #15803d; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-info { background: #e0f2fe; color: #0369a1; }

/* ================= CASHIER / POS LAYOUT ================= */
.pos-container {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 18px;
  height: calc(100vh - 110px);
}

.pos-catalog-panel {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  overflow: hidden;
}

.pos-cart-panel {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.pos-search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.pos-category-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 12px;
}

.category-pill {
  padding: 5px 12px;
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 450;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.category-pill.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.pos-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 10px;
  overflow-y: auto;
  padding-right: 2px;
  flex-grow: 1;
}

.product-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.18s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.product-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 121, 120, 0.08);
}

.product-card .p-name {
  font-weight: 550;
  font-size: 13px;
  color: var(--text-heading);
  margin-bottom: 3px;
}

.product-card .p-category {
  font-size: 10.5px;
  color: var(--text-muted);
}

.product-card .p-price {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--primary);
  margin-top: 6px;
}

.product-card .p-stock {
  font-size: 11px;
  color: var(--text-muted);
}

.cart-items-list {
  flex-grow: 1;
  overflow-y: auto;
  margin: 10px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 2px;
}

.cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fafbfc;
}

.cart-item-info {
  flex-grow: 1;
}

.cart-item-name {
  font-weight: 550;
  font-size: 12.5px;
  color: var(--text-heading);
}

.cart-item-price {
  font-size: 11.5px;
  color: var(--text-muted);
}

.cart-qty-ctrl {
  display: flex;
  align-items: center;
  gap: 5px;
}

.btn-qty {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 500;
}

.cart-summary {
  border-top: 1px solid var(--border);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-body);
}

.summary-row.total {
  font-size: 15.5px;
  font-weight: 650;
  color: var(--primary);
  padding-top: 6px;
  border-top: 1px dashed var(--border);
}

/* ================= MODALS ================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(2px);
}

.modal-dialog {
  background: #ffffff;
  border-radius: var(--radius-md);
  width: 90%;
  max-width: 580px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalPop 0.18s ease;
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-body {
  padding: 18px;
  overflow-y: auto;
}

.modal-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background-color: #fafbfc;
}

/* ================= THERMAL RECEIPT, ETIKET & SP PRINT STYLES ================= */
#receiptPrintArea,
#etiketPrintArea,
#spPrintArea {
  display: none;
}

@media print {
  body * {
    visibility: hidden;
  }
  #receiptPrintArea, #receiptPrintArea *,
  #etiketPrintArea, #etiketPrintArea *,
  #spPrintArea, #spPrintArea * {
    visibility: visible;
  }
  #receiptPrintArea {
    display: block !important;
    position: absolute;
    left: 0;
    top: 0;
    width: 80mm;
    font-family: 'Courier New', Courier, monospace;
    font-size: 11px;
    line-height: 1.3;
    padding: 10px;
    color: #000;
  }
  #etiketPrintArea {
    display: block !important;
    position: absolute;
    left: 0;
    top: 0;
    width: 75mm;
    padding: 8px;
    background: #fff;
  }
  #spPrintArea {
    display: block !important;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    padding: 20mm;
    background: #fff;
    color: #000;
  }
}

.receipt-box {
  width: 80mm;
  font-family: 'Courier New', Courier, monospace;
  font-size: 12px;
  line-height: 1.3;
  margin: 0 auto;
  padding: 10px;
  background: #ffffff;
  border: 1px dashed #ccc;
}

.receipt-box .text-center { text-align: center; }
.receipt-box .divider { border-bottom: 1px dashed #000; margin: 6px 0; }

/* ================= ETIKET OBAT STYLES ================= */
.etiket-preview-card {
  width: 72mm;
  border-radius: 8px;
  padding: 12px 14px;
  margin: 0 auto;
  background: #ffffff;
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: #1e293b;
  position: relative;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.etiket-preview-card.putih {
  border: 2px solid #007978;
}

.etiket-preview-card.biru {
  border: 2px solid #2563eb;
  background-color: #f8faff;
}

.etiket-header {
  text-align: center;
  border-bottom: 1px dashed #cbd5e1;
  padding-bottom: 6px;
  margin-bottom: 8px;
}

.etiket-header .etiket-title {
  font-weight: 600;
  font-size: 13px;
  color: #0f172a;
}

.etiket-header .etiket-sipa {
  font-size: 9.5px;
  color: #64748b;
}

.etiket-body {
  font-size: 12px;
  line-height: 1.5;
}

.etiket-rule-box {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 8px;
  text-align: center;
  margin: 8px 0;
  font-size: 14px;
  font-weight: 600;
  color: #007978;
}

.etiket-preview-card.biru .etiket-rule-box {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.etiket-footer-tag {
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 3px;
  border-radius: 4px;
  margin-top: 6px;
}

.etiket-footer-tag.putih {
  background-color: #e6f4f4;
  color: #007978;
}

.etiket-footer-tag.biru {
  background-color: #dbeafe;
  color: #1e40af;
}

/* ================= SURAT PESANAN (SP) STYLES ================= */
.sp-document {
  max-width: 800px;
  margin: 0 auto;
  background: #ffffff;
  padding: 36px 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  color: #000000;
  font-family: 'Inter', sans-serif;
  line-height: 1.5;
}

.sp-header {
  display: flex;
  justify-content: space-between;
  border-bottom: 2px solid #000;
  padding-bottom: 12px;
  margin-bottom: 20px;
}

.sp-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
  font-size: 13px;
}

.sp-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 30px;
}

.sp-table th,
.sp-table td {
  border: 1px solid #000;
  padding: 8px 10px;
  font-size: 12.5px;
}

.sp-table th {
  background-color: #f1f5f9;
  font-weight: 600;
}

.sp-signature-row {
  display: flex;
  justify-content: flex-end;
  text-align: center;
  margin-top: 30px;
}

.sp-signature-box {
  width: 240px;
}

.sp-signature-line {
  margin-top: 60px;
  border-bottom: 1px solid #000;
  font-weight: 600;
}

/* ================= STOCKTAKE DIFF BADGES ================= */
.diff-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 550;
}

.diff-match { background: #dcfce7; color: #15803d; }
.diff-minus { background: #fee2e2; color: #b91c1c; }
.diff-plus { background: #fef3c7; color: #b45309; }

/* ================= REPORTS HUB (FARMACARE STYLE) ================= */
.reports-hub-wrapper {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.reports-hub-header {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.reports-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-grow: 1;
  max-width: 380px;
}

.report-group-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.report-group-heading {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-heading);
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.report-group-heading .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--primary);
}

.report-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.report-card-item {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  cursor: pointer;
  transition: all 0.18s ease;
  position: relative;
  text-decoration: none;
  color: inherit;
}

.report-card-item:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 121, 120, 0.08);
}

.report-card-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background-color: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.report-card-content {
  flex-grow: 1;
}

.report-card-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-heading);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.report-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.report-card-arrow {
  color: var(--text-light);
  font-size: 16px;
  transition: transform 0.18s;
  align-self: center;
}

.report-card-item:hover .report-card-arrow {
  color: var(--primary);
  transform: translateX(3px);
}

/* ================= REPORT DETAIL VIEW ================= */
.report-detail-view {
  display: none;
  flex-direction: column;
  gap: 18px;
}

.report-detail-view.active {
  display: flex;
}

.report-detail-topbar {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.report-detail-title-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-back-report {
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-body);
  transition: all 0.15s;
}

.btn-back-report:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.report-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.report-kpi-box {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.report-kpi-box .kpi-label {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.report-kpi-box .kpi-val {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-heading);
}



/* ===================================================================
   BARANG SUBMODULES STYLES: BATCH & ED, DEFECTA, KATALOG, BUNDLE
   =================================================================== */

/* Status Countdown Badges */
.badge-ed {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 600;
}
.badge-ed.expired {
  background: #fee2e2;
  color: #b91c1c;
}
.badge-ed.critical {
  background: #ffedd5;
  color: #c2410c;
}
.badge-ed.warning {
  background: #fef9c3;
  color: #854d0e;
}
.badge-ed.safe {
  background: #dcfce7;
  color: #15803d;
}

/* BPOM Golongan Obat Symbols */
.bpom-symbol {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
  border: 1.5px solid #000;
}
.bpom-symbol.bebas {
  background: #22c55e;
  border-color: #000;
}
.bpom-symbol.bebas-terbatas {
  background: #0284c7;
  border-color: #000;
}
.bpom-symbol.keras {
  background: #ef4444;
  color: #000;
  border-color: #000;
}
.bpom-symbol.herbal {
  background: #10b981;
  color: #fff;
  border-color: #047857;
}

/* Defecta View Styling */
.defecta-qty-input {
  width: 75px;
  padding: 4px 8px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 4px;
  text-align: center;
  font-weight: 600;
}
.defecta-qty-input:focus {
  border-color: var(--primary);
  outline: none;
}

/* Visual Catalog Grid */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 14px;
}

.catalog-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
  position: relative;
  cursor: pointer;
}

.catalog-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  border-color: #0d9488;
}

.bpom-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}
.bpom-pill.bebas { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.bpom-pill.bebas-terbatas { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.bpom-pill.keras { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.bpom-pill.herbal { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }

.catalog-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.catalog-card-image-wrap {
  width: 100%;
  height: 175px;
  background-color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  margin-bottom: 12px;
  padding: 6px;
  border: 1px solid #f1f5f9;
  overflow: hidden;
}

.catalog-card-image {
  max-width: 100%;
  max-height: 160px;
  width: auto;
  height: auto;
  object-fit: contain;
  background-color: #ffffff;
  transition: transform 0.25s ease;
}

.catalog-card:hover .catalog-card-image {
  transform: scale(1.04);
}

.catalog-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 3px;
}

.catalog-card-spec {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.catalog-card-indication {
  font-size: 12.5px;
  color: var(--text-body);
  background: #f8fafc;
  padding: 6px 10px;
  border-radius: 6px;
  margin-bottom: 12px;
  min-height: 44px;
}

.catalog-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  margin-top: auto;
}

.catalog-card-price {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--primary);
}

/* Paket Penjualan / Bundle Cards */
.bundle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 18px;
  margin-top: 14px;
}

.bundle-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.bundle-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(0, 121, 120, 0.08);
}

.bundle-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.bundle-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-heading);
}

.bundle-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.bundle-items-list {
  background: #f8fafc;
  border: 1px solid #edf2f7;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 14px;
}

.bundle-item-row {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  padding: 3px 0;
  border-bottom: 1px dashed #e2e8f0;
}
.bundle-item-row:last-child {
  border-bottom: none;
}

.bundle-pricing {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}

.bundle-price-final {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
}

.bundle-price-orig {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: line-through;
  margin-left: 8px;
}

.bundle-discount-badge {
  background: #fee2e2;
  color: #b91c1c;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}
