/* ==========================================================================
   Trivali Imóveis — painel de cadastro (shortcode [imoveis_cadastro])
   Herda os tokens de ti-front.css.
   ========================================================================== */

.ti-app--admin { max-width: 1080px; }

/* ---------- Bloqueio de acesso ---------- */

.ti-gate {
	max-width: 460px;
	margin: 64px auto;
	text-align: center;
	background: var(--ti-surface);
	border: 1px solid var(--ti-line);
	border-radius: var(--ti-radius);
	padding: 44px 32px;
	box-shadow: var(--ti-shadow);
}

.ti-gate h1 { font-size: 26px; margin-bottom: 12px; }
.ti-gate p { color: var(--ti-muted); margin-bottom: 24px; font-size: 15px; }

/* ---------- Cabeçalho ---------- */

.ti-admin__head {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	align-items: flex-end;
	justify-content: space-between;
	padding-block: 32px 22px;
	border-bottom: 1px solid var(--ti-line);
	margin-bottom: 26px;
}

.ti-admin__eyebrow {
	font-size: 12px;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--ti-accent);
	font-weight: 600;
	margin-bottom: 8px;
}

.ti-admin__title { font-size: clamp(26px, 4vw, 36px); }

.ti-admin__headactions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Avisos ---------- */

.ti-notice {
	padding: 13px 16px;
	border-radius: var(--ti-radius-sm);
	font-size: 14.5px;
	font-weight: 500;
	margin-bottom: 22px;
	border: 1px solid transparent;
}

.ti-notice--ok {
	background: #e6f7ee;
	border-color: #b5e5cb;
	color: #00733a;
}

.ti-notice--erro {
	background: #fdeeeb;
	border-color: #f8d3cb;
	color: var(--ti-danger);
}

/* ---------- Painéis ---------- */

.ti-panel__bar {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 18px;
}

.ti-panel__bar h2 { font-size: 21px; }

/* ---------- Tabela de imóveis ---------- */

.ti-list { overflow-x: auto; }

.ti-table {
	width: 100%;
	min-width: 680px;
	border-collapse: collapse;
	background: var(--ti-surface);
	border: 1px solid var(--ti-line);
	border-radius: var(--ti-radius);
	overflow: hidden;
	font-size: 14.5px;
}

.ti-table thead th {
	text-align: left;
	font-size: 11.5px;
	letter-spacing: .07em;
	text-transform: uppercase;
	color: var(--ti-muted);
	font-weight: 600;
	padding: 13px 16px;
	background: var(--ti-paper);
	border-bottom: 1px solid var(--ti-line);
}

.ti-table td {
	padding: 13px 16px;
	border-bottom: 1px solid var(--ti-line-soft);
	vertical-align: middle;
	color: var(--ti-ink-soft);
}

.ti-table tbody tr:last-child td { border-bottom: none; }
.ti-table tbody tr:hover { background: var(--ti-paper); }

.ti-table__main { display: flex; align-items: center; gap: 12px; }

.ti-table__thumb {
	flex: 0 0 54px;
	width: 54px; height: 42px;
	border-radius: 7px;
	overflow: hidden;
	background: var(--ti-brand-soft);
	display: block;
}

.ti-table__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.ti-table__info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ti-table__info strong { color: var(--ti-ink); font-weight: 600; }
.ti-table__info small { font-size: 12.5px; color: var(--ti-muted); }

.ti-table__actions { white-space: nowrap; }
.ti-table__actions .ti-link { margin-right: 12px; font-size: 13.5px; }
.ti-table__actions .ti-link:last-child { margin-right: 0; }

.ti-pill {
	display: inline-block;
	font-size: 11.5px;
	font-weight: 600;
	letter-spacing: .04em;
	padding: 4px 10px;
	border-radius: 999px;
	background: var(--ti-line-soft);
	color: var(--ti-ink-soft);
	font-style: normal;
}

.ti-pill--disponivel { background: var(--ti-brand-soft); color: var(--ti-brand-dark); }
.ti-pill--reservado  { background: var(--ti-brand-soft); color: #943d15; }
.ti-pill--vendido,
.ti-pill--alugado    { background: var(--ti-line-soft); color: var(--ti-muted); }
.ti-pill--draft      { background: var(--ti-line-soft); color: var(--ti-muted); margin-left: 6px; }

/* ---------- Formulário ---------- */

.ti-form {
	background: var(--ti-surface);
	border: 1px solid var(--ti-line);
	border-radius: var(--ti-radius);
	padding: 28px;
	box-shadow: var(--ti-shadow);
}

.ti-form__head { margin-bottom: 26px; }
.ti-form__head h2 { font-size: 24px; margin-bottom: 6px; }
.ti-form__head p { color: var(--ti-muted); font-size: 14.5px; max-width: 64ch; }

.ti-fieldset {
	border: none;
	margin: 0 0 30px;
	padding: 0 0 26px;
	border-bottom: 1px solid var(--ti-line-soft);
}

.ti-fieldset:last-of-type { border-bottom: none; padding-bottom: 6px; }

.ti-fieldset legend {
	font-family: var(--ti-display);
	font-size: 17px;
	font-weight: 600;
	color: var(--ti-ink);
	padding: 0;
	margin-bottom: 16px;
	width: 100%;
}

.ti-grid-form {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
	gap: 16px;
}

.ti-grid-form--compact { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }

.ti-field--full   { grid-column: 1 / -1; }
.ti-field--wide   { grid-column: span 2; }
.ti-field--narrow { max-width: 180px; }

.ti-req { color: var(--ti-danger); }

.ti-field.is-invalid input,
.ti-field.is-invalid select,
.ti-field.is-invalid textarea {
	border-color: var(--ti-danger);
	box-shadow: 0 0 0 3px rgba(156, 59, 46, .1);
}

.ti-check--solo span {
	border: none;
	background: none;
	padding: 0 0 0 30px;
	position: relative;
	font-size: 14.5px;
	color: var(--ti-ink-soft);
	line-height: 1.5;
}

.ti-check--solo span::before {
	content: "";
	position: absolute;
	left: 0; top: 1px;
	width: 19px; height: 19px;
	border: 1px solid var(--ti-line);
	border-radius: 5px;
	background: var(--ti-surface);
	transition: all .15s ease;
}

.ti-check--solo input:checked + span::before {
	background: var(--ti-brand);
	border-color: var(--ti-brand);
}

.ti-check--solo input:checked + span::after {
	content: "";
	position: absolute;
	left: 6px; top: 5px;
	width: 6px; height: 11px;
	border-right: 2px solid #fff;
	border-bottom: 2px solid #fff;
	transform: rotate(42deg);
}

.ti-check--solo input:checked + span { font-weight: 400; color: var(--ti-ink); }

/* ---------- Upload de fotos ---------- */

.ti-uploader { margin-bottom: 18px; }

.ti-uploader__drop {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 5px;
	text-align: center;
	padding: 34px 20px;
	border: 1.5px dashed var(--ti-line);
	border-radius: var(--ti-radius);
	background: var(--ti-paper);
	transition: border-color .18s ease, background .18s ease;
}

.ti-uploader__drop strong { font-size: 15.5px; color: var(--ti-ink); }
.ti-uploader__drop span { font-size: 14px; color: var(--ti-muted); }
.ti-uploader__drop small { font-size: 12.5px; color: var(--ti-muted); margin-top: 4px; }

.ti-uploader__drop.is-over {
	border-color: var(--ti-brand);
	background: var(--ti-brand-soft);
}

.ti-uploader__progress {
	height: 4px;
	border-radius: 999px;
	background: var(--ti-line-soft);
	margin-top: 12px;
	overflow: hidden;
}

.ti-uploader__progress span {
	display: block;
	height: 100%;
	width: 0;
	background: var(--ti-brand);
	transition: width .2s ease;
}

.ti-thumbs {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
	gap: 12px;
}

.ti-thumb {
	position: relative;
	border-radius: var(--ti-radius-sm);
	overflow: hidden;
	border: 1px solid var(--ti-line);
	background: var(--ti-brand-soft);
	aspect-ratio: 4 / 3;
	max-width: 100%;
}

.ti-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.ti-thumb.is-uploading { opacity: .5; }

.ti-thumb__capa {
	position: absolute;
	top: 6px; left: 6px;
	font-size: 10.5px;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
	padding: 3px 8px;
	border-radius: 999px;
	background: var(--ti-brand);
	color: #fff;
}

.ti-thumb__tools {
	position: absolute;
	inset: auto 0 0 0;
	display: flex;
	justify-content: space-between;
	gap: 4px;
	padding: 6px;
	background: linear-gradient(to top, rgba(22, 32, 28, .78), transparent);
	opacity: 0;
	transition: opacity .18s ease;
}

.ti-thumb:hover .ti-thumb__tools,
.ti-thumb:focus-within .ti-thumb__tools { opacity: 1; }

.ti-thumb__tools button {
	border: none;
	background: rgba(255, 255, 255, .92);
	color: var(--ti-ink);
	width: 26px; height: 26px;
	border-radius: 6px;
	font-size: 14px;
	line-height: 1;
	cursor: pointer;
	display: grid;
	place-items: center;
	transition: background .15s ease;
}

.ti-thumb__tools button:hover { background: #fff; }
.ti-thumb__tools button[disabled] { opacity: .35; cursor: default; }
.ti-thumb__tools button[data-ti-remove]:hover { background: var(--ti-danger); color: #fff; }

/* ---------- Ações do formulário ---------- */

.ti-form__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	padding-top: 24px;
	margin-top: 8px;
	border-top: 1px solid var(--ti-line);
}

.ti-form__actions .ti-link { margin-left: auto; }

.ti-btn.is-busy { pointer-events: none; opacity: .7; }

/* ---------- Responsivo ---------- */

@media (max-width: 700px) {
	.ti-field--wide { grid-column: 1 / -1; }
	.ti-field--narrow { max-width: none; }
	.ti-form { padding: 20px 16px; }
	.ti-admin__head { padding-block: 22px 18px; }
	.ti-admin__headactions { width: 100%; }
	.ti-admin__headactions .ti-btn { flex: 1; }
	.ti-form__actions .ti-btn { flex: 1 1 100%; }
	.ti-form__actions .ti-link { margin-left: 0; }
}
