:root {
	--epce-navy: #0f2942;
	--epce-navy-dark: #0a1c2e;
	--epce-emerald: #059669;
	--epce-emerald-hover: #047857;
	--epce-bg: #f1f5f9;
	--epce-surface: #ffffff;
	--epce-border: #dbe3ec;
	--epce-text: #1e293b;
	--epce-muted: #64748b;
	--epce-danger: #dc2626;
	--epce-warn: #d97706;
	--epce-radius: 10px;
	--epce-shadow: 0 4px 16px rgba(15, 41, 66, 0.07);
}

* { box-sizing: border-box; }

body.epce-login-body,
body.epce-app-body {
	margin: 0;
	padding: 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Arial, sans-serif;
	color: var(--epce-text);
	background: var(--epce-bg);
	font-size: 14px;
	line-height: 1.5;
}

.epce-hidden { display: none !important; }

/* LOGIN */
.epce-login-body {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, #0a1c2e 0%, #0f2942 55%, #164e63 100%);
	padding: 20px;
}

.epce-login-shell {
	width: 100%;
	max-width: 430px;
}

.epce-login-card {
	background: #ffffff;
	border-radius: 14px;
	padding: 28px;
	box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
}

.epce-login-brand {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 22px;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--epce-border);
}

.epce-brand-badge {
	width: 46px;
	height: 46px;
	border-radius: 12px;
	background: var(--epce-navy);
	color: #ffffff;
	font-weight: 800;
	font-size: 17px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.epce-brand-kicker {
	display: block;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--epce-emerald);
	font-weight: 700;
}

.epce-login-brand h1 {
	margin: 0;
	font-size: 20px;
	color: var(--epce-navy);
}

.epce-login-brand p {
	margin: 0;
	font-size: 13px;
	color: var(--epce-muted);
}

.epce-login-form {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.epce-pass-wrap {
	display: flex;
	gap: 6px;
}

.epce-pass-wrap input { flex: 1; }

.epce-login-footer {
	margin-top: 20px;
	padding-top: 14px;
	border-top: 1px solid var(--epce-border);
	display: flex;
	justify-content: space-between;
	font-size: 12px;
	color: var(--epce-muted);
}

/* LAYOUT SPA */
.epce-layout {
	display: flex;
	min-height: 100vh;
}

.epce-sidebar {
	width: 260px;
	background: var(--epce-navy);
	color: #e2e8f0;
	display: flex;
	flex-direction: column;
	flex-shrink: 0;
	position: sticky;
	top: 0;
	height: 100vh;
}

.epce-sidebar-header {
	padding: 18px 16px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
	display: flex;
	align-items: center;
	gap: 12px;
}

.epce-sidebar-header .epce-brand-badge {
	width: 38px;
	height: 38px;
	background: var(--epce-emerald);
	font-size: 14px;
}

.epce-sidebar-header strong {
	display: block;
	font-size: 15px;
	color: #ffffff;
}

.epce-sidebar-header small {
	display: block;
	font-size: 11px;
	color: #94a3b8;
}

.epce-mobile-close {
	display: none;
	margin-left: auto;
	background: transparent;
	border: 0;
	color: #ffffff;
	font-size: 24px;
	cursor: pointer;
}

.epce-nav {
	flex: 1;
	overflow-y: auto;
	padding: 12px 10px;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.epce-nav-section {
	font-size: 10px;
	text-transform: uppercase;
	letter-spacing: 0.7px;
	color: #94a3b8;
	padding: 14px 10px 4px;
	font-weight: 700;
}

.epce-nav-item {
	background: transparent;
	border: 0;
	color: #cbd5e1;
	text-align: left;
	padding: 10px 12px;
	border-radius: 8px;
	font-size: 13.5px;
	font-weight: 500;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 10px;
	transition: background 0.15s ease, color 0.15s ease;
}

.epce-nav-item:hover {
	background: rgba(255, 255, 255, 0.08);
	color: #ffffff;
}

.epce-nav-item.active {
	background: var(--epce-emerald);
	color: #ffffff;
	font-weight: 600;
}

.epce-nav-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: currentColor;
	opacity: 0.7;
}

.epce-sidebar-footer {
	padding: 14px;
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	background: var(--epce-navy-dark);
}

.epce-user-chip {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 12px;
}

.epce-user-avatar {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: #1e40af;
	color: #ffffff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	flex-shrink: 0;
}

.epce-user-meta strong {
	display: block;
	font-size: 13px;
	color: #ffffff;
}

.epce-user-meta small {
	display: block;
	font-size: 11px;
	color: #94a3b8;
}

.epce-main-wrap {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
}

.epce-topbar {
	background: var(--epce-surface);
	border-bottom: 1px solid var(--epce-border);
	padding: 14px 24px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	position: sticky;
	top: 0;
	z-index: 20;
}

.epce-topbar-left {
	display: flex;
	align-items: center;
	gap: 12px;
}

.epce-topbar h2 {
	margin: 0;
	font-size: 18px;
	color: var(--epce-navy);
}

.epce-topbar p {
	margin: 0;
	font-size: 12px;
	color: var(--epce-muted);
}

.epce-topbar-actions {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.epce-mobile-toggle {
	display: none;
	border: 1px solid var(--epce-border);
	background: #ffffff;
	border-radius: 6px;
	padding: 6px 10px;
	font-size: 18px;
	cursor: pointer;
}

.epce-content {
	padding: 22px 24px;
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.epce-view { display: none; flex-direction: column; gap: 18px; }
.epce-view.active { display: flex; }

/* CARDS & GRIDS */
.epce-card {
	background: var(--epce-surface);
	border: 1px solid var(--epce-border);
	border-radius: var(--epce-radius);
	padding: 18px;
	box-shadow: var(--epce-shadow);
}

.epce-form-card { max-width: 820px; }

.epce-card h3 {
	margin: 0 0 12px;
	font-size: 16px;
	color: var(--epce-navy);
}

.epce-card-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 12px;
}

.epce-card-head h3 { margin: 0; }

.epce-kpi-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
	gap: 14px;
}

.epce-kpi {
	background: var(--epce-surface);
	border: 1px solid var(--epce-border);
	border-left: 4px solid var(--epce-navy);
	border-radius: var(--epce-radius);
	padding: 16px;
	box-shadow: var(--epce-shadow);
}

.epce-kpi.kpi-emerald { border-left-color: var(--epce-emerald); }
.epce-kpi.kpi-danger { border-left-color: var(--epce-danger); }
.epce-kpi.kpi-amber { border-left-color: var(--epce-warn); }

.epce-kpi span {
	display: block;
	font-size: 12px;
	color: var(--epce-muted);
	font-weight: 600;
}

.epce-kpi strong {
	display: block;
	font-size: 26px;
	color: var(--epce-navy);
	margin-top: 4px;
}

.epce-kpi small {
	display: block;
	font-size: 11px;
	color: var(--epce-muted);
	margin-top: 2px;
}

.epce-grid-2 {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 18px;
}

.epce-grid-2-asym {
	display: grid;
	grid-template-columns: 1.25fr 1fr;
	gap: 18px;
}

/* FORMULARIOS & CONTROLES */
.epce-form-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px;
}

.epce-col-full { grid-column: 1 / -1; }

.epce-field {
	display: flex;
	flex-direction: column;
	gap: 5px;
}

.epce-field label {
	font-size: 12.5px;
	font-weight: 600;
	color: #334155;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="search"],
input[type="date"],
select,
textarea {
	width: 100%;
	padding: 9px 11px;
	border: 1px solid #cbd5e1;
	border-radius: 7px;
	font-size: 13.5px;
	color: var(--epce-text);
	background: #ffffff;
	font-family: inherit;
}

input:focus, select:focus, textarea:focus {
	outline: none;
	border-color: var(--epce-emerald);
	box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.14);
}

.epce-check-inline {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
}

.epce-form-actions {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
}

.epce-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 14px;
}

.epce-toolbar h3 { margin: 0; }

.epce-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	flex: 1;
}

.epce-filters input,
.epce-filters select {
	width: auto;
	min-width: 165px;
}

/* BOTOES */
.epce-btn {
	border: 1px solid transparent;
	border-radius: 7px;
	padding: 9px 15px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	text-decoration: none;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.epce-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.epce-btn-block { width: 100%; }
.epce-btn-sm { padding: 7px 11px; font-size: 12.5px; }
.epce-btn-xs { padding: 4px 8px; font-size: 11.5px; }

.epce-btn-primary { background: var(--epce-emerald); color: #ffffff; }
.epce-btn-primary:hover { background: var(--epce-emerald-hover); }

.epce-btn-secondary { background: var(--epce-navy); color: #ffffff; }
.epce-btn-secondary:hover { background: #163b5e; }

.epce-btn-outline { background: #ffffff; border-color: #cbd5e1; color: var(--epce-navy); }
.epce-btn-outline:hover { background: #f8fafc; border-color: #94a3b8; }

.epce-btn-danger-outline {
	background: rgba(220, 38, 38, 0.12);
	border-color: rgba(248, 113, 113, 0.45);
	color: #fecaca;
}
.epce-btn-danger-outline:hover { background: #dc2626; color: #ffffff; }

.epce-btn-danger-xs {
	background: #fee2e2;
	color: #991b1b;
	border: 1px solid #fecaca;
	padding: 4px 8px;
	border-radius: 6px;
	font-size: 11.5px;
	font-weight: 600;
	cursor: pointer;
}

.epce-btn-ghost-sm {
	background: #f1f5f9;
	border: 1px solid #cbd5e1;
	border-radius: 7px;
	padding: 0 12px;
	font-size: 12px;
	font-weight: 600;
	color: var(--epce-navy);
	cursor: pointer;
}

.epce-btn-group { display: flex; flex-wrap: wrap; gap: 6px; }

/* TABS */
.epce-tabs {
	display: flex;
	gap: 8px;
	border-bottom: 2px solid var(--epce-border);
	padding-bottom: 8px;
	flex-wrap: wrap;
}

.epce-tab {
	border: 0;
	background: #e2e8f0;
	color: #334155;
	padding: 8px 14px;
	border-radius: 7px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}

.epce-tab.active {
	background: var(--epce-navy);
	color: #ffffff;
}

.epce-tab-panel { display: none; }
.epce-tab-panel.active { display: block; }

/* TABELAS */
.epce-table-wrap {
	width: 100%;
	overflow-x: auto;
}

.epce-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}

.epce-table th,
.epce-table td {
	padding: 9px 10px;
	border-bottom: 1px solid #e2e8f0;
	text-align: left;
	vertical-align: middle;
}

.epce-table th {
	background: #f8fafc;
	color: #475569;
	font-size: 11.5px;
	text-transform: uppercase;
	letter-spacing: 0.3px;
	font-weight: 700;
}

.epce-table tr:hover td { background: #f8fafc; }
.epce-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.epce-table .actions { text-align: right; white-space: nowrap; }
.epce-empty { text-align: center !important; color: var(--epce-muted); padding: 20px !important; }

/* BADGES & ALERTS */
.epce-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 700;
}

.badge-ok { background: #dcfce7; color: #166534; }
.badge-crit { background: #fee2e2; color: #991b1b; }
.badge-warn { background: #fef3c7; color: #92400e; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-muted { background: #e2e8f0; color: #475569; }

.epce-alert {
	padding: 11px 14px;
	border-radius: 8px;
	margin-bottom: 14px;
	font-size: 13px;
	font-weight: 500;
}
.epce-alert-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.epce-muted { color: var(--epce-muted); font-size: 13px; margin-top: 0; }
.epce-divider { border: 0; border-top: 1px solid var(--epce-border); margin: 16px 0; }

/* MODAL */
.epce-modal-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, 0.55);
	z-index: 100;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.epce-modal {
	background: #ffffff;
	border-radius: 12px;
	width: 100%;
	max-width: 680px;
	max-height: 90vh;
	display: flex;
	flex-direction: column;
	box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.epce-modal-header {
	padding: 14px 18px;
	border-bottom: 1px solid var(--epce-border);
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.epce-modal-header h3 { margin: 0; color: var(--epce-navy); font-size: 16px; }

.epce-modal-close {
	background: transparent;
	border: 0;
	font-size: 24px;
	cursor: pointer;
	color: var(--epce-muted);
}

.epce-modal-body {
	padding: 18px;
	overflow-y: auto;
}

/* TOASTS */
.epce-toast-container {
	position: fixed;
	right: 18px;
	bottom: 18px;
	z-index: 200;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.epce-toast {
	background: var(--epce-navy);
	color: #ffffff;
	padding: 11px 16px;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 500;
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
	max-width: 380px;
}
.epce-toast.toast-success { background: var(--epce-emerald); }
.epce-toast.toast-error { background: var(--epce-danger); }

@media (max-width: 980px) {
	.epce-grid-2, .epce-grid-2-asym { grid-template-columns: 1fr; }
	.epce-sidebar {
		position: fixed;
		left: -270px;
		top: 0;
		bottom: 0;
		z-index: 60;
		transition: left 0.2s ease;
	}
	.epce-sidebar.open { left: 0; }
	.epce-mobile-toggle, .epce-mobile-close { display: inline-flex; }
}

@media (max-width: 640px) {
	.epce-form-grid { grid-template-columns: 1fr; }
	.epce-topbar { padding: 12px 14px; }
	.epce-content { padding: 14px; }
}