/* ============================================================
   Ecohomes Invoices — My Account (Invoice & Pembayaran)
   Table + detail panel layout, matched to the reference design.
   Green brand accent + blue primary CTA. Self-contained tokens.
   ============================================================ */

.eh-inv-wrap {
	--eh-ink: #1F2937;
	--eh-muted: #6B7280;
	--eh-faint: #9CA3AF;
	--eh-line: #EEF1F5;
	--eh-line-soft: #F3F5F8;
	--eh-bg: #F7F8FA;
	--eh-green: #22C55E;
	--eh-green-dark: #16A34A;
	--eh-green-tint: #ECFDF3;
	--eh-blue: #2563EB;
	--eh-blue-dark: #1D4ED8;
	--eh-radius: 12px;
	--eh-card-sh: 0 1px 2px rgba(16,24,40,.04);
	color: var(--eh-ink);
	font-size: 14px;
	line-height: 1.5;
}

/* ── Header ── */
.eh-inv-wrap .eh-page-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.eh-inv-wrap .eh-page-title { font-size: 1.5rem; font-weight: 700; letter-spacing: -.01em; color: var(--eh-ink); margin: 0; }
.eh-inv-wrap .eh-page-subtitle { margin: 5px 0 0; color: var(--eh-muted); font-size: .9rem; }
.eh-last-updated { font-size: .78rem; color: var(--eh-faint); white-space: nowrap; flex-shrink: 0; margin-top: 6px; }

/* ── Notice ── */
.eh-inv-notice { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-radius: 10px; font-size: .88rem; font-weight: 500; margin-bottom: 18px; }
.eh-inv-notice .dashicons { font-size: 18px; width: 18px; height: 18px; }
.eh-inv-notice--success { background: var(--eh-green-tint); color: var(--eh-green-dark); }
.eh-inv-notice--error { background: #FEF2F2; color: #DC2626; }

/* ── Stat cards ── */
.eh-inv-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.eh-stat-card {
	display: grid;
	grid-template-columns: 40px 1fr;
	grid-template-areas: "icon label" "icon count" "amount amount" "link link";
	column-gap: 12px; row-gap: 3px;
	background: #fff; border: 1px solid var(--eh-line); border-radius: var(--eh-radius); box-shadow: var(--eh-card-sh); padding: 16px 18px;
}
.eh-stat-icon { grid-area: icon; align-self: start; width: 40px; height: 40px; border-radius: 10px; background: var(--eh-green-tint); color: var(--eh-green-dark); display: flex; align-items: center; justify-content: center; font-size: 20px; }
.eh-stat-label { grid-area: label; align-self: center; font-size: .82rem; font-weight: 600; color: var(--eh-muted); }
.eh-stat-count { grid-area: count; font-size: 1.6rem; font-weight: 700; line-height: 1.05; color: var(--eh-ink); }
.eh-stat-count small { font-size: .72rem; font-weight: 500; color: var(--eh-faint); margin-left: 2px; }
.eh-stat-amount { grid-area: amount; margin-top: 8px; font-size: .95rem; font-weight: 700; color: var(--eh-green-dark); }
.eh-stat-link { grid-area: link; margin-top: 10px; display: inline-flex; align-items: center; gap: 3px; font-size: .78rem; font-weight: 600; color: var(--eh-green-dark); text-decoration: none; }
.eh-stat-link .dashicons { font-size: 14px; width: 14px; height: 14px; }
.eh-stat-card--orange .eh-stat-icon { background: #FFF4E5; color: #D97706; }
.eh-stat-card--blue .eh-stat-icon { background: #E8F0FE; color: var(--eh-blue); }
.eh-stat-card--success .eh-stat-icon { background: var(--eh-green-tint); color: var(--eh-green-dark); }
.eh-stat-card--red .eh-stat-icon { background: #FEECEC; color: #DC2626; }

/* ── Tabs ── */
.eh-inv-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--eh-line); margin-bottom: 18px; }
.eh-inv-tab { padding: 11px 18px; font-size: .9rem; font-weight: 600; color: var(--eh-muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.eh-inv-tab:hover { color: var(--eh-ink); }
.eh-inv-tab.is-active { color: var(--eh-green-dark); border-bottom-color: var(--eh-green); }

/* ── Badges ── */
.eh-inv-wrap .eh-badge { display: inline-flex; align-items: center; padding: 4px 11px; border-radius: 999px; font-size: .72rem; font-weight: 600; line-height: 1.3; white-space: nowrap; }
.eh-inv-wrap .eh-badge-green  { background: var(--eh-green-tint); color: var(--eh-green-dark); }
.eh-inv-wrap .eh-badge-blue   { background: #E8F0FE; color: var(--eh-blue-dark); }
.eh-inv-wrap .eh-badge-yellow { background: #FEF6E0; color: #B45309; }
.eh-inv-wrap .eh-badge-orange { background: #FFF4E5; color: #C2620C; }
.eh-inv-wrap .eh-badge-red    { background: #FEECEC; color: #DC2626; }
.eh-inv-wrap .eh-badge-gray   { background: #F1F3F6; color: #6B7280; }

/* ── Buttons ── */
.eh-inv-wrap .eh-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 10px 16px; border-radius: 9px; font-size: .85rem; font-weight: 600; text-decoration: none; cursor: pointer; border: 1px solid transparent; line-height: 1.2; transition: all .15s; }
.eh-inv-wrap .eh-btn .dashicons { font-size: 16px; width: 16px; height: 16px; }
.eh-inv-wrap .eh-btn-blue { background: var(--eh-blue); color: #fff; border-color: var(--eh-blue); }
.eh-inv-wrap .eh-btn-blue:hover { background: var(--eh-blue-dark); border-color: var(--eh-blue-dark); color: #fff; }
.eh-inv-wrap .eh-btn-primary { background: var(--eh-green); color: #fff; border-color: var(--eh-green); }
.eh-inv-wrap .eh-btn-primary:hover { background: var(--eh-green-dark); border-color: var(--eh-green-dark); color: #fff; }
.eh-inv-wrap .eh-btn-outline { background: #fff; color: var(--eh-ink); border-color: #DCE1E8; }
.eh-inv-wrap .eh-btn-outline:hover { background: var(--eh-bg); border-color: #C7CDD6; }
.eh-inv-wrap .eh-btn-block { width: 100%; }
.eh-inv-wrap .eh-btn-sm { padding: 8px 14px; font-size: .8rem; }

/* ── Toolbar ── */
.eh-inv-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: #fff; border: 1px solid var(--eh-line); border-radius: var(--eh-radius); box-shadow: var(--eh-card-sh); padding: 12px; margin-bottom: 16px; }
.eh-filter-search { position: relative; flex: 1 1 220px; }
.eh-filter-search .dashicons { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--eh-faint); font-size: 18px; }
.eh-search-input { width: 100%; height: 40px; padding: 0 12px 0 38px; box-sizing: border-box; border: 1px solid #E2E6EC; border-radius: 8px; font-size: .85rem; color: var(--eh-ink); background: #fff; }
.eh-search-input:focus { outline: none; border-color: var(--eh-green); box-shadow: 0 0 0 3px rgba(34,197,94,.12); }
.eh-filter-select { flex: 0 0 auto; min-width: 150px; height: 40px; padding: 0 30px 0 12px; border: 1px solid #E2E6EC; border-radius: 8px; font-size: .85rem; color: var(--eh-ink); background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2.5'><path d='M6 9l6 6 6-6'/></svg>") no-repeat right 11px center; -webkit-appearance: none; appearance: none; cursor: pointer; }
.eh-filter-select:focus { outline: none; border-color: var(--eh-green); box-shadow: 0 0 0 3px rgba(34,197,94,.12); }
.eh-date-field { position: relative; display: inline-flex; align-items: center; }
.eh-date-ico { position: absolute; left: 10px; color: var(--eh-faint); font-size: 16px; pointer-events: none; }
.eh-date-input { height: 40px; padding: 0 10px 0 32px; border: 1px solid #E2E6EC; border-radius: 8px; font-size: .82rem; color: var(--eh-ink); background: #fff; min-width: 140px; }
.eh-date-input:focus { outline: none; border-color: var(--eh-green); box-shadow: 0 0 0 3px rgba(34,197,94,.12); }
.eh-filter-btn { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 16px; border: 1px solid #E2E6EC; border-radius: 8px; background: #fff; color: var(--eh-ink); font-size: .85rem; font-weight: 600; cursor: pointer; }
.eh-filter-btn .dashicons { font-size: 16px; width: 16px; height: 16px; }
.eh-reset-btn { display: inline-flex; align-items: center; height: 40px; padding: 0 14px; font-size: .85rem; font-weight: 600; color: var(--eh-green-dark); text-decoration: none; }
.eh-reset-btn:hover { color: var(--eh-green); }

/* ── Layout ── */
.eh-inv-layout { display: grid; grid-template-columns: minmax(0,1fr) 348px; gap: 18px; align-items: start; margin-bottom: 24px; }

/* ── Table ── */
.eh-inv-tablecard { background: #fff; border: 1px solid var(--eh-line); border-radius: var(--eh-radius); box-shadow: var(--eh-card-sh); overflow: hidden; }
.eh-inv-table { width: 100%; border-collapse: collapse; font-size: .85rem; display: block; overflow-x: auto; }
.eh-inv-table thead th { text-align: left; padding: 13px 16px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--eh-faint); background: var(--eh-line-soft); border-bottom: 1px solid var(--eh-line); white-space: nowrap; }
.eh-inv-th-aksi { text-align: center; width: 56px; }
.eh-inv-table tbody td { padding: 14px 16px; border-bottom: 1px solid var(--eh-line); color: var(--eh-ink); vertical-align: middle; }
.eh-inv-table tbody tr:last-child td { border-bottom: none; }
.eh-inv-trow { cursor: pointer; transition: background .12s; }
.eh-inv-trow:hover { background: var(--eh-line-soft); }
.eh-inv-trow.is-active { background: var(--eh-green-tint); box-shadow: inset 3px 0 0 var(--eh-green); }
.eh-inv-trow:focus { outline: none; background: var(--eh-line-soft); }
.eh-inv-td-num { white-space: nowrap; }
.eh-inv-td-number { font-weight: 700; color: var(--eh-ink); }
.eh-inv-part-chip { display: inline-block; margin-left: 6px; font-size: .62rem; font-weight: 700; padding: 2px 6px; border-radius: 5px; color: #fff; vertical-align: middle; }
.eh-inv-part-chip--dp { background: var(--eh-blue); }
.eh-inv-part-chip--pelunasan { background: var(--eh-green-dark); }
.eh-inv-td-project { color: var(--eh-muted); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eh-inv-td-amount { font-weight: 700; color: var(--eh-ink); white-space: nowrap; }
.eh-inv-td-due { color: var(--eh-muted); white-space: nowrap; }
.eh-inv-td-metode { color: var(--eh-muted); }
.eh-inv-metode { display: inline-block; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; cursor: help; }
.eh-inv-td-aksi { text-align: center; position: relative; }

/* Aksi dropdown */
.eh-inv-aksi { position: relative; display: inline-block; }
.eh-inv-kebab { border: none; background: none; cursor: pointer; color: var(--eh-faint); padding: 4px; border-radius: 6px; }
.eh-inv-kebab:hover { background: var(--eh-line); color: var(--eh-ink); }
.eh-inv-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 50; min-width: 230px; background: #fff; border: 1px solid var(--eh-line); border-radius: 10px; box-shadow: 0 12px 30px rgba(16,24,40,.14); padding: 6px; display: none; text-align: left; }
.eh-inv-menu.is-open { display: block; }
.eh-inv-menu__item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 10px; border: none; background: none; cursor: pointer; font-size: .82rem; color: var(--eh-ink); border-radius: 7px; text-align: left; }
.eh-inv-menu__item:hover { background: var(--eh-line-soft); }
.eh-inv-menu__item .dashicons { font-size: 16px; width: 16px; height: 16px; color: var(--eh-muted); }

/* Modal */
.eh-inv-modal { position: fixed; inset: 0; z-index: 100000; }
.eh-inv-modal[hidden] { display: none; }
.eh-inv-modal__backdrop { position: absolute; inset: 0; background: rgba(15,23,42,.45); }
.eh-inv-modal__box { position: relative; max-width: 560px; margin: 6vh auto; background: #fff; border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,.28); max-height: 86vh; overflow: auto; }
.eh-inv-modal__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--eh-line); position: sticky; top: 0; background: #fff; }
.eh-inv-modal__title { margin: 0; font-size: 1rem; font-weight: 700; color: var(--eh-ink); }
.eh-inv-modal__close { border: none; background: none; font-size: 26px; line-height: 1; cursor: pointer; color: var(--eh-muted); }
.eh-inv-modal__body { padding: 18px; }
.eh-inv-modal__loading, .eh-inv-modal__err { color: var(--eh-muted); }

/* Order-summary markup (shared with admin) */
.eh-ordsum__head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.eh-ordsum__num { font-size: 1.05rem; font-weight: 700; color: var(--eh-ink); }
.eh-ordsum__meta { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; color: var(--eh-muted); margin-bottom: 14px; }
.eh-ordsum__meta strong { color: var(--eh-ink); font-weight: 600; }
.eh-ordsum__items { width: 100%; border-collapse: collapse; font-size: .82rem; margin-bottom: 12px; }
.eh-ordsum__items th { text-align: left; padding: 8px 10px; background: var(--eh-line-soft); color: var(--eh-faint); font-size: .68rem; text-transform: uppercase; letter-spacing: .03em; }
.eh-ordsum__items td { padding: 8px 10px; border-bottom: 1px solid var(--eh-line); color: var(--eh-ink); }
.eh-ordsum__qty, .eh-ordsum__amt { text-align: right; white-space: nowrap; }
.eh-ordsum__totals { font-size: .82rem; }
.eh-ordsum__totals > div { display: flex; justify-content: space-between; padding: 5px 10px; color: var(--eh-muted); }
.eh-ordsum__grand { border-top: 1px solid var(--eh-line); margin-top: 4px; font-weight: 700; color: var(--eh-ink) !important; }
.eh-ordsum__addr { margin-top: 14px; font-size: .82rem; color: var(--eh-muted); }
.eh-ordsum__addr strong { display: block; color: var(--eh-ink); margin-bottom: 4px; }

/* Split form (modal) */
.eh-split-form__hint { font-size: .82rem; color: var(--eh-muted); margin: 0 0 14px; }
.eh-split-form__msg { margin: 4px 0 12px; font-size: .82rem; padding: 8px 10px; border-radius: 8px; }
.eh-split-form__msg.is-err { background: #FEECEC; color: #DC2626; }
.eh-split-form__msg.is-ok { background: var(--eh-green-tint); color: var(--eh-green-dark); }
.eh-split-form input[type=number], .eh-split-form input[type=date] { width: 100%; height: 40px; padding: 0 12px; box-sizing: border-box; border: 1px solid #E2E6EC; border-radius: 8px; font-size: .85rem; }
.eh-inv-link { color: var(--eh-blue-dark); font-weight: 600; text-decoration: none; }
.eh-inv-link:hover { text-decoration: underline; }

.eh-inv-tablefoot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--eh-line); flex-wrap: wrap; }
.eh-result-count { font-size: .8rem; color: var(--eh-muted); }

/* ── Empty ── */
.eh-inv-empty { text-align: center; padding: 44px 16px; color: var(--eh-muted); }
.eh-inv-empty .dashicons { font-size: 38px; width: 38px; height: 38px; opacity: .45; }
.eh-inv-empty p { margin: 10px 0 0; }

/* ── Pagination ── */
.eh-pagination { display: inline-flex; gap: 4px; }
.eh-pagination .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; padding: 0 9px; border: 1px solid var(--eh-line); border-radius: 8px; text-decoration: none; color: var(--eh-ink); font-size: .82rem; background: #fff; }
.eh-pagination .page-numbers .dashicons { font-size: 16px; width: 16px; height: 16px; }
.eh-pagination .page-numbers.current { background: var(--eh-blue); color: #fff; border-color: var(--eh-blue); }
.eh-pagination .page-numbers:hover:not(.current) { background: var(--eh-line-soft); }
.eh-pagination .page-numbers.dots { border: none; background: none; }

/* ── Detail panel ── */
.eh-inv-aside { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 20px; }
.eh-inv-detailpane { background: #fff; border: 1px solid var(--eh-line); border-radius: var(--eh-radius); box-shadow: var(--eh-card-sh); overflow: hidden; }
.eh-inv-detailpane__bar { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--eh-line); }
.eh-inv-detailpane__title { font-size: .9rem; font-weight: 700; margin: 0; color: var(--eh-ink); }
.eh-inv-detailpane__close { display: none; border: none; background: none; cursor: pointer; color: var(--eh-muted); }
.eh-inv-detailpane__body { padding: 18px 16px; min-height: 80px; }
.eh-inv-detailpane__body.is-loading { opacity: .5; }
.eh-inv-detailpane__empty { color: var(--eh-faint); font-size: .85rem; text-align: center; padding: 24px 0; }

.eh-inv-detail__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.eh-inv-detail__num { font-size: 1.15rem; font-weight: 700; color: var(--eh-ink); }
.eh-inv-detail__project { margin: 4px 0 14px; color: var(--eh-muted); font-size: .85rem; }
.eh-inv-detail__rows { display: flex; flex-direction: column; gap: 10px; padding: 14px 0; border-top: 1px solid var(--eh-line); }
.eh-inv-detail__row { display: flex; justify-content: space-between; gap: 10px; font-size: .85rem; }
.eh-inv-detail__k { color: var(--eh-muted); }
.eh-inv-detail__v { font-weight: 600; color: var(--eh-ink); }
.eh-inv-detail__total { display: flex; flex-direction: column; gap: 3px; padding: 14px 0 18px; border-top: 1px solid var(--eh-line); }
.eh-inv-detail__total-k { font-size: .78rem; color: var(--eh-muted); }
.eh-inv-detail__total-v { font-size: 1.5rem; font-weight: 700; color: var(--eh-ink); }
.eh-inv-detail__actions { display: flex; flex-direction: column; gap: 10px; }

/* Konfirmasi form */
.eh-konfirmasi-form { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--eh-line); }
.eh-konfirmasi-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.eh-konfirmasi-label { font-size: .8rem; font-weight: 600; color: var(--eh-ink); }
.eh-konfirmasi-label small { color: var(--eh-muted); font-weight: 500; }
.eh-konfirmasi-file { font-size: .8rem; }
.eh-konfirmasi-toggle { display: flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--eh-ink); margin-bottom: 12px; cursor: pointer; }

/* Help card */
.eh-inv-help { display: flex; gap: 12px; background: #fff; border: 1px solid var(--eh-line); border-radius: var(--eh-radius); box-shadow: var(--eh-card-sh); padding: 16px; }
.eh-inv-help__ico { flex-shrink: 0; width: 38px; height: 38px; border-radius: 10px; background: #E8F0FE; color: var(--eh-blue); display: flex; align-items: center; justify-content: center; font-size: 20px; }
.eh-inv-help__body strong { display: block; font-size: .88rem; color: var(--eh-ink); }
.eh-inv-help__body p { margin: 4px 0 10px; font-size: .8rem; color: var(--eh-muted); }

/* ── Payment methods ── */
.eh-inv-methods { margin-bottom: 22px; }
.eh-inv-section-title { font-size: 1rem; font-weight: 700; color: var(--eh-ink); margin: 0 0 14px; }
.eh-inv-methods__grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.eh-inv-method { display: flex; flex-direction: column; gap: 6px; background: #fff; border: 1px solid var(--eh-line); border-radius: var(--eh-radius); box-shadow: var(--eh-card-sh); padding: 16px; }
.eh-inv-method__ico { width: 38px; height: 38px; border-radius: 10px; background: var(--eh-green-tint); color: var(--eh-green-dark); display: flex; align-items: center; justify-content: center; font-size: 20px; margin-bottom: 4px; }
.eh-inv-method strong { font-size: .85rem; color: var(--eh-ink); }
.eh-inv-method span { font-size: .76rem; color: var(--eh-muted); line-height: 1.45; }

/* ── Trust badges ── */
.eh-inv-trust { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; padding: 20px; background: #fff; border: 1px solid var(--eh-line); border-radius: var(--eh-radius); box-shadow: var(--eh-card-sh); }
.eh-inv-trust__item { display: flex; align-items: center; gap: 10px; }
.eh-inv-trust__ico { width: 36px; height: 36px; border-radius: 9px; background: var(--eh-green-tint); color: var(--eh-green-dark); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.eh-inv-trust__item strong { display: block; font-size: .82rem; color: var(--eh-ink); }
.eh-inv-trust__item span { font-size: .74rem; color: var(--eh-muted); }

/* ── Responsive ── */
@media (max-width: 1100px) {
	.eh-inv-methods__grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 980px) {
	.eh-inv-layout { grid-template-columns: 1fr; }
	.eh-inv-aside { position: static; }
	.eh-inv-detailpane { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 92vw); border-radius: 0; transform: translateX(100%); transition: transform .25s ease; z-index: 99999; overflow-y: auto; }
	.eh-inv-detailpane.is-active { transform: translateX(0); }
	.eh-inv-detailpane__close { display: inline-flex; }
	.eh-inv-help { display: none; }
}
@media (max-width: 760px) {
	.eh-inv-stats { grid-template-columns: repeat(2, 1fr); }
	.eh-inv-trust { grid-template-columns: repeat(2, 1fr); }
	.eh-inv-methods__grid { grid-template-columns: repeat(2, 1fr); }
	.eh-inv-table thead { display: none; }
	.eh-inv-table tbody td { display: block; padding: 4px 16px; border: none; }
	.eh-inv-trow { display: block; padding: 12px 0; border-bottom: 1px solid var(--eh-line); }
	.eh-inv-td-num { padding-top: 12px; }
	.eh-inv-td-aksi { display: none; }
}
