/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --orange: #E67E22;
  --orange-dark: #D35400;
  --blue: #3B82F6;
  --green: #22C55E;
  --green-wa: #25D366;
  --yellow: #F59E0B;
  --red: #EF4444;
  --white: #FFFFFF;
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-600: #4B5563;
  --gray-800: #1F2937;
  --gray-900: #111827;
  --shadow: 0 1px 3px rgba(0,0,0,0.12);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
  --radius: 8px;
  --radius-lg: 12px;
  --transition: 0.2s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Poppins', sans-serif;
  color: var(--gray-800);
  background: var(--gray-50);
  line-height: 1.5;
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* ===== LOGIN GATE ===== */
.login-gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #F3F4F6 0%, #E5E7EB 100%);
  padding: 24px;
}

.login-card {
  background: var(--white);
  border-radius: 20px;
  padding: 48px 40px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.1);
  border-top: 4px solid var(--orange);
}

.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 32px;
}

.login-icon {
  width: 160px;
  height: auto;
  margin-bottom: 16px;
}

.lb-name {
  display: none;
}

.lb-tag {
  display: none;
}

.login-title {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 8px;
}

.login-subtitle {
  text-align: center;
  font-size: 0.88rem;
  color: var(--gray-600);
  margin-bottom: 32px;
}

.login-form .form-group {
  margin-bottom: 24px;
}

.login-form label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrap input {
  width: 100%;
  padding: 14px 48px 14px 16px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--gray-800);
  cursor: text;
  transition: var(--transition);
}

.input-wrap input:focus {
  outline: none;
  border-color: var(--orange);
}

.input-wrap input.error { border-color: var(--red); }

.toggle-pw {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--gray-400);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 6px;
  transition: var(--transition);
}

.toggle-pw:hover { color: var(--gray-600); }

.error-msg {
  display: block;
  font-size: 0.75rem;
  color: var(--red);
  margin-top: 6px;
  min-height: 18px;
}

.btn-login {
  width: 100%;
  padding: 14px 24px;
  background: var(--orange);
  color: var(--white);
  border: none;
  border-radius: var(--radius-lg);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
}

.btn-login:hover { background: var(--orange-dark); }
.btn-login:disabled { opacity: 0.6; cursor: not-allowed; }

.login-footer {
  text-align: center;
}

.login-footer a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  color: var(--gray-600);
  cursor: pointer;
  transition: var(--transition);
}

.login-footer a:hover { color: var(--orange); }

/* ===== DASHBOARD ===== */
.dashboard {
  min-height: 100vh;
  background: var(--gray-50);
}

/* ===== HEADER ===== */
.admin-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-logo {
  width: 140px;
  height: auto;
}

.header-brand {
  display: none;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-date {
  font-size: 0.85rem;
  color: var(--gray-600);
  padding: 8px 12px;
  background: var(--gray-100);
  border-radius: var(--radius);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.btn-outline {
  background: var(--white);
  color: var(--blue);
  border: 1.5px solid var(--blue);
}

.btn-outline:hover { background: var(--blue); color: var(--white); }

.btn-logout {
  background: var(--red);
  color: var(--white);
}

.btn-logout:hover { background: #DC2626; }

.btn-primary {
  background: var(--orange);
  color: var(--white);
}

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

.btn-whatsapp {
  background: var(--green-wa);
  color: var(--white);
}

.btn-whatsapp:hover { background: #1DA851; }

.btn-export {
  background: var(--green);
  color: var(--white);
}

.btn-export:hover { background: #16A34A; }

/* ===== TABS NAVIGATION ===== */
.tabs-nav {
  background: var(--white);
  border-bottom: 2px solid var(--gray-200);
  padding: 0 24px;
  display: flex;
  gap: 4px;
}

.tab-btn {
  position: relative;
  padding: 14px 20px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tab-btn:hover { color: var(--orange); background: rgba(230,126,34,0.05); }

.tab-btn.active {
  color: var(--orange);
  border-bottom-color: var(--orange);
}

.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--blue);
  color: var(--white);
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 700;
}

/* ===== MAIN CONTENT ===== */
.main-content {
  padding: 24px;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ===== CONTENT HEADER ===== */
.content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 20px;
  flex-wrap: wrap;
}

.ch-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ch-left h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gray-900);
  display: flex;
  align-items: center;
  gap: 10px;
}

.item-count {
  padding: 4px 12px;
  background: var(--gray-100);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-600);
}

.quot-count {
  background: rgba(230,126,34,0.15);
  color: var(--orange);
}

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

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box i {
  position: absolute;
  left: 12px;
  color: var(--gray-400);
  font-size: 0.85rem;
  pointer-events: none;
}

.search-box input {
  padding: 9px 16px 9px 36px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.85rem;
  width: 220px;
  cursor: text;
  transition: var(--transition);
}

.search-box input:focus {
  outline: none;
  border-color: var(--orange);
}

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

.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow);
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--white);
  flex-shrink: 0;
}

.stat-card.blue .stat-icon { background: var(--blue); }
.stat-card.green .stat-icon { background: var(--green); }
.stat-card.yellow .stat-icon { background: var(--yellow); }
.stat-card.red .stat-icon { background: var(--red); }

.stat-info strong {
  display: block;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--gray-900);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-info span {
  font-size: 0.8rem;
  color: var(--gray-600);
}

/* ===== INFO BANNER ===== */
.info-banner {
  background: rgba(59,130,246,0.08);
  border-left: 4px solid var(--blue);
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: var(--gray-700);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.info-banner i {
  color: var(--blue);
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* ===== TABLE ===== */
.table-container {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  box-shadow: var(--shadow);
}

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

.data-table thead {
  background: var(--gray-50);
  border-bottom: 2px solid var(--gray-200);
}

.data-table thead th {
  text-align: left;
  padding: 14px 16px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gray-700);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-table tbody tr {
  border-bottom: 1px solid var(--gray-200);
  transition: var(--transition);
}

.data-table tbody tr:hover {
  background: var(--gray-50);
}

.data-table tbody tr:last-child {
  border-bottom: none;
}

.data-table tbody td {
  padding: 12px 16px;
  font-size: 0.85rem;
  color: var(--gray-700);
}

.data-table tbody td:first-child {
  font-weight: 600;
  color: var(--gray-900);
}

/* ===== EMPTY STATE ===== */
.empty-row td {
  padding: 80px 40px !important;
}

.empty-state {
  text-align: center;
  color: var(--gray-400);
}

.empty-state i {
  font-size: 3.5rem;
  color: var(--gray-300);
  margin-bottom: 16px;
}

.empty-state p {
  font-size: 0.95rem;
  line-height: 1.6;
}

.empty-state strong {
  color: var(--orange);
}

/* ===== BADGES ===== */
.badge-number {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(251,191,36,0.15);
  color: #D97706;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
}

.customer-cell {
  display: flex;
  flex-direction: column;
}

.customer-cell strong {
  font-weight: 700;
  color: var(--gray-900);
}

.customer-cell span {
  font-size: 0.75rem;
  color: var(--gray-500);
}

.status-badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-badge.draft {
  background: rgba(156,163,175,0.15);
  color: var(--gray-700);
}

.status-badge.sent {
  background: rgba(59,130,246,0.15);
  color: var(--blue);
}

.status-badge.accepted {
  background: rgba(34,197,94,0.15);
  color: var(--green);
}

.status-badge.rejected {
  background: rgba(239,68,68,0.15);
  color: var(--red);
}

.status-badge.in {
  background: rgba(34,197,94,0.15);
  color: var(--green);
}

.status-badge.low {
  background: rgba(245,158,11,0.15);
  color: #d97706;
}

.status-badge.out {
  background: rgba(239,68,68,0.15);
  color: var(--red);
}

.status-badge.enquiry {
  background: rgba(156,163,175,0.15);
  color: var(--gray-700);
}

.status-badge.quotation-sent {
  background: rgba(59,130,246,0.15);
  color: var(--blue);
}

.status-badge.order-confirmed {
  background: rgba(34,197,94,0.15);
  color: var(--green);
}

.status-badge.installation {
  background: rgba(168,85,247,0.15);
  color: #7c3aed;
}

.btn-whatsapp-header {
  background: #25d366;
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-whatsapp-header:hover { background: #1da851; }

.quot-fetch-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.quot-fetch-row input { flex: 1; }
.btn-fetch {
  padding: 0 12px;
  border: 2px solid var(--orange);
  background: var(--orange-light);
  color: var(--orange);
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.btn-fetch:hover { background: var(--orange); color: #fff; }

.wa-setup-note {
  font-size: 0.85rem;
  color: var(--gray-600);
  line-height: 1.5;
  margin-bottom: 16px;
  padding: 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
}

.section-gap { margin-top: 32px; padding-top: 24px; border-top: 2px solid var(--gray-200); }

.btn-icon.btn-complete {
  background: rgba(34,197,94,0.12);
  color: var(--green);
}
.btn-icon.btn-complete:hover { background: var(--green); color: #fff; }

.status-badge.completed {
  background: rgba(34,197,94,0.2);
  color: #15803d;
}

.status-badge.on-hold {
  background: rgba(245,158,11,0.15);
  color: #d97706;
}

.status-select {
  min-width: 140px;
  max-width: 170px;
  padding: 6px 8px;
  border: 1px solid var(--gray-200, #e2e8f0);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gray-800, #1e293b);
  background: #fff;
  cursor: pointer;
}

.status-select:hover,
.status-select:focus {
  border-color: var(--orange, #e67e22);
  outline: none;
}

.addr-cell {
  max-width: 180px;
  white-space: normal;
  line-height: 1.35;
  font-size: 0.82rem;
}

.data-table th:last-child,
.data-table td.actions-cell {
  position: sticky;
  right: 0;
  background: #fff;
  z-index: 1;
  box-shadow: -4px 0 8px rgba(0,0,0,0.04);
}

.data-table thead th:last-child {
  background: var(--gray-50, #f8fafc);
  z-index: 2;
}

/* ===== ACTION BUTTONS ===== */
.action-btns {
  display: flex;
  gap: 6px;
}

.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-pdf {
  background: rgba(239,68,68,0.1);
  color: var(--red);
}

.btn-pdf:hover { background: var(--red); color: var(--white); }

.btn-whatsapp {
  background: rgba(37,211,102,0.1);
  color: var(--green-wa);
}

.btn-whatsapp:hover { background: var(--green-wa); color: var(--white); }

.btn-edit {
  background: rgba(59,130,246,0.1);
  color: var(--blue);
}

.btn-edit:hover { background: var(--blue); color: var(--white); }

.btn-complete {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
}

.btn-complete:hover { background: #16a34a; color: var(--white); }

.btn-delete {
  background: rgba(239,68,68,0.1);
  color: var(--red);
}

.btn-delete:hover { background: var(--red); color: var(--white); }

/* ===== QUOTATION MODAL ===== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: none;
  align-items: flex-start;
  justify-content: center;
  z-index: 10000;
  padding: 24px;
  overflow-y: auto;
}
.modal.show { display: flex; }

.quot-modal-content {
  background: var(--white);
  border-radius: 16px;
  width: 100%;
  max-width: 920px;
  margin: 20px auto 40px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  overflow: hidden;
}

.quot-modal-header {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  color: var(--white);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.quot-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.quot-header-icon {
  width: 36px;
  height: 36px;
  background: var(--orange);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.quot-modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.quot-modal-close {
  background: rgba(255,255,255,0.2);
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: var(--white);
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.quot-modal-close:hover { background: rgba(255,255,255,0.35); }

.quot-modal-body {
  padding: 24px;
  max-height: calc(100vh - 180px);
  overflow-y: auto;
}

.quot-section {
  margin-bottom: 24px;
}

.quot-section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: 0.5px;
  margin-bottom: 14px;
}
.quot-section-label.right {
  justify-content: flex-end;
}
.quot-section-label i {
  font-size: 0.85rem;
}

.quot-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.quot-field label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--gray-600);
  letter-spacing: 0.4px;
  margin-bottom: 6px;
}
.quot-field .req { color: var(--red); }
.quot-field .opt { color: var(--gray-400); font-weight: 500; }

.quot-field input,
.quot-field select,
.quot-field textarea,
.quot-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--gray-800);
  background: var(--gray-50);
  cursor: text;
  transition: var(--transition);
}
.quot-field input:focus,
.quot-field select:focus,
.quot-field textarea:focus,
.quot-textarea:focus {
  outline: none;
  border-color: var(--orange);
  background: var(--white);
}
.quot-field input[readonly] {
  background: var(--gray-100);
  color: var(--gray-600);
  cursor: default;
}
.quot-field select { cursor: pointer; }
.quot-field.full { grid-column: 1 / -1; }

.quot-fetch-bar {
  margin-bottom: 16px;
  padding: 14px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 10px;
}
.quot-fetch-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.quot-fetch-row input { flex: 1; min-width: 0; }
.quot-fetch-hint {
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--gray-600);
  display: flex;
  align-items: flex-start;
  gap: 6px;
  line-height: 1.45;
}
.quot-fetch-hint i { color: var(--blue); margin-top: 2px; }

.capacity-template-panel {
  padding: 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, #fff7ed 0%, #fffbeb 50%, #f8fafc 100%);
  border: 1px solid #fed7aa;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.capacity-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cap-chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px solid #fdba74;
  background: #fff;
  color: #9a3412;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.cap-chip:hover { background: #ffedd5; }
.cap-chip.active {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
}
.btn-apply-template-lg {
  width: 100%;
  padding: 12px 16px;
  font-size: 0.9rem;
}

.template-excel-bar {
  margin-top: 4px;
  padding: 12px;
  background: #fff;
  border: 1px dashed #86efac;
  border-radius: 10px;
}
.template-excel-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #166534;
  margin-bottom: 10px;
}
.template-excel-label i { color: #16a34a; }
.template-excel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.btn-excel-dl,
.btn-excel-up,
.btn-excel-save {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1.5px solid #86efac;
  background: #f0fdf4;
  color: #166534;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-excel-dl:hover,
.btn-excel-up:hover,
.btn-excel-save:hover {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
}
.btn-excel-up { cursor: pointer; }

.maintenance-banner {
  background: #fff7ed !important;
  border-color: #fdba74 !important;
}
.maintenance-table .maintenance-row {
  background: #fffbeb;
}
.maintenance-table .status-badge.low {
  background: rgba(245, 158, 11, 0.2);
  color: #b45309;
  font-weight: 700;
}

.quot-kw-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.quot-kw-row input { flex: 1; min-width: 0; }

.btn-apply-template {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  border: none;
  background: var(--orange);
  color: #fff;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}
.btn-apply-template:hover {
  background: var(--orange-dark, #d35400);
}

.bom-template-bar {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 10px;
  background: linear-gradient(135deg, #fff7ed 0%, #f8fafc 100%);
  border: 1px solid #fed7aa;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.bom-template-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--gray-600);
  flex: 1;
  min-width: 220px;
}
.bom-template-info i { color: var(--orange); font-size: 1.1rem; }
.bom-template-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.bom-template-actions select {
  padding: 8px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  background: #fff;
}

/* BOM Section */
.bom-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.bom-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: 0.4px;
}
.btn-add-row {
  padding: 8px 16px;
  background: var(--white);
  border: 1.5px solid var(--blue);
  color: var(--blue);
  border-radius: 50px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}
.btn-add-row:hover {
  background: var(--blue);
  color: var(--white);
}

.bom-table-wrap {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
}

.bom-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.bom-table thead {
  background: #1e3a5f;
  color: var(--white);
}
.bom-table th {
  padding: 12px 10px;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.bom-table th .req { color: #fca5a5; }
.bom-table td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--gray-200);
  vertical-align: middle;
}
.bom-table tbody tr:last-child td { border-bottom: none; }
.bom-table tbody tr:hover { background: var(--gray-50); }

.bom-table input,
.bom-table select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.8rem;
  background: var(--white);
  cursor: text;
}
.bom-table select { cursor: pointer; }
.bom-table input:focus,
.bom-table select:focus {
  outline: none;
  border-color: var(--blue);
}
.bom-table .col-sno {
  width: 44px;
  text-align: center;
  font-weight: 700;
  color: var(--gray-600);
}
.bom-table .col-qty { width: 60px; }
.bom-table .col-uom { width: 72px; }
.bom-table .col-price { width: 110px; }
.bom-table .col-action { width: 40px; text-align: center; }

.btn-bom-remove {
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(239,68,68,0.1);
  color: var(--red);
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition: var(--transition);
}
.btn-bom-remove:hover {
  background: var(--red);
  color: var(--white);
}

.bom-totals {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  padding-right: 4px;
}
.total-row {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--gray-600);
}
.total-row strong {
  min-width: 100px;
  text-align: right;
  font-size: 0.95rem;
  color: var(--gray-900);
}
.gst-row .gst-input-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}
.gst-row .gst-input-wrap input {
  width: 48px;
  padding: 4px 8px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.85rem;
  text-align: center;
  cursor: text;
}
.gst-row .gst-input-wrap span {
  font-size: 0.8rem;
  color: var(--gray-500);
}
.total-row.grand-total {
  background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
  color: var(--white);
  padding: 12px 20px;
  border-radius: 50px;
  margin-top: 4px;
  gap: 24px;
}
.total-row.grand-total span {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--white);
}
.total-row.grand-total strong {
  color: var(--white);
  font-size: 1.1rem;
}

.quot-textarea {
  background: var(--gray-50);
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

.quot-modal-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--gray-200);
  margin-top: 8px;
}

.btn-quot-cancel {
  padding: 10px 20px;
  background: none;
  border: none;
  color: var(--gray-600);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-quot-cancel:hover { color: var(--gray-900); }

.btn-quot-save,
.btn-quot-pdf {
  padding: 10px 22px;
  border: none;
  border-radius: 50px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
  color: var(--white);
}
.btn-quot-save {
  background: var(--orange);
}
.btn-quot-save:hover { background: var(--orange-dark); }
.btn-quot-pdf {
  background: var(--red);
}
.btn-quot-pdf:hover { background: #dc2626; }
.btn-quot-merge {
  padding: 10px 22px;
  border: none;
  border-radius: 50px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
  color: var(--white);
  background: #0f766e;
}
.btn-quot-merge:hover { background: #115e59; }

/* PDF Merge pack */
.pdf-merge-panel {
  padding: 14px 16px;
  border-radius: 12px;
  background: linear-gradient(145deg, #fff7ed, #f0fdfa);
  border: 1px solid #fed7aa;
}
.pdf-merge-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
  margin-bottom: 12px;
}
.btn-pdf-upload {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 50px;
  background: #1e3a5f;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-pdf-upload:hover { background: #162d4a; }
.pdf-merge-pos {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 240px;
  flex: 1;
}
.pdf-merge-pos label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-600);
}
.pdf-merge-pos select {
  padding: 9px 12px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.85rem;
  background: #fff;
  cursor: pointer;
}
.pdf-merge-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
}
.pdf-merge-empty {
  padding: 12px;
  text-align: center;
  color: var(--gray-500);
  font-size: 0.85rem;
  background: rgba(255,255,255,0.7);
  border-radius: 8px;
  border: 1px dashed var(--gray-300);
}
.pdf-merge-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--gray-200);
}
.pdf-merge-order {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #0f766e;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.pdf-merge-name {
  flex: 1;
  min-width: 0;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gray-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pdf-merge-name i { color: #dc2626; margin-right: 6px; }
.pdf-merge-item-actions {
  display: flex;
  gap: 4px;
}
.pdf-merge-item-actions .btn-icon:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.pdf-merge-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.btn-pdf-preview,
.btn-pdf-download,
.btn-pdf-clear {
  padding: 9px 14px;
  border: none;
  border-radius: 50px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #fff;
  transition: var(--transition);
}
.btn-pdf-preview { background: #0369a1; }
.btn-pdf-preview:hover { background: #075985; }
.btn-pdf-download { background: #15803d; }
.btn-pdf-download:hover { background: #166534; }
.btn-pdf-clear { background: var(--gray-500); }
.btn-pdf-clear:hover { background: var(--gray-700); }
.btn-icon.btn-merge {
  color: #0f766e;
  background: #ccfbf1;
}
.btn-icon.btn-merge:hover {
  background: #99f6e4;
}
.pdf-merge-modal-content {
  max-width: 640px;
}

/* Admin generic modals */
.admin-modal-content {
  background: var(--white);
  border-radius: 16px;
  width: 100%;
  max-width: 720px;
  margin: 20px auto 40px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  overflow: hidden;
}
.admin-modal-header {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  color: var(--white);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-modal-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}
.admin-modal-close {
  background: rgba(255,255,255,0.2);
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: var(--white);
  font-size: 1.4rem;
  cursor: pointer;
}
.admin-modal-body { padding: 24px; }
.admin-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.admin-field label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--gray-600);
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}
.admin-field input,
.admin-field select,
.admin-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.88rem;
  background: var(--gray-50);
  cursor: text;
}
.admin-field select { cursor: pointer; }
.admin-field input:focus,
.admin-field select:focus,
.admin-field textarea:focus {
  outline: none;
  border-color: var(--orange);
  background: var(--white);
}
.admin-field.full { grid-column: 1 / -1; }
.admin-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--gray-200);
}
.pricing-table .col-price-input { width: 140px; }

/* ===== QUICK INVENTORY ===== */
.quick-inv-section {
  margin: 0 0 28px;
  padding: 20px 22px 24px;
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(255, 248, 240, 0.95), rgba(240, 248, 255, 0.9)),
    #f7fafc;
  border: 1px solid var(--gray-200);
}
.quick-inv-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.quick-inv-header h3 {
  margin: 0 0 4px;
  font-size: 1.15rem;
  color: var(--gray-900);
  display: flex;
  align-items: center;
  gap: 8px;
}
.quick-inv-header h3 i { color: var(--orange); }
.quick-inv-header p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--gray-500);
}
.quick-inv-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.quick-inv-group-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gray-600);
  margin: 14px 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.quick-inv-group-label:first-of-type { margin-top: 0; }
.quick-inv-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
.quick-inv-grid.panels-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 520px;
}
.quick-card {
  position: relative;
  padding: 16px 14px 14px;
  border-radius: 12px;
  color: #fff;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
  min-height: 96px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.quick-card::after {
  content: '';
  position: absolute;
  inset: auto -20% -40% auto;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  pointer-events: none;
}
.quick-card .qk-label {
  font-size: 0.78rem;
  font-weight: 600;
  opacity: 0.92;
  letter-spacing: 0.02em;
}
.quick-card strong {
  font-size: 1.85rem;
  line-height: 1.1;
  font-weight: 800;
  margin: 6px 0 2px;
}
.quick-card .qk-sub {
  font-size: 0.72rem;
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.quick-card.kw-2 { background: linear-gradient(135deg, #0ea5e9, #0369a1); }
.quick-card.kw-3 { background: linear-gradient(135deg, #22c55e, #15803d); }
.quick-card.kw-5 { background: linear-gradient(135deg, #f59e0b, #c2410c); }
.quick-card.kw-6 { background: linear-gradient(135deg, #8b5cf6, #5b21b6); }
.quick-card.kw-10 { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.quick-card.panel-dcr { background: linear-gradient(135deg, #14b8a6, #0f766e); }
.quick-card.panel-nondcr { background: linear-gradient(135deg, #64748b, #334155); }
.quick-card.inv-2 { background: linear-gradient(135deg, #38bdf8, #0284c7); }
.quick-card.inv-3 { background: linear-gradient(135deg, #4ade80, #16a34a); }
.quick-card.inv-5 { background: linear-gradient(135deg, #fb923c, #ea580c); }
.quick-card.inv-6 { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.quick-card.inv-10 { background: linear-gradient(135deg, #f87171, #dc2626); }
.inv-cap-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}
.quick-form-title {
  margin: 16px 0 10px;
  font-size: 0.95rem;
  color: var(--gray-800);
}
.quick-form-title:first-of-type { margin-top: 0; }

@media (max-width: 1100px) {
  .quick-inv-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .quick-inv-grid,
  .quick-inv-grid.panels-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: none; }
}
@media (max-width: 420px) {
  .quick-inv-grid,
  .quick-inv-grid.panels-grid { grid-template-columns: 1fr; }
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 20px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--white);
  z-index: 9999;
  transform: translateY(120%);
  opacity: 0;
  transition: all 0.3s ease;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}

.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { background: var(--green); }
.toast.error { background: var(--red); }
.toast.info { background: var(--blue); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .admin-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .header-right {
    width: 100%;
    justify-content: space-between;
  }
  .tabs-nav { overflow-x: auto; }
  .content-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .ch-right {
    width: 100%;
    flex-wrap: wrap;
  }
  .search-box input { width: 100%; }
  .stats-grid { grid-template-columns: 1fr; }
  .quick-inv-header { flex-direction: column; }
  .table-container { overflow-x: auto; }
  .quot-form-grid { grid-template-columns: 1fr; }
  .bom-table-wrap { overflow-x: auto; }
  .quot-modal-footer { flex-wrap: wrap; }
  .admin-form-grid { grid-template-columns: 1fr; }
}
