/* ============================================================
   Ecohomes Quotations — Riwayat Penawaran
   Reference: 3.Riwayat_Penawaran.png (green brand kept).
   ============================================================ */

.eh-quotations-page {
	flex: 1; min-width: 0;
	--eh-ink: #1E293B; --eh-muted: #64748B; --eh-line: #EDF0F4; --eh-track: #EAECF0;
	--eh-tint: #EAF8F0; --eh-card-sh: 0 1px 2px rgba(16,24,40,.05);
	color: var(--eh-ink);
}

/* Widen content on this page only */
.woocommerce-account .container:has(.eh-quotations-page) { width: 100% !important; max-width: 1360px !important; }
.woocommerce-account .dashboard-wrap:has(.eh-quotations-page) > [class*="col-"]:first-child { flex: 0 0 19%; max-width: 19%; }
.woocommerce-account .dashboard-wrap:has(.eh-quotations-page) > [class*="col-"]:last-child { flex: 0 0 81%; max-width: 81%; }

/* Buttons */
.eh-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 8px; font-size: .85rem; font-weight: 600; text-decoration: none; cursor: pointer; border: 1px solid transparent; line-height: 1.2; transition: all .15s; }
.eh-btn .dashicons { font-size: 16px; width: 16px; height: 16px; }
.eh-btn-primary { background: var(--eh-green, #2ECC71); color: #fff; border-color: var(--eh-green, #2ECC71); }
.eh-btn-primary:hover { background: var(--eh-green-dark, #27AE60); border-color: var(--eh-green-dark, #27AE60); color: #fff; }
.eh-btn-outline { background: #fff; color: var(--eh-ink); border-color: #DCE1E8; }
.eh-btn-outline:hover { background: var(--eh-tint); color: var(--eh-green-dark); border-color: var(--eh-green); }
.eh-btn-sm { padding: 7px 14px; font-size: .8rem; }
.eh-btn-xs { padding: 5px 11px; font-size: .74rem; }

/* Header */
.eh-q-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.eh-q-header .eh-page-title { font-size: 1.5rem; color: var(--eh-ink); margin: 0; }
.eh-page-subtitle { margin: 6px 0 0; color: var(--eh-muted); font-size: .9rem; }
.eh-q-header-right { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; flex-shrink: 0; }
.eh-last-updated { font-size: .78rem; color: var(--eh-muted); white-space: nowrap; }

/* Stat cards */
.eh-q-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.eh-q-stats .eh-stat-card {
	position: relative; display: grid; grid-template-columns: 44px 1fr;
	grid-template-areas: "icon label" "icon value" "link link"; column-gap: 12px; row-gap: 2px;
	text-align: left; background: #fff; border: 1px solid var(--eh-line); border-radius: 12px; box-shadow: var(--eh-card-sh); padding: 16px;
}
.eh-q-stats .eh-stat-icon { grid-area: icon; position: static; width: 44px; height: 44px; border-radius: 11px; background: var(--eh-tint); color: var(--eh-green-dark); display: flex; align-items: center; justify-content: center; font-size: 22px; }
.eh-q-stats .eh-stat-label { grid-area: label; align-self: end; font-size: .8rem; color: var(--eh-muted); }
.eh-q-stats .eh-stat-value { grid-area: value; align-self: start; font-size: 1.7rem; font-weight: 700; color: var(--eh-ink); line-height: 1.1; }
.eh-stat-link { grid-area: link; margin-top: 12px; display: inline-flex; align-items: center; gap: 4px; font-size: .8rem; font-weight: 600; color: var(--eh-green-dark); text-decoration: none; }
.eh-stat-link .dashicons { font-size: 15px; width: 15px; height: 15px; transition: transform .15s; }
.eh-stat-link:hover .dashicons { transform: translateX(3px); }
.eh-stat-card--blue .eh-stat-icon { background: #E7F1FF; color: #1F6FEB; }
.eh-stat-card--purple .eh-stat-icon { background: #F3EEFF; color: #7C3AED; }
.eh-stat-card--orange .eh-stat-icon { background: #FFF3E6; color: #E8821A; }
.eh-stat-card--success .eh-stat-icon { background: #E8F8EF; color: #1E9E59; }

/* Filter */
.eh-q-filter { display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: 12px; align-items: end; background: #fff; border: 1px solid var(--eh-line); border-radius: 12px; box-shadow: var(--eh-card-sh); padding: 14px 16px; margin-bottom: 16px; }
.eh-q-filter-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.eh-q-filter-field label { font-size: .74rem; font-weight: 600; color: var(--eh-muted); }
.eh-filter-select { height: 40px; padding: 0 12px; border: 1px solid #DCE1E8; border-radius: 8px; font-size: .85rem; color: var(--eh-ink); background: #fff; cursor: pointer; width: 100%; box-sizing: border-box; }
.eh-filter-select:focus { outline: none; border-color: var(--eh-green); box-shadow: 0 0 0 3px rgba(46,204,113,.15); }
.eh-q-filter-actions { display: flex; gap: 8px; }

/* Table card */
.eh-q-card { background: #fff; border: 1px solid var(--eh-line); border-radius: 14px; box-shadow: var(--eh-card-sh); overflow: hidden; }
.eh-q-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--eh-line); }
.eh-q-card-title { font-size: 1rem; font-weight: 700; color: var(--eh-ink); margin: 0; }
.eh-result-count { font-size: .82rem; color: var(--eh-muted); }

.eh-q-table-wrap { overflow-x: auto; container-type: inline-size; container-name: ehqt; }
.eh-q-table { width: 100%; min-width: 720px; border-collapse: collapse; font-size: .82rem; }
.eh-q-table thead th { text-align: left; padding: 12px 14px; font-size: .7rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--eh-muted); background: #F8FAFC; border-bottom: 1px solid var(--eh-line); white-space: nowrap; }
.eh-q-table tbody td { padding: 13px 14px; border-bottom: 1px solid var(--eh-line); vertical-align: middle; }
.eh-q-row:hover td { background: #FBFCFE; }
.eh-q-number { font-weight: 700; color: var(--eh-green-dark); text-decoration: none; }
.eh-q-number:hover { text-decoration: underline; }
.eh-q-link { color: #1F6FEB; text-decoration: none; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.eh-q-link:hover { text-decoration: underline; }
.eh-q-link .dashicons { font-size: 13px; width: 13px; height: 13px; }
.eh-q-total { font-weight: 700; color: var(--eh-ink); }
.eh-cell-muted { color: #B6BECB; }

/* Action icons */
.eh-col-action { text-align: right; white-space: nowrap; }
.eh-q-actions { display: inline-flex; align-items: center; gap: 6px; }
.eh-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 8px; background: #F8FAFC; border: 1px solid var(--eh-line); color: var(--eh-muted); cursor: pointer; text-decoration: none; transition: all .15s; }
.eh-icon-btn:hover { background: var(--eh-tint); color: var(--eh-green-dark); border-color: var(--eh-green); }
.eh-icon-btn .dashicons { font-size: 17px; width: 17px; height: 17px; }
.eh-icon-btn.is-active { background: var(--eh-green); border-color: var(--eh-green); color: #fff; }
.eh-icon-btn-danger:hover { background: #FDECEC; color: #D64545; border-color: #F3B4B4; }

/* Detail row */
.eh-q-detail-row > td { padding: 0 !important; background: #F8FAFC; }
.eh-q-detail { padding: 18px; }
.eh-q-detail-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 20px; margin-bottom: 16px; }
.eh-q-dl { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.eh-col-label { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: #94A3B8; }
.eh-q-dl strong { font-size: .88rem; color: var(--eh-ink); }
.eh-q-detail-subtitle { font-size: .85rem; font-weight: 700; color: var(--eh-ink); margin: 6px 0 8px; }
.eh-q-items { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--eh-line); border-radius: 10px; overflow: hidden; margin-bottom: 14px; }
.eh-q-items th { text-align: left; padding: 9px 12px; font-size: .7rem; text-transform: uppercase; letter-spacing: .02em; color: var(--eh-muted); background: #F8FAFC; border-bottom: 1px solid var(--eh-line); }
.eh-q-items td { padding: 9px 12px; font-size: .82rem; border-bottom: 1px solid var(--eh-line); }
.eh-q-items tr:last-child td { border-bottom: none; }
.eh-q-notes { background: #fff; border: 1px solid var(--eh-line); border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; }
.eh-q-notes-body { font-size: .85rem; color: #334155; margin-top: 4px; }
.eh-q-notes-body p { margin: 0 0 6px; }
.eh-q-detail-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.eh-q-qr { display: flex; flex-direction: column; align-items: center; gap: 2px; }

/* Pagination */
.eh-q-pagination { padding: 16px; }
.eh-q-pagination ul { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; justify-content: center; }
.eh-q-pagination li a, .eh-q-pagination li span { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 38px; padding: 0 10px; border-radius: 8px; font-size: .85rem; font-weight: 500; text-decoration: none; border: 1px solid var(--eh-line); color: var(--eh-ink); background: #fff; transition: all .15s; }
.eh-q-pagination li a:hover, .eh-q-pagination .current span, .eh-q-pagination li span.current { background: var(--eh-green); color: #fff; border-color: var(--eh-green); }

/* Empty */
.eh-q-empty { padding: 56px 24px; text-align: center; color: var(--eh-muted); }
.eh-q-empty .dashicons { font-size: 48px; width: 48px; height: 48px; color: #CBD5E1; display: block; margin: 0 auto 12px; }
.eh-q-empty p { margin: 0 0 16px; font-size: .9rem; }

/* QR Verify Panel */
.eh-q-verify-section { margin-bottom: 16px; }
.eh-q-verify-toggle { display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--eh-line); border-radius: 10px; padding: 10px 16px; font-size: .85rem; font-weight: 600; color: var(--eh-ink); cursor: pointer; transition: all .15s; }
.eh-q-verify-toggle:hover { border-color: var(--eh-green); color: var(--eh-green-dark); }
.eh-q-verify-toggle .dashicons { font-size: 17px; width: 17px; height: 17px; }
.eh-q-verify-toggle .eh-toggle-arrow { margin-left: 4px; transition: transform .2s; font-size: 15px; width: 15px; height: 15px; }
.eh-q-verify-toggle[aria-expanded="true"] .eh-toggle-arrow { transform: rotate(180deg); }
.eh-q-verify-panel { background: #fff; border: 1px solid var(--eh-line); border-radius: 12px; padding: 16px 18px; margin-top: 8px; }
.eh-q-verify-desc { font-size: .82rem; color: var(--eh-muted); margin: 0 0 12px; }
.eh-q-verify-row { display: flex; gap: 8px; align-items: center; }
.eh-q-verify-input { flex: 1; height: 38px; padding: 0 12px; border: 1px solid #DCE1E8; border-radius: 8px; font-size: .85rem; color: var(--eh-ink); background: #fff; }
.eh-q-verify-input:focus { outline: none; border-color: var(--eh-green); box-shadow: 0 0 0 3px rgba(46,204,113,.15); }
.eh-q-verify-result { margin-top: 10px; font-size: .85rem; border-radius: 8px; padding: 8px 12px; display: none; }
.eh-q-verify-result.success { display: block; background: #E8F8EF; color: #14532D; border: 1px solid #A7F3C0; }
.eh-q-verify-result.error   { display: block; background: #FEF2F2; color: #7F1D1D; border: 1px solid #FECACA; }

/* Quotation number code badge under title */
.eh-q-number-code { font-size: .72rem; color: var(--eh-muted); font-weight: 500; }

/* ── Responsive: stack table into cards ── */
@container ehqt (max-width: 700px) {
	.eh-q-table { min-width: 0; }
	.eh-q-table thead { display: none; }
	.eh-q-table, .eh-q-table tbody, .eh-q-table tr, .eh-q-table td { display: block; width: 100%; }
	.eh-q-row { border: 1px solid var(--eh-line); border-radius: 12px; margin: 12px; padding: 4px 12px; }
	.eh-q-row td { border-bottom: 1px dashed var(--eh-line); padding: 9px 0; display: flex; justify-content: space-between; gap: 16px; align-items: center; }
	.eh-q-row td:last-child { border-bottom: none; }
	.eh-q-table tbody td::before { content: attr(data-label); font-size: .7rem; font-weight: 700; text-transform: uppercase; color: var(--eh-muted); }
	.eh-q-detail-row > td::before { display: none; }
	.eh-col-action { justify-content: flex-start !important; }
	.eh-q-detail-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 980px) {
	.woocommerce-account .col-lg-9:has(.eh-quotations-page),
	.woocommerce-account .col-md-8:has(.eh-quotations-page) { flex: 0 0 100%; max-width: 100%; }
	.eh-q-stats { grid-template-columns: repeat(2, 1fr); }
	.eh-q-filter { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
	.eh-q-header { flex-direction: column; }
	.eh-q-header-right { align-items: flex-start; }
}
@media (max-width: 560px) {
	.eh-q-stats { grid-template-columns: 1fr; }
	.eh-q-filter { grid-template-columns: 1fr; }
}
