.mdm-public { --mdm-accent: #2563eb; max-width: 1080px; margin: 0 auto; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }

.mdm-pub-header { text-align: center; margin-bottom: 32px; }
.mdm-pub-title { font-size: 30px; font-weight: 700; margin: 0 0 8px; color: #0f172a; }
.mdm-pub-intro { color: #64748b; font-size: 16px; margin: 0 0 16px; }
.mdm-pub-total { display: inline-flex; align-items: baseline; gap: 8px; background: color-mix(in srgb, var(--mdm-accent) 10%, #fff); border: 1px solid color-mix(in srgb, var(--mdm-accent) 25%, #fff); border-radius: 999px; padding: 8px 20px; }
.mdm-pub-total-num { font-size: 22px; font-weight: 700; color: var(--mdm-accent); }
.mdm-pub-total-label { font-size: 13px; color: #64748b; }

.mdm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.mdm-pub-empty { grid-column: 1/-1; text-align: center; color: #64748b; padding: 40px; }

.mdm-item {
	background: #fff; border: 1px solid #e5e7eb; border-radius: 14px;
	padding: 20px; display: flex; flex-direction: column;
	transition: box-shadow .2s, transform .2s;
}
.mdm-item:hover { box-shadow: 0 8px 24px rgba(15,23,42,.08); transform: translateY(-2px); }
.mdm-item-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.mdm-item-title { font-size: 18px; font-weight: 650; margin: 0; color: #0f172a; }
.mdm-lock { color: #f59e0b; display: inline-flex; }

.mdm-item-meta { display: flex; gap: 8px; margin: 10px 0; flex-wrap: wrap; }
.mdm-tag { font-size: 12px; background: color-mix(in srgb, var(--mdm-accent) 12%, #fff); color: var(--mdm-accent); padding: 3px 10px; border-radius: 6px; font-weight: 500; }
.mdm-ver { font-size: 12px; background: #f1f5f9; color: #475569; padding: 3px 10px; border-radius: 6px; }
.mdm-item-desc { color: #64748b; font-size: 14px; line-height: 1.6; margin: 4px 0 16px; flex-grow: 1; }

.mdm-item-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: auto; }
.mdm-dl-count { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: #94a3b8; }

.mdm-btn {
	display: inline-flex; align-items: center; gap: 6px;
	background: var(--mdm-accent); color: #fff !important;
	border: none; border-radius: 9px; padding: 9px 18px;
	font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none;
	transition: filter .15s;
}
.mdm-btn:hover { filter: brightness(.92); }

.mdm-pwbox { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mdm-pw-input { padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 13px; width: 120px; }
.mdm-pw-msg { font-size: 12px; color: #dc2626; width: 100%; }

@media (max-width: 600px) {
	.mdm-grid { grid-template-columns: 1fr; }
	.mdm-pw-input { flex: 1; }
}

/* ===== Header ringkasan (v1.1) ===== */
.mdm-pub-header {
	display: flex; align-items: center; justify-content: space-between;
	gap: 24px; flex-wrap: wrap; text-align: left;
	background: #fff; border: 1px solid #e5e7eb; border-radius: 16px;
	padding: 28px 32px; margin-bottom: 20px;
}
.mdm-pub-headline { display: flex; align-items: center; gap: 18px; }
.mdm-pub-icon { color: var(--mdm-accent); display: inline-flex; }
.mdm-pub-header .mdm-pub-title { font-size: 26px; margin: 0; }
.mdm-pub-header .mdm-pub-intro { margin: 4px 0 0; }
.mdm-pub-stats { display: flex; gap: 36px; }
.mdm-stat { text-align: center; }
.mdm-stat-num { display: block; font-size: 30px; font-weight: 700; color: var(--mdm-accent); line-height: 1.1; }
.mdm-stat-label { font-size: 12px; color: #94a3b8; }

/* ===== Toolbar: search + toggle ===== */
.mdm-pub-toolbar { display: flex; gap: 12px; margin-bottom: 22px; align-items: center; }
.mdm-search {
	flex: 1; display: flex; align-items: center; gap: 10px;
	background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 0 16px;
}
.mdm-search svg { color: #94a3b8; flex-shrink: 0; }
.mdm-search-input { flex: 1; border: none; outline: none; padding: 14px 0; font-size: 15px; background: transparent; color: #0f172a; }
.mdm-view-toggle { display: flex; background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; overflow: hidden; }
.mdm-vt { background: none; border: none; padding: 11px 13px; cursor: pointer; color: #94a3b8; display: inline-flex; }
.mdm-vt:hover { color: #475569; }
.mdm-vt.is-active { background: var(--mdm-accent); color: #fff; }

/* ===== Items container ===== */
.mdm-items { display: block; }
.mdm-thead { display: none; }

/* GRID mode */
.mdm-view-grid .mdm-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.mdm-view-grid .mdm-item { flex-direction: column; padding: 20px; }
.mdm-view-grid .mdm-cell { display: block; }
.mdm-view-grid .mdm-cell-cat, .mdm-view-grid .mdm-cell-ver { display: inline-block; margin: 8px 8px 0 0; }
.mdm-view-grid .mdm-cell-dl { margin-top: 12px; }
.mdm-view-grid .mdm-cell-act { margin-top: 14px; }
.mdm-view-grid .mdm-th { display: none; }

/* TABLE mode (default) */
.mdm-view-table .mdm-items {
	display: table; width: 100%; border-collapse: separate; border-spacing: 0;
	background: #fff; border: 1px solid #e5e7eb; border-radius: 14px; overflow: hidden;
}
.mdm-view-table .mdm-thead { display: table-row; background: #f8fafc; }
.mdm-view-table .mdm-th {
	display: table-cell; padding: 14px 18px; font-size: 12px; font-weight: 600;
	text-transform: uppercase; letter-spacing: .03em; color: #64748b;
	border-bottom: 1px solid #e5e7eb; text-align: left; white-space: nowrap;
}
.mdm-view-table .mdm-th-dl, .mdm-view-table .mdm-th-act { text-align: center; }
.mdm-view-table .mdm-item {
	display: table-row; padding: 0; border: none; box-shadow: none; transform: none;
}
.mdm-view-table .mdm-item:hover { background: #f8fafc; box-shadow: none; transform: none; }
.mdm-view-table .mdm-cell {
	display: table-cell; padding: 16px 18px; vertical-align: middle;
	border-bottom: 1px solid #f1f5f9;
}
.mdm-view-table .mdm-item:last-child .mdm-cell { border-bottom: none; }
.mdm-view-table .mdm-cell-name { min-width: 220px; }
.mdm-view-table .mdm-cell-dl, .mdm-view-table .mdm-cell-act { text-align: center; }
.mdm-view-table .mdm-item-desc { margin: 4px 0 0; font-size: 13px; }
.mdm-view-table .mdm-dl-count { justify-content: center; }
.mdm-view-table .mdm-pwbox { justify-content: center; }
.mdm-dash { color: #cbd5e1; }

.mdm-no-result { text-align: center; color: #64748b; padding: 30px; }
.mdm-pub-empty { display: flex; flex-direction: column; align-items: center; gap: 12px; color: #cbd5e1; padding: 56px 20px; }
.mdm-pub-empty p { color: #94a3b8; margin: 0; }

@media (max-width: 760px) {
	.mdm-pub-header { padding: 20px; }
	.mdm-pub-stats { gap: 24px; }
	/* Tabel jadi kartu di mobile */
	.mdm-view-table .mdm-items { display: block; border: none; background: transparent; }
	.mdm-view-table .mdm-thead { display: none; }
	.mdm-view-table .mdm-item {
		display: block; background: #fff; border: 1px solid #e5e7eb;
		border-radius: 14px; margin-bottom: 12px; padding: 16px;
	}
	.mdm-view-table .mdm-cell { display: block; padding: 4px 0; border: none; text-align: left; }
	.mdm-view-table .mdm-cell-cat, .mdm-view-table .mdm-cell-ver { display: inline-block; margin-right: 8px; }
	.mdm-view-table .mdm-cell-act { margin-top: 10px; }
	.mdm-view-table .mdm-pwbox, .mdm-view-table .mdm-dl-count { justify-content: flex-start; }
	.mdm-pw-input { flex: 1; }
}
