/* ----------------------------------------------------------------
	Custom CSS

	Add all your Custom Styled CSS here for New Styles or
	Overwriting Default Theme Styles for Better Handling Updates
-----------------------------------------------------------------*/

:root {
	--admin-bg: #f7f8fc;
	--admin-surface: #ffffff;
	--admin-border: #e8ebf2;
	--admin-title: #1d2433;
	--admin-text: #4b5567;
	--admin-accent: #0f6fff;
	--admin-accent-soft: #eaf2ff;
	--admin-success: #157347;
	--admin-warning: #b7791f;
	--admin-muted: #6c7788;
}

body.admin-body {
	font-family: "Inter", sans-serif;
	background: linear-gradient(180deg, #f4f7ff 0%, #f8f9fc 100%);
	color: var(--admin-text);
	margin: 0;
	padding: 0;
}

.admin-shell {
	min-height: 100vh;
}

.admin-sidebar {
	background: var(--admin-surface);
	border-right: 1px solid var(--admin-border);
	min-height: auto;
	position: relative;
	padding: 1.5rem 1rem;
}

.admin-brand {
	font-weight: 700;
	color: var(--admin-title);
	margin-bottom: 1.5rem;
	letter-spacing: 0.02em;
}

.admin-nav-link {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	border-radius: 0.6rem;
	padding: 0.65rem 0.75rem;
	margin-bottom: 0.35rem;
	color: var(--admin-text);
	text-decoration: none;
	font-weight: 500;
}

.admin-nav-link:hover {
	background: #f5f7fb;
	color: var(--admin-title);
}

.admin-nav-link.active {
	background: var(--admin-accent-soft);
	color: var(--admin-accent);
}

.admin-main {
	padding: 1.25rem;
}

.admin-topbar {
	background: var(--admin-surface);
	border: 1px solid var(--admin-border);
	border-radius: 0.85rem;
	padding: 0.95rem 1rem;
	margin-bottom: 1rem;
}

.admin-page-title {
	margin: 0;
	color: var(--admin-title);
	font-size: 1.15rem;
	font-weight: 600;
}

.admin-card {
	background: var(--admin-surface);
	border: 1px solid var(--admin-border);
	border-radius: 0.85rem;
	box-shadow: 0 10px 22px rgba(17, 24, 39, 0.04);
}

.status-badge {
	border-radius: 999px;
	padding: 0.18rem 0.6rem;
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	border: 1px solid transparent;
}

.status-bot {
	background: #ecfdf3;
	color: var(--admin-success);
	border-color: #c7efd8;
}

.status-human {
	background: #fff7eb;
	color: var(--admin-warning);
	border-color: #ffe1b6;
}

.status-closed {
	background: #eef1f6;
	color: var(--admin-muted);
	border-color: #dce3ed;
}

/* Status-tinted backgrounds */
.chat-shell.shell-bot,
.conv-card-bot {
	background: #f4fdf7 !important;
	border-color: #d4edda !important;
}

.chat-shell.shell-human,
.conv-card-human {
	background: #fffbf4 !important;
	border-color: #ffe8c4 !important;
}

.chat-shell.shell-closed,
.conv-card-closed {
	background: #f5f6fa !important;
	border-color: #dce3ed !important;
}

/* Inbox */
.inbox-contact-name {
	color: #1d2433;
}

.inbox-contact-number {
	color: #4b5567;
}

.inbox-last-message {
	color: #6c7788;
	font-size: 0.9rem;
}

.inbox-needs-help {
	color: #b42318;
	font-size: 0.9rem;
}

/* Inbox actions */
.inbox-actions {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 0.5rem;
	margin-left: auto;
}

.inbox-open-chat-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 112px;
	padding-right: 1.4rem;
}

.inbox-actions form {
	margin: 0;
}

/* Unread dots */
.unread-dot {
	position: absolute;
	top: 7px;
	right: 7px;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	pointer-events: none;
}

.unread-dot-hidden {
	display: none;
}

.unread-dot-red {
	background: #dc3545;
	box-shadow: 0 0 0 2px #fff, 0 0 6px rgba(220, 53, 69, 0.5);
}

.unread-dot-orange {
	background: #f59e0b;
	box-shadow: 0 0 0 2px #fff, 0 0 6px rgba(245, 158, 11, 0.4);
}

@media (max-width: 767.98px) {
	.inbox-actions {
		width: 100%;
		justify-content: flex-start;
	}
}

/* Chat */
.chat-shell {
	display: grid;
	grid-template-rows: auto 1fr auto;
	min-height: calc(100vh - 170px);
}

.chat-meta {
	border-bottom: 1px solid var(--admin-border);
	padding-bottom: 0.85rem;
	margin-bottom: 0.95rem;
}

.chat-messages {
	overflow-y: auto;
	padding-right: 0.25rem;
	max-height: calc(100vh - 360px);
}

.bubble {
	max-width: 78%;
	border-radius: 0.8rem;
	padding: 0.65rem 0.8rem;
	margin-bottom: 0.65rem;
	line-height: 1.4;
}

.bubble-body {
	white-space: pre-wrap;
}

.bubble-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 0.25rem;
}

.bubble-time {
	font-size: 0.7rem;
	color: var(--admin-muted);
	white-space: nowrap;
}

.bubble-user {
	background: #f3f6fb;
	margin-right: auto;
	color: #2f3a4b;
}

.bubble-bot {
	background: #eef7ff;
	margin-left: auto;
	color: #0f4d8a;
}

.bubble-human {
	background: #ecfdf3;
	margin-left: auto;
	color: #175b37;
}

.bubble-system {
	background: #fff7eb;
	margin: 0 auto 0.65rem auto;
	color: #9a630e;
	max-width: 90%;
	text-align: center;
}

.bubble-has-debug {
	border: 1px dashed rgba(154, 99, 14, 0.3);
}

.debug-toggle {
	border: 0;
	background: transparent;
	color: #9a630e;
	cursor: pointer;
	line-height: 1;
	font-size: 0.95rem;
	padding: 0;
}

.debug-context {
	margin-top: 0.5rem;
	padding: 0.55rem 0.65rem;
	border-radius: 0.5rem;
	background: rgba(255, 255, 255, 0.6);
	border: 1px solid rgba(154, 99, 14, 0.25);
	text-align: left;
	font-size: 0.78rem;
	line-height: 1.35;
	word-break: break-word;
}

.composer-form {
	border-top: 1px solid var(--admin-border);
	margin-top: 0.85rem;
	padding-top: 0.9rem;
}

/* Admin overrides: aislar el panel de reglas globales del theme */
#wrapper.admin-shell {
	float: none !important;
	width: 100% !important;
	min-height: 100vh;
	overflow: visible !important;
}

#wrapper.admin-shell::before,
#wrapper.admin-shell::after {
	display: none !important;
	content: none !important;
}

.admin-shell .container-fluid {
	max-width: none !important;
	padding: 0 !important;
	margin: 0 !important;
}

.admin-shell .row {
	margin: 0 !important;
}

.admin-shell .admin-main {
	position: relative;
	z-index: 2;
	display: block !important;
}

.admin-shell .admin-main > * {
	clear: both;
}

@media (max-width: 991px) {
	.admin-sidebar {
		border-right: 0;
		border-bottom: 1px solid var(--admin-border);
	}
}

