/* weomail.com - backoffice styles */

@font-face {
	font-family: 'Roboto';
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url('../../../includes/fonts/roboto/roboto-latin.woff2') format('woff2');
}

@font-face {
	font-family: 'Roboto';
	font-style: normal;
	font-weight: 500;
	font-display: swap;
	src: url('../../../includes/fonts/roboto/roboto-latin.woff2') format('woff2');
}

@font-face {
	font-family: 'Roboto';
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: url('../../../includes/fonts/roboto/roboto-latin.woff2') format('woff2');
}

@font-face {
	font-family: 'Roboto';
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url('../../../includes/fonts/roboto/roboto-latin.woff2') format('woff2');
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	padding: 0;
	font-family: 'Roboto', "Segoe UI", Arial, Helvetica, sans-serif;
	background: #f4f6f8;
	color: #2b2f33;
	font-size: 14px;
	font-weight: 400;
}

a {
	color: #2563a8;
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

#topbar {
	background: linear-gradient(180deg, #26374c 0%, #19232f 100%);
	color: #ffffff;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
	position: sticky;
	top: 0;
	z-index: 100;
}

.topbar-inner {
	max-width: 1400px;
	margin: 0 auto;
	padding: 0 20px;
	height: 58px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	position: relative;
}

.brand {
	display: flex;
	align-items: center;
	gap: 10px;
	color: #ffffff;
	flex-shrink: 0;
}

.brand:hover {
	text-decoration: none;
}

.brand-mark {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 7px;
	background: #4a90d9;
	color: #ffffff;
	font-weight: 700;
	font-size: 15px;
	flex-shrink: 0;
}

.brand-text {
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 0.2px;
	white-space: nowrap;
}

.nav {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	flex: 1;
	min-width: 0;
	gap: 16px;
}

.nav-main {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

.nav-main li a,
.nav-user li a {
	display: flex;
	align-items: center;
	gap: 7px;
	color: #b7c3d1;
	font-size: 13px;
	font-weight: 500;
	padding: 8px 12px;
	border-radius: 6px;
	transition: background 0.15s ease, color 0.15s ease;
	white-space: nowrap;
}

.nav-main li a svg,
.nav-user li a svg {
	flex-shrink: 0;
}

.nav-main li a:hover {
	color: #ffffff;
	background: rgba(255, 255, 255, 0.09);
	text-decoration: none;
}

.nav-main li.active a {
	color: #ffffff;
	background: rgba(74, 144, 217, 0.25);
}

.nav-main li.active a svg {
	color: #7cb8ef;
}

.nav-user {
	list-style: none;
	margin: 0;
	padding: 0 0 0 16px;
	border-left: 1px solid rgba(255, 255, 255, 0.14);
	display: flex;
	flex-shrink: 0;
}

.nav-user li a:hover {
	color: #ffffff;
	background: rgba(199, 66, 54, 0.3);
	text-decoration: none;
}

.nav-toggle {
	display: none;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	background: transparent;
	border: none;
	color: #ffffff;
	cursor: pointer;
	border-radius: 6px;
	flex-shrink: 0;
}

.nav-toggle:hover {
	background: rgba(255, 255, 255, 0.1);
}

/* Responsive: tablet and below */
@media (max-width: 860px) {
	.nav-toggle {
		display: flex;
	}

	.nav {
		position: absolute;
		top: 58px;
		left: 0;
		right: 0;
		background: #1a2734;
		flex-direction: column;
		align-items: stretch;
		justify-content: flex-start;
		gap: 0;
		max-height: 0;
		overflow: hidden;
		transition: max-height 0.2s ease;
	}

	.nav.open {
		max-height: 480px;
		box-shadow: 0 6px 10px rgba(0, 0, 0, 0.3);
	}

	.nav-main,
	.nav-user {
		flex-direction: column;
		width: 100%;
		gap: 0;
		padding: 8px 12px;
	}

	.nav-user {
		border-left: none;
		border-top: 1px solid rgba(255, 255, 255, 0.14);
	}

	.nav-main li a,
	.nav-user li a {
		padding: 12px 8px;
		border-radius: 4px;
	}
}

/* Responsive: phones */
@media (max-width: 600px) {
	.topbar-inner {
		padding: 0 14px;
	}

	.brand-text {
		font-size: 13px;
	}

	#content {
		padding: 0 12px;
		margin: 16px auto;
	}

	.panel {
		padding: 14px;
	}

	table.list {
		display: block;
		overflow-x: auto;
		white-space: nowrap;
	}

	.editor-toolbar-actions {
		width: 100%;
	}

	.template-card {
		width: 100%;
	}

	#gjs {
		overflow-x: auto;
	}
}

#content {
	max-width: 1400px;
	margin: 24px auto;
	padding: 0 20px;
}

.panel {
	background: #ffffff;
	border: 1px solid #dde2e7;
	border-radius: 6px;
	padding: 20px;
	margin-bottom: 20px;
}

.panel h1, .panel h2 {
	margin-top: 0;
}

table.list {
	width: 100%;
	border-collapse: collapse;
	background: #ffffff;
}

table.list th, table.list td {
	text-align: left;
	padding: 8px 10px;
	border-bottom: 1px solid #eaecef;
	font-size: 13px;
}

table.list th {
	background: #f0f2f5;
	font-weight: 600;
}

table.list th a {
	color: inherit;
	text-decoration: none;
}

table.list th a:hover {
	text-decoration: underline;
}

table.list tr:hover td {
	background: #f7f9fb;
}

form.form input[type="text"],
form.form input[type="email"],
form.form input[type="password"],
form.form select,
form.form textarea {
	width: 100%;
	max-width: 380px;
	padding: 7px 9px;
	border: 1px solid #ccd2d8;
	border-radius: 4px;
	font-size: 13px;
	line-height: 18px;
	margin-bottom: 12px;
}

form.form select {
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	background-color: #ffffff;
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M0 0 L5 6 L10 0 Z' fill='%236b7280'/></svg>");
	background-repeat: no-repeat;
	background-position: right 10px center;
	padding-right: 28px;
}

form.form label {
	display: block;
	font-weight: 600;
	margin-bottom: 4px;
}

.btn {
	display: inline-block;
	background: #2563a8;
	color: #ffffff;
	border: none;
	border-radius: 4px;
	padding: 8px 16px;
	font-size: 13px;
	cursor: pointer;
}

.btn:hover {
	background: #1d4f87;
	text-decoration: none;
}

.btn.btn-danger {
	background: #b3372c;
}

.btn.btn-danger:hover {
	background: #8f2c23;
}

.msg-error {
	background: #fdecea;
	border: 1px solid #f5c2bd;
	color: #9c2c22;
	padding: 10px 14px;
	border-radius: 4px;
	margin-bottom: 16px;
}

.msg-success {
	background: #eaf7ec;
	border: 1px solid #bfe3c4;
	color: #1e6b2c;
	padding: 10px 14px;
	border-radius: 4px;
	margin-bottom: 16px;
}

#errorbox {
	max-width: 480px;
	margin: 80px auto;
	background: #ffffff;
	border: 1px solid #dde2e7;
	border-radius: 6px;
	padding: 24px;
	text-align: center;
}

.filter-row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	margin-bottom: 16px;
}

.filter-row input[type="text"],
.filter-row select,
.filter-row .btn {
	height: 36px !important;
	line-height: 36px !important;
	padding-top: 0 !important;
	padding-bottom: 0 !important;
	margin-bottom: 0 !important;
	box-sizing: border-box !important;
	vertical-align: middle;
}

.filter-row input[type="text"],
.filter-row select {
	width: auto;
}

.filter-row .btn {
	padding-left: 16px !important;
	padding-right: 16px !important;
	border: none;
}

.client-filter-row input[type="text"] {
	width: 190px !important;
}

.client-filter-row select[name="unsubscribed"] {
	width: 140px !important;
}

.pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 14px;
}

.pagination a {
	display: inline-block;
	padding: 5px 10px;
	border: 1px solid #ccd2d8;
	border-radius: 4px;
	color: #2b2f33;
}

.pagination a.current {
	background: #2563a8;
	border-color: #2563a8;
	color: #ffffff;
	text-decoration: none;
}

.pagination-ellipsis {
	display: inline-block;
	padding: 5px 4px;
	color: #8a8f94;
}

.checkbox-group {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 18px;
	border: 1px solid #eaecef;
	border-radius: 4px;
	padding: 10px 12px;
	margin-bottom: 14px;
}

.checkbox-item {
	display: flex;
	align-items: center;
	font-weight: normal;
	margin-bottom: 0;
	gap: 6px;
}

.checkbox-item input[type="checkbox"],
.checkbox-item input[type="radio"] {
	width: auto;
}

/* modules/settings */

.form-section {
	margin-bottom: 28px;
	padding-bottom: 24px;
	border-bottom: 1px solid #eaecef;
}

.form-section:last-of-type {
	border-bottom: none;
	margin-bottom: 8px;
	padding-bottom: 0;
}

.form-section h2 {
	font-size: 14px;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	color: #6b7280;
	margin: 0 0 14px 0;
}

.form-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 4px 32px;
}

.field-span-2 {
	grid-column: 1 / -1;
}

.field label {
	display: block;
	font-weight: 600;
	margin-bottom: 4px;
}

.field-hint {
	font-size: 12px;
	color: #8a8f94;
	margin: -8px 0 12px;
}

.field-hint-label {
	font-weight: normal !important;
	font-size: 12px;
	color: #6b7280;
}

.form-actions {
	display: flex;
	gap: 10px;
	margin-top: 8px;
}

.settings-last-test {
	margin-top: 16px;
	font-size: 12px;
	color: #8a8f94;
}

@media (max-width: 700px) {
	.form-grid {
		grid-template-columns: 1fr;
	}
}

/* modules/content - editor GrapesJS */

.editor-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	align-items: flex-end;
	margin-bottom: 16px;
}

.editor-toolbar > div {
	display: flex;
	flex-direction: column;
}

.editor-toolbar label {
	font-weight: 600;
	margin-bottom: 4px;
	font-size: 12px;
}

.editor-toolbar input[type="text"],
.editor-toolbar select {
	padding: 7px 9px;
	border: 1px solid #ccd2d8;
	border-radius: 4px;
	font-size: 13px;
	min-width: 220px;
}

.editor-toolbar-actions {
	display: flex;
	align-items: center;
	gap: 10px;
}

#save-status {
	font-size: 12px;
}

.save-status-ok {
	color: #1e6b2c;
}

.save-status-error {
	color: #9c2c22;
}

#gjs {
	border: 1px solid #dde2e7;
	border-radius: 4px;
}

/* o seletor de dispositivos embutido do preset newsletter (Desktop/Tablet/
   Mobile portrait) serve para pre-visualizacao responsiva - agora registados
   no deviceManager para funcionar; coexiste com o .width-switch abaixo, que
   define a largura real e guardada da tabela do email */

.width-switch {
	display: flex;
	gap: 4px;
}

.width-switch-btn {
	background: #ffffff;
	border: 1px solid #ccd2d8;
	border-radius: 4px;
	padding: 7px 10px;
	font-size: 12px;
	cursor: pointer;
	color: #2b2f33;
}

.width-switch-btn:hover {
	border-color: #2563a8;
}

.width-switch-btn.active {
	background: #2563a8;
	border-color: #2563a8;
	color: #ffffff;
}

/* modules/content - galeria de templates */

.template-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin-bottom: 20px;
}

.template-card {
	display: block;
	width: 200px;
	border: 1px solid #dde2e7;
	border-radius: 6px;
	padding: 12px;
	color: #2b2f33;
	text-decoration: none;
	background: #ffffff;
}

.template-card:hover {
	border-color: #2563a8;
	text-decoration: none;
}

.template-thumb {
	height: 110px;
	background: #f0f2f5;
	border-radius: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	font-size: 12px;
	color: #8a8f94;
	padding: 8px;
	margin-bottom: 8px;
	overflow: hidden;
}

.template-thumb-blank {
	font-size: 32px;
	color: #2563a8;
}

.template-card-name {
	font-weight: 600;
	font-size: 13px;
}

.template-card-category {
	font-size: 11px;
	color: #8a8f94;
	margin-top: 2px;
}
/* modules/campaign - ficha de campanha */

.campaign-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 360px);
	gap: 20px;
	align-items: start;
}

.campaign-layout .panel {
	margin-bottom: 20px;
}

@media (max-width: 900px) {
	.campaign-layout {
		grid-template-columns: 1fr;
	}
}

.campaign-preview-frame {
	width: 100%;
	height: 600px;
	border: 1px solid #dde2e7;
	border-radius: 4px;
	background: #f7f9fb;
}

.status-badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 12px;
	font-size: 12px;
	font-weight: 600;
}

.status-badge-draft {
	background: #eef0f2;
	color: #4b5563;
}

.status-badge-scheduled {
	background: #e0ecfb;
	color: #1d4c8a;
}

.status-badge-sending {
	background: #fdf1d6;
	color: #92650a;
}

.status-badge-sent {
	background: #dff3e3;
	color: #1e6b2c;
}

.status-badge-cancelled {
	background: #fbe1df;
	color: #9c2c22;
}

.status-badge-delivered {
	background: #dff3e3;
	color: #1e6b2c;
}

.status-badge-opened {
	background: #e0ecfb;
	color: #1d4c8a;
}

.status-badge-clicked {
	background: #ece3fb;
	color: #4a1d8a;
}

.status-badge-not_delivered {
	background: #fbe1df;
	color: #9c2c22;
}

.status-badge-bounced {
	background: #fde3cf;
	color: #9c4a0a;
}

.status-badge-complaint {
	background: #f8d1d6;
	color: #8a0a1f;
}

.status-badge-unknown, .status-badge-pending_check {
	background: #eef0f2;
	color: #6b7280;
}

.delivery-stats-row {
	display: grid;
	grid-template-columns: 170px 1fr 50px;
	align-items: center;
	gap: 10px;
	font-size: 13px;
	margin-bottom: 8px;
}

.delivery-bar-track {
	background: #eef0f2;
	border-radius: 4px;
	height: 14px;
	overflow: hidden;
}

.delivery-bar-fill {
	height: 100%;
	border-radius: 4px;
	background: #8a8f94;
}

.delivery-bar-fill-delivered { background: #2e8b57; }
.delivery-bar-fill-opened { background: #2563a8; }
.delivery-bar-fill-clicked { background: #6a3fbf; }
.delivery-bar-fill-not_delivered { background: #c0392b; }
.delivery-bar-fill-bounced { background: #d35400; }
.delivery-bar-fill-complaint { background: #b3001b; }
.delivery-bar-fill-unknown { background: #8a8f94; }
.delivery-bar-fill-pending_check { background: #cbd3da; }

/* ficha de detalhe (campanha, cliente) - cabecalho */
.detail-header {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 16px;
}

.detail-header h1 {
	margin: 0;
}

.detail-meta-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: 14px;
	padding: 14px 16px;
	background: #f7f9fb;
	border: 1px solid #eef0f2;
	border-radius: 6px;
	margin-bottom: 16px;
}

.detail-meta-item {
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.detail-meta-label {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: #9aa1a9;
}

.detail-meta-value {
	font-size: 14px;
	color: #1f2937;
	font-weight: 500;
}

.detail-meta-empty {
	font-size: 13px;
	color: #9aa1a9;
	font-style: italic;
}

.detail-tags-row {
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin: 44px 0;
}

.detail-tags-group {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.tag-pill-group {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.tag-pill {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 12px;
	font-size: 12px;
	font-weight: 600;
	background: #e0ecfb;
	color: #1d4c8a;
}

.tag-pill-alt {
	background: #ece3fb;
	color: #4a1d8a;
}

.detail-header-actions {
	margin-top: 8px;
}

.campaign-layout-single {
	grid-template-columns: 1fr;
}

/* informacao de auditoria (criado/actualizado) - campanhas, conteudos, clientes */
.audit-info {
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-size: 12px;
	color: #6b7280;
	margin: 10px 0;
}

.audit-info-line {
	padding-left: 10px;
	border-left: 2px solid #d7dce2;
}

.audit-info-line strong {
	color: #374151;
	font-weight: 600;
}

.audit-info-date {
	color: #9aa1a9;
}