/* static/styles.css - Hệ thống Báo giá & Phiếu giao hàng IT Connect */

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

:root {
  --primary: #004b87;
  --primary-dark: #002e5b;
  --primary-light: #e8f1f5;
  --secondary: #e65100;
  --accent: #0284c7;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: #f8fafc;
  color: #1e293b;
}

.mono {
  font-family: 'JetBrains Mono', monospace;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Table Hover and Form Inputs */
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #0284c7;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.2);
}

/* A4 Sheet Preview Container */
.a4-preview-wrapper {
  background: #525659;
  padding: 24px 12px;
  display: flex;
  justify-content: center;
  overflow-x: auto;
}

.a4-page {
  width: 210mm;
  min-height: 297mm;
  padding: 18mm 14mm 10mm 14mm; /* Dời lề trên xuống 1 dòng (~6mm) */
  margin: 0 auto;
  background: white;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  box-sizing: border-box;
  font-size: 12px;
  line-height: 1.35;
  color: #000;
  position: relative;
}

.a4-page table {
  width: 100%;
  border-collapse: collapse;
}

.a4-page table th, .a4-page table td {
  border: 1px solid #1e293b;
  padding: 4px 6px;
}

.a4-page table th {
  background-color: #e8f1f5;
  color: #002060;
  font-weight: 700;
}

/* Print Stylesheet */
@media print {
  body * {
    visibility: hidden;
  }
  
  #printableArea, #printableArea * {
    visibility: visible;
  }
  
  #printableArea {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    background: transparent !important;
  }

  .a4-preview-wrapper {
    background: transparent !important;
    padding: 0 !important;
  }

  .a4-page {
    width: 100% !important;
    min-height: auto !important;
    padding: 6mm 4mm 2mm 4mm !important; /* Dời lề trên xuống 1 dòng khi in */
    margin: 0 !important;
    box-shadow: none !important;
    border: none !important;
    page-break-after: avoid;
    page-break-inside: avoid;
  }

  .no-print {
    display: none !important;
  }

  @page {
    size: A4 portrait;
    margin: 10mm 8mm 6mm 8mm; /* Dời lề trên trang in xuống 1 dòng (từ 6mm lên 10mm) */
  }
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.2s ease-out forwards;
}

.badge-draft { background-color: #f1f5f9; color: #475569; }
.badge-sent { background-color: #e0f2fe; color: #0369a1; }
.badge-accepted { background-color: #dcfce7; color: #15803d; }
.badge-converted { background-color: #fae8ff; color: #86198f; }
.badge-rejected { background-color: #fee2e2; color: #b91c1c; }
.badge-delivered { background-color: #dcfce7; color: #166534; }

/* Autocomplete Suggestion Dropdowns */
.suggest-box {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 440px;
  max-width: 580px;
  background: #ffffff;
  border: 1.5px solid #3b82f6;
  border-radius: 8px;
  box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.3), 0 10px 12px -5px rgba(0, 0, 0, 0.15);
  z-index: 99999;
  max-height: 280px;
  overflow-y: auto;
  margin-top: 4px;
}

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

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

.suggest-item:hover, .suggest-item.active {
  background-color: #eff6ff;
  border-left: 4px solid #2563eb;
}

