@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
	/* Vitória Hospitalar Brand Theme - Clean White & Red (Default Light Mode) */
	--bg-ink: #f8fafc;
	--bg-deep: #ffffff;
	--bg-soft: #fbfbfb;
	--surface: #ffffff;
	--surface-border: #e2e8f0;
	--surface-border-subtle: #f1f5f9;
	--text-main: #0f172a;
	--text-body: #1e293b;
	--text-muted: #64748b;
	--text-subtle: #94a3b8;

	/* Red Accents */
	--brand-crimson: #c8102e;
	--accent-cyan: #dc2626; /* Primary brand red */
	--accent-lime: #ef4444; /* Vibrant brand red */
	--accent-red-hover: #b91c1c;
	--accent-red-soft: #fef2f2;
	--accent-red-border: #fecaca;
	--danger: #dc2626;

	/* Status Colors */
	--success: #16a34a;
	--success-soft: #f0fdf4;
	--success-border: #bbf7d0;
	--warning: #d97706;
	--warning-soft: #fffbeb;
	--warning-border: #fde68a;

	/* Shadows & Radii */
	--shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
	--shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
	--shadow-lg: 0 10px 25px -5px rgba(220, 38, 38, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
	--shadow-glow: 0 0 15px rgba(220, 38, 38, 0.2);
	--radius-xl: 18px;
	--radius-lg: 14px;
	--radius-md: 10px;
	--radius-sm: 6px;
}

/* =====================================================
   DARK THEME VARIABLES & OVERRIDES
   ===================================================== */
:root[data-theme="dark"],
body.erp-theme-dark {
	--bg-ink: #0b111e;
	--bg-deep: #0f172a;
	--bg-soft: #080d1a;
	--surface: #131d31;
	--surface-border: rgba(255, 255, 255, 0.12);
	--surface-border-subtle: rgba(255, 255, 255, 0.06);
	--text-main: #f8fafc;
	--text-body: #e2e8f0;
	--text-muted: #94a3b8;
	--text-subtle: #64748b;

	--brand-crimson: #ef4444;
	--accent-cyan: #ef4444;
	--accent-lime: #f87171;
	--accent-red-hover: #dc2626;
	--accent-red-soft: rgba(239, 68, 68, 0.14);
	--accent-red-border: rgba(239, 68, 68, 0.32);
	--danger: #ef4444;

	--shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
	--shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.35);
	--shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}

* {
	box-sizing: border-box;
}

html,
body {
	margin: 0;
	min-height: 100%;
}

body {
	font-family: 'Sora', sans-serif;
	background:
		radial-gradient(1000px circle at 5% 5%, rgba(200, 16, 46, 0.04), transparent 55%),
		radial-gradient(800px circle at 95% 95%, rgba(239, 68, 68, 0.03), transparent 60%),
		linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
	color: var(--text-main);
	-webkit-font-smoothing: antialiased;
	transition: background-color 0.2s ease, color 0.2s ease;
}

[data-theme="dark"] body,
body.erp-theme-dark {
	background:
		radial-gradient(1000px circle at 5% 5%, rgba(220, 38, 38, 0.08), transparent 55%),
		radial-gradient(800px circle at 95% 95%, rgba(239, 68, 68, 0.05), transparent 60%),
		linear-gradient(180deg, #0b111e 0%, #0f172a 100%);
	color: #f8fafc;
}

/* =====================================================
   AUTH & LOGIN SCREENS
   ===================================================== */

.erp-auth {
	display: grid;
	grid-template-columns: 1.1fr minmax(320px, 460px);
	gap: 28px;
	min-height: 100vh;
	padding: 28px;
	background:
		radial-gradient(900px circle at 15% 15%, rgba(200, 16, 46, 0.06), transparent 55%),
		radial-gradient(700px circle at 85% 85%, rgba(220, 38, 38, 0.04), transparent 65%),
		#f8fafc;
}

.erp-panel,
.erp-card {
	background: var(--surface);
	border: 1px solid var(--surface-border);
	box-shadow: var(--shadow-lg);
	border-radius: var(--radius-xl);
}

.erp-panel {
	padding: clamp(26px, 4vw, 54px);
	position: relative;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	border-left: 6px solid var(--brand-crimson);
}

.erp-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	border-radius: 999px;
	border: 1px solid var(--accent-red-border);
	background: var(--accent-red-soft);
	padding: 6px 14px;
	font-size: 12px;
	font-weight: 600;
	color: var(--brand-crimson);
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.erp-chip::before {
	content: '';
	width: 8px;
	height: 8px;
	border-radius: 999px;
	background: var(--brand-crimson);
}

.erp-title {
	margin: 20px 0 14px;
	font-size: clamp(28px, 4vw, 56px);
	line-height: 1.08;
	letter-spacing: -0.03em;
	color: var(--text-main);
	max-width: 15ch;
	font-weight: 800;
}

.erp-subtitle {
	margin: 0;
	color: var(--text-muted);
	line-height: 1.75;
	max-width: 56ch;
	font-size: 15px;
}

.erp-grid {
	margin-top: 34px;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
}

.erp-stat {
	border-radius: var(--radius-md);
	border: 1px solid var(--surface-border);
	background: var(--surface);
	padding: 16px 18px;
	box-shadow: var(--shadow-sm);
}

.erp-stat strong {
	display: block;
	font-size: 24px;
	margin-bottom: 4px;
	color: var(--brand-crimson);
	font-weight: 800;
}

.erp-stat span {
	color: var(--text-muted);
	font-size: 13px;
}

.erp-card {
	padding: 32px;
	align-self: center;
	animation: rise 450ms ease-out;
}

.erp-brand {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 20px;
}

.erp-brand strong {
	font-size: 20px;
	letter-spacing: -0.02em;
	color: var(--text-main);
	font-weight: 800;
}

.erp-tag {
	font-family: 'JetBrains Mono', monospace;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.07em;
	text-transform: uppercase;
	color: var(--brand-crimson);
	background: var(--accent-red-soft);
	border: 1px solid var(--accent-red-border);
	border-radius: 999px;
	padding: 5px 10px;
}

.erp-card h1 {
	margin: 4px 0 8px;
	font-size: clamp(24px, 2vw, 30px);
	letter-spacing: -0.03em;
	color: var(--text-main);
	font-weight: 800;
}

.erp-card p {
	margin: 0 0 22px;
	color: var(--text-muted);
	line-height: 1.6;
	font-size: 14px;
}

.erp-alert {
	border: 1px solid var(--accent-red-border);
	background: var(--accent-red-soft);
	color: #991b1b;
	border-radius: var(--radius-md);
	padding: 12px 14px;
	margin-bottom: 16px;
	font-size: 13px;
	font-weight: 500;
	display: flex;
	align-items: center;
	gap: 8px;
}

.erp-form {
	display: grid;
	gap: 14px;
}

.erp-form-inline {
	grid-template-columns: minmax(240px, 1.8fr) repeat(2, minmax(160px, 1fr)) auto;
	align-items: end;
	max-width: 100%;
}

.erp-form-inline .erp-button {
	margin-top: 0;
	width: auto;
	min-width: 150px;
}

.erp-field label {
	display: block;
	margin-bottom: 6px;
	font-size: 12px;
	font-weight: 600;
	color: var(--text-body);
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.erp-input {
	width: 100%;
	border-radius: var(--radius-md);
	border: 1px solid var(--surface-border);
	background: var(--surface);
	color: var(--text-main);
	padding: 11px 13px;
	font-size: 14px;
	font-family: 'Sora', sans-serif;
	transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.erp-input::placeholder {
	color: var(--text-subtle);
}

.erp-input:focus {
	outline: none;
	border-color: var(--brand-crimson);
	box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.12);
	transform: translateY(-1px);
}

.erp-autocomplete {
	position: absolute;
	left: 0;
	right: 0;
	top: calc(100% + 6px);
	z-index: 30;
	border: 1px solid var(--surface-border);
	border-radius: var(--radius-md);
	background: var(--surface);
	box-shadow: var(--shadow-lg);
	overflow: hidden;
}

.erp-autocomplete-item {
	display: flex;
	flex-direction: column;
	gap: 3px;
	width: 100%;
	padding: 11px 14px;
	border: 0;
	border-bottom: 1px solid var(--surface-border-subtle);
	background: var(--surface);
	color: var(--text-main);
	text-align: left;
	cursor: pointer;
	font-family: 'Sora', sans-serif;
	transition: background 150ms ease;
}

.erp-autocomplete-item:last-child {
	border-bottom: 0;
}

.erp-autocomplete-item:hover,
.erp-autocomplete-item:focus-visible {
	background: var(--accent-red-soft);
	color: var(--brand-crimson);
	outline: none;
}

.erp-autocomplete-item strong {
	font-size: 13px;
	font-weight: 600;
}

.erp-autocomplete-item span {
	font-size: 12px;
	color: var(--text-muted);
}

.erp-options {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 2px;
	gap: 10px;
}

.erp-topbar-head {
	display: inline-flex;
	align-items: center;
	gap: 10px;
}

.erp-menu-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: var(--radius-sm);
	border: 1px solid var(--surface-border);
	background: var(--surface);
	color: var(--text-body);
	cursor: pointer;
	transition: all 140ms ease;
}

.erp-menu-toggle:hover {
	background: var(--accent-red-soft);
	border-color: var(--accent-red-border);
	color: var(--brand-crimson);
}

.erp-menu-toggle svg {
	width: 17px;
	height: 17px;
}

.erp-checkbox {
	display: inline-flex;
	gap: 8px;
	align-items: center;
	font-size: 13px;
	color: var(--text-muted);
}

.erp-link {
	color: var(--brand-crimson);
	text-decoration: none;
	font-size: 13px;
	font-weight: 600;
}

.erp-link:hover {
	text-decoration: underline;
}

.erp-button {
	margin-top: 8px;
	border: 0;
	border-radius: var(--radius-md);
	width: 100%;
	padding: 12px 18px;
	font-weight: 700;
	letter-spacing: 0.02em;
	color: #ffffff;
	background: linear-gradient(135deg, var(--brand-crimson), var(--accent-cyan));
	box-shadow: 0 4px 12px rgba(200, 16, 46, 0.22);
	cursor: pointer;
	font-family: 'Sora', sans-serif;
	font-size: 14px;
	transition: transform 170ms ease, box-shadow 170ms ease, filter 170ms ease;
}

.erp-button:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 16px rgba(200, 16, 46, 0.32);
	filter: brightness(1.04);
}

.erp-button-ghost {
	background: var(--surface);
	border: 1px solid var(--surface-border);
	color: var(--text-body);
	box-shadow: var(--shadow-sm);
}

.erp-button-ghost:hover {
	background: var(--accent-red-soft);
	border-color: var(--accent-red-border);
	color: var(--brand-crimson);
	box-shadow: var(--shadow-md);
}

.erp-note {
	margin-top: 18px;
	font-size: 12px;
	color: var(--text-muted);
	text-align: center;
}

/* =====================================================
   APP SHELL — LAYOUT AUTENTICADO (SIDEBAR + MAIN)
   ===================================================== */

.erp-app {
	display: grid;
	grid-template-columns: 260px 1fr;
	height: 100vh;
	overflow: hidden;
	background: var(--bg-ink);
	transition: grid-template-columns 180ms ease, background-color 0.2s ease;
}

/* --- Sidebar --- */

.erp-sidebar {
	background: var(--surface);
	border-right: 1px solid var(--surface-border);
	display: flex;
	flex-direction: column;
	overflow-y: auto;
	box-shadow: 2px 0 8px rgba(0, 0, 0, 0.02);
	transition: min-width 180ms ease, width 180ms ease, background-color 0.2s ease, border-color 0.2s ease;
}

.erp-sidebar-brand {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 18px 16px;
	border-bottom: 1px solid var(--surface-border);
	flex-shrink: 0;
	background: var(--surface);
}

.erp-sidebar-brand strong {
	font-size: 17px;
	font-weight: 800;
	letter-spacing: -0.02em;
	color: var(--text-main);
}

.erp-nav {
	flex: 1;
	padding: 14px 10px;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.erp-nav-label {
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--text-subtle);
	padding: 12px 10px 6px;
	margin-top: 4px;
}

.erp-nav-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 12px;
	border-radius: var(--radius-md);
	border: 1px solid transparent;
	color: var(--text-muted);
	text-decoration: none;
	font-size: 13.5px;
	font-weight: 600;
	cursor: pointer;
	transition: all 140ms ease;
}

.erp-nav-item:hover {
	background: var(--accent-red-soft);
	color: var(--brand-crimson);
}

.erp-nav-item.active {
	background: var(--accent-red-soft);
	border-color: var(--accent-red-border);
	color: var(--brand-crimson);
	font-weight: 700;
}

.erp-nav-item svg {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
}

.erp-nav-sub {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding-left: 28px;
	margin-bottom: 4px;
}

.erp-nav-sub-item {
	display: block;
	padding: 7px 10px;
	border-radius: var(--radius-sm);
	color: var(--text-muted);
	text-decoration: none;
	font-size: 13px;
	font-weight: 500;
	border: 1px solid transparent;
	transition: all 140ms ease;
}

.erp-nav-sub-item:hover {
	background: var(--accent-red-soft);
	color: var(--brand-crimson);
}

.erp-nav-sub-item.active {
	background: var(--accent-red-soft);
	border-color: var(--accent-red-border);
	color: var(--brand-crimson);
	font-weight: 700;
}

.erp-sidebar-footer {
	padding: 14px 12px;
	border-top: 1px solid var(--surface-border);
	background: var(--surface);
	display: flex;
	flex-direction: column;
	gap: 10px;
	flex-shrink: 0;
}

/* Sidebar Recolhida */
.erp-app.erp-sidebar-collapsed {
	grid-template-columns: 72px 1fr;
}

.erp-app.erp-sidebar-collapsed .erp-sidebar {
	min-width: 72px;
}

.erp-app.erp-sidebar-collapsed .erp-sidebar-brand {
	justify-content: center;
	padding-left: 8px;
	padding-right: 8px;
}

.erp-app.erp-sidebar-collapsed .erp-sidebar-brand strong,
.erp-app.erp-sidebar-collapsed .erp-tag,
.erp-app.erp-sidebar-collapsed .erp-nav-label {
	display: none;
}

.erp-app.erp-sidebar-collapsed .erp-nav {
	padding-left: 8px;
	padding-right: 8px;
}

.erp-app.erp-sidebar-collapsed .erp-nav-item {
	justify-content: center;
	padding-left: 0;
	padding-right: 0;
	font-size: 0;
}

.erp-app.erp-sidebar-collapsed .erp-nav-item svg {
	width: 20px;
	height: 20px;
}

.erp-app.erp-sidebar-collapsed .erp-nav-sub,
.erp-app.erp-sidebar-collapsed .erp-sidebar-footer {
	display: none;
}

/* --- Main Content Area --- */

.erp-main {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: var(--bg-ink);
}

.erp-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 28px;
	border-bottom: 1px solid var(--surface-border);
	background: var(--surface);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
	flex-shrink: 0;
	transition: background-color 0.2s ease, border-color 0.2s ease;
}

.erp-topbar-title {
	font-size: 16px;
	font-weight: 700;
	letter-spacing: -0.02em;
	color: var(--text-main);
}

.erp-topbar-meta {
	font-size: 12px;
	color: var(--text-muted);
	margin-top: 2px;
}

.erp-content {
	flex: 1;
	overflow-y: auto;
	padding: 24px 28px;
}

/* Welcome Section */

.erp-welcome {
	background: var(--surface);
	border: 1px solid var(--surface-border);
	border-left: 5px solid var(--brand-crimson);
	border-radius: var(--radius-md);
	padding: 18px 22px;
	margin-bottom: 22px;
	box-shadow: var(--shadow-sm);
}

.erp-welcome h2 {
	margin: 0 0 4px;
	font-size: clamp(18px, 1.8vw, 24px);
	letter-spacing: -0.02em;
	color: var(--text-main);
	font-weight: 800;
}

.erp-welcome p {
	margin: 0;
	color: var(--text-muted);
	font-size: 13.5px;
	line-height: 1.5;
}

/* =====================================================
   TABELAS & LISTAGENS
   ===================================================== */

.erp-table-wrap {
	border: 1px solid var(--surface-border);
	border-radius: var(--radius-md);
	background: var(--surface);
	box-shadow: var(--shadow-sm);
	overflow: auto;
}

.erp-table-wrap-responsive {
	overflow-x: auto;
	overflow-y: hidden;
	max-width: 100%;
	-webkit-overflow-scrolling: touch;
}

.erp-table {
	width: 100%;
	border-collapse: collapse;
	min-width: 760px;
	background: var(--surface);
}

.erp-table th,
.erp-table td {
	text-align: left;
	padding: 11px 14px;
	border-bottom: 1px solid var(--surface-border-subtle);
	font-size: 13px;
}

.erp-table th {
	background: var(--bg-ink);
	color: var(--text-muted);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	font-size: 11px;
	border-bottom: 2px solid var(--surface-border);
}

.erp-table tbody tr {
	transition: background 120ms ease;
}

.erp-table tbody tr:hover {
	background: var(--accent-red-soft) !important;
}

.erp-table tbody tr:last-child td {
	border-bottom: 0;
}

.erp-sort-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: inherit;
	text-decoration: none;
	font-weight: 700;
}

.erp-sort-link:hover {
	color: var(--brand-crimson);
}

.erp-sort-link.active {
	color: var(--brand-crimson);
}

.erp-table-link {
	color: var(--brand-crimson);
	text-decoration: none;
	font-weight: 600;
}

.erp-table-link:hover {
	text-decoration: underline;
}

/* =====================================================
   PAGINAÇÃO & NAVEGAÇÃO
   ===================================================== */

.erp-pagination-wrap {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
}

.erp-pagination-surface {
	padding: 10px 14px;
	border-radius: var(--radius-md);
	border: 1px solid var(--surface-border);
	background: var(--surface);
	box-shadow: var(--shadow-sm);
}

.erp-pagination-summary {
	font-size: 12.5px;
	color: var(--text-muted);
	font-weight: 500;
}

.erp-pagination {
	display: inline-flex;
	gap: 6px;
	align-items: center;
}

.erp-page-link {
	border: 1px solid var(--surface-border);
	border-radius: var(--radius-sm);
	padding: 7px 11px;
	color: var(--text-body);
	text-decoration: none;
	font-size: 12px;
	font-weight: 600;
	background: var(--surface);
	transition: all 140ms ease;
}

.erp-page-link:hover {
	background: var(--accent-red-soft);
	border-color: var(--accent-red-border);
	color: var(--brand-crimson);
}

.erp-page-link.current {
	border-color: var(--brand-crimson);
	background: var(--brand-crimson);
	color: #ffffff;
}

.erp-page-link.disabled {
	opacity: 0.45;
	cursor: default;
	pointer-events: none;
}

/* =====================================================
   DASHBOARD & MÓDULOS
   ===================================================== */

.erp-kpi-row {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
	margin-bottom: 26px;
}

.erp-kpi {
	background: var(--surface);
	border: 1px solid var(--surface-border);
	border-left: 4px solid var(--brand-crimson);
	border-radius: var(--radius-md);
	padding: 16px 18px;
	display: flex;
	flex-direction: column;
	gap: 4px;
	box-shadow: var(--shadow-sm);
	transition: transform 160ms ease, box-shadow 160ms ease;
}

.erp-kpi:hover {
	transform: translateY(-2px);
	box-shadow: var(--shadow-md);
}

.erp-kpi-label {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--text-muted);
}

.erp-kpi-value {
	font-size: 24px;
	font-weight: 800;
	letter-spacing: -0.02em;
	color: var(--text-main);
}

.erp-module-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
	gap: 16px;
}

.erp-module-card {
	background: var(--surface);
	border: 1px solid var(--surface-border);
	border-radius: var(--radius-lg);
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	box-shadow: var(--shadow-sm);
	transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.erp-module-card:hover {
	border-color: var(--accent-red-border);
	transform: translateY(-3px);
	box-shadow: var(--shadow-lg);
}

.erp-module-icon {
	width: 42px;
	height: 42px;
	border-radius: var(--radius-md);
	background: var(--accent-red-soft);
	border: 1px solid var(--accent-red-border);
	display: flex;
	align-items: center;
	justify-content: center;
}

.erp-module-icon svg {
	width: 20px;
	height: 20px;
	stroke: var(--brand-crimson);
}

.erp-module-card-title {
	font-size: 16px;
	font-weight: 700;
	color: var(--text-main);
	letter-spacing: -0.02em;
}

.erp-module-screens {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.erp-module-screen-link {
	font-size: 13px;
	color: var(--text-muted);
	display: flex;
	align-items: center;
	gap: 7px;
	text-decoration: none;
	transition: color 130ms ease;
}

.erp-module-screen-link::before {
	content: '';
	width: 5px;
	height: 5px;
	border-radius: 999px;
	background: var(--brand-crimson);
	flex-shrink: 0;
}

.erp-module-screen-link:hover {
	color: var(--brand-crimson);
	font-weight: 600;
}

/* =====================================================
   TOPBAR STATUS & THEME TOGGLE STYLES
   ===================================================== */
.erp-topbar-actions {
	display: flex;
	align-items: center;
	gap: 12px;
}

.erp-topbar-status {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 12px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.01em;
	transition: all 0.2s ease;
	border: 1px solid transparent;
}

.erp-status-dot {
	width: 8px;
	height: 8px;
	border-radius: 999px;
	display: inline-block;
}

/* Online */
.erp-topbar-status-online {
	background: #f0fdf4;
	border-color: #bbf7d0;
	color: #15803d;
}
.erp-topbar-status-online .erp-status-dot {
	background: #16a34a;
	box-shadow: 0 0 8px rgba(22, 163, 74, 0.6);
	animation: erp-pulse 2s infinite;
}

/* Offline */
.erp-topbar-status-offline {
	background: #fef2f2;
	border-color: #fecaca;
	color: #b91c1c;
}
.erp-topbar-status-offline .erp-status-dot {
	background: #dc2626;
	box-shadow: 0 0 6px rgba(220, 38, 38, 0.4);
}

/* Checking */
.erp-topbar-status-checking {
	background: var(--surface);
	border-color: var(--surface-border);
	color: var(--text-muted);
}
.erp-topbar-status-checking .erp-status-dot {
	background: var(--text-subtle);
}

/* Dark Mode Status Overrides */
[data-theme="dark"] .erp-topbar-status-online,
body.erp-theme-dark .erp-topbar-status-online {
	background: rgba(22, 163, 74, 0.16);
	border-color: rgba(22, 163, 74, 0.35);
	color: #86efac;
}
[data-theme="dark"] .erp-topbar-status-offline,
body.erp-theme-dark .erp-topbar-status-offline {
	background: rgba(220, 38, 38, 0.16);
	border-color: rgba(220, 38, 38, 0.35);
	color: #fca5a5;
}
[data-theme="dark"] .erp-topbar-status-checking,
body.erp-theme-dark .erp-topbar-status-checking {
	background: rgba(255, 255, 255, 0.08);
	border-color: rgba(255, 255, 255, 0.15);
	color: #94a3b8;
}

/* Theme Toggle Button */
.erp-theme-toggle-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	border-radius: var(--radius-md);
	border: 1px solid var(--surface-border);
	background: var(--surface);
	color: var(--text-body);
	font-family: 'Sora', sans-serif;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
	transition: all 0.15s ease;
}

.erp-theme-toggle-btn:hover {
	background: var(--accent-red-soft);
	border-color: var(--accent-red-border);
	color: var(--brand-crimson);
	transform: translateY(-1px);
	box-shadow: 0 2px 5px rgba(200, 16, 46, 0.15);
}

[data-theme="dark"] .erp-theme-toggle-btn,
body.erp-theme-dark .erp-theme-toggle-btn {
	background: #1e293b;
	border-color: #334155;
	color: #e2e8f0;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .erp-theme-toggle-btn:hover,
body.erp-theme-dark .erp-theme-toggle-btn:hover {
	background: rgba(239, 68, 68, 0.15);
	border-color: rgba(239, 68, 68, 0.35);
	color: #f87171;
}

@keyframes erp-pulse {
	0%, 100% { transform: scale(1); opacity: 1; }
	50% { transform: scale(1.18); opacity: 0.75; }
}

/* Animations */
@keyframes rise {
	from {
		opacity: 0;
		transform: translateY(16px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 1080px) {
	.erp-kpi-row {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 860px) {
	.erp-app {
		grid-template-columns: 190px 1fr;
	}
	.erp-sidebar {
		min-width: 190px;
	}
}

@media (max-width: 640px) {
	.erp-auth {
		grid-template-columns: 1fr;
		padding: 14px;
	}
	.erp-app {
		grid-template-columns: 1fr;
	}
	.erp-sidebar {
		display: none;
	}
}
