* {
  font-family: "Inter", sans-serif;
}

body {
  background: #f5f5f5;
  min-height: 100vh;
  padding: 15px 0;
}

.main-container {
  max-width: 900px;
  margin: 0 auto;
}

.search-card {
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 20px;
  margin-bottom: 15px;
}

.logo-section {
  text-align: center;
  margin-bottom: 20px;
}

.logo-section h1 {
  color: #667eea;
  font-weight: 600;
  font-size: 1.5rem;
  margin-bottom: 5px;
}

.logo-section p {
  color: #6c757d;
  font-size: 0.9rem;
}

.search-box {
  position: relative;
  margin-bottom: 0;
}

.search-box input {
  height: 42px;
  border-radius: 6px;
  border: 1px solid #ddd;
  padding-left: 40px;
  padding-right: 40px;
  font-size: 0.95rem;
  transition: all 0.2s;
}

.search-box input:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15);
}

.search-box i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  color: #667eea;
}

.clear-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #999;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.clear-btn:hover {
  color: #667eea;
  background: #f0f0f0;
}

.clear-btn.show {
  display: flex;
}

.btn-search {
  height: 42px;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 500;
  background: #667eea;
  border: none;
  transition: all 0.2s;
}

.btn-search:hover {
  background: #5568d3;
}

.loading {
  display: none;
  text-align: center;
  padding: 30px;
}

.loading .spinner-border {
  width: 2rem;
  height: 2rem;
  color: #667eea;
}

.loading p {
  color: #667eea;
  font-weight: 500;
}

.result-section {
  display: none;
}

.invoice-card {
  background: white;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 12px;
  border: 1px solid #e0e0e0;
  transition: all 0.2s;
}

.invoice-card:hover {
  border-color: #667eea;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.invoice-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f0f0f0;
}

.invoice-code {
  font-size: 1.1rem;
  font-weight: 600;
  color: #667eea;
}

.invoice-ycsc {
  color: #28a745;
  font-size: 0.85rem;
  font-weight: 500;
  margin-top: 3px;
}

.invoice-date {
  color: #6c757d;
  font-size: 0.85rem;
}

.customer-info {
  background: #f8f9fa;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 10px;
}

.customer-info .row > div {
  margin-bottom: 8px;
}

.info-label {
  font-weight: 500;
  color: #495057;
  margin-bottom: 3px;
  font-size: 0.85rem;
}

.info-value {
  color: #212529;
  font-size: 0.95rem;
}

.amount-section {
  background: #667eea;
  color: white;
  border-radius: 6px;
  padding: 12px;
  margin-top: 10px;
}

.amount-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 0.95rem;
}

.amount-row.total {
  font-size: 1.1rem;
  font-weight: 600;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.products-section {
  margin-top: 12px;
}

.products-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 8px 0;
  user-select: none;
}

.products-header:hover {
  color: #667eea;
}

.products-header h6 {
  margin: 0;
  font-size: 0.95rem;
}

.toggle-icon {
  transition: transform 0.3s;
  font-size: 1.1rem;
  color: #667eea;
}

.toggle-icon.collapsed {
  transform: rotate(-90deg);
}

.products-list {
  max-height: 500px;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.products-list.collapsed {
  max-height: 0;
}

.product-item {
  background: #f8f9fa;
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 8px;
  border-left: 3px solid #667eea;
}

.product-name {
  font-weight: 500;
  color: #212529;
  margin-bottom: 4px;
  font-size: 0.95rem;
}

.product-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.product-warranty {
  color: #6c757d;
  font-size: 0.85rem;
}

.product-price {
  font-weight: 600;
  color: #667eea;
  font-size: 0.95rem;
}

.no-result {
  display: none;
  text-align: center;
  padding: 40px 20px;
}

.no-result i {
  font-size: 3rem;
  color: #ddd;
  margin-bottom: 15px;
}

.no-result h3 {
  color: #6c757d;
  margin-bottom: 8px;
  font-size: 1.2rem;
}

.badge-status {
  padding: 5px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
}

.alert-custom {
  border-radius: 6px;
  border: none;
  padding: 10px 15px;
  font-size: 0.9rem;
}

.pagination-section {
  margin-top: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 6px;
}

.pagination-info {
  font-size: 0.9rem;
  color: #6c757d;
}

.pagination-controls {
  display: flex;
  gap: 8px;
}

.btn-page {
  padding: 6px 12px;
  border: 1px solid #ddd;
  background: white;
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-page:hover:not(:disabled) {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

.btn-page:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-page.active {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

.btn-go-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  z-index: 1000;
}

.btn-go-top:hover {
  background: #5568d3;
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
}

.btn-go-top.show {
  display: flex;
}

@media (max-width: 768px) {
  .search-card {
    padding: 15px;
  }

  .logo-section h1 {
    font-size: 1.3rem;
  }

  .invoice-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .invoice-code {
    margin-bottom: 8px;
  }

  .product-details {
    flex-direction: column;
    align-items: flex-start;
  }

  .product-price {
    margin-top: 6px;
  }

  .pagination-section {
    flex-direction: column;
    gap: 10px;
  }

  .pagination-controls {
    width: 100%;
    justify-content: center;
  }

  .btn-go-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    font-size: 1.1rem;
  }
}

/* YCSC Clickable Style */
.ycsc-clickable {
  cursor: pointer;
  color: #28a745;
  font-weight: 600;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 4px;
}

.ycsc-clickable:hover {
  background: #e7f5ec;
  color: #1e7e34;
  transform: translateX(2px);
}

.ycsc-clickable i {
  font-size: 0.8rem;
  opacity: 0.7;
}

/* Modal Styles */
.modal-content {
  border-radius: 10px;
  border: none;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  border-bottom: none;
  padding: 15px 20px;
}

.modal-header .modal-title {
  font-weight: 600;
  font-size: 1.1rem;
}

.modal-header .btn-close {
  filter: brightness(0) invert(1);
  opacity: 0.8;
}

.modal-header .btn-close:hover {
  opacity: 1;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  border-top: 1px solid #e9ecef;
  padding: 12px 20px;
}

/* YCSC Details Styles */
.ycsc-details {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.detail-row {
  background: #f8f9fa;
  padding: 12px;
  border-radius: 6px;
  border-left: 3px solid #667eea;
}

.detail-label {
  font-weight: 600;
  color: #495057;
  margin-bottom: 6px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.detail-value {
  color: #212529;
  font-size: 0.95rem;
  line-height: 1.5;
  word-wrap: break-word;
}

.detail-value.fw-bold {
  font-size: 1.1rem;
}
