/* Agency Manager Pro Portal */
.tm-portal {
	max-width: 1100px;
	margin: 24px auto;
	padding: 0 16px;
}

.tm-portal-hero {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	background: linear-gradient(135deg, #111827 0%, #1f2937 100%);
	color: #fff;
	padding: 28px;
	border-radius: 22px;
	box-shadow: 0 20px 40px rgba(17, 24, 39, 0.14);
	margin-bottom: 18px;
}

.tm-portal-hero h2 {
	margin: 0 0 8px;
}

.tm-portal-hero p {
	margin: 0;
	opacity: .88;
}

.tm-portal-badge {
	padding: 8px 14px;
	border-radius: 999px;
	background: rgba(255,255,255,0.12);
	font-weight: 600;
}

.tm-portal-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 16px;
	margin-bottom: 18px;
}

.tm-portal-card,
.tm-portal-section {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 18px;
	padding: 20px;
	box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}

.tm-portal-card h3,
.tm-portal-section h3 {
	margin-top: 0;
}

.tm-portal-number {
	font-size: 34px;
	font-weight: 700;
	margin: 8px 0 0;
	color: #111827;
}

.tm-portal-sections {
	display: grid;
	grid-template-columns: 1fr;
	gap: 16px;
}

.tm-portal-section-head {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	align-items: baseline;
	margin-bottom: 14px;
}

.tm-portal-section-head span {
	color: #6b7280;
	font-size: 13px;
}

.tm-portal-table-wrap {
	overflow-x: auto;
}

.tm-portal-table {
	width: 100%;
	border-collapse: collapse;
}

.tm-portal-table th,
.tm-portal-table td {
	padding: 10px 8px;
	border-bottom: 1px solid #e5e7eb;
	text-align: left;
	font-size: 14px;
}

.tm-portal-table th {
	color: #6b7280;
	font-weight: 600;
}

@media (max-width: 768px) {
	.tm-portal-hero {
		flex-direction: column;
		align-items: flex-start;
	}

	.tm-portal-section-head {
		flex-direction: column;
	}
}

.tm-portal-nav {
	display:flex;
	flex-wrap:wrap;
	gap:10px;
	margin:0 0 18px;
}
.tm-portal-nav-link {
	display:inline-flex;
	align-items:center;
	padding:10px 14px;
	border-radius:999px;
	background:#fff;
	border:1px solid #e5e7eb;
	text-decoration:none;
	color:#111827;
	font-weight:600;
}
.tm-portal-nav-link.is-active {
	background:#111827;
	color:#fff;
	border-color:#111827;
}
.tm-portal-grid--mini {
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.tm-portal-mini-card {
	background:#f9fafb;
	border:1px solid #e5e7eb;
	border-radius:16px;
	padding:16px;
	display:flex;
	flex-direction:column;
	gap:8px;
}
.tm-login-shell {
	max-width:520px;
}
.tm-portal-login-card {
	background:#fff;
	border:1px solid #e5e7eb;
	border-radius:22px;
	padding:28px;
	box-shadow: 0 20px 40px rgba(17,24,39,.08);
}
.tm-portal-login-card .login-username,
.tm-portal-login-card .login-password,
.tm-portal-login-card .login-remember,
.tm-portal-login-card .login-submit {
	margin:0 0 14px;
}
.tm-portal-login-card input[type=text],
.tm-portal-login-card input[type=password] {
	width:100%;
	padding:12px 14px;
	border:1px solid #d1d5db;
	border-radius:12px;
}
.tm-portal-login-card .button-primary {
	padding:10px 18px;
}

.tm-portal-timeline {
	display: grid;
	gap: 12px;
}

.tm-portal-timeline-item {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 14px 16px;
	background: #f8fafc;
	border: 1px solid #e5e7eb;
	border-radius: 14px;
}

.tm-portal-timeline-item strong {
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: .06em;
	color: #2563eb;
}

.tm-portal-timeline-item span {
	font-weight: 700;
	color: #0f172a;
}

.tm-portal-timeline-item small {
	color: #64748b;
}


.tm-portal-hero-main {
	display: flex;
	align-items: center;
	gap: 16px;
}

.tm-portal-brand-logo {
	width: 72px;
	height: 72px;
	padding: 10px;
	border-radius: 18px;
	background: rgba(255,255,255,.08);
	display: flex;
	align-items: center;
	justify-content: center;
}

.tm-portal-brand-logo img,
.tm-portal-login-logo img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

.tm-portal-brand-kicker {
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: .08em;
	opacity: .72;
	margin-bottom: 8px;
}

.tm-portal-contact-line,
.tm-portal-login-meta {
	display: block;
	margin-top: 10px;
	opacity: .78;
}

.tm-portal-login-logo {
	width: 92px;
	height: 92px;
	margin: 0 auto 18px;
	padding: 14px;
	border-radius: 24px;
	background: #f8fafc;
	border: 1px solid #e5e7eb;
	display: flex;
	align-items: center;
	justify-content: center;
}

.tm-portal-stack {
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.tm-portal-entry {
	padding: 18px;
	border: 1px solid #e5e7eb;
	border-radius: 18px;
	background: #fff;
	box-shadow: 0 10px 25px rgba(15,23,42,.04);
}

.tm-portal-entry-head {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	align-items: flex-start;
	margin-bottom: 10px;
}

.tm-portal-entry-head small,
.tm-portal-entry-meta {
	color: #64748b;
}

.tm-portal-entry-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	font-size: 13px;
	margin-bottom: 10px;
}

.tm-portal-entry-notes {
	margin-bottom: 12px;
}

.tm-portal-comments {
	border-top: 1px solid #e5e7eb;
	padding-top: 14px;
}

.tm-portal-comment {
	padding: 12px 14px;
	background: #f8fafc;
	border: 1px solid #e5e7eb;
	border-radius: 14px;
	margin-bottom: 10px;
}

.tm-portal-comment small {
	display: block;
	margin-top: 2px;
	margin-bottom: 8px;
	color: #64748b;
}

.tm-portal-inline-form {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.tm-portal-inline-form input,
.tm-portal-inline-form select,
.tm-portal-inline-form textarea,
.tm-portal-inline-form button {
	width: 100%;
}

.tm-portal-inline-form textarea,
.tm-portal-inline-form input,
.tm-portal-inline-form select {
	padding: 12px 14px;
	border-radius: 12px;
	border: 1px solid #cbd5e1;
}

.tm-portal-inline-form button {
	border: none;
	padding: 12px 16px;
	border-radius: 12px;
	background: #111827;
	color: #fff;
	font-weight: 700;
	cursor: pointer;
}

.tm-portal-messages-grid {
	display: grid;
	grid-template-columns: 360px 1fr;
	gap: 18px;
}

.tm-portal-message-list,
.tm-portal-message-thread {
	padding: 18px;
	border: 1px solid #e5e7eb;
	border-radius: 18px;
	background: #fff;
}

@media (max-width: 980px) {
	.tm-portal-messages-grid {
		grid-template-columns: 1fr;
	}
}

.tm-portal-alert {
	margin: 0 0 16px;
	padding: 12px 16px;
	border-radius: 14px;
	background: #ecfdf5;
	border: 1px solid #a7f3d0;
	color: #065f46;
	font-weight: 600;
}

.tm-portal-inline-form p {
	margin: 0 0 14px;
}

.tm-portal-inline-form input[type=text],
.tm-portal-inline-form input[type=file],
.tm-portal-inline-form select,
.tm-portal-inline-form textarea {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid #d1d5db;
	border-radius: 12px;
	box-sizing: border-box;
}

.tm-portal-inline-form button {
	padding: 10px 16px;
	border: 0;
	border-radius: 12px;
	background: #111827;
	color: #fff;
	font-weight: 600;
	cursor: pointer;
}

.tm-portal-form-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 14px;
}

.tm-portal-field-full {
	grid-column: 1 / -1;
}

.tm-portal-messages-grid {
	display: grid;
	grid-template-columns: 320px 1fr;
	gap: 16px;
}

.tm-portal-thread-list,
.tm-portal-chat-card {
	background: #f8fafc;
	border: 1px solid #e5e7eb;
	border-radius: 16px;
	padding: 16px;
}

.tm-portal-thread-item {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 12px 14px;
	border-radius: 14px;
	border: 1px solid #e5e7eb;
	text-decoration: none;
	color: #111827;
	background: #fff;
	margin-bottom: 10px;
}

.tm-portal-thread-item.is-active {
	border-color: #111827;
	box-shadow: 0 0 0 1px #111827 inset;
}

.tm-portal-thread-item em {
	font-style: normal;
	font-size: 12px;
	color: #2563eb;
	font-weight: 700;
}

.tm-portal-chat-head {
	display:flex;
	justify-content:space-between;
	align-items:center;
	gap:12px;
	margin-bottom: 12px;
}

.tm-portal-chat-messages {
	display: flex;
	flex-direction: column;
	gap: 12px;
	max-height: 520px;
	overflow: auto;
	margin-bottom: 16px;
}

.tm-portal-chat-bubble {
	padding: 12px 14px;
	border-radius: 16px;
	max-width: 85%;
}

.tm-portal-chat-bubble.is-me {
	align-self: flex-end;
	background: #111827;
	color: #fff;
}

.tm-portal-chat-bubble.is-other {
	align-self: flex-start;
	background: #fff;
	border: 1px solid #e5e7eb;
}

.tm-portal-chat-bubble small {
	display:block;
	opacity:.72;
	margin:4px 0 8px;
}

.tm-portal-comments-list {
	display:grid;
	gap:12px;
	margin-bottom:16px;
}

.tm-portal-comment {
	padding: 14px 16px;
	border: 1px solid #e5e7eb;
	border-radius: 14px;
	background: #f8fafc;
}

.tm-portal-comment small {
	display:block;
	color:#64748b;
	margin:4px 0 8px;
}

@media (max-width: 900px) {
	.tm-portal-messages-grid {
		grid-template-columns: 1fr;
	}
}

.tm-thread-item {
	display: block;
	padding: 12px 14px;
	border: 1px solid #e5e7eb;
	border-radius: 14px;
	background: #fff;
	text-decoration: none;
	color: inherit;
	margin-bottom: 10px;
}

.tm-thread-item.is-active {
	border-color: #111827;
	box-shadow: 0 10px 24px rgba(15,23,42,.08);
}

.tm-thread-item-top,
.tm-chat-meta {
	display: flex;
	justify-content: space-between;
	gap: 10px;
}

.tm-thread-subject {
	font-weight: 700;
	margin: 6px 0;
}

.tm-thread-excerpt {
	color: #64748b;
	font-size: 13px;
}

.tm-chat-head {
	padding-bottom: 14px;
	border-bottom: 1px solid #e5e7eb;
	margin-bottom: 16px;
}

.tm-chat-messages {
	display: flex;
	flex-direction: column;
	gap: 14px;
	max-height: 520px;
	overflow: auto;
	padding-right: 6px;
	margin-bottom: 16px;
}

.tm-chat-bubble {
	max-width: 78%;
	padding: 14px 16px;
	border-radius: 16px;
	box-shadow: 0 8px 20px rgba(15,23,42,.05);
}

.tm-chat-bubble.is-me {
	align-self: flex-end;
	background: #111827;
	color: #fff;
	border-top-right-radius: 6px;
}

.tm-chat-bubble.is-other {
	align-self: flex-start;
	background: #f3f4f6;
	color: #111827;
	border-top-left-radius: 6px;
}

.tm-chat-bubble.is-me .tm-chat-meta small {
	color: rgba(255,255,255,.72);
}

.tm-mini-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	background: #111827;
	color: #fff;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 700;
}

.tm-portal-section-subcard {
	padding: 18px;
	border: 1px solid #e5e7eb;
	border-radius: 18px;
	background: #fff;
	margin-bottom: 16px;
}

.tm-login-notice {
	margin: 14px 0;
	padding: 12px 14px;
	border-radius: 12px;
	font-size: 14px;
	border: 1px solid transparent;
}

.tm-login-notice.is-success {
	background: #ecfdf5;
	border-color: #a7f3d0;
	color: #065f46;
}

.tm-login-notice.is-error {
	background: #fef2f2;
	border-color: #fecaca;
	color: #991b1b;
}

.tm-lost-password-box {
	margin-top: 16px;
	padding-top: 14px;
	border-top: 1px solid #e5e7eb;
}

.tm-lost-password-box summary {
	cursor: pointer;
	font-weight: 600;
	color: #111827;
}

.tm-lost-password-form {
	display: grid;
	gap: 10px;
	margin-top: 12px;
}

.tm-lost-password-form input[type=text] {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid #d1d5db;
	border-radius: 12px;
}
