@import url("main.css");

.login-overlay {
	position: fixed;
	inset: 0;
	background: #0c1b45;
	display: flex;
	align-items: stretch;
	justify-content: center;
	padding: 60px 0 60px 80px;
	z-index: 60;
}

.login-overlay.is-hidden {
	display: none;
}

.login-panel {
	flex: 1;
	display: grid;
	grid-template-columns: 1.2fr 1fr;
	gap: 60px;
	align-items: center;
	color: #ffffff;
	width: 100%;
	padding-right: 80px;
}

.login-left {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.login-logo {
	width: 150px;
	height: auto;
	margin-bottom: 30px;
}

.login-title {
	margin: 0;
	font-size: 30px;
	font-weight: 600;
}

.login-subtitle {
	margin: 0;
	font-size: 14px;
	color: rgba(255, 255, 255, 0.72);
}

.login-card {
	background: #ffffff;
	color: #1f2a44;
	border-radius: 16px;
	padding: 26px 28px;
	box-shadow: 0 18px 40px rgba(8, 18, 48, 0.32);
	justify-self: end;
	width: 460px;
	max-width: 100%;
}

.login-card-title {
	margin: 0 0 4px;
	font-size: 20px;
}

.login-card-subtitle {
	margin: 0 0 18px;
	color: #7d88a5;
	font-size: 13px;
}

.login-form {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.login-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-size: 12px;
	color: #7d88a5;
}

.login-input {
	height: 40px;
	border-radius: 10px;
	border: 1px solid #e1e6f2;
	padding: 0 12px;
	font-size: 13px;
	outline: none;
}

.login-input:focus {
	border-color: #6e8bff;
	box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.16);
}

.login-error {
	min-height: 16px;
	font-size: 12px;
	color: #d14343;
}

.login-button {
	height: 40px;
	border-radius: 10px;
	border: none;
	background: var(--color-primary);
	color: #ffffff;
	font-weight: 600;
	cursor: pointer;
}

.login-button:hover {
	background: var(--color-primary-hover);
}

.login-footer {
	position: absolute;
	left: 80px;
	bottom: 40px;
	font-size: 11px;
	color: rgba(255, 255, 255, 0.6);
}

.form-header-actions {
	display: flex;
	align-items: center;
	gap: 12px;
}

.form-active-field {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
	color: var(--color-text-muted);
	white-space: nowrap;
}

.input--checkbox {
	width: 16px;
	height: 16px;
}

.record-overlay {
	position: absolute;
	inset: 0;
	background: rgba(30, 41, 59, 0.32);
	display: none;
	align-items: flex-start;
	justify-content: center;
	padding-top: 80px;
	z-index: 55;
}

.record-overlay.is-open {
	display: flex;
}

.record-panel {
	width: min(860px, 92vw);
	max-height: 82vh;
	background: var(--color-surface);
	border-radius: 16px;
	padding: 22px 24px;
	box-shadow: 0 22px 44px rgba(30, 41, 59, 0.2);
	overflow: auto;
	transform: translateY(18px);
	opacity: 0;
	transition: transform 0.3s ease, opacity 0.3s ease;
}

.record-overlay.is-open .record-panel {
	transform: translateY(0);
	opacity: 1;
}

.record-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 18px;
}

.record-title {
	margin: 0 0 6px;
	font-size: 22px;
	color: var(--color-text);
}

.record-subtitle {
	margin: 0;
	color: var(--color-text-muted);
	font-size: 13px;
}

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

.record-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 12px;
}

.record-field {
	background: #fbfcff;
	border: 1px solid var(--color-border);
	border-radius: 12px;
	padding: 12px 14px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-height: 70px;
}

.record-label {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--color-text-muted);
}

.record-value {
	font-size: 14px;
	color: var(--color-text);
	word-break: break-word;
}

.record-layout {
	display: grid;
	grid-template-columns: 260px 1fr;
	gap: 20px;
}

.record-layout--account {
	grid-template-columns: 260px 1fr;
}

.record-side {
	background: transparent;
	padding: 4px 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.record-avatar {
	width: 120px;
	height: 120px;
	border-radius: 50%;
	background: #eef2ff;
	color: #51619a;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 28px;
	font-weight: 600;
}

.record-avatar--square {
	border-radius: 18px;
}

.record-name {
	font-size: 18px;
	font-weight: 600;
	color: var(--color-text);
}

.record-role {
	font-size: 13px;
	color: var(--color-text-muted);
}

.record-meta {
	font-size: 12px;
	color: #7b879f;
}

.record-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 4px;
}

.record-tag {
	font-size: 11px;
	padding: 4px 10px;
	border-radius: 999px;
	border: 1px solid #dfe4f2;
	background: #ffffff;
	color: #526183;
	text-transform: capitalize;
}

.record-tag--active {
	background: rgba(34, 197, 94, 0.12);
	color: #1f7a45;
	border-color: rgba(34, 197, 94, 0.3);
}

.record-tag--inactive {
	background: rgba(248, 113, 113, 0.12);
	color: #b91c1c;
	border-color: rgba(248, 113, 113, 0.3);
}

.record-tag--status {
	background: rgba(96, 165, 250, 0.12);
	color: #1d4ed8;
	border-color: rgba(96, 165, 250, 0.3);
}

.record-main {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.record-tabs {
	display: flex;
	gap: 10px;
	border-bottom: 1px solid #eef1f6;
	padding-bottom: 8px;
}

.record-tab {
	border: none;
	background: transparent;
	font-size: 13px;
	color: var(--color-text-muted);
	padding: 6px 8px;
	cursor: pointer;
}

.record-tab--active {
	color: var(--color-text);
	border-bottom: 2px solid var(--color-primary);
	font-weight: 600;
}

.record-section {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.record-section-title {
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--color-text-muted);
}

.record-note {
	padding: 8px 0;
	border: none;
	background: transparent;
	color: var(--color-text);
	font-size: 13px;
}

.view-header-left {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
}

.view-search {
	min-width: 220px;
	height: 36px;
}

.record-lines {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.record-line {
	display: grid;
	grid-template-columns: 140px 1fr;
	gap: 12px;
	align-items: baseline;
	font-size: 13px;
}

.record-line-label {
	color: var(--color-text-muted);
}

.record-line-value {
	color: var(--color-text);
	word-break: break-word;
}

.record-activities-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.record-activity-row {
	display: grid;
	grid-template-columns: 1.4fr 1fr 1fr;
	gap: 10px;
	font-size: 13px;
	color: var(--color-text);
}

.record-activity-title {
	font-weight: 600;
}

.record-activity-meta {
	color: var(--color-text-muted);
}

.record-empty {
	font-size: 13px;
	color: var(--color-text-muted);
}

.activities-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.activity-row {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 12px;
	padding: 12px 14px;
	border: 1px solid var(--color-border);
	border-radius: 12px;
	background: var(--color-surface);
	font-size: 13px;
	color: var(--color-text);
	cursor: pointer;
}

.activity-row--head {
	background: #f1f3f8;
	font-weight: 600;
	cursor: default;
}

.activity-row span {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.activity-title {
	font-weight: 600;
	font-size: 16px;
}

.lead-contact--phones {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.lead-contact-label {
	font-size: 12px;
	color: var(--color-text-muted);
}

.whatsapp-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: rgba(34, 197, 94, 0.12);
	color: #16a34a;
}

.whatsapp-icon {
	width: 16px;
	height: 16px;
	fill: currentColor;
}

.tag-control {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.tag-control--inline {
	flex-direction: row;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.tags-selected {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	min-height: 20px;
}

.tag-chip {
	background: #eef2ff;
	color: #3b4a7f;
	padding: 4px 10px;
	border-radius: 999px;
	font-size: 12px;
}

.tag-overlay {
	position: fixed;
	inset: 0;
	background: rgba(30, 41, 59, 0.32);
	display: none;
	align-items: flex-start;
	justify-content: center;
	padding-top: 80px;
	z-index: 150;
}

.tag-overlay.is-open {
	display: flex;
}

.tag-panel {
	width: min(520px, 92vw);
	max-height: 80vh;
	background: var(--color-surface);
	border-radius: 16px;
	padding: 20px 22px;
	box-shadow: 0 22px 44px rgba(30, 41, 59, 0.2);
	overflow: auto;
	transform: translateY(18px);
	opacity: 0;
	transition: transform 0.3s ease, opacity 0.3s ease;
}

.tag-overlay.is-open .tag-panel {
	transform: translateY(0);
	opacity: 1;
}

.tag-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 16px;
}

.tag-title {
	margin: 0;
	font-size: 18px;
	color: var(--color-text);
}

.tag-actions {
	display: flex;
	align-items: center;
	gap: 8px;
}

.tag-new {
	display: flex;
	gap: 8px;
	margin-bottom: 12px;
}

.tag-new-input {
	flex: 1;
}

.tag-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.tag-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 8px 10px;
	border: 1px solid var(--color-border);
	border-radius: 10px;
}

.tag-item-label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: var(--color-text);
}

.tag-delete {
	border: none;
	background: transparent;
	color: #b91c1c;
	cursor: pointer;
	font-size: 13px;
}

.activity-form {
	display: block;
	background: transparent;
	border: none;
	border-radius: 0;
	padding: 0;
}

.activity-overlay {
	position: absolute;
	inset: 0;
	background: rgba(30, 41, 59, 0.32);
	display: none;
	align-items: flex-start;
	justify-content: center;
	padding-top: 80px;
	z-index: 55;
}

.activity-overlay.is-open {
	display: flex;
}

.activity-form-overlay {
	position: fixed;
	inset: 0;
	background: rgba(30, 41, 59, 0.32);
	display: none;
	align-items: flex-start;
	justify-content: center;
	padding-top: 80px;
	z-index: 140;
}

.activity-form-overlay.is-open {
	display: flex;
}

.activity-form-panel {
	width: min(720px, 92vw);
	max-height: 82vh;
	background: var(--color-surface);
	border-radius: 16px;
	padding: 22px 24px;
	box-shadow: 0 22px 44px rgba(30, 41, 59, 0.2);
	overflow: auto;
	transform: translateY(18px);
	opacity: 0;
	transition: transform 0.3s ease, opacity 0.3s ease;
}

.activity-form-overlay.is-open .activity-form-panel {
	transform: translateY(0);
	opacity: 1;
}

.activity-panel {
	width: min(720px, 92vw);
	max-height: 80vh;
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: 16px;
	padding: 22px 24px;
	box-shadow: 0 22px 44px rgba(30, 41, 59, 0.2);
	overflow: auto;
	transform: translateY(18px);
	opacity: 0;
	transition: transform 0.3s ease, opacity 0.3s ease;
}

.activity-overlay.is-open .activity-panel {
	transform: translateY(0);
	opacity: 1;
}

.activity-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 16px;
}

.activity-title {
	margin: 0 0 6px;
	font-size: 13px;
	color: var(--color-text);
}

.activity-subtitle {
	margin: 0;
	font-size: 13px;
	color: var(--color-text-muted);
	text-transform: capitalize;
}

.activity-meta {
	margin-bottom: 14px;
}

@media (max-width: 900px) {
	.activity-row {
		grid-template-columns: 1.6fr 1fr 1fr;
		grid-auto-rows: auto;
	}

	.activity-row span:nth-child(4),
	.activity-row span:nth-child(5) {
		display: none;
	}
}

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

	.record-side {
		align-items: center;
		text-align: center;
	}
}

@media (max-width: 980px) {
	.login-panel {
		grid-template-columns: 1fr;
	}

	.login-left {
		align-items: center;
		text-align: center;
	}

	.login-footer {
		position: static;
		margin-top: 20px;
		text-align: center;
	}
}

/* ==========================================================================
   Logo Field
   ========================================================================== */

.form-field--logo {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.logo-field {
	display: flex;
	align-items: center;
	gap: 8px;
}

.logo-preview {
	width: 80px;
	height: 80px;
	border-radius: 8px;
	border: 2px solid var(--color-border);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	background: #f8f9fc;
}

.logo-placeholder {
	font-size: 11px;
	color: var(--color-text-light);
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.logo-image {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.logo-edit {
	width: 32px;
	height: 32px;
	border-radius: 6px;
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	font-size: 16px;
	color: var(--color-text);
	transition: all 0.2s;
}

.logo-edit:hover {
	background: var(--color-app);
	border-color: var(--color-primary);
	color: var(--color-primary);
}

/* Logo in cards and overlays */
.lead-avatar--logo,
.record-avatar--logo {
	background: white;
	padding: 6px;
	border: 2px solid var(--color-border);
}

.lead-avatar--logo img,
.record-avatar--logo img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

/* ==========================================================================
   Delete Confirmation Overlay
   ========================================================================== */

.delete-confirm-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s;
	z-index: 200;
}

.delete-confirm-overlay.is-open {
	opacity: 1;
	pointer-events: auto;
}

.delete-confirm-panel {
	background: white;
	border-radius: 12px;
	padding: 32px;
	max-width: 400px;
	width: 90%;
	text-align: center;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.delete-confirm-icon {
	font-size: 48px;
	color: #dc3545;
	margin-bottom: 16px;
}

.delete-confirm-title {
	font-size: 18px;
	font-weight: 600;
	color: var(--color-text);
	margin-bottom: 8px;
}

.delete-confirm-message {
	font-size: 14px;
	color: var(--color-text-light);
	margin-bottom: 24px;
	line-height: 1.5;
}

.delete-confirm-actions {
	display: flex;
	gap: 12px;
	justify-content: center;
}

.form-actions {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.form-actions-right {
	display: flex;
	gap: 12px;
}

/* ==========================================================================
   Help Overlay
   ========================================================================== */

.help-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s;
	z-index: 200;
}

.help-overlay.is-open {
	opacity: 1;
	pointer-events: auto;
}

.help-panel {
	background: white;
	border-radius: 12px;
	padding: 0;
	max-width: 600px;
	width: 90%;
	max-height: 80vh;
	overflow: hidden;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
	display: flex;
	flex-direction: column;
}

.help-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 20px 24px;
	border-bottom: 1px solid var(--color-border);
}

.help-title {
	font-size: 20px;
	font-weight: 600;
	color: var(--color-text);
	margin: 0;
}

.help-body {
	padding: 24px;
	overflow-y: auto;
}

.help-section {
	margin-bottom: 28px;
}

.help-section:last-child {
	margin-bottom: 0;
}

.help-section-title {
	font-size: 14px;
	font-weight: 600;
	color: var(--color-text);
	margin-bottom: 12px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.help-shortcuts {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.help-shortcut {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 10px 12px;
	background: #f8f9fc;
	border-radius: 8px;
}

.help-keys {
	display: flex;
	gap: 6px;
	align-items: center;
	font-size: 13px;
	color: var(--color-text-light);
}

.help-keys kbd {
	background: white;
	border: 1px solid var(--color-border);
	border-radius: 4px;
	padding: 4px 8px;
	font-size: 12px;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-weight: 500;
	color: var(--color-text);
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.help-description {
	font-size: 13px;
	color: var(--color-text);
}
