/* =====================================================
   EQUIPMENT / ASSET LIST — รายการครุภัณฑ์หน่วยงาน
   Brand: #218bc3 · #3e9aa1 · #76ad59
   ===================================================== */

.eq-wrap { padding: 10px 0 60px; }

/* ── heading ── */
.eq-head { text-align: center; margin-bottom: 28px; }
.eq-head .eq-badge {
	display: inline-block;
	background: linear-gradient(135deg, rgba(33,139,195,.12), rgba(118,173,89,.12));
	color: #218bc3;
	font-size: .8rem; font-weight: 700; letter-spacing: .5px;
	padding: 5px 16px; border-radius: 50px; margin-bottom: 12px;
}
.eq-head h3 {
	font-weight: 800; color: #1e293b;
	font-size: clamp(1.3rem, 2.4vw, 1.9rem);
	margin: 0; display: inline-block; position: relative; padding-bottom: 12px;
}
.eq-head h3::after {
	content: ''; position: absolute; left: 50%; bottom: 0;
	transform: translateX(-50%); width: 70px; height: 4px; border-radius: 3px;
	background: linear-gradient(135deg, #218bc3, #3e9aa1, #76ad59);
}

/* ── summary stat chips ── */
.eq-stats {
	display: flex; flex-wrap: wrap; justify-content: center;
	gap: 16px; margin-bottom: 30px;
}
.eq-stat {
	display: flex; align-items: center; gap: 14px;
	background: #fff; border-radius: 16px;
	padding: 16px 24px; min-width: 200px;
	box-shadow: 0 6px 22px rgba(33, 86, 124, 0.08);
	border-left: 5px solid #218bc3;
}
.eq-stat.ready  { border-left-color: #76ad59; }
.eq-stat.types  { border-left-color: #3e9aa1; }
.eq-stat-icon {
	width: 48px; height: 48px; border-radius: 12px;
	display: flex; align-items: center; justify-content: center;
	font-size: 1.3rem; color: #fff; flex-shrink: 0;
	background: linear-gradient(135deg, #218bc3, #3e9aa1);
}
.eq-stat.ready .eq-stat-icon { background: linear-gradient(135deg, #3e9aa1, #76ad59); }
.eq-stat.types .eq-stat-icon { background: linear-gradient(135deg, #218bc3, #76ad59); }
.eq-stat-num { font-size: 1.5rem; font-weight: 800; color: #1e293b; line-height: 1; }
.eq-stat-label { font-size: .82rem; color: #64748b; margin-top: 3px; }

/* ── table card ── */
.eq-card {
	background: #fff; border: none !important;
	border-radius: 20px !important;
	box-shadow: 0 8px 30px rgba(33, 86, 124, 0.08) !important;
	overflow: hidden;
}
.eq-card .card-body { padding: 22px 24px; }

/* ── DataTable restyle ── */
.eq-card .dataTables_wrapper .row:first-child { margin-bottom: 14px; }
.eq-card div.dataTables_filter input {
	border: 1.5px solid #e2e8f0;
	border-radius: 50px;
	padding: 8px 16px;
	margin-left: 8px;
	transition: border-color .2s ease, box-shadow .2s ease;
}
.eq-card div.dataTables_filter input:focus {
	border-color: #3e9aa1;
	box-shadow: 0 0 0 3px rgba(62,154,161,.15);
	outline: none;
}
.eq-card div.dataTables_length select {
	border: 1.5px solid #e2e8f0;
	border-radius: 10px;
	padding: 6px 10px;
}

.eq-card table.dataTable {
	border-collapse: separate !important;
	border-spacing: 0;
}
.eq-card table.dataTable thead th {
	background: linear-gradient(135deg, #218bc3, #3e9aa1);
	color: #fff !important;
	font-weight: 600;
	font-size: .9rem;
	border: none !important;
	padding: 14px 14px;
	vertical-align: middle;
}
.eq-card table.dataTable thead th:first-child { border-top-left-radius: 12px; }
.eq-card table.dataTable thead th:last-child  { border-top-right-radius: 12px; }
.eq-card table.dataTable tbody td {
	padding: 13px 14px;
	border-top: 1px solid #eef2f7;
	vertical-align: middle;
	font-size: .9rem;
	color: #334155;
}
.eq-card table.dataTable.table-striped tbody tr:nth-of-type(odd) { background: #fafcfe; }
.eq-card table.dataTable tbody tr:hover {
	background: linear-gradient(135deg, rgba(33,139,195,.06), rgba(118,173,89,.06)) !important;
}
.eq-card table.dataTable tbody tr td:first-child {
	font-weight: 700; color: #94a3b8;
}

/* asset number → mono chip */
.eq-assetno {
	display: inline-block;
	background: #eef6fc;
	color: #1d6fa0;
	font-family: ui-monospace, "Courier New", monospace;
	font-size: .82rem; font-weight: 600;
	padding: 3px 10px; border-radius: 7px;
}

/* detail button */
.eq-detail-btn {
	display: inline-flex; align-items: center; gap: 6px;
	background: linear-gradient(135deg, #218bc3, #3e9aa1);
	color: #fff !important;
	border: none; border-radius: 50px;
	padding: 7px 16px; font-size: .82rem; font-weight: 600;
	text-decoration: none;
	box-shadow: 0 4px 12px rgba(33,139,195,.28);
	transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
}
.eq-detail-btn:hover {
	color: #fff !important; filter: brightness(1.07);
	transform: translateY(-2px);
	box-shadow: 0 7px 18px rgba(33,139,195,.4);
}

/* pagination */
.eq-card .dataTables_paginate .paginate_button {
	border-radius: 8px !important;
	border: none !important;
	margin: 0 2px;
	padding: 6px 12px !important;
}
.eq-card .dataTables_paginate .paginate_button.current {
	background: linear-gradient(135deg, #218bc3, #3e9aa1) !important;
	color: #fff !important;
	border: none !important;
}
.eq-card .dataTables_paginate .paginate_button:hover {
	background: rgba(33,139,195,.12) !important;
	color: #218bc3 !important;
	border: none !important;
}

/* =====================================================
   DETAIL MODAL — เปลี่ยนจากตารางเป็นการ์ดเป็นกลุ่ม
   ===================================================== */
#showModal .modal-content {
	border: none; border-radius: 20px; overflow: hidden;
}
#showModal .modal-header {
	background: linear-gradient(135deg, #218bc3 0%, #3e9aa1 55%, #76ad59 100%) !important;
	border: none; padding: 18px 24px;
}
#showModal .modal-title { font-weight: 700; }

.eq-modal-body { background: #f4f7fb; padding: 24px !important; }

.eq-group {
	background: #fff; border-radius: 16px;
	box-shadow: 0 4px 18px rgba(33, 86, 124, 0.06);
	margin-bottom: 18px; overflow: hidden;
}
.eq-group-head {
	display: flex; align-items: center; gap: 10px;
	padding: 13px 20px;
	font-weight: 700; font-size: .95rem; color: #fff;
}
.eq-group-head .ico {
	width: 30px; height: 30px; border-radius: 8px;
	background: rgba(255,255,255,.22);
	display: flex; align-items: center; justify-content: center;
	font-size: .9rem; flex-shrink: 0;
}
.eq-group.g-blue   .eq-group-head { background: linear-gradient(135deg, #218bc3, #3e9aa1); }
.eq-group.g-green  .eq-group-head { background: linear-gradient(135deg, #3e9aa1, #76ad59); }
.eq-group.g-amber  .eq-group-head { background: linear-gradient(135deg, #e8a13a, #d98324); }
.eq-group.g-teal   .eq-group-head { background: linear-gradient(135deg, #2b9aa6, #218bc3); }
.eq-group.g-rose   .eq-group-head { background: linear-gradient(135deg, #e06b6b, #c94f6d); }

.eq-info-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 1px;
	background: #eef2f7;
}
.eq-info {
	background: #fff;
	padding: 12px 20px;
}
.eq-info.full { grid-column: 1 / -1; }
.eq-info .k {
	font-size: .76rem; color: #94a3b8; font-weight: 600;
	margin-bottom: 3px; text-transform: uppercase; letter-spacing: .3px;
}
.eq-info .v { font-size: .95rem; color: #1e293b; font-weight: 500; word-break: break-word; }
.eq-info .v.price { color: #218bc3; font-weight: 700; }

.eq-status-badge {
	display: inline-flex; align-items: center; gap: 6px;
	font-size: .85rem; font-weight: 700;
	padding: 5px 14px; border-radius: 50px;
}
.eq-status-badge.ok  { background: rgba(118,173,89,.15); color: #4d8a2f; }
.eq-status-badge.no  { background: rgba(224,107,107,.15); color: #c0392b; }

/* ── DataTables Responsive: collapse control + child rows ── */
.eq-card table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control:before,
.eq-card table.dataTable > tbody > tr.parent td.dtr-control:before {
	background: linear-gradient(135deg, #218bc3, #3e9aa1);
	border: none;
	box-shadow: 0 2px 6px rgba(33,139,195,.35);
	color: #fff;
	font-weight: 700;
	top: 50%;
	transform: translateY(-50%);
}
.eq-card table.dataTable > tbody > tr.child ul.dtr-details {
	width: 100%;
}
.eq-card table.dataTable > tbody > tr.child ul.dtr-details > li {
	border-bottom: 1px solid #eef2f7;
	padding: 8px 6px;
}
.eq-card table.dataTable > tbody > tr.child .dtr-title {
	color: #218bc3;
	font-weight: 600;
	min-width: 40%;
}
.eq-card table.dataTable > tbody > tr.child {
	background: #fafcfe;
}

/* ══════════════ TABLET ══════════════ */
@media (max-width: 991px) {
	.eq-card .card-body { padding: 16px; }
}

/* ══════════════ MOBILE ══════════════ */
@media (max-width: 767px) {
	/* DataTable top controls stack & center */
	.eq-card .dataTables_wrapper .dataTables_length,
	.eq-card .dataTables_wrapper .dataTables_filter {
		text-align: center;
		float: none;
		width: 100%;
		margin-bottom: 8px;
	}
	.eq-card div.dataTables_filter input { margin-left: 6px; width: 60%; }
	.eq-card .dataTables_wrapper .dataTables_info,
	.eq-card .dataTables_wrapper .dataTables_paginate {
		text-align: center;
		float: none;
		width: 100%;
		margin-top: 8px;
	}
	.eq-card .dataTables_paginate .paginate_button { padding: 5px 10px !important; }

	.eq-card table.dataTable thead th { font-size: .82rem; padding: 11px 10px; }
	.eq-card table.dataTable tbody td { font-size: .85rem; padding: 11px 10px; }
	.eq-detail-btn { padding: 6px 12px; font-size: .78rem; }
}

@media (max-width: 575px) {
	.eq-info-grid { grid-template-columns: 1fr; }
	.eq-stat { min-width: 100%; }
	.eq-modal-body { padding: 16px !important; }
	.eq-group-head { font-size: .88rem; padding: 11px 16px; }
	.eq-info { padding: 10px 16px; }
	.eq-card div.dataTables_filter input { width: 70%; }
	#showModal .modal-dialog { margin: 8px; }
}
