:root {
  --primary: #0284c7;
  --primary-dark: #0369a1;
  --primary-light: #38bdf8;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #cbd5e1;
  --radius: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Sarabun', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

h1, h2, h3, h4, th, .brand-logo, .cat-pill {
  font-family: 'Prompt', sans-serif;
}

/* Header */
.app-header {
  background: white;
  border-bottom: 2px solid #0284c7;
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.8rem 1.5rem;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo {
  background: #0284c7;
  color: white;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.95rem;
}

.brand h1 { font-size: 1.25rem; color: #0f172a; }
.brand p { font-size: 0.78rem; color: var(--muted); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: all 0.2s;
}

.btn-quote { background: #0284c7; color: white; }
.btn-quote:hover { background: #0369a1; }
.badge { background: #facc15; color: #1e293b; font-size: 0.75rem; font-weight: 700; padding: 2px 7px; border-radius: 10px; }

/* Hero */
.hero-bar {
  background: linear-gradient(135deg, #0c4a6e, #0284c7);
  color: white;
  padding: 2.5rem 1.5rem;
  text-align: center;
}

.hero-content { max-width: 900px; margin: 0 auto; }
.hero-content h2 { font-size: 1.8rem; margin-bottom: 0.6rem; }
.hero-content p { font-size: 0.95rem; opacity: 0.9; margin-bottom: 1.2rem; }

.standards-tags { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.standards-tags span { background: rgba(255,255,255,0.15); padding: 4px 12px; border-radius: 20px; font-size: 0.8rem; }

/* Main Container */
.main-container {
  max-width: 1200px;
  margin: 2rem auto 4rem;
  padding: 0 1.5rem;
}

.filter-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.filter-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.2rem;
  margin-bottom: 1.2rem;
}

.search-wrap label, .select-wrap label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.3rem; }
.search-wrap input, .select-wrap select {
  width: 100%;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.95rem;
}

.category-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cat-pill {
  background: #f1f5f9;
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  cursor: pointer;
  color: #334155;
  transition: all 0.2s;
}

.cat-pill.active, .cat-pill:hover {
  background: #0284c7;
  color: white;
  border-color: #0284c7;
}

/* Table Card */
.table-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.table-header-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.table-header-info h3 { font-size: 1.15rem; color: #0f172a; }
.unit-note { font-size: 0.8rem; color: var(--muted); }

.table-responsive {
  overflow-x: auto;
}

.price-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.price-table th {
  background: #f8fafc;
  border-bottom: 2px solid var(--border);
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: #334155;
}

.price-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
}

.price-table tr:hover {
  background: #f8fafc;
}

.dn-badge {
  background: #e0f2fe;
  color: #0369a1;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
}

.price-col {
  font-weight: 700;
  color: #0284c7;
  font-size: 1rem;
}

.btn-add-item {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  transition: all 0.2s;
}

.btn-add-item:hover {
  background: #0284c7;
  color: white;
}

/* Quotation Modal */
.modal { display: none; position: fixed; inset: 0; z-index: 1000; }
.modal.active { display: block; }
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(3px); }
.modal-box {
  position: relative;
  max-width: 650px;
  margin: 40px auto;
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 20px 30px rgba(0,0,0,0.2);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 1rem 1.4rem;
  background: #f1f5f9;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-close { background: none; border: none; font-size: 1.6rem; cursor: pointer; color: var(--muted); }
.modal-body { padding: 1.4rem; overflow-y: auto; }
.modal-footer {
  padding: 1rem 1.4rem;
  background: #f1f5f9;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.project-info-form { margin-bottom: 1.2rem; background: #f8fafc; padding: 10px; border-radius: 6px; border: 1px solid var(--border); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-group label { display: block; font-size: 0.8rem; font-weight: 600; margin-bottom: 0.2rem; }
.form-group input { width: 100%; padding: 6px 10px; border: 1px solid var(--border); border-radius: 4px; font-family: inherit; font-size: 0.85rem; }

.quote-items-table { display: flex; flex-direction: column; gap: 8px; margin-bottom: 1.2rem; }
.quote-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.88rem;
}

.quote-calc-footer {
  background: #f1f5f9;
  padding: 12px;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.95rem;
}

.calc-row { display: flex; justify-content: space-between; }
.total-highlight { border-top: 1px solid #cbd5e1; padding-top: 6px; font-size: 1.1rem; color: #0284c7; }

.btn-primary { background: #0284c7; color: white; }
.btn-primary:hover { background: #0369a1; }
.btn-secondary { background: #e2e8f0; color: #334155; }
.btn-secondary:hover { background: #cbd5e1; }

.app-footer {
  text-align: center;
  padding: 2rem 1.5rem;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
  background: white;
}

@media (max-width: 768px) {
  .filter-row { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}
