/* ==========================================================================
   EDRP shared theme
   Linked from every redesigned page. Keep this file in sync across pages -
   edit here, not inline in individual .php files.
   ========================================================================== */

:root {
	--edrp-navy: #0f2a4a;
	--edrp-navy-light: #1c3f68;
	--edrp-blue: #2563eb;
	--edrp-teal: #0d9488;
	--edrp-amber: #d97706;
	--edrp-green: #16a34a;
	--edrp-red: #dc2626;
	--edrp-bg: #eef1f6;
	--edrp-card: #ffffff;
	--edrp-text: #1f2937;
	--edrp-muted: #6b7280;
	--edrp-border: #e5e7eb;
}

body {
	background-color: var(--edrp-bg);
	font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
	color: var(--edrp-text);
}

/* Top navbar */
.header .navbar {
	background: linear-gradient(135deg, var(--edrp-navy) 0%, var(--edrp-navy-light) 100%);
	box-shadow: 0 2px 10px rgba(15, 42, 74, 0.25);
}
.header .navbar-brand .brand-text strong {
	color: #ffffff !important;
	font-weight: 600;
	letter-spacing: 0.3px;
}
.header #toggle-btn i {
	color: #ffffff;
}
.welcome-pill {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: rgba(255, 255, 255, 0.12);
	color: #ffffff;
	padding: 6px 16px;
	border-radius: 999px;
	font-size: 14px;
	font-weight: 500;
	margin-right: 16px;
}
.welcome-pill i {
	color: #ffd166;
}
.nav-link.logout {
	background-color: rgba(220, 38, 38, 0.85);
	color: #fff !important;
	padding: 7px 16px;
	border-radius: 6px;
	transition: background-color 0.15s ease;
}
.nav-link.logout:hover {
	background-color: #b91c1c;
}

/* Page title bar (used on inner pages instead of the dashboard hero) */
.edrp-page-title {
	background: linear-gradient(120deg, var(--edrp-blue) 0%, var(--edrp-teal) 100%);
	border-radius: 14px;
	padding: 22px 28px;
	margin: 24px 24px 0 24px;
	box-shadow: 0 8px 24px rgba(37, 99, 235, 0.18);
}
.edrp-page-title h1 {
	color: #ffffff;
	font-size: 21px;
	font-weight: 600;
	margin: 0;
	letter-spacing: 0.2px;
}
.edrp-page-title p {
	color: rgba(255, 255, 255, 0.85);
	margin: 4px 0 0 0;
	font-size: 13px;
}

/* Hero (dashboard welcome banner) */
.edrp-hero {
	background: linear-gradient(120deg, var(--edrp-blue) 0%, var(--edrp-teal) 100%);
	border-radius: 14px;
	padding: 32px 28px;
	margin: 24px 24px 0 24px;
	box-shadow: 0 8px 24px rgba(37, 99, 235, 0.18);
	text-align: center;
}
.edrp-hero h1 {
	color: #ffffff;
	font-size: 26px;
	font-weight: 600;
	margin: 0;
	letter-spacing: 0.3px;
}
.edrp-hero p {
	color: rgba(255, 255, 255, 0.85);
	margin: 6px 0 0 0;
	font-size: 14px;
}

/* Generic content wrap + card */
.edrp-content-wrap {
	margin: 24px;
}
.edrp-card {
	background: var(--edrp-card);
	border-radius: 14px;
	box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
	overflow: hidden;
	max-width: 960px;
	margin: 0 auto 24px auto;
}
.edrp-card.edrp-card-wide {
	max-width: 100%;
}
.edrp-card-header {
	padding: 18px 24px;
	border-bottom: 1px solid var(--edrp-border);
	display: flex;
	align-items: center;
	gap: 10px;
}
.edrp-card-header i {
	color: var(--edrp-blue);
	font-size: 18px;
}
.edrp-card-header h2 {
	font-size: 16px;
	font-weight: 600;
	margin: 0;
	color: var(--edrp-text);
}
.edrp-card-body {
	padding: 24px;
}

/* Alerts / inline messages (replaces bare <font color=...> messages) */
.edrp-alert {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 16px;
	border-radius: 10px;
	font-size: 14px;
	margin-bottom: 16px;
}
.edrp-alert:empty { display: none; }
.edrp-alert-success { background-color: #dcfce7; color: #15803d; }
.edrp-alert-error   { background-color: #fee2e2; color: #b91c1c; }
.edrp-alert-info    { background-color: #e0edff; color: #1d4ed8; }
.edrp-alert-warning { background-color: #fef3c7; color: #b45309; }

/* Forms */
.edrp-form-grid {
	display: grid;
	grid-template-columns: 200px 1fr;
	gap: 14px 20px;
	align-items: center;
	max-width: 640px;
}
.edrp-form-grid label {
	font-weight: 600;
	font-size: 14px;
	color: var(--edrp-text);
	margin: 0;
}
.edrp-form-grid input[type="text"],
.edrp-form-grid input[type="password"],
.edrp-form-grid input[type="date"],
.edrp-form-grid input[type="file"],
.edrp-form-grid select {
	width: 100%;
	padding: 9px 12px;
	border: 1px solid var(--edrp-border);
	border-radius: 8px;
	font-size: 14px;
	font-family: inherit;
	background-color: #fbfcfe;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	box-sizing: border-box;
}
.edrp-form-grid input:focus,
.edrp-form-grid select:focus {
	outline: none;
	border-color: var(--edrp-blue);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.edrp-form-grid input[disabled] {
	background-color: #f1f5f9;
	color: var(--edrp-muted);
}
.edrp-form-actions {
	display: flex;
	gap: 10px;
	margin-top: 22px;
	flex-wrap: wrap;
}
.edrp-form-actions .btn {
	border-radius: 8px;
	padding: 9px 22px;
	font-weight: 500;
}
.edrp-form-note {
	font-size: 13px;
	color: var(--edrp-muted);
	margin-top: 10px;
}

/* Horizontal scroll wrapper for wide tables (many columns) so columns
   scroll into view instead of being clipped by .edrp-card's overflow:hidden */
.edrp-table-scroll {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}
.edrp-table-scroll .edrp-table,
.edrp-table-scroll .edrp-status-table {
	min-width: 900px;
}
.edrp-table-scroll .edrp-table td,
.edrp-table-scroll .edrp-table th,
.edrp-table-scroll .edrp-status-table td {
	white-space: nowrap;
}

/* Generic result / listing table */
.edrp-table {
	width: 100%;
	border-collapse: collapse;
}
.edrp-table thead th,
.edrp-table thead td {
	background-color: #f8fafc;
	color: var(--edrp-muted);
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	padding: 12px 16px;
	border-bottom: 1px solid var(--edrp-border);
	text-align: left;
}
.edrp-table tbody tr {
	transition: background-color 0.15s ease;
}
.edrp-table tbody tr:hover {
	background-color: #f5f8ff;
}
.edrp-table td {
	padding: 12px 16px;
	font-size: 14px;
	border-bottom: 1px solid var(--edrp-border);
	vertical-align: middle;
	color: var(--edrp-text);
}
.edrp-table .edrp-empty-row td {
	text-align: center;
	color: var(--edrp-red);
	padding: 24px 16px;
	font-style: italic;
}

/* Status badges */
.edrp-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 10px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	white-space: nowrap;
}
.edrp-badge-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	display: inline-block;
}
.edrp-badge.status-downloaded { background-color: #e0edff; color: #1d4ed8; }
.edrp-badge.status-downloaded .edrp-badge-dot { background-color: #1d4ed8; }
.edrp-badge.status-sent { background-color: #fef3c7; color: #b45309; }
.edrp-badge.status-sent .edrp-badge-dot { background-color: #b45309; }
.edrp-badge.status-replied { background-color: #dcfce7; color: #15803d; }
.edrp-badge.status-replied .edrp-badge-dot { background-color: #15803d; }
.edrp-badge.status-pending { background-color: #fef3c7; color: #b45309; }
.edrp-badge.status-pending .edrp-badge-dot { background-color: #b45309; }
.edrp-badge.status-other { background-color: #f1f5f9; color: #475569; }
.edrp-badge.status-other .edrp-badge-dot { background-color: #64748b; }

.edrp-total-row td {
	background: linear-gradient(90deg, var(--edrp-navy) 0%, var(--edrp-navy-light) 100%);
	color: #ffffff;
	font-size: 14px;
	border-bottom: none;
	padding: 16px 20px;
}
.edrp-total-row .edrp-total-label { font-weight: 600; letter-spacing: 0.02em; }
.edrp-total-row .edrp-total-value { font-weight: 700; font-size: 16px; }

/* Table toolbar: client-side search box above a results grid */
.edrp-table-tools {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 20px;
	border-bottom: 1px solid var(--edrp-border);
	flex-wrap: wrap;
}
.edrp-table-search {
	position: relative;
	flex: 0 1 280px;
}
.edrp-table-search i {
	position: absolute;
	left: 12px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--edrp-muted);
	font-size: 13px;
}
.edrp-table-search input {
	width: 100%;
	padding: 8px 12px 8px 32px;
	border: 1px solid var(--edrp-border);
	border-radius: 8px;
	font-size: 13px;
	background-color: #fbfcfe;
	box-sizing: border-box;
}
.edrp-table-search input:focus {
	outline: none;
	border-color: var(--edrp-blue);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.edrp-table-count {
	font-size: 12px;
	color: var(--edrp-muted);
	white-space: nowrap;
}

/* Pagination controls under a results grid */
.edrp-pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 14px 20px;
	border-top: 1px solid var(--edrp-border);
	flex-wrap: wrap;
}
.edrp-pagination button {
	border: 1px solid var(--edrp-border);
	background: #ffffff;
	color: var(--edrp-text);
	border-radius: 6px;
	padding: 5px 11px;
	font-size: 13px;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}
.edrp-pagination button:hover:not(:disabled) {
	background-color: #eef1f6;
}
.edrp-pagination button.active {
	background-color: var(--edrp-blue);
	border-color: var(--edrp-blue);
	color: #ffffff;
}
.edrp-pagination button:disabled {
	color: var(--edrp-muted);
	cursor: not-allowed;
	opacity: 0.5;
}

/* Row action links (replaces <font color="red">Edit/Delete</font>) */
.edrp-action-link {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 4px 10px;
	border-radius: 6px;
	font-size: 12px;
	font-weight: 600;
	text-decoration: none;
	margin-right: 6px;
	transition: background-color 0.15s ease;
}
.edrp-action-link.edit { background-color: #e0edff; color: #1d4ed8; }
.edrp-action-link.edit:hover { background-color: #c7ddff; color: #1d4ed8; text-decoration: none; }
.edrp-action-link.delete { background-color: #fee2e2; color: #b91c1c; }
.edrp-action-link.delete:hover { background-color: #fecaca; color: #b91c1c; text-decoration: none; }
.edrp-action-link.approve { background-color: #dcfce7; color: #15803d; }
.edrp-action-link.approve:hover { background-color: #bbf7d0; color: #15803d; text-decoration: none; }

/* Footer */
.main-footer { background-color: transparent; }
.main-footer p { color: var(--edrp-muted); font-size: 13px; }
.main-footer a.external { color: var(--edrp-blue); font-weight: 600; }

@media (max-width: 576px) {
	.edrp-hero, .edrp-page-title, .edrp-content-wrap { margin: 16px; }
	.edrp-hero { padding: 22px 16px; }
	.edrp-hero h1 { font-size: 20px; }
	.edrp-form-grid { grid-template-columns: 1fr; }
}
