:root {
	--wp-admin--admin-bar--height: 0px;
}

body.admin-bar {
	--wp-admin--admin-bar--height: 32px;
}

@media screen and (max-width: 782px) {
	body.admin-bar {
		--wp-admin--admin-bar--height: 46px;
	}
}

.msc-wrap,
.msc-wrap * {
	box-sizing: border-box;
}

.msc-wrap {
	width: 100%;
	font-family: var(--cfg-font);
}

.msc-topbar {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 20px;
	width: 100%;
	margin-bottom: 24px;
}
/* Título como el de las vistas v2 y Reportes: 40/400, -0,02 em (2026-11-21, petición del usuario). */

.msc-title {
	margin: 0;
	font-size: 40px;
	line-height: 1.05;
	font-weight: 400;
	letter-spacing: -0.02em;
	color: var(--cfg-text);
}

.msc-subtitle {
	margin: 6px 0 0;
	font-size: 13px;
	color: var(--cfg-text-soft);
}

.msc-save {
	background: var(--cfg-primary);
	border-color: var(--cfg-primary);
	color: #fff;
	border-radius: var(--a-radius);
	min-height: 40px;
	padding: 0 18px;
	box-shadow: none;
	cursor: pointer;
}

.msc-layout {
	display: grid;
	grid-template-columns: 260px minmax(0, 1fr);
	gap: 24px;
	align-items: start;
}

.msc-sidebar {
	width: 100%;
	min-width: 0;
	overflow-y: hidden;
	position: sticky;
	top: 16px;
	align-self: start;
}

.msc-nav {
	display: flex;
	flex-direction: column;
	gap: 6px;
	background: var(--cfg-surface);
	border: 1px solid var(--cfg-border);
	border-radius: var(--a-radius);
	padding: 12px;
}

.msc-nav-btn {
	display: flex;
	align-items: center;
	gap: 10px;
	text-decoration: none;
	padding: 10px 12px;
	border-radius: var(--a-radius);
	color: var(--cfg-text-muted);
	font-size: 14px;
	font-weight: 500;
	transition: .2s ease;
	outline: none;
	box-shadow: none;
	cursor: pointer;
}

.msc-nav-btn:hover {
	color: var(--cfg-text);
	background: var(--cfg-muted-bg);
}

.msc-nav-btn.active {
	background: var(--cfg-muted-bg);
	color: var(--cfg-primary);
	font-weight: 600;
}

.msc-nav-btn .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
}

.msc-content {
	display: flex;
	flex-direction: column;
	gap: 14px;
	width: 100%;
	min-width: 0;
}

.msc-panel {
	display: none;
	width: 100%;
}

.msc-panel.active {
	display: block;
}

.msc-notice {
	margin: 0 0 16px 0;
}

.msc-placeholder {
	background: var(--cfg-surface);
	border: 1px solid var(--cfg-border);
	border-radius: var(--a-radius);
	padding: 30px 24px;
	color: var(--cfg-text-soft);
}

.msc-card {
	background: var(--cfg-surface);
	border: 1px solid var(--cfg-border);
	border-radius: var(--a-radius);
	margin-bottom: 18px;
	overflow: hidden;
}

.msc-card-header {
	padding: 16px 20px;
	border-bottom: 1px solid var(--cfg-border);
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 14px;
}

.msc-card-header h3 {
	margin: 0;
	font-size: 16px;
	color: var(--cfg-text);
}

.msc-card-header p {
	margin: 3px 0 0;
	font-size: 12px;
	color: var(--cfg-text-muted);
}

.msc-card-body {
	padding: 18px 20px;
}

.msc-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 18px;
}

.msc-field-full {
	grid-column: 1 / -1;
}

.msc-field {
	margin-bottom: 14px;
	min-width: 0;
}

.msc-field label {
	display: block;
	margin-bottom: 6px;
	font-size: 12px;
	font-weight: 700;
	color: var(--cfg-text);
}

.msc-field input,
.msc-field select,
.msc-field textarea {
	width: 100%;
	min-height: 40px;
	border: 1px solid var(--cfg-border-2);
	background: var(--cfg-bg);
	border-radius: var(--a-radius);
	padding: 10px 12px;
	color: var(--cfg-text-soft);
	font-size: 13px;
	box-shadow: none;
}

.msc-field textarea {
	min-height: 86px;
	resize: vertical;
}

.msc-field input:focus,
.msc-field select:focus,
.msc-field textarea:focus {
	border-color: transparent;
	box-shadow: 0 0 0 1px var(--cfg-primary);
	background: var(--cfg-surface);
	outline: none;
}

.msc-color-row {
	display: flex;
	gap: 8px;
	align-items: center;
}

.msc-color-row input[type="color"] {
	width: 44px;
	min-height: 44px;
	padding: 3px;
	cursor: pointer;
	border-radius: var(--a-radius);
	flex-shrink: 0;
}

.msc-color-row input[type="text"] {
	flex: 1;
	font-family: monospace;
}

.msc-field-hint {
	margin: 5px 0 0;
	font-size: 11px;
	color: var(--cfg-text-muted);
}

.msc-logo-preview {
	width: 100%;
	height: 80px;
	border: 2px dashed var(--cfg-border-2);
	border-radius: var(--a-radius);
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--cfg-surface-2);
	overflow: hidden;
}

.msc-logo-preview img {
	max-height: 60px;
	max-width: 100%;
	object-fit: contain;
}

.msc-logo-empty {
	font-size: 12px;
	color: var(--cfg-text-muted);
}

.msc-media-btn {
	background: var(--cfg-surface);
	border: 1px solid var(--cfg-border-2);
	border-radius: var(--a-radius);
	padding: 0 14px;
	min-height: 40px;
	font-size: 13px;
	color: var(--cfg-text);
	cursor: pointer;
	white-space: nowrap;
	flex-shrink: 0;
}

.msc-media-btn:hover {
	background: var(--cfg-muted-bg);
}

.msc-reset-btn {
	background: var(--cfg-surface);
	border: 1px solid var(--cfg-border-2);
	border-radius: var(--a-radius);
	color: var(--cfg-text);
	cursor: pointer;
	font-size: 13px;
	font-weight: 700;
	min-height: 38px;
	padding: 0 14px;
	white-space: nowrap;
}

.msc-reset-btn:hover {
	background: var(--cfg-muted-bg);
}

.msc-color-preview {
	display: flex;
	gap: 8px;
	align-items: center;
	padding: 10px 12px;
	background: var(--cfg-bg);
	border: 1px solid var(--cfg-border-2);
	border-radius: var(--a-radius);
	min-height: 44px;
}

.msc-color-preview span {
	flex: 1;
	border-radius: var(--a-radius);
	padding: 6px 10px;
	font-size: 12px;
	font-weight: 600;
	text-align: center;
	transition: background .2s, color .2s;
}

.msc-cp-primary {
	background: var(--cfg-primary);
	color: #fff;
}

.msc-cp-secondary {
	background: var(--cfg-secondary);
	color: #fff;
}

.msc-cp-fondo {
	background: var(--cfg-bg);
	color: var(--cfg-text);
	border: 1px solid var(--cfg-border-2);
}

.msc-font-preview {
	padding: 12px;
	background: var(--cfg-surface-2);
	border: 1px solid var(--cfg-border);
	border-radius: var(--a-radius);
	font-size: 14px;
	color: var(--cfg-text);
	line-height: 1.5;
	transition: font-family .3s;
}

.msc-mode-group {
	display: flex;
	gap: 14px;
	flex-wrap: wrap;
}

.msc-mode-card {
	flex: 1;
	min-width: 140px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 18px 12px;
	border: 2px solid var(--cfg-border);
	border-radius: var(--a-radius);
	cursor: pointer;
	transition: border-color .2s, background .2s;
	background: var(--cfg-surface-2);
	text-align: center;
}

.msc-mode-card input[type="radio"] {
	display: none;
}

.msc-mode-card.selected {
	border-color: var(--cfg-primary);
	background: var(--cfg-muted-bg);
}

.msc-mode-icon {
	font-size: 26px;
	line-height: 1;
}

.msc-mode-card strong {
	font-size: 13px;
	color: var(--cfg-text);
}

.msc-mode-desc {
	font-size: 11px;
	color: var(--cfg-text-muted);
}

.msc-list {
	width: 100%;
}

.msc-list p {
	margin: 3px 0 0;
	font-size: 12px;
	color: var(--cfg-text-muted);
}

.msc-list strong {
	font-size: 13px;
	color: var(--cfg-text);
}

.msc-list-row,
.msc-session-row,
.msc-activity-row {
	padding: 14px 20px;
	border-bottom: 1px solid var(--cfg-border);
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 14px;
}

.msc-list-row:last-child,
.msc-session-row:last-child,
.msc-activity-row:last-child {
	border-bottom: none;
}

.msc-list-row>div,
.msc-session-row>div,
.msc-activity-row>div {
	min-width: 0;
}

.msc-list-row p,
.msc-list-row strong,
.msc-session-row p,
.msc-session-row strong,
.msc-activity-row p,
.msc-activity-row strong {
	overflow-wrap: anywhere;
}

.msc-session-row>div:nth-child(2) {
	flex: 1;
}

.msc-switch input {
	display: none;
}

.msc-switch span {
	width: 42px;
	height: 24px;
	background: var(--cfg-border-2);
	border-radius: var(--a-radius);
	display: block;
	position: relative;
	cursor: pointer;
	flex-shrink: 0;
}

.msc-switch span::before {
	content: "";
	width: 18px;
	height: 18px;
	background: var(--cfg-surface);
	border-radius: 50%;
	position: absolute;
	top: 3px;
	left: 3px;
	transition: left .2s ease;
}

.msc-switch input:checked+span {
	background: var(--cfg-muted-bg);
}

.msc-switch input:checked+span::before {
	left: 21px;
}

.msc-device-icon {
	width: 34px;
	height: 34px;
	background: var(--cfg-muted-bg);
	border-radius: var(--a-radius);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.msc-badge {
	font-size: 11px;
	font-weight: 700;
	padding: 5px 9px;
	border-radius: var(--a-radius);
	white-space: nowrap;
	flex-shrink: 0;
}

.msc-badge.ok {
	background: #dcfce7;
	color: #16a34a;
}

.msc-badge.info {
	background: var(--cfg-surface-2);
	color: var(--cfg-secondary);
}

.msc-danger-btn {
	border: 1px solid #fecdd3;
	background: #fff5f6;
	color: #e11d48;
	border-radius: var(--a-radius);
	padding: 8px 12px;
	font-weight: 700;
	font-size: 12px;
	cursor: pointer;
	flex-shrink: 0;
}

.msc-link {
	font-size: 12px;
	color: var(--cfg-secondary);
	text-decoration: none;
	font-weight: 700;
	white-space: nowrap;
}

@media (max-width: 1100px) {
	.msc-layout {
		grid-template-columns: 1fr;
	}

	.msc-sidebar {
		position: static;
	}

	.msc-nav {
		flex-direction: row;
		flex-wrap: wrap;
	}
}

@media (max-width: 980px) {
	.msc-grid {
		grid-template-columns: 1fr;
	}

	.msc-topbar {
		flex-direction: column;
		align-items: stretch;
	}

	.msc-list-row,
	.msc-session-row,
	.msc-activity-row {
		align-items: flex-start;
		flex-wrap: wrap;
		gap: 10px;
	}

	.msc-mode-group {
		flex-direction: column;
	}
}

/* Asegura que el panel de configuración se alinee arriba para que el sidebar sticky funcione */
.dashboard-view.active:has(.msc-wrap) {
	justify-content: flex-start;
	align-items: stretch;
	width: 100%;
}

/* =========================================================
   Seguridad — Contraseñas, 2FA, Sesiones y Registro de auditoría
   ========================================================= */
.msc-pass-wrapper {
	position: relative;
	display: flex;
	align-items: center;
	width: 100%;
}

/* Móvil: 32 px, como .v2-titulo (atenea-v2.css). */
@media (max-width: 640px) {
	.msc-title { font-size: 32px; }
}
.msc-pass-wrapper input {
	padding-right: 44px !important;
}

.msc-pass-toggle {
	position: absolute;
	right: 10px;
	top: 50%;
	transform: translateY(-50%);
	background: transparent;
	border: none !important;
	padding: 5px;
	cursor: pointer;
	color: var(--cfg-text-muted);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--a-radius-sm, 8px);
	transition: color .2s, box-shadow .2s;
	box-shadow: none !important;
	outline: none !important;
	z-index: 2;
}

.msc-pass-toggle:hover {
	color: var(--cfg-text);
	box-shadow: 0 0 0 2px rgba(89, 101, 121, 0.12) !important;
}

.msc-pass-toggle:focus-visible {
	box-shadow: 0 0 0 1px var(--cfg-primary) !important;
}

.msc-strength-meter {
	margin-top: 8px;
	display: flex;
	align-items: center;
	gap: 10px;
}

.msc-strength-track {
	flex: 1;
	height: 4px;
	background: var(--cfg-border-2);
	border-radius: 999px;
	overflow: hidden;
	position: relative;
}

.msc-strength-fill {
	height: 100%;
	width: 0%;
	transition: width .3s ease, background-color .3s ease;
	border-radius: 999px;
}

.msc-strength-text {
	font-size: 11px;
	font-weight: 600;
	color: var(--cfg-text-muted);
	min-width: 50px;
	text-align: right;
}

.msc-codes-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 10px;
	margin: 16px 0;
}

.msc-code-chip {
	background: var(--cfg-surface-2);
	border: 1px solid var(--cfg-border);
	border-radius: var(--a-radius);
	padding: 10px 14px;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 13px;
	font-weight: 600;
	color: var(--cfg-text);
	text-align: center;
	letter-spacing: 1px;
	user-select: all;
}

.msc-modal-box {
	max-width: 580px;
	width: 92%;
	background: var(--cfg-surface);
	border: 1px solid var(--cfg-border);
	border-radius: var(--a-radius);
	padding: 24px;
	box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.12), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
	color: var(--cfg-text);
	position: relative;
	margin: auto;
}

.msc-modal-box h3 {
	margin: 0 0 6px 0;
	font-size: 17px;
	color: var(--cfg-text);
}

.msc-modal-box p {
	margin: 0 0 16px 0;
	font-size: 13px;
	color: var(--cfg-text-muted);
	line-height: 1.5;
}

.msc-modal-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	margin-bottom: 16px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--cfg-border);
}

.msc-modal-close {
	background: transparent;
	border: none !important;
	color: var(--cfg-text-muted);
	cursor: pointer;
	padding: 4px;
	border-radius: var(--a-radius-sm, 8px);
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: none !important;
}

.msc-modal-close:hover {
	color: var(--cfg-text);
	box-shadow: 0 0 0 2px rgba(89, 101, 121, 0.15) !important;
}

.msc-modal-close:focus-visible {
	box-shadow: 0 0 0 1px var(--cfg-primary) !important;
}

.msc-modal-actions {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	margin-top: 20px;
	padding-top: 16px;
	border-top: 1px solid var(--cfg-border);
	flex-wrap: wrap;
}

.msc-audit-search {
	margin-bottom: 14px;
	width: 100%;
}

.msc-audit-scroll {
	max-height: 380px;
	overflow-y: auto;
	border: 1px solid var(--cfg-border);
	border-radius: var(--a-radius);
}

.msc-device-icon svg {
	width: 18px;
	height: 18px;
	stroke: var(--cfg-text);
}
