*, *::before, *::after {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
	background: #f0f2f5;
	color: #29136c;
	min-height: 100vh;
}

/* ── Navbar ────────────────────────────────────────────────── */
.navbar {
	background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
	padding: 0 1.5rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 56px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, .3);
	position: sticky;
	top: 0;
	z-index: 1000;
}

.navbar-brand {
	color: #fff;
	font-size: 1.2rem;
	font-weight: 700;
	text-decoration: none;
	display: flex;
	align-items: center;
	gap: 8px;
}

.navbar-user {
	display: flex;
	align-items: center;
	gap: .75rem;
	color: #ccc;
	font-size: .9rem;
}

.badge-role {
	background: #e94560;
	color: #fff;
	padding: 2px 10px;
	border-radius: 20px;
	font-size: .75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .5px;
}

.btn-logout {
	background: transparent;
	border: 1px solid #e94560;
	color: #e94560;
	padding: 5px 14px;
	border-radius: 6px;
	cursor: pointer;
	text-decoration: none;
	font-size: .85rem;
	transition: all .2s;
	font-family: inherit;
}

.btn-logout:hover {
	background: #e94560;
	color: #fff;
}

/* ── Page wrapper ──────────────────────────────────────────── */
.page-wrap {
	padding: 0.5rem;
}

/* ── Page header ───────────────────────────────────────────── */
.page-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: .5rem;
	margin-bottom: .75rem;
}

.page-header h1 {
	font-size: 1.4rem;
	color: #1a1a2e;
	font-weight: 700;
}

.page-header p {
	color: #666;
	font-size: .85rem;
	margin-top: 2px;
}

.page-header-left {
	display: flex;
	flex-direction: column;
}

.back-link {
	color: #0f3460;
	text-decoration: none;
	font-size: .82rem;
	opacity: .8;
	margin-bottom: .2rem;
}

.back-link:hover {
	opacity: 1;
}

/* ── Stat cards ────────────────────────────────────────────── */
.stats-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: .75rem;
	margin-bottom: .75rem;
}

.stat-card {
	background: #fff;
	border-radius: 10px;
	padding: .75rem 1rem;
	box-shadow: 0 1px 6px rgba(0, 0, 0, .07);
	border-left: 4px solid;
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.stat-card.blue {
	border-color: #3498db;
}

.stat-card.green {
	border-color: #27ae60;
}

.stat-card.orange {
	border-color: #f39c12;
}

.stat-card.red {
	border-color: #e74c3c;
}

.stat-card.purple {
	border-color: #9b59b6;
}

.stat-card.teal {
	border-color: #1abc9c;
}

.stat-card.accent {
	border-color: #1d4f38;
}

.stat-value {
	font-size: 1.7rem;
	font-weight: 700;
	color: #1a1a2e;
	line-height: 1;
}

.stat-label {
	font-size: .7rem;
	color: #888;
	text-transform: uppercase;
	letter-spacing: .5px;
}

.stat-sub {
	font-size: .72rem;
	color: #aaa;
}

/* ── Card ──────────────────────────────────────────────────── */
.card {
	background: #fff;
	box-shadow: 0 1px 6px rgba(0, 0, 0, .07);
	border: 1px solid #e8e8e8;
	margin-bottom: .75rem;
	overflow: hidden;
}

.card-header {
	padding: .65rem 1rem;
	border-bottom: 1px solid #f0f0f0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: .5rem;
}

.card-title {
	font-size: 1rem;
	font-weight: 600;
	color: #1a1a2e;
}

.card-header a {
	font-size: .8rem;
	color: #0f3460;
	text-decoration: none;
	opacity: .8;
}

.card-header a:hover {
	opacity: 1;
}

.card-body {
	padding: .85rem 1rem;
}

/* ── Two column layout ─────────────────────────────────────── */
.main-grid {
	display: grid;
	grid-template-columns: 1fr 300px;
	gap: .75rem;
	align-items: start;
}

/* ── Layout grid for master data etc ──────────────────────── */
.layout-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: .75rem;
}

/* ── Table ─────────────────────────────────────────────────── */
.table-wrapper {
	overflow-x: auto;
}

table {
	width: 100%;
	border-collapse: collapse;
	font-size: .88rem;
}

thead th {
	background: #f8f9fa;
	padding: .5rem .85rem;
	text-align: left;
	font-weight: 600;
	font-size: .85rem;
	letter-spacing: .4px;
	border-bottom: 2px solid #e9ecef;
	white-space: nowrap;
}

tbody td {
	padding: .5rem .85rem;
	border-bottom: 1px solid #f0f0f0;
	vertical-align: middle;
}

tbody tr:hover {
	background: #fafafa;
}

/* ── Badges ────────────────────────────────────────────────── */
.badge {
	display: inline-block;
	padding: 2px 9px;
	border-radius: 20px;
	font-size: .72rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .3px;
}

.badge-cop {
	background: #e7eeea;
	color: #1d4f38;
}

.badge-cap {
	background: #e6f1fb;
	color: #185fa5;
}

.badge-cew {
	background: #faeeda;
	color: #854f0b;
}

.badge-admin {
	background: #e94560;
	color: #fff;
}

.badge-officer {
	background: #0f3460;
	color: #fff;
}

.badge-active {
	background: #d4edda;
	color: #155724;
}

.badge-inactive {
	background: #f8d7da;
	color: #721c24;
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: .45rem 1rem;
	font-size: .88rem;
	font-weight: 500;
	text-decoration: none;
	border: none;
	cursor: pointer;
	transition: all .15s;
	font-family: inherit;
	white-space: nowrap;
}

.btn:active {
	transform: scale(.97);
}

.btn-primary {
	background: #0f3460;
	color: #fff;
}

.btn-primary:hover {
	background: #1a1a2e;
}

.btn-success {
	background: #27ae60;
	color: #fff;
}

.btn-success:hover {
	background: #219a52;
}

.btn-danger {
	background: #e74c3c;
	color: #fff;
}

.btn-danger:hover {
	background: #c0392b;
}

.btn-warning {
	background: #f39c12;
	color: #fff;
}

.btn-warning:hover {
	background: #d68910;
}

.btn-ghost {
	background: #fff;
	border: 1.5px solid #ddd;
	color: #13296c;
}

.btn-ghost:hover {
	background: #f5f5f5;
}

.btn-sm {
	padding: .3rem .75rem;
	font-size: .8rem;
}

.btn-xs {
	padding: .2rem .55rem;
	font-size: .75rem;
	border-radius: 6px;
}

/* Inline icon buttons */
.btn-edit {
	background: #e6f1fb;
	color: #185fa5;
}

.btn-delete {
	background: #f8d7da;
	color: #721c24;
}

.btn-view {
	background: #e7eeea;
	color: #1d4f38;
}

/* ── Forms ─────────────────────────────────────────────────── */
.form-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: .75rem;
}

.form-group {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.form-group label {
	font-size: .78rem;
	font-weight: 600;
	color: #555;
	text-transform: uppercase;
	letter-spacing: .04em;
}

.form-group .req {
	color: #e74c3c;
}

.form-group input, .form-group select, .form-group textarea {
	padding: .5rem .75rem;
	border: 1.5px solid #ddd;
	border-radius: 8px;
	font-size: .9rem;
	outline: none;
	transition: border-color .15s, box-shadow .15s;
	background: #fff;
	font-family: inherit;
	color: #1a1916;
	width: 100%;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus
	{
	border-color: #0f3460;
	box-shadow: 0 0 0 3px rgba(15, 52, 96, .1);
}

.form-group select {
	appearance: none;
	-webkit-appearance: none;
	background-image:
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7'%3E%3Cpath fill='%2397938d' d='M0 0l5.5 7L11 0z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right .75rem center;
	padding-right: 2rem;
}

.form-group input[disabled], .form-group select[disabled] {
	background: #f5f5f5;
	cursor: not-allowed;
	color: #999;
}

.form-group textarea {
	resize: vertical;
	min-height: 72px;
}

.form-footer {
	margin-top: 1rem;
	display: flex;
	gap: .75rem;
	flex-wrap: wrap;
}

/* ── Alerts ────────────────────────────────────────────────── */
.alert {
	padding: .6rem .9rem;
	border-radius: 8px;
	margin-bottom: .75rem;
	font-size: .87rem;
}

.alert-success {
	background: #d4edda;
	color: #155724;
	border: 1px solid #c3e6cb;
}

.alert-error {
	background: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
}

.alert-info {
	background: #d1ecf1;
	color: #0c5460;
	border: 1px solid #bee5eb;
}

/* ── Pills (program type selector) ────────────────────────── */
.pills {
	display: flex;
	flex-wrap: wrap;
	gap: .4rem;
}

.pills input[type=radio] {
	display: none;
}

.pills label {
	padding: .3rem .9rem;
	border: 1.5px solid #ddd;
	border-radius: 100px;
	font-size: .84rem;
	font-weight: 500;
	color: #333;
	cursor: pointer;
	transition: all .15s;
	text-transform: none;
	letter-spacing: 0;
}

.pills input[type=radio]:checked+label {
	background: #0f3460;
	border-color: #0f3460;
	color: #fff;
}

/* ── Conditional panels ────────────────────────────────────── */
.cond-panel {
	display: none !important;
}

.cond-panel.show {
	display: flex !important;
	flex-direction: column;
	gap: 4px;
}

/* ── Section (form card sections) ─────────────────────────── */
.sec {
	padding: 1rem 1.25rem;
	border-bottom: 1px solid #f0f0f0;
}

.sec:last-of-type {
	border-bottom: none;
}

.sec-title {
	font-size: .9rem;
	font-weight: 600;
	color: #1a1a2e;
	margin-bottom: .75rem;
	display: flex;
	align-items: center;
	gap: .4rem;
	text-transform: uppercase;
	letter-spacing: .04em;
}

.sec-title::before {
	content: '';
	display: inline-block;
	width: 3px;
	height: .9rem;
	background: #0f3460;
	border-radius: 2px;
}

/* ── Dynamic table (representatives, dignitaries) ──────────── */
.dyn-table {
	width: 100%;
	border-collapse: collapse;
}

.dyn-table th {
	font-size: .72rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: #888;
	padding: .3rem .4rem;
	border-bottom: 1px solid #eee;
	text-align: left;
}

.dyn-table td {
	padding: .3rem .3rem;
	vertical-align: middle;
}

.dyn-table input {
	padding: .4rem .6rem;
	font-size: .86rem;
	border: 1.5px solid #ddd;
	border-radius: 6px;
	width: 100%;
	font-family: inherit;
}

.dyn-table input:focus {
	outline: none;
	border-color: #0f3460;
}

.btn-rm {
	background: none;
	border: none;
	cursor: pointer;
	padding: .25rem .4rem;
	border-radius: 6px;
	color: #e74c3c;
	font-size: .95rem;
	transition: background .15s;
	line-height: 1;
}

.btn-rm:hover {
	background: #f8d7da;
}

.btn-add-row {
	margin-top: .5rem;
	display: inline-flex;
	align-items: center;
	gap: .3rem;
	padding: .3rem .75rem;
	border: 1.5px dashed #0f3460;
	border-radius: 8px;
	color: #0f3460;
	font-size: .82rem;
	font-weight: 500;
	font-family: inherit;
	background: #eef3f9;
	cursor: pointer;
	transition: background .15s;
}

.btn-add-row:hover {
	background: #dde9f5;
}

/* ── Photo upload ──────────────────────────────────────────── */
.drop-zone {
	border: 2px dashed #ddd;
	border-radius: 10px;
	padding: 1.25rem 1rem;
	text-align: center;
	cursor: pointer;
	background: #fafafa;
	position: relative;
	transition: border-color .15s, background .15s;
	margin-top: .5rem;
}

.drop-zone:hover, .drop-zone.over {
	border-color: #0f3460;
	background: #eef3f9;
}

.drop-zone input[type=file] {
	position: absolute;
	inset: 0;
	opacity: 0;
	cursor: pointer;
	width: 100%;
	height: 100%;
}

.drop-zone .icon {
	font-size: 1.5rem;
	margin-bottom: .3rem;
}

.drop-zone p {
	font-size: .82rem;
	color: #888;
}

.drop-zone strong {
	color: #0f3460;
}

.photo-grid {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
	margin-top: .6rem;
	justify-content: center;
}

.photo-thumb {
	width: 100px;
	height: 100px;
	flex-shrink: 0;
}

.photo-thumb {
	position: relative;
	border-radius: 8px;
	overflow: hidden;
	border: 1px solid #ddd;
}

.photo-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	cursor: pointer;
	transition: opacity .15s;
}

.photo-thumb img:hover {
	opacity: .88;
}

.photo-thumb .rm-ph {
	position: absolute;
	top: 3px;
	right: 3px;
	background: rgba(0, 0, 0, .5);
	color: #fff;
	border: none;
	border-radius: 50%;
	width: 20px;
	height: 20px;
	font-size: .7rem;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}

.photo-thumb .del-label {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	background: rgba(185, 51, 51, .85);
	color: #fff;
	font-size: .68rem;
	padding: .2rem .4rem;
	display: flex;
	align-items: center;
	gap: .25rem;
	cursor: pointer;
}

.ph-hint {
	font-size: .75rem;
	color: #888;
	margin-top: .3rem;
}

/* ── Form card footer ──────────────────────────────────────── */
.form-footer-bar {
	padding: .85rem 1.25rem;
	background: #f8f9fa;
	border-top: 1px solid #eee;
	display: flex;
	justify-content: flex-end;
	gap: .65rem;
	align-items: center;
}

/* ── Readonly display field ────────────────────────────────── */
.readonly-field {
	padding: .5rem .75rem;
	border: 1.5px solid #ddd;
	border-radius: 8px;
	background: #f5f5f5;
	font-size: .9rem;
	color: #555;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

/* ── Master data item list ─────────────────────────────────── */
.item-list {
	display: flex;
	flex-direction: column;
	gap: .35rem;
	margin-top: .75rem;
}

.item-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: .45rem .65rem;
	border: 1px solid #eee;
	border-radius: 8px;
	background: #fafafa;
	gap: .5rem;
}

.item-info {
	flex: 1;
	min-width: 0;
}

.item-name {
	font-size: .88rem;
	font-weight: 500;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.item-sub {
	font-size: .75rem;
	color: #888;
	margin-top: .1rem;
}

.item-btns {
	display: flex;
	gap: .3rem;
	flex-shrink: 0;
}

.edit-form {
	display: none;
	flex-direction: column;
	gap: .35rem;
	padding: .6rem .75rem;
	margin-top: .25rem;
	border: 1.5px solid #0f3460;
	border-radius: 8px;
	background: #eef3f9;
}

.edit-form.open {
	display: flex;
}

.edit-form input, .edit-form select {
	padding: .4rem .65rem;
	border: 1.5px solid #ddd;
	border-radius: 6px;
	font-family: inherit;
	font-size: .86rem;
	width: 100%;
	background: #fff;
	color: #1a1916;
}

.edit-form select {
	appearance: none;
	background-image:
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7'%3E%3Cpath fill='%2397938d' d='M0 0l5.5 7L11 0z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right .65rem center;
	padding-right: 1.8rem;
}

.edit-actions {
	display: flex;
	gap: .35rem;
}

/* ── Quick links ───────────────────────────────────────────── */
.quick-links {
	display: flex;
	flex-direction: column;
}

.ql-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: .65rem 1rem;
	border-bottom: 1px solid #f0f0f0;
	text-decoration: none;
	color: #1a1916;
	transition: background .12s;
}

.ql-item:last-child {
	border-bottom: none;
}

.ql-item:hover {
	background: #f5f5f5;
}

.ql-left {
	display: flex;
	align-items: center;
	gap: .65rem;
}

.ql-icon {
	width: 30px;
	height: 30px;
	border-radius: 7px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: .9rem;
	flex-shrink: 0;
}

.ql-icon-green {
	background: #e7eeea;
}

.ql-icon-blue {
	background: #e6f1fb;
}

.ql-icon-amber {
	background: #faeeda;
}

.ql-name {
	font-size: .88rem;
	font-weight: 500;
}

.ql-desc {
	font-size: .73rem;
	color: #888;
	margin-top: 1px;
}

.ql-arrow {
	font-size: .9rem;
	color: #aaa;
}

/* ── Type breakdown bars ───────────────────────────────────── */
.type-breakdown {
	padding: .85rem 1rem;
}

.type-row {
	display: flex;
	align-items: center;
	gap: .65rem;
	margin-bottom: .6rem;
}

.type-row:last-child {
	margin-bottom: 0;
}

.type-label {
	font-size: .8rem;
	font-weight: 500;
	min-width: 36px;
}

.type-bar-wrap {
	flex: 1;
	background: #f0f0f0;
	border-radius: 100px;
	height: 7px;
	overflow: hidden;
}

.type-bar {
	height: 100%;
	border-radius: 100px;
}

.bar-cop {
	background: #1d4f38;
}

.bar-cap {
	background: #185fa5;
}

.bar-cew {
	background: #ef9f27;
}

.type-count {
	font-size: .8rem;
	color: #888;
	min-width: 24px;
	text-align: right;
}

/* ── Lightbox ──────────────────────────────────────────────── */
.lb-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, .82);
	z-index: 1000;
	align-items: center;
	justify-content: center;
}

.lb-overlay.open {
	display: flex;
}

.lb-overlay img {
	max-width: 90vw;
	max-height: 90vh;
	border-radius: 10px;
	object-fit: contain;
}

.lb-close {
	position: absolute;
	top: 1rem;
	right: 1.25rem;
	color: #fff;
	font-size: 1.4rem;
	cursor: pointer;
	background: none;
	border: none;
	line-height: 1;
}

/* ── Meta grid (view page) ─────────────────────────────────── */
.meta-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: .75rem;
}

.meta-item label {
	font-size: .7rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .05em;
	color: #888;
	display: block;
	margin-bottom: .15rem;
}

.meta-item span {
	font-size: .92rem;
	color: #1a1916;
}

/* ── Add row form (master data) ────────────────────────────── */
.add-row {
	display: flex;
	gap: .4rem;
	flex-wrap: wrap;
}

.add-row input, .add-row select {
	flex: 1;
	min-width: 0;
	padding: .45rem .7rem;
	border: 1.5px solid #ddd;
	border-radius: 8px;
	font-family: inherit;
	font-size: .86rem;
	color: #1a1916;
	background: #fff;
	appearance: none;
	-webkit-appearance: none;
}

.add-row select {
	background-image:
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7'%3E%3Cpath fill='%2397938d' d='M0 0l5.5 7L11 0z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right .65rem center;
	padding-right: 1.8rem;
}

.add-row input:focus, .add-row select:focus {
	outline: none;
	border-color: #0f3460;
}

/* ── Empty states ──────────────────────────────────────────── */
.empty-state {
	text-align: center;
	padding: 2.5rem 1rem;
	color: #aaa;
	font-size: .9rem;
}

.empty-row {
	font-size: .84rem;
	color: #aaa;
	padding: .65rem .5rem;
}

/* ── Login ─────────────────────────────────────────────────── */
.login-body {
	min-height: 100vh;
	background: linear-gradient(135deg, #8dbed6bf 0%, #4392c8 50%, #185984b8 100%);
	display: flex;
	align-items: center;
	justify-content: center;
}

.login-card {
	background: #fff;
	border-radius: 14px;
	padding: 2rem;
	width: 100%;
	max-width: 420px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}

.login-card .form-group {
	margin-bottom: 1rem;
}

.login-logo {
	text-align: center;
	margin-bottom: 1.5rem;
}

.login-logo h2 {
	font-size: 1.6rem;
	font-weight: 700;
	color: #1a1a2e;
}

.login-logo p {
	color: #888;
	margin-top: 4px;
	font-size: .88rem;
}

/* ── Tabs ──────────────────────────────────────────────────── */
.tabs {
	display: flex;
	gap: 0;
	border-bottom: 2px solid #e9ecef;
	margin-bottom: .5rem;
	overflow-x: auto;
}

.tab-btn {
	padding: .55rem 1.1rem;
	border: none;
	background: none;
	cursor: pointer;
	font-size: .88rem;
	color: #888;
	font-weight: 500;
	border-bottom: 2px solid transparent;
	white-space: nowrap;
	transition: all .2s;
	font-family: inherit;
}

.tab-btn.active {
	color: #0f3460;
	border-bottom-color: #0f3460;
}

.tab-btn:hover {
	color: #0f3460;
}

.tab-panel {
	display: none;
}

.tab-panel.active {
	display: block;
}

/* ── Misc ──────────────────────────────────────────────────── */
.text-muted {
	color: #888;
	font-size: .84rem;
}

.actions {
	display: flex;
	gap: .3rem;
	flex-wrap: wrap;
}

/* ── Responsive ────────────────────────────────────────────── */
@media ( max-width : 900px) {
	.main-grid {
		grid-template-columns: 1fr;
	}
	.layout-grid {
		grid-template-columns: 1fr;
	}
}

@media ( max-width : 640px) {
	.page-wrap {
		padding: .5rem .75rem 2rem;
	}
	.stats-grid {
		grid-template-columns: repeat(2, 1fr);
	}
	.form-grid {
		grid-template-columns: 1fr;
	}
	.meta-grid {
		grid-template-columns: 1fr 1fr;
	}
}

/* ── Nav links ─────────────────────────────────────────────── */
.nav-link {
	color: #ccc;
	text-decoration: none;
	font-size: .88rem;
	font-weight: 500;
	padding: .3rem .6rem;
	border-radius: 6px;
	transition: background .15s, color .15s;
	white-space: nowrap;
}

.nav-link:hover {
	background: rgba(255, 255, 255, .12);
	color: #fff;
}

.nav-link.nav-active {
	background: rgba(255, 255, 255, .18);
	color: #fff;
	font-weight: 600;
	border-bottom: 2px solid #e94560;
	border-radius: 6px 6px 0 0;
}

/* ── Alert aliases (templates use alert-ok / alert-err) ────── */
.alert-ok {
	background: #d4edda;
	color: #155724;
	border: 1px solid #c3e6cb;
	padding: .6rem .9rem;
	border-radius: 8px;
	margin-bottom: .75rem;
	font-size: .87rem;
}

.alert-err {
	background: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
	padding: .6rem .9rem;
	border-radius: 8px;
	margin-bottom: .75rem;
	font-size: .87rem;
}

/* ── Event list helpers ────────────────────────────────────── */
.event-title {
	font-size: .88rem;
	font-weight: 500;
}

.event-theme {
	font-size: .75rem;
	color: #888;
	margin-top: 1px;
}

/* ── Table action button aliases ───────────────────────────── */
.btn-view {
	background: #e7eeea;
	color: #1d4f38;
	display: inline-flex;
	align-items: center;
	padding: .28rem .65rem;
	border-radius: 6px;
	font-size: .78rem;
	font-weight: 600;
	text-decoration: none;
	border: none;
	cursor: pointer;
}

.btn-edit {
	background: #e6f1fb;
	color: #185fa5;
	display: inline-flex;
	align-items: center;
	padding: .28rem .65rem;
	border-radius: 6px;
	font-size: .78rem;
	font-weight: 600;
	text-decoration: none;
	border: none;
	cursor: pointer;
}

.btn-del {
	background: #f8d7da;
	color: #721c24;
	display: inline-flex;
	align-items: center;
	padding: .28rem .65rem;
	border-radius: 6px;
	font-size: .78rem;
	font-weight: 600;
	border: none;
	cursor: pointer;
}

.btn-edit-sm {
	background: #e6f1fb;
	color: #185fa5;
	border: none;
	cursor: pointer;
	padding: .25rem .6rem;
	border-radius: 6px;
	font-size: .78rem;
	font-weight: 600;
}

.btn-del-sm {
	background: #f8d7da;
	color: #721c24;
	border: none;
	cursor: pointer;
	padding: .25rem .6rem;
	border-radius: 6px;
	font-size: .78rem;
	font-weight: 600;
}

.btn-save-sm {
	background: #d4edda;
	color: #155724;
	border: none;
	cursor: pointer;
	padding: .25rem .6rem;
	border-radius: 6px;
	font-size: .78rem;
	font-weight: 600;
}

.btn-cancel-sm {
	background: #e9ecef;
	color: #333;
	border: none;
	cursor: pointer;
	padding: .25rem .6rem;
	border-radius: 6px;
	font-size: .78rem;
	font-weight: 600;
}

/* ── Form layout aliases (form.html uses g2/g3/field/s2/s3) ── */
.g2 {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: .75rem;
}

.g3 {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: .75rem;
}

.g3 .s2 {
	grid-column: span 2;
}

.g3 .s3 {
	grid-column: 1/-1;
}

.field {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.field label {
	font-size: .78rem;
	font-weight: 600;
	color: #555;
	text-transform: uppercase;
	letter-spacing: .04em;
}

.field input, .field select, .field textarea {
	padding: .5rem .75rem;
	border: 1.5px solid #ddd;
	border-radius: 8px;
	font-size: .9rem;
	outline: none;
	background: #fff;
	font-family: inherit;
	color: #1a1916;
	width: 100%;
	transition: border-color .15s, box-shadow .15s;
}

.field input:focus, .field select:focus, .field textarea:focus {
	border-color: #0f3460;
	box-shadow: 0 0 0 3px rgba(15, 52, 96, .1);
}

.field select {
	appearance: none;
	-webkit-appearance: none;
	background-image:
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7'%3E%3Cpath fill='%2397938d' d='M0 0l5.5 7L11 0z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right .75rem center;
	padding-right: 2rem;
}

/* ── Card footer alias (form.html uses .footer) ────────────── */
.footer {
	padding: .85rem 1.25rem;
	background: #f8f9fa;
	border-top: 1px solid #eee;
	display: flex;
	justify-content: flex-end;
	gap: .65rem;
	align-items: center;
}

/* ── Master data layout alias ──────────────────────────────── */
.layout {
	display: grid;
	grid-template-columns: 2fr 2fr 1fr;
	gap: .75rem;
}

@media ( max-width : 900px) {
	.layout {
		grid-template-columns: 1fr;
	}
}

/* ── Page header supplements ───────────────────────────────── */
.page-header-meta {
	color: #666;
	font-size: .85rem;
	margin-top: 2px;
}

.page-header-actions {
	display: flex;
	gap: .5rem;
	align-items: center;
}

/* ── Empty state ───────────────────────────────────────────── */
.empty-icon {
	font-size: 2rem;
	margin-bottom: .5rem;
}

/* ── Logout btn alias ──────────────────────────────────────── */
.logout-btn {
	background: transparent;
	border: 1px solid #e94560;
	color: #e94560;
	padding: 5px 14px;
	border-radius: 6px;
	cursor: pointer;
	font-size: .85rem;
	transition: all .2s;
	font-family: inherit;
}

.logout-btn:hover {
	background: #e94560;
	color: #fff;
}

/* ── Modal overlay ─────────────────────────────────────────── */
.modal-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, .45);
	z-index: 2000;
	align-items: center;
	justify-content: center;
}

.modal-overlay.open {
	display: flex;
}

.modal-box {
	background: #fff;
	border-radius: 12px;
	padding: 1.5rem;
	width: 100%;
	max-width: 520px;
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}

.modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 1rem;
}

.modal-header h2 {
	font-size: 1.1rem;
	color: #1a1a2e;
}

.modal-close {
	background: none;
	border: none;
	font-size: 1.3rem;
	cursor: pointer;
	color: #888;
	line-height: 1;
}

/* ── Compact form layout helpers ───────────────────────────── */

/* Row 1: Date · Theme · Title — date fixed, theme+title equal */
.form-row-dtt {
	display: grid;
	grid-template-columns: 150px 1fr 1fr;
	gap: .65rem;
	align-items: end;
}

/* Row 2: State · District · Venue — equal thirds */
.form-row-3 {
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	gap: .65rem;
	align-items: end;
}

/* Row 3: Type of Program + Participants — equal halves */
.form-row-type-participants {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1.5rem;
	align-items: start;
}

.form-row-type-participants>div:last-child {
	width: auto;
}

/* Row 4: Conducted By — type display + conditional panels in one row */
.form-row-conducted {
	display: flex;
	gap: .65rem;
	align-items: flex-end;
	flex-wrap: nowrap;
}

.form-row-conducted .field {
	flex: 1;
	min-width: 160px;
}

.form-row-conducted .cond-panel.show {
	display: flex !important;
	flex-direction: column;
	flex: 1;
	min-width: 160px;
}

/* Row 5: Representatives + Dignitaries side by side */
.form-row-2col {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1.25rem;
	align-items: start;
}

/* Tighten sec padding */
.sec {
	padding: .7rem 1.25rem;
}

/* ── Responsive ────────────────────────────────────────────── */
@media ( max-width : 900px) {
	.form-row-dtt {
		grid-template-columns: 150px 1fr;
	}
	.form-row-3 {
		grid-template-columns: 1fr 1fr;
	}
	.form-row-type-participants {
		grid-template-columns: 1fr;
	}
	.form-row-2col {
		grid-template-columns: 1fr;
	}
	.form-row-conducted {
		flex-wrap: wrap;
	}
}

@media ( max-width : 600px) {
	.form-row-dtt {
		grid-template-columns: 1fr;
	}
	.form-row-3 {
		grid-template-columns: 1fr;
	}
}