/* ============================================================
   Ecohomes Documents — Dokumen Proyek
   Reference: 7.Dokumen Proyek.png (green brand kept).
   ============================================================ */

.eh-docs-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-docs-page) { width: 100% !important; max-width: 1360px !important; }
.woocommerce-account .dashboard-wrap:has(.eh-docs-page) > [class*="col-"]:first-child { flex: 0 0 19%; max-width: 19%; }
.woocommerce-account .dashboard-wrap:has(.eh-docs-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; }

/* Header */
.eh-docs-header { margin-bottom: 20px; }
.eh-docs-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; }

/* Top grid: 4 stat cards + upload card */
.eh-docs-top { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)) minmax(230px, 1.15fr); gap: 16px; margin-bottom: 18px; align-items: stretch; }
.eh-docs-top .eh-stat-card {
	position: relative; display: flex; flex-direction: column; gap: 2px;
	background: #fff; border: 1px solid var(--eh-line); border-radius: 12px; box-shadow: var(--eh-card-sh); padding: 16px;
}
.eh-stat-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--eh-tint); color: var(--eh-green-dark); display: flex; align-items: center; justify-content: center; font-size: 20px; margin-bottom: 8px; }
.eh-stat-label { font-size: .78rem; color: var(--eh-muted); }
.eh-stat-value { font-size: 1.5rem; font-weight: 700; color: var(--eh-ink); line-height: 1.15; }
.eh-stat-value--sm { font-size: 1.05rem; }
.eh-stat-sub { font-size: .72rem; color: var(--eh-muted); }
.eh-stat-link { font-size: .72rem; color: var(--eh-green-dark); font-weight: 600; margin-top: 4px; }
.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; }
.eh-quota-track { height: 6px; background: var(--eh-track); border-radius: 999px; overflow: hidden; margin: 8px 0 4px; }
.eh-quota-bar { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #1F6FEB, #2ECC71); }

/* Upload card */
.eh-upload-card { background: #fff; border: 1px solid var(--eh-line); border-radius: 12px; box-shadow: var(--eh-card-sh); padding: 14px; display: flex; flex-direction: column; }
.eh-upload-card-title { display: flex; align-items: center; gap: 6px; font-size: .9rem; font-weight: 700; color: var(--eh-ink); margin: 0 0 10px; }
.eh-upload-card-title .dashicons { color: var(--eh-green-dark); font-size: 18px; }
.eh-upload-zone { flex: 1; border: 2px dashed #CBD5E1; border-radius: 10px; padding: 16px 12px; text-align: center; cursor: pointer; transition: all .15s; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.eh-upload-zone:hover, .eh-upload-zone.is-drag { border-color: var(--eh-green); background: var(--eh-tint); }
.eh-upload-zone .dashicons { font-size: 28px; color: #94A3B8; }
.eh-upload-zone p { margin: 4px 0 0; font-size: .76rem; color: var(--eh-muted); line-height: 1.4; }
.eh-upload-zone small { font-size: .68rem; color: #94A3B8; }
.eh-upload-zone .eh-btn { margin-top: 8px; }
.eh-upload-progress { height: 5px; background: var(--eh-track); border-radius: 999px; overflow: hidden; margin-top: 10px; }
.eh-upload-progress[hidden] { display: none !important; }
.eh-upload-progress-bar { height: 100%; width: 0; background: var(--eh-green); transition: width .2s; }

/* Upload detail panel */
.eh-upload-detail { background: #fff; border: 1px solid var(--eh-green); border-radius: 12px; box-shadow: var(--eh-card-sh); padding: 16px; margin-bottom: 18px; }
.eh-upload-detail[hidden] { display: none !important; }
.eh-upload-detail-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.eh-upload-detail-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

/* Filter */
.eh-q-filter { display: grid; grid-template-columns: 1fr 1fr 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 .eh-grow { grid-column: span 1; }
.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; }

/* Category chips */
.eh-doc-cats { margin-bottom: 16px; }
.eh-doc-cats-title { display: block; font-size: .8rem; font-weight: 700; color: var(--eh-ink); margin-bottom: 10px; }
.eh-doc-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.eh-doc-chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 999px; font-size: .82rem; font-weight: 500; color: var(--eh-muted); text-decoration: none; border: 1px solid var(--eh-line); background: #fff; transition: all .15s; }
.eh-doc-chip:hover { border-color: var(--eh-green); color: var(--eh-green-dark); }
.eh-doc-chip.is-active { background: var(--eh-green); color: #fff; border-color: var(--eh-green); }
.eh-chip-count { font-size: .72rem; font-weight: 700; background: rgba(15,23,42,.08); border-radius: 999px; padding: 1px 7px; }
.eh-doc-chip.is-active .eh-chip-count { background: rgba(255,255,255,.28); }

/* Table card */
.eh-docs-card { background: #fff; border: 1px solid var(--eh-line); border-radius: 14px; box-shadow: var(--eh-card-sh); overflow: hidden; }
.eh-docs-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--eh-line); }
.eh-docs-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-docs-table-wrap { overflow-x: auto; container-type: inline-size; container-name: ehdocs; }
.eh-docs-table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: .82rem; }
.eh-docs-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-docs-table tbody td { padding: 12px 14px; border-bottom: 1px solid var(--eh-line); vertical-align: middle; }
.eh-docs-table tbody tr:hover td { background: #FBFCFE; }
.eh-cell-strong { display: block; font-weight: 600; color: var(--eh-ink); }
.eh-cell-muted { color: #B6BECB; }
.eh-file-sub { display: block; font-size: .73rem; color: var(--eh-muted); margin-top: 2px; }
.eh-q-link { color: #1F6FEB; text-decoration: none; font-weight: 600; }
.eh-q-link:hover { text-decoration: underline; }

/* File cell + colored type chip */
.eh-file-cell { display: flex; align-items: center; gap: 11px; min-width: 0; }
.eh-ft { flex-shrink: 0; width: 40px; height: 40px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: .6rem; font-weight: 800; letter-spacing: .02em; color: #fff; }
.eh-ft-pdf { background: #E53935; }
.eh-ft-zip { background: #2E9E5B; }
.eh-ft-xls { background: #1E8E5A; }
.eh-ft-doc { background: #1F6FEB; }
.eh-ft-img { background: #7C3AED; }
.eh-ft-default { background: #94A3B8; }
.eh-file-meta { min-width: 0; }
.eh-file-name { font-weight: 600; color: var(--eh-ink); text-decoration: none; display: flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.eh-file-name:hover { color: var(--eh-green-dark); }
.eh-file-eye { font-size: 14px; width: 14px; height: 14px; color: var(--eh-muted); flex-shrink: 0; }

/* Badges */
.eh-badge { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: .72rem; font-weight: 700; }
.eh-badge-green { background: #E8F8EF; color: #1E9E59; }
.eh-badge-gray { background: #EEF1F5; color: #64748B; }

/* Action icons */
.eh-col-action { text-align: right; white-space: nowrap; }
.eh-doc-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-danger:hover { background: #FDECEC; color: #D64545; border-color: #F3B4B4; }

/* 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-docs-empty { padding: 56px 24px; text-align: center; color: var(--eh-muted); }
.eh-docs-empty .dashicons { font-size: 48px; width: 48px; height: 48px; color: #CBD5E1; display: block; margin: 0 auto 12px; }
.eh-docs-empty p { margin: 0; font-size: .9rem; }

/* ── Responsive ── */
@container ehdocs (max-width: 720px) {
	.eh-docs-table { min-width: 0; }
	.eh-docs-table thead { display: none; }
	.eh-docs-table, .eh-docs-table tbody, .eh-docs-table tr, .eh-docs-table td { display: block; width: 100%; }
	.eh-docs-table tr { border: 1px solid var(--eh-line); border-radius: 12px; margin: 12px; padding: 4px 12px; }
	.eh-docs-table td { border-bottom: 1px dashed var(--eh-line); padding: 9px 0; display: flex; justify-content: space-between; gap: 16px; align-items: center; }
	.eh-docs-table td:last-child { border-bottom: none; }
	.eh-docs-table tbody td::before { content: attr(data-label); font-size: .7rem; font-weight: 700; text-transform: uppercase; color: var(--eh-muted); flex-shrink: 0; }
	.eh-file-name { max-width: 180px; }
	.eh-col-action { justify-content: flex-start; }
}

@media (max-width: 1180px) {
	.eh-docs-top { grid-template-columns: repeat(2, 1fr); }
	.eh-upload-card { grid-column: 1 / -1; }
	.eh-upload-detail-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 980px) {
	.woocommerce-account .col-lg-9:has(.eh-docs-page),
	.woocommerce-account .col-md-8:has(.eh-docs-page) { flex: 0 0 100%; max-width: 100%; }
	.eh-q-filter { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
	.eh-docs-top { grid-template-columns: 1fr; }
	.eh-upload-detail-grid { grid-template-columns: 1fr; }
	.eh-q-filter { grid-template-columns: 1fr; }
}
