/* =============================================================
   Meter Report — ธีมใหม่ (วางทับ Bootstrap 3.2 ที่หน้าเดิมใช้อยู่)
   ไม่ต้องแก้ markup ของหน้าเดิม: panel → card, table, form, tab ฯลฯ
   ============================================================= */
:root {
	--brand: #6d4aff;
	--brand-600: #5835e8;
	--brand-50: #f4f1ff;
	--brand-100: #e9e3ff;
	--side-bg: #ffffff;
	--side-text: #344054;
	--side-muted: #98a2b3;
	--electric: #f08c00;
	--electric-50: #fff4e0;
	--water: #0b84d8;
	--water-50: #e6f4ff;
	--success: #12a150;
	--danger: #d92d20;
	--warning: #dc8a00;
	--info: #0b84d8;

	--bg: #f8f9fb;
	--surface: #ffffff;
	--surface-2: #f9fafb;
	--border: #eaecf0;
	--text: #1d2939;
	--text-2: #475467;
	--muted: #667085;

	--radius: 12px;
	--radius-sm: 8px;
	--shadow: 0 1px 2px rgba(16, 24, 40, .04);
	--shadow-lg: 0 12px 32px rgba(16, 24, 40, .12);
	--sidebar-w: 264px;
	--font: 'IBM Plex Sans Thai', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* ---------- base ---------- */
html { -webkit-text-size-adjust: 100%; }
body {
	font-family: var(--font);
	font-size: 15px;
	line-height: 1.6;
	color: var(--text);
	background: var(--bg);
}
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { font-family: var(--font); color: var(--text); font-weight: 600; line-height: 1.35; }
a { color: var(--brand); }
a:hover, a:focus { color: var(--brand-600); }
:focus-visible { outline: 3px solid rgba(91, 60, 196, .35); outline-offset: 2px; }
hr { border-top-color: var(--border); }
::selection { background: var(--brand-50); }

.skip-link {
	position: absolute; left: 12px; top: -48px; z-index: 2000;
	background: var(--brand); color: #fff; padding: 8px 14px; border-radius: var(--radius-sm);
}
.skip-link:focus { top: 12px; color: #fff; }

/* ---------- legacy utility classes ---------- */
.center { text-align: center; }
.right { text-align: right; }
.fright { float: right; }
.fleft { float: left; }
.clr { clear: both; }
.mg10 { margin: 10px; }
.pd10 { padding: 10px; }
.pad-botm { padding-bottom: 8px; }
.back-widget-set { background-color: transparent; }
@media (max-width: 430px) { .hidden-xxs { display: none !important; } }
@media (max-width: 767px) { .noshowmobile { display: none !important; } }
.resp-container { position: relative; overflow: hidden; padding-top: 56.25%; }
@media (max-width: 767px) { .resp-container { padding-top: 120%; } }
.resp-iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- layout ---------- */
.app-sidebar {
	position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 1040;
	display: flex; flex-direction: column;
	background: var(--side-bg);
	color: var(--side-text);
	border-right: 1px solid var(--border);
	overflow: hidden;
	transition: transform .22s ease;
}
.app-brand {
	display: flex; align-items: center; gap: 12px;
	padding: 20px 20px 18px; color: var(--side-text); text-decoration: none;
	border-bottom: 1px solid var(--border);
}
.app-brand:hover, .app-brand:focus { color: var(--side-text); text-decoration: none; }
.app-brand-mark {
	width: 40px; height: 40px; border-radius: 10px; flex: none;
	display: grid; place-items: center; font-size: 18px;
	color: #fff;
	background: var(--brand);
}
.app-brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.app-brand-text strong { font-size: 16px; letter-spacing: .2px; color: #101828; }
.app-brand-text small { font-size: 12px; color: var(--side-muted); }

.app-nav { padding: 8px 12px 16px; flex: 1; min-height: 0; overflow-y: auto; }
.app-brand, .app-sidebar-foot { flex: none; }
.app-nav-group {
	margin: 18px 10px 6px; font-size: 11.5px; font-weight: 600;
	letter-spacing: .6px; text-transform: uppercase; color: var(--side-muted);
}
.app-nav-link {
	display: flex; align-items: center; gap: 12px;
	padding: 9px 12px; margin: 2px 0; border-radius: var(--radius-sm);
	color: var(--side-text); text-decoration: none; font-size: 14.5px;
	transition: background .15s, color .15s;
}
.app-nav-link i { width: 18px; text-align: center; color: #98a2b3; font-size: 15px; }
.app-nav-link:hover, .app-nav-link:focus { background: #f9fafb; color: #101828; text-decoration: none; }
.app-nav-link.is-active { background: var(--brand-50); color: var(--brand-600); font-weight: 600; }
.app-nav-link.is-active i { color: var(--brand); }
.app-nav-hint {
	margin-left: auto; font-style: normal; font-size: 11px; color: #c4320a;
	background: #ffe9e2; padding: 1px 7px; border-radius: 999px; white-space: nowrap;
}
.app-sidebar-foot {
	padding: 12px 12px 16px; font-size: 12px; line-height: 1.5; color: var(--side-muted);
	border-top: 1px solid var(--border);
}
.app-sidebar-foot .app-user { padding: 8px; border-radius: 10px; }
.app-sidebar-foot .app-user:hover { background: #f9fafb; }
.app-sidebar-foot .app-user-name { flex: 1; min-width: 0; color: #101828; font-size: 13.5px; overflow: hidden; }
.app-user-logout {
	width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 8px;
	color: var(--muted); text-decoration: none;
}
.app-user-logout:hover, .app-user-logout:focus { background: #fef3f2; color: var(--danger); text-decoration: none; }
.app-login-link {
	display: flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 12px; border-radius: 8px;
	border: 1px solid var(--border); color: var(--side-text); font-size: 13.5px; font-weight: 500; text-decoration: none;
}
.app-login-link:hover, .app-login-link:focus { border-color: #d0d5dd; background: #f9fafb; color: #101828; text-decoration: none; }
.app-sidebar-org { padding: 10px 8px 0; }

.app-body { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.app-topbar {
	position: sticky; top: 0; z-index: 1030;
	display: flex; align-items: center; gap: 14px;
	padding: 12px 28px; min-height: 68px;
	background: rgba(255, 255, 255, .94);
	-webkit-backdrop-filter: saturate(160%) blur(10px); backdrop-filter: saturate(160%) blur(10px);
	border-bottom: 1px solid var(--border);
}
.app-topbar-title { flex: 1; min-width: 0; }
.app-topbar-title h1 { margin: 0; font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-topbar-date { font-size: 12.5px; color: var(--muted); }
.app-topbar-user { display: flex; align-items: center; gap: 12px; }
.app-user { display: flex; align-items: center; gap: 10px; }
.app-avatar {
	width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
	background: var(--brand-50); color: var(--brand); font-weight: 600;
}
.app-user-name { display: flex; flex-direction: column; line-height: 1.2; font-size: 14px; font-weight: 500; }
.app-user-name small { color: var(--muted); font-weight: 400; font-size: 12px; }
.app-menu-btn {
	display: none; border: 1px solid var(--border); background: var(--surface);
	width: 40px; height: 40px; border-radius: 10px; color: var(--text); font-size: 17px;
}
.app-main { flex: 1; padding: 24px 28px 40px; margin-top: 0; min-height: 0; }
.app-main > .container, .app-main .container { width: auto; max-width: 1360px; margin: 0 auto; padding-left: 0; padding-right: 0; }
.app-main > .col-lg-12 { float: none; padding: 0; max-width: 1360px; margin: 0 auto; }
.app-footer { padding: 18px 28px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--border); background: var(--surface); }
.app-backdrop { display: none; }

@media (max-width: 991px) {
	.app-sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
	.sidebar-open .app-sidebar { transform: none; }
	.sidebar-open .app-backdrop { display: block; position: fixed; inset: 0; z-index: 1035; background: rgba(16, 24, 40, .45); }
	.app-body { margin-left: 0; }
	.app-menu-btn { display: inline-grid; place-items: center; }
	.app-topbar { padding: 10px 16px; }
	.app-main { padding: 16px 16px 32px; }
	.app-footer { padding: 16px; }
}
@media (max-width: 480px) {
	.app-topbar-date { display: none; }
	.app-topbar-title h1 { font-size: 17px; }
}

/* ---------- page header (legacy h3.header-line) ---------- */
.header-line {
	margin: 0 0 6px; padding: 0 0 14px; font-size: 21px; font-weight: 600;
	text-transform: none; border-bottom: 1px solid var(--border);
	display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.header-line > i, .header-line > .fa, .header-line > .fas {
	width: 38px; height: 38px; border-radius: 10px; display: inline-grid; place-items: center;
	background: var(--brand-50); color: var(--brand); font-size: 17px;
}
.header-line .fa-bolt { background: var(--electric-50); color: var(--electric); }
.header-line .fa-tint, .header-line .fa-droplet { background: var(--water-50); color: var(--water); }

/* ---------- cards (panel) ---------- */
.panel {
	background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
	box-shadow: var(--shadow); margin-bottom: 20px;
}
.panel > .panel-heading {
	border-top-left-radius: var(--radius); border-top-right-radius: var(--radius);
	padding: 14px 18px; font-weight: 600; font-size: 15px;
	background: var(--surface-2); border-bottom: 1px solid var(--border); color: var(--text);
}
.panel-default > .panel-heading { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.panel-info > .panel-heading { background: var(--water-50); color: #075b96; border-color: #cfe8fb; }
.panel-success > .panel-heading { background: #e8f7ee; color: #0b6b37; border-color: #c9ecd7; }
.panel-warning > .panel-heading { background: var(--electric-50); color: #8a5000; border-color: #fde3b5; }
.panel-danger > .panel-heading { background: #fdecea; color: #a1231a; border-color: #f8cfca; }
.panel-primary > .panel-heading { background: var(--brand); color: #fff; border-color: var(--brand); }
.panel-info, .panel-success, .panel-warning, .panel-danger, .panel-primary, .panel-default { border-color: var(--border); }
.panel-body { padding: 18px; }
.panel-body::after { content: ""; display: table; clear: both; }
.panel-footer { background: var(--surface-2); border-top: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); padding: 12px 18px; }
.panel > .table, .panel > .table-responsive > .table { margin-bottom: 0; }

/* ---------- tables ---------- */
.table { color: var(--text); background: var(--surface); }
.table > thead > tr > th {
	background: var(--surface-2); color: var(--text-2); font-weight: 600; font-size: 13.5px;
	border-bottom: 1px solid var(--border) !important; vertical-align: middle; white-space: nowrap;
}
.table > thead > tr > th, .table > tbody > tr > td, .table > tfoot > tr > td, .table > tbody > tr > th, .table > tfoot > tr > th {
	padding: 10px 12px; border-top: 1px solid var(--border); vertical-align: middle;
}
.table-bordered, .table-bordered > thead > tr > th, .table-bordered > tbody > tr > td, .table-bordered > tfoot > tr > td,
.table-bordered > tbody > tr > th, .table-bordered > tfoot > tr > th, .table-bordered > thead > tr > td { border-color: var(--border); }
.table-bordered { border-radius: var(--radius-sm); }
.table-striped > tbody > tr:nth-of-type(odd), .table-striped > tbody > tr:nth-child(odd) > td, .table-striped > tbody > tr:nth-child(odd) > th { background-color: #fbfbfd; }
.table-hover > tbody > tr:hover > td, .table-hover > tbody > tr:hover > th { background-color: var(--brand-50); }
.table-striped > tbody > tr:nth-of-type(odd) > td { background-color: #fcfcfd; }
.table-responsive { border: 0; border-radius: var(--radius-sm); -webkit-overflow-scrolling: touch; }
@media (max-width: 767px) { .table-responsive { border: 0; } }
.table > tbody > tr > td { font-variant-numeric: tabular-nums; }

/* DataTables 1.10 + bootstrap integration */
.dataTables_wrapper .row { margin-left: 0; margin-right: 0; }
.dataTables_wrapper .row > [class*="col-"] { padding-left: 0; padding-right: 0; }
.dataTables_wrapper .dataTables_length, .dataTables_wrapper .dataTables_filter { margin-bottom: 12px; color: var(--text-2); }
.dataTables_wrapper .dataTables_filter { text-align: right; }
.dataTables_wrapper .dataTables_filter input {
	margin-left: 0 !important; width: 240px !important; max-width: 100%;
	padding-left: 34px !important;
	background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 11px center;
}
.dataTables_wrapper .dataTables_length select { width: auto; display: inline-block; margin: 0 4px; }
.dataTables_wrapper .dataTables_info { color: var(--muted); font-size: 13.5px; padding-top: 14px !important; }
.dataTables_wrapper .dataTables_paginate { padding-top: 8px; }
table.dataTable { margin-top: 0 !important; margin-bottom: 8px !important; border-collapse: separate !important; }
table.dataTable thead .sorting, table.dataTable thead .sorting_asc, table.dataTable thead .sorting_desc { cursor: pointer; }
@media (max-width: 767px) {
	.dataTables_wrapper .dataTables_filter { text-align: left; }
	.dataTables_wrapper .dataTables_filter input { width: 100% !important; }
	.dataTables_wrapper .dataTables_filter label { display: block; }
}

.pagination > li > a, .pagination > li > span { color: var(--text-2); border-color: var(--border); padding: 6px 12px; }
.pagination > li:first-child > a, .pagination > li:first-child > span { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.pagination > li:last-child > a, .pagination > li:last-child > span { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.pagination > .active > a, .pagination > .active > a:hover, .pagination > .active > a:focus,
.pagination > .active > span, .pagination > .active > span:hover { background: var(--brand); border-color: var(--brand); }
.pagination > li > a:hover { background: var(--brand-50); color: var(--brand); }

/* ---------- forms ---------- */
label { font-weight: 500; color: var(--text-2); font-size: 14px; margin-bottom: 6px; }
.form-control {
	height: 40px; padding: 8px 12px; font-size: 15px; color: var(--text);
	border: 1px solid #d0d5dd; border-radius: var(--radius-sm); box-shadow: none;
	transition: border-color .15s, box-shadow .15s;
}
textarea.form-control { height: auto; min-height: 90px; }
select.form-control { padding-right: 28px; }
.form-control:focus { border-color: #9b84ff; box-shadow: 0 0 0 4px rgba(91, 60, 196, .14); }
.form-control[readonly], .form-control[disabled] { background: var(--surface-2); color: var(--muted); }
input[type="file"].form-control { height: auto; padding: 7px 10px; }
.input-sm, .form-control.input-sm { height: 34px; padding: 4px 10px; line-height: 1.5; font-size: 14px; border-radius: var(--radius-sm); }
select.input-sm { padding-right: 24px; }
.input-group .form-control:first-child, .input-group-addon:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .form-control:last-child, .input-group-addon:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.input-group-addon { background: var(--surface-2); border-color: #d0d5dd; color: var(--muted); min-width: 42px; }
.input-group > .btn { border-radius: var(--radius-sm); }
.form-group { margin-bottom: 16px; }
.help-block { color: var(--muted); font-size: 13px; }

/* ---------- buttons ---------- */
.btn {
	font-family: var(--font); font-weight: 500; font-size: 14.5px;
	border-radius: var(--radius-sm); padding: 8px 16px; line-height: 1.45;
	transition: background .15s, border-color .15s, box-shadow .15s, color .15s;
	box-shadow: 0 1px 2px rgba(16, 24, 40, .05);
}
.btn i { margin-right: 2px; }
.btn-sm { padding: 6px 12px; font-size: 13.5px; }
.btn-xs { padding: 3px 9px; font-size: 12.5px; border-radius: 6px; }
.btn-lg { padding: 11px 20px; font-size: 16px; border-radius: 10px; }
.btn:focus, .btn:active:focus { outline: none; box-shadow: 0 0 0 4px rgba(91, 60, 196, .18); }
.btn-default { background: var(--surface); border-color: #d0d5dd; color: var(--text); }
.btn-default:hover, .btn-default:focus { background: var(--surface-2); border-color: #b9bfc9; color: var(--text); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover, .btn-primary:focus, .btn-primary:active { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover, .btn-success:focus { background: #0e8a44; border-color: #0e8a44; color: #fff; }
.btn-info { background: var(--water); border-color: var(--water); color: #fff; }
.btn-info:hover, .btn-info:focus { background: #0870b8; border-color: #0870b8; color: #fff; }
.btn-warning { background: var(--electric); border-color: var(--electric); color: #fff; }
.btn-warning:hover, .btn-warning:focus { background: #d67b00; border-color: #d67b00; color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover, .btn-danger:focus { background: #b42318; border-color: #b42318; color: #fff; }
.btn-outline { background: transparent; }
.btn-outline.btn-primary { color: var(--brand); } .btn-outline.btn-primary:hover { color: #fff; background: var(--brand); }
.btn-outline.btn-success { color: var(--success); } .btn-outline.btn-success:hover { color: #fff; background: var(--success); }
.btn-outline.btn-warning { color: #b86e00; } .btn-outline.btn-warning:hover { color: #fff; background: var(--electric); }
.btn-outline.btn-danger { color: var(--danger); } .btn-outline.btn-danger:hover { color: #fff; background: var(--danger); }
.btn-outline.btn-info { color: var(--water); } .btn-outline.btn-info:hover { color: #fff; background: var(--water); }
.btn_select { min-width: 72px; }
.btn-link { box-shadow: none; }

/* ---------- alerts / labels / badges ---------- */
.alert { border-radius: var(--radius); border: 1px solid transparent; padding: 14px 16px; }
.alert-info { background: var(--water-50); border-color: #cfe8fb; color: #075b96; }
.alert-success { background: #e8f7ee; border-color: #c9ecd7; color: #0b6b37; }
.alert-warning { background: var(--electric-50); border-color: #fde3b5; color: #8a5000; }
.alert-danger { background: #fdecea; border-color: #f8cfca; color: #a1231a; }
.label { border-radius: 999px; padding: .25em .7em; font-weight: 500; font-size: 78%; }
.label-success { background: var(--success); } .label-danger { background: var(--danger); }
.label-warning { background: var(--electric); } .label-info { background: var(--water); }
.label-primary { background: var(--brand); } .label-default { background: #98a2b3; }
.badge { background: var(--brand); font-weight: 500; }

/* ---------- tabs (legacy .nav-tabs-custom) ---------- */
.nav-tabs { border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 4px; }
.nav-tabs::before, .nav-tabs::after { display: none; }
.nav-tabs > li { float: none; margin-bottom: -1px; }
.nav-tabs > li > a {
	border: 0; border-bottom: 2px solid transparent; border-radius: 0; margin: 0;
	color: var(--muted); font-weight: 500; padding: 10px 16px;
}
.nav-tabs > li > a:hover { background: transparent; color: var(--text); border-bottom-color: #d0d5dd; }
.nav-tabs > li.active > a, .nav-tabs > li.active > a:hover, .nav-tabs > li.active > a:focus {
	border: 0; border-bottom: 2px solid var(--brand); color: var(--brand); background: transparent;
}
.nav-tabs-custom {
	background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
	box-shadow: var(--shadow); margin-bottom: 20px;
}
.nav-tabs-custom > .nav-tabs { padding: 6px 12px 0; }
.nav-tabs-custom > .tab-content { padding: 20px; }
.tab-content h4 { font-size: 17px; margin: 6px 0 4px; }

/* ---------- dropdown / modal / well ---------- */
.dropdown-menu { border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px; }
.dropdown-menu > li > a { border-radius: 6px; padding: 7px 12px; }
.dropdown-menu > li > a:hover { background: var(--brand-50); color: var(--brand); }
.modal-content { border: 0; border-radius: 14px; box-shadow: var(--shadow-lg); }
.modal-header { border-bottom-color: var(--border); padding: 16px 20px; }
.modal-footer { border-top-color: var(--border); }
.well { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: none; }

/* charts */
canvas { max-width: 100%; }
.tab-pane canvas, .panel-body canvas { margin-top: 8px; }

/* ---------- home ---------- */
.home-hero {
	position: relative; overflow: hidden;
	padding: 26px 28px; margin-bottom: 20px; border-radius: 14px;
	background: var(--surface); border: 1px solid var(--border);
}
.home-hero h2 { color: #101828; margin: 0 0 6px; font-size: 22px; }
.home-hero p { margin: 0; color: var(--text-2); max-width: 640px; }
.home-hero .home-hero-meta { margin-top: 14px; display: inline-flex; gap: 8px; align-items: center; font-size: 13px; background: var(--brand-50); color: var(--brand-600); padding: 4px 12px; border-radius: 999px; }
.home-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 767px) { .home-grid { grid-template-columns: 1fr; } .home-hero { padding: 22px 20px; } }
.home-card {
	background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
	box-shadow: var(--shadow); padding: 22px; display: flex; flex-direction: column; gap: 14px;
}
.home-card-head { display: flex; gap: 14px; align-items: center; }
.home-card-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; flex: none; }
.home-card--electric .home-card-icon { background: var(--electric-50); color: var(--electric); }
.home-card--water .home-card-icon { background: var(--water-50); color: var(--water); }
.home-card--api .home-card-icon { background: var(--brand-50); color: var(--brand); }
.home-card h3 { margin: 0; font-size: 18px; }
.home-card p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.home-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.home-links a {
	display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px;
	border: 1px solid var(--border); color: var(--text); text-decoration: none; transition: border-color .15s, background .15s, transform .15s;
}
.home-links a:hover, .home-links a:focus { border-color: #c8bcff; background: var(--brand-50); text-decoration: none; }
.home-links a i:first-child { color: var(--muted); width: 18px; text-align: center; }
.home-links a .fa-arrow-right { margin-left: auto; color: #98a2b3; font-size: 13px; }
.home-links small { display: block; color: var(--muted); font-size: 12.5px; }
.home-card--api { grid-column: 1 / -1; flex-direction: row; align-items: center; flex-wrap: wrap; }
.home-card--api .home-card-head { flex: 1; min-width: 240px; }

/* ---------- API pages ---------- */
.doc { max-width: 980px; }
.doc h2 { font-size: 19px; margin: 28px 0 10px; }
.doc h3 { font-size: 16px; margin: 20px 0 8px; }
.doc p, .doc li { color: var(--text-2); }
.doc code, .api-code code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.doc :not(pre) > code { background: var(--brand-50); color: #4527a0; padding: 1px 6px; border-radius: 5px; }
.doc pre, .api-code {
	background: #f9fafb; color: #1d2939; border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px;
	font-size: 13px; line-height: 1.6; overflow-x: auto; white-space: pre;
}
.doc pre code { background: none; color: inherit; padding: 0; }
.doc .table td code { white-space: nowrap; }
.method { display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: .4px; padding: 2px 8px; border-radius: 6px; background: #e8f7ee; color: #0b6b37; margin-right: 6px; }
.endpoint { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px; margin: 4px 0 10px; }
.key-reveal {
	display: flex; gap: 8px; align-items: stretch; margin: 10px 0 4px;
}
.key-reveal input { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px; }
.chip { display: inline-block; padding: 2px 9px; margin: 2px 4px 2px 0; border-radius: 999px; font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.chip--electric { background: var(--electric-50); border-color: #fde3b5; color: #8a5000; }
.chip--water { background: var(--water-50); border-color: #cfe8fb; color: #075b96; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--success); }
.status-dot.off { background: #98a2b3; }
.dep-picker { max-height: 260px; overflow-y: auto; border: 1px solid #d0d5dd; border-radius: var(--radius-sm); padding: 8px 12px; background: var(--surface); }
.dep-picker label { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; color: var(--text); margin: 4px 0; font-size: 14px; }
.dep-picker input { margin-top: 5px; }
.btn-group-tight { display: inline-flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.muted { color: var(--muted); }
.doc-client { background: #f9fafb; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; margin: 0 0 12px; }
.doc-client-label { font-size: 12px; color: var(--side-muted); }
.doc-client-name { font-size: 18px; font-weight: 700; color: #101828; }
.doc-client-meta { font-size: 13px; color: var(--text-2); }
.doc-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 767px) { .doc-cols { grid-template-columns: 1fr; } }
.doc-foot { margin-top: 24px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 13px; }
.doc-toolbar-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.doc-toolbar-form .form-group { flex: 1 1 240px; min-width: 0; margin-bottom: 0; }
.doc-toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- auth error page ---------- */
.app-auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--bg); }
.auth-card {
	max-width: 420px; width: 100%; text-align: center; background: var(--surface);
	border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 32px 28px;
}
.auth-card h1 { font-size: 20px; margin: 14px 0 8px; }
.auth-card p { color: var(--muted); margin-bottom: 20px; }
.auth-card .btn { display: inline-block; padding: 10px 18px; border-radius: 8px; background: var(--brand); color: #fff; text-decoration: none; }
.auth-icon { width: 56px; height: 56px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; font-size: 26px; font-weight: 700; background: #fdecea; color: var(--danger); }

@media print {
	.app-sidebar, .app-topbar, .app-footer, .app-backdrop, .doc-toolbar, .pad-botm { display: none !important; }
	.app-main { padding: 0; }
	.doc pre { white-space: pre-wrap; }
	.app-body { margin: 0; }
	.panel, .nav-tabs-custom { box-shadow: none; }
}

/* ภาพรวมรายเดือน (overview_electric.php) */
.ov-panel .panel-body { padding: 20px 22px; }
.ov-title { margin: 0 0 14px; font-size: 16px; font-weight: 700; color: #101828; }
.ov-chart { position: relative; height: 360px; }
.ov-legend { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 12px; font-size: 13px; color: #475467; }
.ov-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.ov-note { margin: 8px 0 0; font-size: 12.5px; color: #667085; }
.ov-up { color: #c9392f; }
.ov-down { color: #3d9467; }
@media (max-width: 767px) { .ov-chart { height: 280px; } }
