/* ==========================================================================
   Style Custom: Sistem Pengecekan & Link SIPLAH Toko Ladang
   ========================================================================== */

:root {
  --primary-color: #1e40af;
  --primary-hover: #1d4ed8;
  --secondary-color: #0ea5e9;
  --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  --border-color: #cbd5e1;
  --text-main: #0f172a;
  --badge-nego-bg: #fef3c7;
  --badge-nego-text: #b45309;
  --badge-nego-border: #fcd34d;
  --badge-ok-bg: #dcfce7;
  --badge-ok-text: #15803d;
  --badge-ok-border: #86efac;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-main);
  background-color: #f1f5f9;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header Navbar */
.navbar-custom {
  background: linear-gradient(90deg, #1e3a8a 0%, #2563eb 100%);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.navbar-brand {
  font-weight: 700;
  letter-spacing: -0.5px;
}

/* Card Container */
.main-card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
  background: #ffffff;
}

/* Sheet Style Table (Mirip Gambar 2) */
.table-siplah {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.table-siplah thead th {
  background-color: #f8fafc;
  color: #334155;
  font-weight: 600;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 12px 14px;
  border-bottom: 2px solid #cbd5e1;
  border-right: 1px solid #e2e8f0;
  text-align: center;
}

.table-siplah thead th:last-child {
  border-right: none;
}

.table-siplah tbody td {
  padding: 8px 10px;
  vertical-align: middle;
  border-bottom: 1px solid #e2e8f0;
  border-right: 1px solid #f1f5f9;
}

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

.table-siplah .col-no {
  width: 50px;
  text-align: center;
  font-weight: 600;
  color: #64748b;
}

.table-siplah .col-nama {
  min-width: 260px;
  position: relative;
}

.table-siplah .col-harga {
  width: 150px;
}

.table-siplah .col-harga-db {
  width: 150px;
  background-color: #f0fdf4;
  font-weight: 600;
  color: #166534;
  text-align: right;
}

.table-siplah .col-cek {
  width: 140px;
  text-align: center;
}

.table-siplah .col-link {
  min-width: 220px;
}

.table-siplah .col-aksi {
  width: 60px;
  text-align: center;
}

/* Form Controls Inside Table */
.cell-input {
  width: 100%;
  padding: 6px 10px;
  font-size: 0.9rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  transition: all 0.2s;
  background-color: #ffffff;
}

.cell-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.cell-input.price-input {
  text-align: right;
  font-family: 'Courier New', Courier, monospace;
  font-weight: 600;
}

/* Status Badges */
.badge-nego {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--badge-nego-text);
  background-color: var(--badge-nego-bg);
  border: 1px solid var(--badge-nego-border);
  border-radius: 20px;
  letter-spacing: 0.02em;
}

.badge-sesuai {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--badge-ok-text);
  background-color: var(--badge-ok-bg);
  border: 1px solid var(--badge-ok-border);
  border-radius: 20px;
}

.badge-notfound {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #64748b;
  background-color: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
}

/* Link Button in Table */
.btn-siplah-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #1e40af;
  background-color: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 5px 12px;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-siplah-link:hover {
  background-color: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

/* Autocomplete Suggestion Dropdown */
.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1050;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
  max-height: 250px;
  overflow-y: auto;
  margin-top: 4px;
}

.autocomplete-item {
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.15s;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.active {
  background-color: #eff6ff;
}

.autocomplete-item .item-title {
  font-weight: 600;
  font-size: 0.88rem;
  color: #1e293b;
}

.autocomplete-item .item-price {
  font-size: 0.82rem;
  font-weight: 700;
  color: #059669;
  background-color: #ecfdf5;
  padding: 2px 8px;
  border-radius: 4px;
}

/* Summary Bar */
.summary-bar {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px 20px;
}

.stat-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.stat-icon.blue { background-color: #dbeafe; color: #1d4ed8; }
.stat-icon.orange { background-color: #fef3c7; color: #d97706; }
.stat-icon.green { background-color: #dcfce7; color: #15803d; }
.stat-icon.gray { background-color: #f1f5f9; color: #64748b; }

.stat-content .stat-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 600;
  margin-bottom: 2px;
}

.stat-content .stat-val {
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1;
}

/* Tooltip & Utilities */
.cursor-pointer { cursor: pointer; }
.table-responsive { overflow-x: auto; min-height: 250px; }

/* Print Mode */
@media print {
  .navbar-custom, .toolbar-actions, .btn-aksi, .no-print {
    display: none !important;
  }
  body {
    background: #ffffff;
    font-size: 10pt;
  }
  .main-card {
    box-shadow: none;
    border: none;
  }
}
