/* =====================================================================
   Modern skin for page content: page headers, buttons, panels, tables,
   DataTables, forms, selectize, modals, labels, tabs, alerts.
   Scoped under .app-modern (set on <body> by view_header.php and the
   sign-in pages). Adapted from kaizenapp's app_modern.css.
   Mukta ships in 400 and 700 only (assets/fonts/Mukta), so weights here
   stay on those two.
   ===================================================================== */
.app-modern {
	--am-accent: var(--brand-primary, #2563eb);
	--am-accent-dark: var(--brand-primary-dark, #1d4ed8);
	--am-accent-rgb: var(--brand-primary-rgb, 37, 99, 235);
	--am-accent-soft: var(--brand-primary-soft, #eef4ff);
	--am-card: #ffffff;
	--am-border: #e4e7ec;
	--am-border-soft: #eef0f3;
	--am-text: #1f2430;
	--am-muted: #667085;
	--am-faint: #98a2b3;
	--am-danger: #d92d20;
	--am-warning: #b54708;
	--am-success: #027a48;
	--am-radius-card: 12px;
	--am-radius-btn: 8px;
	--am-shadow-card: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
	color: var(--am-text);
}

/* :where() keeps these at the weight of a single class, so components that
   colour their own links (sidebar, buttons, menus) still win. */
.app-modern :where(a) { color: var(--am-accent); }
.app-modern :where(a:hover, a:focus) { color: var(--am-accent-dark); }

.app-modern :where(h1, h2, h3, h4, h5, h6) { color: var(--am-text); }

/* ---------------------------------------------------------------
   Page header
   --------------------------------------------------------------- */
.app-modern .page-header {
	margin: 0 0 22px;
	padding: 0;
	border-bottom: none;
}

.app-modern .page-header h1 {
	margin: 0;
	font-size: 28px;
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -0.01em;
	color: var(--am-text);
}

.app-modern .page-header h1 small,
.app-modern .page-header p {
	font-size: 15px;
	font-weight: 400;
	color: var(--am-muted);
}

.app-modern .page-header p { width: 100%; margin: 6px 0 0; }

/* "Add" / "Edit" controls floated into the H1 */
.app-modern .page-header h1 .pull-right { margin-left: 12px; }
.app-modern .page-header h1 > strong { font-weight: 700; }

/* Detail page header (view_detail.php): a row of small status pills, then the
   record's name with its action buttons on the same line. */
.app-modern #view-detail-header h1 {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 16px;
}

.app-modern #view-detail-header .view-detail-info-status-area {
	display: flex;
	flex: 0 0 100%;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin: 0;
}

.app-modern #view-detail-header .label {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin: 0;
	padding: 4px 10px 3px;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: .04em;
}

/* Foto profil (foto utama) di samping nama */
.app-modern #view-detail-header .view-detail-header-photo {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	object-fit: cover;
	border: 2px solid #fff;
	box-shadow: 0 0 0 1px var(--am-border), var(--am-shadow-card);
}

/* The record type ("KONTAK"): neutral, and a link back to the list */
.app-modern #view-detail-header .label-view-detail-entity {
	background: #fff;
	border: 1px solid #d0d5dd;
	color: #475467;
}

.app-modern #view-detail-header .label-view-detail-entity:hover,
.app-modern #view-detail-header .label-view-detail-entity:focus {
	border-color: var(--am-accent);
	color: var(--am-accent);
	text-decoration: none;
}

.app-modern #view-detail-header .label-subgroup-permission-info {
	margin-right: 0 !important;
	font-size: 12px !important;
	border-color: #d0d5dd !important;
}

.app-modern #view-detail-header h1 > .pull-right {
	float: none !important;
	display: inline-flex;
	gap: 8px;
	margin-left: auto;
}

/* ---------------------------------------------------------------
   Buttons
   --------------------------------------------------------------- */
.app-modern .btn {
	border: 1px solid var(--am-border);
	border-radius: var(--am-radius-btn);
	background: #fff;
	color: var(--am-text);
	padding: 7px 14px;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.45;
	box-shadow: none;
	text-shadow: none;
	transition: background .12s ease, border-color .12s ease, box-shadow .12s ease, color .12s ease;
}

.app-modern .btn:hover,
.app-modern .btn:focus { background: #f2f4f7; color: var(--am-text); outline: none; }
.app-modern .btn:active,
.app-modern .btn.active { box-shadow: inset 0 1px 2px rgba(16, 24, 40, .08); }
.app-modern .btn:focus-visible { box-shadow: 0 0 0 3px rgba(var(--am-accent-rgb), .22); }

.app-modern .btn-primary,
.app-modern .btn-primary:focus { background: var(--am-accent); border-color: var(--am-accent); color: #fff; }
.app-modern .btn-primary:hover,
.app-modern .btn-primary:active,
.app-modern .btn-primary.active { background: var(--am-accent-dark); border-color: var(--am-accent-dark); color: #fff; }

.app-modern .btn-success,
.app-modern .btn-success:focus { background: #12b76a; border-color: #12b76a; color: #fff; }
.app-modern .btn-success:hover,
.app-modern .btn-success:active { background: #039855; border-color: #039855; color: #fff; }

.app-modern .btn-info,
.app-modern .btn-info:focus { background: #0ba5ec; border-color: #0ba5ec; color: #fff; }
.app-modern .btn-info:hover,
.app-modern .btn-info:active { background: #0086c9; border-color: #0086c9; color: #fff; }

.app-modern .btn-warning,
.app-modern .btn-warning:focus { background: #f79009; border-color: #f79009; color: #fff; }
.app-modern .btn-warning:hover,
.app-modern .btn-warning:active { background: #dc6803; border-color: #dc6803; color: #fff; }

.app-modern .btn-danger,
.app-modern .btn-danger:focus { background: #fff; border-color: #fecdca; color: var(--am-danger); }
.app-modern .btn-danger:hover,
.app-modern .btn-danger:active { background: #fef3f2; border-color: #fda29b; color: #b42318; }

.app-modern .btn-default,
.app-modern .btn-default:focus { background: #fff; border-color: var(--am-border); color: var(--am-text); }
.app-modern .btn-default:hover,
.app-modern .btn-default:active { background: #f2f4f7; border-color: #d0d5dd; }

.app-modern .btn-link,
.app-modern .btn-link:focus { border-color: transparent; background: none; color: var(--am-accent); }
.app-modern .btn-link:hover { background: none; color: var(--am-accent-dark); text-decoration: underline; }

.app-modern .btn-lg { padding: 11px 20px; font-size: 16px; border-radius: 10px; }
.app-modern .btn-sm { padding: 5px 11px; font-size: 13px; }
.app-modern .btn-xs { padding: 2px 8px; font-size: 12px; border-radius: 6px; }
.app-modern .btn.disabled,
.app-modern .btn[disabled] { opacity: .55; box-shadow: none; }
.app-modern .btn .glyphicon { top: 1px; }

/* Joined button groups (row actions, split buttons): square off only the
   sides where a button actually meets another button. A lone dropdown toggle
   (followed by its <ul>, not by a button) keeps all four corners round. */
.app-modern .btn-group > .btn { border-radius: var(--am-radius-btn); }
.app-modern .btn-group > .btn:has(+ .btn) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.app-modern .btn-group > .btn + .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.app-modern .btn-group > .btn-xs { border-radius: 6px; }
.app-modern .btn-group > .btn-xs:has(+ .btn) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.app-modern .btn-group > .btn-xs + .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.app-modern .btn-group > .btn:hover,
.app-modern .btn-group > .btn:focus { z-index: 2; }

/* Input-group buttons (e.g. show password) sit flush with the field */
.app-modern .input-group-btn > .btn { padding-top: 9px; padding-bottom: 9px; }
.app-modern .input-group-btn:last-child > .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.app-modern .input-group-btn:first-child > .btn { border-top-right-radius: 0; border-bottom-right-radius: 0; }

/* ---------------------------------------------------------------
   Dropdown menus
   --------------------------------------------------------------- */
.app-modern .dropdown-menu {
	min-width: 180px;
	padding: 6px;
	border: 1px solid var(--am-border);
	border-radius: 10px;
	box-shadow: 0 12px 28px rgba(16, 24, 40, .16);
	font-size: 14px;
}

.app-modern .dropdown-menu > li > a {
	padding: 7px 12px;
	border-radius: 7px;
	color: var(--am-text);
}

.app-modern .dropdown-menu > li > a:hover,
.app-modern .dropdown-menu > li > a:focus { background: var(--am-accent-soft); color: var(--am-accent); }

.app-modern .dropdown-menu > .active > a,
.app-modern .dropdown-menu > .active > a:hover,
.app-modern .dropdown-menu > .active > a:focus { background: var(--am-accent); color: #fff; }

.app-modern .dropdown-menu .divider { margin: 6px 4px; background: var(--am-border-soft); }
.app-modern .dropdown-header { padding: 6px 12px 4px; font-size: 12px; font-weight: 700; color: var(--am-faint); text-transform: uppercase; letter-spacing: .04em; }

/* ---------------------------------------------------------------
   Cards / panels / wells
   --------------------------------------------------------------- */
.app-modern .panel {
	margin-bottom: 20px;
	background: var(--am-card);
	border: 1px solid var(--am-border);
	border-radius: var(--am-radius-card);
	box-shadow: var(--am-shadow-card);
}

.app-modern .panel > .panel-heading {
	padding: 13px 18px;
	background: #f8fafc;
	border-bottom: 1px solid var(--am-border-soft);
	border-radius: var(--am-radius-card) var(--am-radius-card) 0 0;
	color: var(--am-text);
	font-weight: 700;
}

.app-modern .panel-title {
	font-size: 16px;
	font-weight: 700;
	color: var(--am-text);
}

.app-modern .panel-body { padding: 18px; }

.app-modern .panel-footer {
	padding: 12px 18px;
	background: #fafbfc;
	border-top: 1px solid var(--am-border-soft);
	border-radius: 0 0 var(--am-radius-card) var(--am-radius-card);
}

/* Contextual panels keep their meaning: a coloured top edge, and a heading
   tinted to match so it stands apart from the rows below it */
.app-modern .panel-primary > .panel-heading { background: var(--am-accent-soft); border-bottom-color: #c7d7fb; }
.app-modern .panel-success > .panel-heading { background: #ecfdf3; border-bottom-color: #abefc6; }
.app-modern .panel-info    > .panel-heading { background: #f0f9ff; border-bottom-color: #b9e6fe; }
.app-modern .panel-warning > .panel-heading { background: #fffaeb; border-bottom-color: #fedf89; }
.app-modern .panel-danger  > .panel-heading { background: #fef3f2; border-bottom-color: #fecdca; }

.app-modern .panel-primary { border-top: 3px solid var(--am-accent); }
.app-modern .panel-success { border-top: 3px solid #12b76a; }
.app-modern .panel-info    { border-top: 3px solid #0ba5ec; }
.app-modern .panel-warning { border-top: 3px solid #f79009; }
.app-modern .panel-danger  { border-top: 3px solid #f04438; }

.app-modern .panel > .table,
.app-modern .panel > .table-responsive > .table { margin-bottom: 0; }
.app-modern .panel > .list-group .list-group-item { border-color: var(--am-border-soft); }

.app-modern .well {
	background: #fafbfc;
	border: 1px solid var(--am-border);
	border-radius: var(--am-radius-card);
	box-shadow: none;
}

.app-modern .list-group-item { border-color: var(--am-border); }
.app-modern .list-group-item:first-child { border-top-left-radius: var(--am-radius-btn); border-top-right-radius: var(--am-radius-btn); }
.app-modern .list-group-item:last-child { border-bottom-left-radius: var(--am-radius-btn); border-bottom-right-radius: var(--am-radius-btn); }

/* ---------------------------------------------------------------
   Tables (plain Bootstrap tables and DataTables)
   --------------------------------------------------------------- */
.app-modern .table { background: var(--am-card); }

.app-modern .table > thead > tr > th {
	padding: 11px 12px;
	background: #f7f8fa;
	border-top: none;
	border-bottom: 1px solid var(--am-border);
	color: #475467;
	font-size: 13px;
	font-weight: 700;
	vertical-align: middle;
}

.app-modern .table > tbody > tr > td,
.app-modern .table > tbody > tr > th,
.app-modern .table > tfoot > tr > td,
.app-modern .table > tfoot > tr > th {
	padding: 10px 12px;
	border-top: 1px solid var(--am-border-soft);
	vertical-align: middle;
}

.app-modern .table-condensed > thead > tr > th,
.app-modern .table-condensed > tbody > tr > td { padding: 6px 8px; }

.app-modern .table-bordered,
.app-modern .table-bordered > thead > tr > th,
.app-modern .table-bordered > tbody > tr > td,
.app-modern .table-bordered > tbody > tr > th,
.app-modern .table-bordered > tfoot > tr > td,
.app-modern .table-bordered > tfoot > tr > th { border-color: var(--am-border); }

.app-modern .table-striped > tbody > tr:nth-of-type(odd) { background: #fafbfc; }
.app-modern .table-hover > tbody > tr:hover { background: #f5f8ff; }

/* Info table on detail pages */
.app-modern table.table-info td.info-label {
	border-right: 1px solid var(--am-border-soft);
	color: var(--am-muted);
	font-weight: 700;
}

/* DataTables: the table and its controls sit on one card */
.app-modern .dataTables_wrapper {
	padding: 14px 16px 12px;
	background: var(--am-card);
	border: 1px solid var(--am-border);
	border-radius: var(--am-radius-card);
	box-shadow: var(--am-shadow-card);
	margin-bottom: 20px;
}

/* The tables' `dom` lays the controls out as floated col-md-* blocks with no
   .row around them: contain the floats so they stay on the card, and let the
   card's padding replace the columns' gutters so everything lines up with the
   table's edges. */
.app-modern .dataTables_wrapper::after { content: ''; display: table; clear: both; }
.app-modern .dataTables_wrapper > [class*="col-"] { padding-left: 0; padding-right: 0; }
.app-modern .dataTables_wrapper > [class*="col-"]:has(.dataTables_filter) { padding-left: 12px; }
.app-modern .dataTables_wrapper > [class*="col-"]:has(.dataTables_paginate) { padding-left: 12px; }

/* Below the table: "Showing 1 to 10 of N", then export buttons | pagination */
.app-modern .dataTables_wrapper > .col-md-12:has(.dataTables_info) { margin-bottom: 12px; }
.app-modern .dataTables_wrapper .dataTables_info { padding-top: 14px; }
.app-modern .dataTables_wrapper > [class*="col-"]:has(.dt-buttons) .dt-buttons { margin: 0; }

.app-modern .dataTables_wrapper .table { margin-bottom: 0; }
.app-modern .dataTables_wrapper .table-container { border: 1px solid var(--am-border-soft); border-radius: var(--am-radius-btn); }

.app-modern .dataTables_length,
.app-modern .dataTables_filter { margin-bottom: 12px; color: var(--am-muted); font-size: 14px; }

.app-modern .dataTables_length label,
.app-modern .dataTables_filter label { font-weight: 400; color: var(--am-muted); }

.app-modern .dataTables_length select,
.app-modern .dataTables_filter input {
	height: 36px;
	padding: 5px 10px;
	border: 1px solid var(--am-border);
	border-radius: var(--am-radius-btn);
	background-color: #fff;
	color: var(--am-text);
	font-size: 14px;
	box-shadow: none;
}

.app-modern .dataTables_filter input { min-width: 220px; margin-left: 8px; }

.app-modern .dataTables_length select:focus,
.app-modern .dataTables_filter input:focus {
	outline: none;
	border-color: var(--am-accent);
	box-shadow: 0 0 0 3px rgba(var(--am-accent-rgb), .14);
}

.app-modern .dataTables_info { padding-top: 12px; color: var(--am-muted); font-size: 13.5px; }

/* Column search row */
.app-modern input.form-control.column-search-box {
	min-height: 32px;
	padding: 4px 9px;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 400;
}

/* Export / column-visibility buttons */
.app-modern .dt-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }

.app-modern .dt-buttons .dt-button,
.app-modern .dt-buttons .btn {
	margin: 0 !important;
	padding: 6px 12px !important;
	border: 1px solid var(--am-border) !important;
	border-radius: var(--am-radius-btn) !important;
	background: #fff !important;
	background-image: none !important;
	color: var(--am-text) !important;
	font-size: 13px !important;
	font-weight: 700 !important;
	box-shadow: none !important;
}

.app-modern .dt-buttons .dt-button:hover,
.app-modern .dt-buttons .btn:hover { background: #f2f4f7 !important; }

/* Column visibility popup: a checklist, not a stack of buttons. A shown
   column has a filled, ticked box; a hidden one an empty box and muted text.
   The untitled actions column is left out of the list. */
.app-modern ul.dt-button-collection.dropdown-menu {
	min-width: 240px;
	max-height: min(440px, 70vh);
	overflow-y: auto;
	padding: 6px;
	border: 1px solid var(--am-border);
	border-radius: 10px;
	box-shadow: 0 12px 28px rgba(16, 24, 40, .18);
}

.app-modern ul.dt-button-collection > li.dt-button {
	display: block;
	width: 100%;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: none !important;
	box-shadow: none !important;
	font-size: 14px !important;
	font-weight: 400 !important;
}

.app-modern ul.dt-button-collection > li.dt-button:has(> a:empty) { display: none; }

.app-modern ul.dt-button-collection > li > a {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 7px 10px;
	border-radius: 7px;
	background: none;
	color: var(--am-muted);
	white-space: nowrap;
}

.app-modern ul.dt-button-collection > li > a::before {
	content: '';
	flex: none;
	width: 16px;
	height: 16px;
	border: 1.5px solid #d0d5dd;
	border-radius: 4px;
	background: #fff center / 12px 12px no-repeat;
}

.app-modern ul.dt-button-collection > li > a:hover,
.app-modern ul.dt-button-collection > li > a:focus,
.app-modern ul.dt-button-collection > li.active > a:hover,
.app-modern ul.dt-button-collection > li.active > a:focus {
	background: var(--am-accent-soft);
	color: var(--am-text);
}

.app-modern ul.dt-button-collection > li.active > a {
	background: none;
	color: var(--am-text);
}

.app-modern ul.dt-button-collection > li.active > a::before {
	border-color: var(--am-accent);
	background-color: var(--am-accent);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.6 8.3l2.8 2.8 6-6.2' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* Bootstrap's backdrop for the popup: clear, just catches the outside click */
.dt-button-background { background: transparent !important; }

/* Pagination (DataTables' own and Bootstrap's) */
.app-modern .dataTables_paginate { padding-top: 10px; }

.app-modern .pagination > li > a,
.app-modern .pagination > li > span {
	margin: 0 2px;
	min-width: 34px;
	padding: 6px 11px;
	border: 1px solid var(--am-border);
	border-radius: var(--am-radius-btn) !important;
	color: var(--am-text);
	text-align: center;
}

.app-modern .pagination > li > a:hover,
.app-modern .pagination > li > a:focus { background: #f2f4f7; border-color: var(--am-border); color: var(--am-text); }

.app-modern .pagination > .active > a,
.app-modern .pagination > .active > a:hover,
.app-modern .pagination > .active > a:focus { background: var(--am-accent); border-color: var(--am-accent); color: #fff; }

.app-modern .pagination > .disabled > a,
.app-modern .pagination > .disabled > a:hover { opacity: .5; background: #fff; }

/* Selected row: a clear blue tint with an accent bar, dark text, and links in
   a deep blue (DataTables' own #a2d4ed is meant for its dark-blue row fill and
   all but disappears on a light one). */
.app-modern table.dataTable tbody tr.selected > td,
.app-modern table.dataTable tbody tr.selected > th,
.app-modern table.dataTable tbody td.selected {
	background-color: #dbe7ff !important;
	color: var(--am-text) !important;
	border-top-color: #c7d7fb;
}
.app-modern table.dataTable tbody tr.selected > :first-child { box-shadow: inset 3px 0 0 var(--am-accent); }
.app-modern table.dataTable tbody tr.selected a,
.app-modern table.dataTable tbody td.selected a { color: var(--brand-primary-ink, #1e40af) !important; }
.app-modern table.dataTable tbody tr.selected a:hover,
.app-modern table.dataTable tbody td.selected a:hover { color: #172554 !important; }

/* ---------------------------------------------------------------
   Forms
   --------------------------------------------------------------- */
.app-modern .form-group { margin-bottom: 18px; }

.app-modern .control-label,
.app-modern .form-group > label {
	margin-bottom: 6px;
	color: #344054;
	font-size: 14px;
	font-weight: 700;
}

.app-modern .form-control {
	height: 40px;
	padding: 8px 12px;
	border: 1px solid #d0d5dd;
	border-radius: var(--am-radius-btn);
	background-color: #fff;
	color: var(--am-text);
	font-size: 15px;
	box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
	transition: border-color .12s ease, box-shadow .12s ease;
}

.app-modern textarea.form-control { height: auto; min-height: 90px; line-height: 1.5; }
.app-modern select[multiple].form-control,
.app-modern select[size].form-control { height: auto; }
.app-modern .input-sm, .app-modern .form-group-sm .form-control { height: 32px; padding: 4px 10px; font-size: 13px; border-radius: 6px; }
.app-modern .input-lg, .app-modern .form-group-lg .form-control { height: 48px; font-size: 17px; }
.app-modern .big-input, .app-modern .super-big-input { height: auto; }

.app-modern .form-control:focus {
	outline: none;
	border-color: var(--am-accent);
	box-shadow: 0 0 0 3px rgba(var(--am-accent-rgb), .14);
}

.app-modern .form-control::placeholder { color: var(--am-faint); }

.app-modern .form-control[readonly],
.app-modern .form-control[disabled],
.app-modern fieldset[disabled] .form-control { background-color: #f5f6f8; }

.app-modern .input-group-addon {
	border: 1px solid #d0d5dd;
	border-radius: var(--am-radius-btn);
	background: #f7f8fa;
	color: var(--am-muted);
	font-size: 14px;
}

/* Field + addon read as one control: the addon gives up the corners and the
   border on the side it shares with the field */
.app-modern .input-group > .input-group-addon:last-child {
	border-left: 0;
	border-top-left-radius: 0;
	border-bottom-left-radius: 0;
}

.app-modern .input-group > .input-group-addon:first-child {
	border-right: 0;
	border-top-right-radius: 0;
	border-bottom-right-radius: 0;
}

.app-modern .input-group > .form-control:not(:last-child):has(+ .input-group-addon) { border-right: 0; }
.app-modern .input-group > .input-group-addon + .form-control { border-left: 0; }

/* Show/hide password (the eye): part of the field, not a grey box beside it */
.app-modern .input-group-addon.show_hide_password {
	padding: 0 14px;
	background: #fff;
	color: #98a2b3;
	cursor: pointer;
	transition: color .12s ease;
}

.app-modern .input-group-addon.show_hide_password:hover { color: var(--am-accent); }
.app-modern .input-group-addon.show_hide_password .glyphicon { top: 2px; font-size: 15px; }

/* Focus: one ring around field and addon together */
.app-modern .input-group:focus-within {
	border-radius: var(--am-radius-btn);
	box-shadow: 0 0 0 3px rgba(var(--am-accent-rgb), .14);
}

.app-modern .input-group:focus-within > .form-control,
.app-modern .input-group:focus-within > .input-group-addon { border-color: var(--am-accent); }
.app-modern .input-group > .form-control:focus { box-shadow: none; }

.app-modern .has-error .input-group-addon { background: #fff; border-color: #fda29b; color: var(--am-danger); }
.app-modern .has-error .input-group:focus-within { box-shadow: 0 0 0 3px rgba(217, 45, 32, .14); }
.app-modern .has-error .input-group:focus-within > .form-control,
.app-modern .has-error .input-group:focus-within > .input-group-addon { border-color: var(--am-danger); }

.app-modern .help-block { margin-top: 5px; font-size: 13px; color: var(--am-muted); }
.app-modern .has-error .help-block { color: var(--am-danger); }
.app-modern .has-error .form-control { border-color: #fda29b; }
.app-modern .has-error .form-control:focus { border-color: var(--am-danger); box-shadow: 0 0 0 3px rgba(217, 45, 32, .14); }
.app-modern .has-error .control-label { color: var(--am-danger); }
.app-modern .has-success .form-control { border-color: #6ce9a6; }

.app-modern .checkbox label,
.app-modern .radio label,
.app-modern .checkbox-inline,
.app-modern .radio-inline { font-weight: 400; }

/* Section heading inside long forms */
.app-modern .section-start {
	padding-bottom: 8px;
	border-bottom: 1px solid var(--am-border);
	color: var(--am-accent) !important;
	font-size: 13px !important;
	font-weight: 700 !important;
	letter-spacing: .05em;
	text-transform: uppercase !important;
}

/* ---------------------------------------------------------------
   Selectize
   --------------------------------------------------------------- */
/* The wrapper copies the <select>'s .form-control; keep only the inner box */
.app-modern .selectize-control.form-control {
	height: auto;
	min-height: 0;
	padding: 0;
	border: 0;
	background: transparent;
	box-shadow: none;
}

.app-modern .selectize-control.single .selectize-input,
.app-modern .selectize-control.multi .selectize-input {
	min-height: 40px;
	padding: 9px 12px;
	border: 1px solid #d0d5dd;
	border-radius: var(--am-radius-btn);
	background: #fff;
	font-size: 15px;
	box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}

.app-modern .selectize-control.multi .selectize-input.has-items { padding: 6px 8px 3px; }

.app-modern .selectize-control.multi .selectize-input > div {
	border-radius: 6px;
	background: var(--am-accent-soft);
	color: var(--brand-primary-ink, #1e40af);
}

.app-modern .selectize-input.focus {
	border-color: var(--am-accent);
	box-shadow: 0 0 0 3px rgba(var(--am-accent-rgb), .14);
}

/* The dropdown list. Selectize copies the <select>'s classes onto it too, so
   it is a .form-control as well; undo the field's fixed height and padding
   or the list is cut off at 40px and its options spill out under it. */
.selectize-dropdown,
.app-modern .selectize-dropdown.form-control {
	height: auto;
	min-height: 0;
	margin-top: 4px;
	padding: 4px;
	background: #fff;
	border: 1px solid var(--am-border, #e4e7ec);
	border-radius: 10px;
	box-shadow: 0 12px 28px rgba(16, 24, 40, .16);
	font-size: 14.5px;
}

.selectize-dropdown .selectize-dropdown-content { max-height: 260px; padding: 0; }

.selectize-dropdown .option,
.selectize-dropdown .create,
.selectize-dropdown .optgroup-header {
	padding: 7px 10px;
	border-radius: 7px;
	line-height: 1.35;
}

.selectize-dropdown .option + .option { margin-top: 1px; }

.selectize-dropdown .optgroup-header {
	color: var(--am-faint, #98a2b3);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
}

.selectize-dropdown .active,
.app-modern .selectize-dropdown .active {
	background: var(--am-accent-soft, #eef4ff);
	color: var(--brand-primary-ink, #1e40af);
}

/* The current choice */
.selectize-dropdown .option.selected { font-weight: 700; }

/* Matched text while typing: tinted, not highlighter yellow */
.selectize-dropdown .highlight {
	background: rgba(var(--brand-primary-rgb, 37, 99, 235), .14);
	color: inherit;
	border-radius: 3px;
}

/* Open field: the arrow and the border show it is active */
.app-modern .selectize-input.dropdown-active {
	border-radius: var(--am-radius-btn);
	border-color: var(--am-accent);
	box-shadow: 0 0 0 3px rgba(var(--am-accent-rgb), .14);
}

.app-modern .selectize-input.dropdown-active::before { display: none; }

.app-modern .selectize-control.single .selectize-input::after {
	right: 14px;
	border-top-color: #667085;
}

.app-modern .selectize-control.single .selectize-input.dropdown-active::after { border-bottom-color: #667085; }

.app-modern .selectize-input.disabled { background: #f5f6f8; opacity: 1; }

/* ---------------------------------------------------------------
   Modals
   --------------------------------------------------------------- */
.app-modern .modal-content {
	border: none;
	border-radius: 14px;
	box-shadow: 0 20px 48px rgba(16, 24, 40, .28);
}

.app-modern .modal-header { padding: 16px 20px; border-bottom: 1px solid var(--am-border-soft); }
.app-modern .modal-title { font-size: 18px; font-weight: 700; color: var(--am-text); }

.app-modern .modal-header .close {
	margin-top: -2px;
	color: var(--am-faint);
	font-size: 26px;
	font-weight: 400;
	text-shadow: none;
	opacity: 1;
}

.app-modern .modal-header .close:hover { color: var(--am-text); }
.app-modern .modal-body { padding: 18px 20px; }
.app-modern .modal-footer { padding: 14px 20px; border-top: 1px solid var(--am-border-soft); }
.app-modern .modal-backdrop.in { opacity: .45; }

/* ---------------------------------------------------------------
   Labels / badges
   --------------------------------------------------------------- */
.app-modern .label {
	display: inline-block;
	padding: .3em .75em .25em;
	border-radius: 999px;
	font-size: 78%;
	font-weight: 700;
	letter-spacing: .01em;
}

.app-modern .label-default { background: #f2f4f7; color: #344054; }
.app-modern .label-primary { background: var(--am-accent-soft); color: var(--brand-primary-ink, #1e40af); }
.app-modern .label-info    { background: #f0f9ff; color: #026aa2; }
.app-modern .label-success { background: #ecfdf3; color: var(--am-success); }
.app-modern .label-warning { background: #fffaeb; color: var(--am-warning); }
.app-modern .label-danger  { background: #fef3f2; color: #b42318; }

.app-modern .badge { border-radius: 999px; background: #eaecf0; color: #344054; font-weight: 700; }
.app-modern .badge-title { background: var(--am-accent-soft); color: var(--brand-primary-ink, #1e40af); }

/* ---------------------------------------------------------------
   Tabs / pills
   --------------------------------------------------------------- */
.app-modern .nav-tabs { margin-bottom: 18px; border-bottom: 1px solid var(--am-border); }

.app-modern .nav-tabs > li > a {
	margin-right: 4px;
	padding: 10px 14px;
	border: none;
	border-bottom: 2px solid transparent;
	border-radius: 0;
	color: var(--am-muted);
	font-weight: 700;
}

.app-modern .nav-tabs > li > a:hover { background: none; border-bottom-color: var(--am-border); color: var(--am-text); }

.app-modern .nav-tabs > li.active > a,
.app-modern .nav-tabs > li.active > a:hover,
.app-modern .nav-tabs > li.active > a:focus {
	border: none;
	border-bottom: 2px solid var(--am-accent);
	background: none;
	color: var(--am-accent);
}

.app-modern .nav-pills > li > a { border-radius: var(--am-radius-btn); font-weight: 700; }
.app-modern .nav-pills > li.active > a,
.app-modern .nav-pills > li.active > a:hover,
.app-modern .nav-pills > li.active > a:focus { background: var(--am-accent); }

/* ---------------------------------------------------------------
   Detail pages (view_detail.php)
   --------------------------------------------------------------- */
.app-modern .entity-label,
.app-modern .entity-label:hover { color: var(--am-muted); font-size: 13px; letter-spacing: .06em; }
.app-modern .entity-label:hover { color: var(--am-accent); }
.app-modern .field-label { color: var(--am-muted); font-size: 12px; font-weight: 700; letter-spacing: .03em; }
.app-modern .field-value { color: var(--am-text); font-size: 16px; font-weight: 700; }
.app-modern .widget-panel-title { font-size: 18px; font-weight: 700; }

/* Widget headings: title centred against its action button, every heading the
   same height whether or not it has one */
.app-modern .panel-heading .widget-panel-title {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 32px;
}

.app-modern .widget-panel-title > .pull-right {
	float: none !important;
	display: inline-flex;
	gap: 6px;
	margin-left: auto;
}

.app-modern .widget-panel-title .btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	font-size: 13px;
}

/* Widgets beside the info table on a detail page (Foto, Keluarga, Dokumen...):
   flowed into columns so each box sits right under the one above it, rather
   than in float rows that wait for the tallest box. Two columns when there is
   room, one otherwise. Top lines up with the "Info <entity>" heading. */
.app-modern .detail-info-widgets {
	margin-top: 20px;
	columns: 2 240px;
	column-gap: 20px;
}

.app-modern .detail-info-widgets > [class*="col-"] {
	float: none;
	width: auto;
	padding: 0;
	break-inside: avoid;
	page-break-inside: avoid;
}

.app-modern .detail-info-widgets .panel {
	display: inline-block; /* keeps a box from being split across columns */
	width: 100%;
	margin-bottom: 20px;
}

.app-modern .detail-info-widgets .field-value ul {
	margin: 2px 0 0;
	padding-left: 18px;
}

.app-modern .tab-content > .tab-pane h2 {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
	font-size: 20px;
	font-weight: 700;
}

.app-modern .tab-content > .tab-pane h2 .pull-right { float: none !important; margin-left: auto; }

/* ---------------------------------------------------------------
   Alerts, progress, misc
   --------------------------------------------------------------- */
.app-modern .alert { border: 1px solid transparent; border-radius: 10px; }
.app-modern .alert-success { background: #ecfdf3; border-color: #abefc6; color: #067647; }
.app-modern .alert-danger  { background: #fef3f2; border-color: #fecdca; color: #b42318; }
.app-modern .alert-warning { background: #fffaeb; border-color: #fedf89; color: #93370d; }
.app-modern .alert-info    { background: var(--am-accent-soft); border-color: var(--brand-primary-border, #c7d7fb); color: var(--brand-primary-ink, #1e40af); }
.app-modern .alert .alert-link { color: inherit; }

.app-modern .progress { height: 10px; border-radius: 999px; background: #eaecf0; box-shadow: none; }
.app-modern .progress-bar { background-color: var(--am-accent); box-shadow: none; }

.app-modern hr { border-top-color: var(--am-border); }

.app-modern .tooltip-inner { padding: 6px 10px; border-radius: 6px; font-size: 13px; }
.app-modern .popover { border-color: var(--am-border); border-radius: 10px; box-shadow: 0 12px 28px rgba(16, 24, 40, .16); }

/* ---------------------------------------------------------------
   Account security: two-factor status + method choice
   (view_user_settings.php)
   --------------------------------------------------------------- */
.tfa-status {
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 0 0 18px;
	padding: 14px 16px;
	border: 1px solid;
	border-radius: 12px;
}

.tfa-status.is-on  { background: #ecfdf3; border-color: #abefc6; }
.tfa-status.is-off { background: #fffaeb; border-color: #fedf89; }

.tfa-status-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 42px;
	height: 42px;
	border-radius: 11px;
	background: #fff;
}

.tfa-status-icon .app-icon { width: 24px; height: 24px; }
.tfa-status.is-on  .tfa-status-icon { color: #067647; box-shadow: inset 0 0 0 1px #abefc6; }
.tfa-status.is-off .tfa-status-icon { color: #b54708; box-shadow: inset 0 0 0 1px #fedf89; }

.tfa-status-text {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
	min-width: 0;
}

/* The state itself, as a status pill with a dot */
.tfa-status-pill {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 3px 11px 2px;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.5;
}

.tfa-status-pill::before {
	content: '';
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: currentColor;
}

.tfa-status.is-on  .tfa-status-pill { background: #dcfae6; color: #067647; }
.tfa-status.is-off .tfa-status-pill { background: #fef0c7; color: #93370d; }

.tfa-status-detail { color: #475467; font-size: 14px; line-height: 1.45; }

.tfa-choose-label {
	margin: 0 0 8px;
	color: #344054;
	font-size: 14px;
	font-weight: 700;
}

.tfa-options { display: grid; gap: 10px; }

/* One way to turn it on: icon, name, one line on what it means */
.tfa-option {
	display: flex;
	align-items: center;
	gap: 14px;
	width: 100%;
	padding: 14px 16px;
	border: 1px solid var(--am-border, #e4e7ec);
	border-radius: 12px;
	background: #fff;
	color: inherit;
	text-align: left;
	box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
	transition: border-color .12s ease, box-shadow .12s ease, background .12s ease;
}

.tfa-option:hover,
.tfa-option:focus-visible {
	border-color: var(--brand-primary, #2563eb);
	background: #fbfcff;
	box-shadow: 0 0 0 3px rgba(var(--brand-primary-rgb, 37, 99, 235), .12);
	outline: none;
}

.tfa-option[disabled] {
	opacity: .55;
	cursor: not-allowed;
	box-shadow: none;
	background: #fafbfc;
	border-color: var(--am-border, #e4e7ec);
}

.tfa-option-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 40px;
	height: 40px;
	border-radius: 10px;
	background: var(--brand-primary-soft, #eef4ff);
	color: var(--brand-primary, #2563eb);
}

.tfa-option-icon .app-icon { width: 21px; height: 21px; }

.tfa-option-text {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.tfa-option-title { color: var(--am-text, #1f2430); font-size: 15px; font-weight: 700; line-height: 1.3; }
.tfa-option-desc  { color: var(--am-muted, #667085); font-size: 13.5px; line-height: 1.4; }

.tfa-option-arrow { width: 18px; height: 18px; color: #98a2b3; }
.tfa-option:hover .tfa-option-arrow { color: var(--brand-primary, #2563eb); }

/* ---------------------------------------------------------------
   State page: halaman status satu kartu di tengah (akses ditolak,
   presensi belum dibuka, dsb.). Varian warna: --danger, --warning.
   --------------------------------------------------------------- */
.am-state {
	--am-state-tone: var(--am-accent);
	--am-state-tone-soft: var(--am-accent-soft);
	display: flex; justify-content: center; align-items: flex-start;
	padding: 6vh 0 48px;
}
.am-state--danger { --am-state-tone: var(--am-danger); --am-state-tone-soft: #fef3f2; }
.am-state--warning { --am-state-tone: var(--am-warning); --am-state-tone-soft: #fffaeb; }
.am-state-card {
	position: relative; overflow: hidden;
	width: 100%; max-width: 560px; padding: 40px 36px 32px;
	background: var(--am-card); border: 1px solid var(--am-border); border-radius: 16px;
	box-shadow: 0 12px 32px -12px rgba(16, 24, 40, .14), var(--am-shadow-card);
	text-align: center;
}
.am-state-card::before {
	content: ''; position: absolute; inset: 0 0 auto 0; height: 120px; pointer-events: none;
	background: radial-gradient(120% 100% at 50% 0%, var(--am-state-tone-soft) 0%, rgba(255, 255, 255, 0) 70%);
}
.am-state-card > * { position: relative; }
.am-state-icon {
	display: inline-grid; place-items: center;
	width: 64px; height: 64px; margin-bottom: 18px; border-radius: 18px;
	background: var(--am-state-tone-soft); color: var(--am-state-tone);
	box-shadow: 0 0 0 8px rgba(255, 255, 255, .7), 0 0 0 9px var(--am-border-soft);
}
.am-state-icon svg { width: 30px; height: 30px; }
.am-state-eyebrow {
	margin: 0 0 6px; font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
	color: var(--am-state-tone);
}
.app-modern .am-state-title {
	margin: 0; font-size: 26px; font-weight: 700; line-height: 1.2; letter-spacing: -.01em;
	color: var(--am-text); text-wrap: balance; overflow-wrap: anywhere;
}
.am-state-text { margin: 10px auto 0; max-width: 420px; font-size: 15.5px; line-height: 1.55; color: var(--am-muted); }
.am-state-body { margin-top: 24px; text-align: left; }
.am-state-actions {
	display: flex; flex-wrap: wrap; justify-content: center; gap: 10px;
	margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--am-border-soft);
}
.am-state-actions .btn { display: inline-flex; align-items: center; gap: 7px; }
.am-state-actions .btn svg { width: 16px; height: 16px; flex: none; }
.am-state-foot { margin: 16px 0 0; font-size: 13px; color: var(--am-faint); }

@media (max-width: 575px) {
	.am-state { padding-top: 12px; }
	.am-state-card { padding: 32px 20px 24px; border-radius: 14px; }
	.app-modern .am-state-title { font-size: 22px; }
	.am-state-actions .btn { flex: 1 1 100%; justify-content: center; }
}

/* Kisah singkat (mis. anekdot Alkitab) di bawah penjelasan state page */
.am-state-story {
	position: relative;
	margin: 22px auto 0; max-width: 440px; padding: 22px 20px 14px;
	border-radius: 12px; background: #f8f9fb;
	font-size: 14.5px; line-height: 1.55; color: var(--am-muted); text-align: center;
}
.am-state-story::before {
	content: '\201C'; position: absolute; top: -2px; left: 50%; transform: translateX(-50%);
	font-family: Georgia, 'Times New Roman', serif; font-size: 40px; line-height: 1;
	color: var(--am-state-tone); opacity: .45;
}
.am-state-body + .am-state-story { max-width: none; margin-top: 14px; }
