:root {
  --tv-primary: #244AA5;
  --tv-primary-dark: #1b3a85;
  --tv-primary-deep: #102559;
  --tv-primary-soft: #e3eafa;
  --tv-accent: #f0b100;
  --tv-accent-soft: #fdf3d0;
  --tv-bg: #f5f7fa;
  --tv-ink: #0f172a;
  --tv-body: #334155;
  --tv-muted: #64748b;
  --tv-card: #ffffff;
  --tv-border: #e5e9f0;
  --tv-sidebar-w: 248px;
  --bs-body-font-family: "Geist", "Montserrat", "Segoe UI", system-ui, sans-serif;
  --bs-link-color-rgb: 36, 74, 165;
  --bs-link-hover-color-rgb: 27, 58, 133;
}

body { background: radial-gradient(1100px 480px at 100% -8%, rgba(36,74,165,.07), transparent 55%), var(--tv-bg); color: var(--tv-ink); font-family: var(--bs-body-font-family); font-size: .92rem; -webkit-font-smoothing: antialiased; }
h1, .h1, h2, .h2, h3, .h3 { letter-spacing: -.02em; }

/* ---------------------------------------------------------------- icons */
.tv-icon, svg.lucide { width: 1.1em; height: 1.1em; stroke-width: 2; vertical-align: -.2em; flex-shrink: 0; }
i.tv-icon { display: inline-block; }
.icon-lg { width: 2.2rem !important; height: 2.2rem !important; stroke-width: 1.5; }
.icon-xl { width: 3rem !important; height: 3rem !important; stroke-width: 1.5; }
.btn .tv-icon { margin-top: -.1em; }

/* ---------------------------------------------------------------- layout */
.tv-shell { display: flex; min-height: 100vh; }
.tv-main { flex: 1; min-width: 0; padding: 1.75rem 2rem 3rem; }
.tv-sidebar { background: radial-gradient(120% 60% at 0% 100%, rgba(240,177,0,.10) 0%, transparent 60%), linear-gradient(180deg, var(--tv-primary-deep) 0%, var(--tv-primary) 100%); color: #fff; box-shadow: 1px 0 0 rgba(255,255,255,.06), 4px 0 24px rgba(16,37,89,.12); }
.tv-sidebar-inner { display: flex; flex-direction: column; height: 100%; padding: 1.5rem 1rem 1.25rem; }
@media (min-width: 992px) {
  .tv-sidebar { position: sticky; top: 0; width: var(--tv-sidebar-w); height: 100vh; flex-shrink: 0; }
}
@media (max-width: 991.98px) {
  .tv-sidebar { --bs-offcanvas-width: 270px; }
  .tv-main { padding: 1.25rem 1rem 2.5rem; }
}
.tv-topbar { position: sticky; top: 0; z-index: 1030; display: flex; align-items: center; gap: .75rem; padding: .55rem 1rem; background: var(--tv-primary-deep); box-shadow: 0 2px 12px rgba(16,37,89,.25); }
.tv-icon-btn { color: #fff; border: 1px solid rgba(255,255,255,.2); padding: .3rem .5rem; }
.tv-icon-btn:hover { color: #fff; background: rgba(255,255,255,.1); }

.tv-brand { display: flex; align-items: center; padding: .15rem .75rem 1.25rem; margin-bottom: .35rem; border-bottom: 1px solid rgba(255,255,255,.1); text-decoration: none; }
.tv-brand img { display: block; width: 138px; height: auto; transition: opacity .15s ease; }
.tv-brand:hover img { opacity: .88; }
.tv-topbar .tv-brand { padding: 0; margin: 0; border: 0; }
.tv-topbar .tv-brand img { width: auto; height: 24px; }
.tv-login-logo { display: block; width: 190px; max-width: 100%; height: auto; margin: 0 auto; }

.tv-nav-label { font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.45); margin: 1rem .75rem .4rem; }
.tv-nav { display: flex; flex-direction: column; gap: .15rem; }
.tv-nav a { display: flex; align-items: center; gap: .7rem; padding: .55rem .75rem; border-radius: 10px; color: rgba(255,255,255,.75); text-decoration: none; font-weight: 500; transition: background-color .15s ease, color .15s ease; }
.tv-nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.tv-nav a.active { color: var(--tv-primary-deep); background: #fff; font-weight: 600; box-shadow: inset 3px 0 0 var(--tv-accent), 0 4px 14px rgba(0,0,0,.15); }
.tv-nav a.active .tv-icon { color: var(--tv-primary); }
.tv-region { display: flex; align-items: center; gap: .5rem; font-size: .78rem; color: rgba(255,255,255,.6); padding: .5rem .75rem; }
.tv-region .tv-icon { color: var(--tv-accent); }
.tv-profile { display: flex; align-items: center; gap: .7rem; margin: 0 0 .6rem; padding: .6rem .7rem; border-radius: 14px; text-decoration: none; color: #fff; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); transition: background-color .15s ease, border-color .15s ease; }
.tv-profile:hover, .tv-profile.active { color: #fff; background: rgba(255,255,255,.14); border-color: rgba(240,177,0,.6); }
.tv-avatar { position: relative; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; overflow: hidden; background: linear-gradient(135deg, #3d66c9 0%, var(--tv-primary) 50%, var(--tv-primary-deep) 100%); color: #fff; font-weight: 800; font-size: .85rem; letter-spacing: .02em; box-shadow: 0 0 0 2px rgba(255,255,255,.9), 0 4px 12px rgba(0,0,0,.18); }
.tv-avatar img { width: 100%; height: 100%; object-fit: cover; }
.tv-avatar.xl { width: 112px; height: 112px; font-size: 2.3rem; background: linear-gradient(135deg, #3d66c9 0%, var(--tv-primary) 50%, var(--tv-primary-deep) 100%); color: #fff; box-shadow: 0 0 0 4px #fff, 0 0 0 6px var(--tv-primary-soft), 0 14px 32px rgba(16,37,89,.22); }
.tv-profile-text { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.tv-profile-name { font-weight: 700; font-size: .86rem; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-profile-email { font-size: .72rem; color: rgba(255,255,255,.62); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-profile-gear { color: rgba(255,255,255,.55); transition: transform .3s ease, color .15s ease; }
.tv-profile:hover .tv-profile-gear { color: var(--tv-accent); transform: rotate(60deg); }
.tv-logout { display: flex; align-items: center; gap: .6rem; padding: .55rem .75rem; border-radius: 10px; color: rgba(255,255,255,.75); text-decoration: none; border: 1px solid rgba(255,255,255,.15); transition: background-color .15s ease, border-color .15s ease, color .15s ease; }
.tv-logout:hover { color: #fff; background: rgba(255,255,255,.08); border-color: rgba(240,177,0,.55); }
.profile-card { padding: 0; overflow: hidden; }
.profile-card .form-label { font-size: .78rem; font-weight: 600; color: var(--tv-muted); margin-bottom: .3rem; }
.profile-section { padding: 1.35rem 1.5rem; border-bottom: 1px solid var(--tv-border); }
.profile-section-title { display: flex; align-items: center; gap: .5rem; font-size: .95rem; font-weight: 700; margin-bottom: 1rem; color: var(--tv-ink); }
.profile-section-title .tv-icon { color: var(--tv-primary); }
.profile-footer { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem; padding: 1.2rem 1.5rem; background: #f8fafc; }
.profile-footer .btn { height: 38px; }
.profile-side { position: relative; overflow: hidden; padding: 0 1.5rem 1.5rem; text-align: center; }
.profile-side::before { content: ""; display: block; height: 84px; margin: 0 -1.5rem; background: radial-gradient(120% 140% at 0% 0%, rgba(240,177,0,.35) 0%, transparent 55%), linear-gradient(135deg, var(--tv-primary-deep), var(--tv-primary)); }
.profile-avatar-wrap { position: relative; width: 112px; margin: -56px auto 1rem; }
.avatar-edit { position: absolute; right: 2px; bottom: 2px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--tv-accent); color: var(--tv-primary-deep); border: 3px solid #fff; cursor: pointer; box-shadow: 0 4px 12px rgba(15,23,42,.18); transition: transform .15s ease; }
.avatar-edit:hover { transform: scale(1.08); }
.avatar-edit .tv-icon { width: 15px; height: 15px; }
.profile-side-name { font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; }
.profile-side-email { color: var(--tv-muted); margin-top: .15rem; word-break: break-word; }
.profile-role { display: inline-flex; align-items: center; gap: .3rem; margin-top: .65rem; padding: .22rem .65rem; border-radius: 99px; background: var(--tv-primary-soft); color: var(--tv-primary-dark); font-size: .75rem; font-weight: 700; }
.security-row, .action-row { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; padding: 1rem; border: 1px solid var(--tv-border); border-radius: 14px; background: #f8fafc; }
.security-icon, .action-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--tv-primary-soft); color: var(--tv-primary); flex-shrink: 0; }
.action-row-text { flex: 1 1 220px; min-width: 0; }
.action-row-text .fw-semibold { color: var(--tv-ink); }
.action-row-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; flex: 2 1 420px; justify-content: flex-end; }
.action-row-controls .form-control { background: #fff; height: 40px; }
.action-row-controls .btn { height: 40px; white-space: nowrap; }
.country-checks { display: flex; flex-wrap: wrap; gap: .4rem; margin-right: auto; }
.country-check { position: relative; margin: 0; cursor: pointer; }
.country-check input { position: absolute; opacity: 0; pointer-events: none; }
.country-check span { display: inline-flex; align-items: center; gap: .35rem; height: 34px; padding: 0 .8rem; border-radius: 99px; border: 1px solid #dbe1ea; background: #fff; color: var(--tv-muted); font-size: .8rem; font-weight: 600; transition: background-color .15s ease, border-color .15s ease, color .15s ease; }
.country-check span::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: #cbd5e1; transition: background-color .15s ease; }
.country-check input:checked + span { background: var(--tv-primary-soft); border-color: #b9c8ee; color: var(--tv-primary-dark); }
.country-check input:checked + span::before { background: var(--tv-primary); }
.country-check input:focus-visible + span { box-shadow: 0 0 0 .2rem rgba(36,74,165,.2); }
.pw-dots { letter-spacing: .12em; color: var(--tv-body); }
.pw-modal, .tv-modal { overflow: hidden; }
.pw-modal-head, .tv-modal-head { position: relative; padding: 1.5rem 1.5rem .75rem; }
.pw-modal-head .btn-close, .tv-modal-head .btn-close { position: absolute; top: 1rem; right: 1rem; }
.pw-modal-head .modal-title, .tv-modal-head .modal-title { margin: .9rem 0 .3rem; }
.pw-modal-icon, .tv-modal-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(135deg, var(--tv-primary), var(--tv-primary-deep)); color: #fff; box-shadow: 0 8px 20px rgba(36,74,165,.28); }
.pw-modal-icon .tv-icon, .tv-modal-icon .tv-icon { width: 22px; height: 22px; }
.pw-modal .modal-body, .tv-modal .modal-body { padding: .5rem 1.5rem 1rem; }
.pw-modal .modal-footer, .tv-modal .modal-footer { padding: .85rem 1.5rem; background: #f8fafc; }
.tv-modal .modal-body p { color: var(--tv-body); line-height: 1.55; }
.modal-note { display: flex; gap: .6rem; padding: .75rem .9rem; border-radius: 12px; background: var(--tv-accent-soft); color: #7a5b00; font-size: .84rem; line-height: 1.5; }
.modal-note .tv-icon { margin-top: .15rem; }
.pw-modal .form-label { font-size: .78rem; font-weight: 600; color: var(--tv-muted); margin-bottom: .3rem; }
.pw-field { position: relative; }
.pw-field .form-control { height: 44px; padding-right: 2.9rem; }
.pw-field .form-control.is-valid, .pw-field .form-control.is-invalid { background-image: none; padding-right: 2.9rem; }
.pw-toggle { position: absolute; top: 50%; right: .45rem; transform: translateY(-50%); width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--tv-muted); display: grid; place-items: center; }
.pw-toggle:hover { background: #eef2f8; color: var(--tv-primary); }
.pw-strength { display: flex; align-items: center; gap: .75rem; }
.pw-bars { display: grid; grid-template-columns: repeat(4, 1fr); gap: .3rem; flex: 1; }
.pw-bars span { height: 5px; border-radius: 99px; background: #e2e8f0; transition: background-color .2s ease; }
.pw-label { font-size: .75rem; font-weight: 600; color: var(--tv-muted); min-width: 7.5rem; text-align: right; }
.pw-strength[data-level="1"] .pw-bars span:nth-child(-n+1) { background: #ef4444; }
.pw-strength[data-level="2"] .pw-bars span:nth-child(-n+2) { background: #f59e0b; }
.pw-strength[data-level="3"] .pw-bars span:nth-child(-n+3) { background: #3b82f6; }
.pw-strength[data-level="4"] .pw-bars span:nth-child(-n+4) { background: #16a34a; }
.pw-strength[data-level="1"] .pw-label { color: #dc2626; }
.pw-strength[data-level="2"] .pw-label { color: #b45309; }
.pw-strength[data-level="3"] .pw-label { color: #1d4ed8; }
.pw-strength[data-level="4"] .pw-label { color: #15803d; }
.pw-match.ok { color: #15803d; font-weight: 600; }
.pw-match.bad { color: #dc2626; font-weight: 600; }
.profile-meta { display: flex; align-items: center; justify-content: center; gap: .4rem; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--tv-border); color: var(--tv-muted); font-size: .8rem; }

.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem 1.25rem; margin-bottom: 1.35rem; }
.page-head h1 { font-size: 1.65rem; font-weight: 800; margin: 0 0 .35rem; line-height: 1.15; }
.page-head p { color: var(--tv-muted); margin: 0; max-width: 680px; line-height: 1.5; }
.page-head > div:first-child { min-width: 0; flex: 1 1 420px; }
.page-live { display: inline-flex; align-items: center; gap: .4rem; margin-top: .6rem; padding: .22rem .65rem; border-radius: 99px; background: #fff; border: 1px solid var(--tv-border); color: var(--tv-muted); font-size: .74rem; font-weight: 600; }
.page-live::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: #16a34a; box-shadow: 0 0 0 3px rgba(22,163,74,.18); animation: tv-pulse 2s ease-in-out infinite; }
@keyframes tv-pulse { 50% { box-shadow: 0 0 0 6px rgba(22,163,74,0); } }
.page-live.is-running { background: var(--tv-primary-soft); border-color: #c3d0f0; color: var(--tv-primary-dark); }
.page-live.is-running::before { background: var(--tv-primary); box-shadow: 0 0 0 3px rgba(36,74,165,.2); animation-name: tv-pulse-blue; }
@keyframes tv-pulse-blue { 50% { box-shadow: 0 0 0 6px rgba(36,74,165,0); } }
.progress-bar-animated { background-color: var(--tv-primary); }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.page-title { font-size: 1.5rem; font-weight: 800; margin: 0 0 .25rem; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
h1 .badge, .page-title .badge { font-size: .72rem; font-weight: 600; letter-spacing: .01em; }
@media (max-width: 575.98px) {
  .page-head { margin-bottom: 1rem; }
  .page-head h1 { font-size: 1.4rem; }
  .page-head p { font-size: .86rem; }
  .page-actions, .page-actions > .btn, .page-actions > form, .page-actions > form > .btn { width: 100%; }
  form.page-actions > .btn { width: auto; flex: 1 1 auto; }
  form.page-actions > .limit-input { flex: 1 1 110px; width: auto; }
}

/* ---------------------------------------------------------------- cards / stats */
.tv-card { background: var(--tv-card); border: 1px solid var(--tv-border); border-radius: 16px; box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 10px 28px rgba(15,23,42,.035); }
.tv-stat { position: relative; overflow: hidden; padding: 1rem 1.1rem; height: 100%; display: flex; align-items: center; gap: .9rem; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.tv-stat:hover { transform: translateY(-2px); border-color: #d5deee; box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 14px 30px rgba(16,37,89,.08); }
.tv-stat-body { min-width: 0; flex: 1; }
.tv-stat-sub { margin-top: .15rem; font-size: .75rem; color: var(--tv-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-stat-bar { height: 4px; margin-top: .55rem; border-radius: 99px; background: #eef2f6; overflow: hidden; }
.tv-stat-bar span { display: block; height: 100%; border-radius: inherit; background: currentColor; }
.tv-stat.tone-card-green .tv-stat-bar { color: #16a34a; }
.tv-stat.tone-card-amber .tv-stat-bar { color: #d99a00; }
.tv-stat.tone-card-violet .tv-stat-bar { color: #7c3aed; }
.tv-stat.tone-card-teal .tv-stat-bar { color: var(--tv-primary); }
.tv-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--tv-border); }
.tv-card-head .card-title-sm { margin: 0; }
.tv-card-count { display: inline-flex; align-items: center; height: 1.4rem; padding: 0 .55rem; border-radius: 99px; background: var(--tv-primary-soft); color: var(--tv-primary-dark); font-size: .74rem; font-weight: 700; }
.tv-card-head .text-muted { font-size: .8rem; }
.tv-card-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; padding: .85rem 1.25rem; border-top: 1px solid var(--tv-border); background: #f8fafc; }
.tv-card.overflow-hidden > .tv-table { border-radius: 0; }
.tv-stat .label { color: var(--tv-muted); font-size: .8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-stat .value { font-size: 1.6rem; font-weight: 800; line-height: 1.2; letter-spacing: -.03em; color: var(--tv-ink); }
.tv-stat .icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tv-stat .icon .tv-icon { width: 21px; height: 21px; }
.tone-teal { background: var(--tv-primary-soft); color: var(--tv-primary); }
.tone-green { background: #dcfce7; color: #15803d; }
.tone-violet { background: #ede9fe; color: #7c3aed; }
.tone-amber { background: var(--tv-accent-soft); color: #9a7200; }
.tone-red { background: #fee2e2; color: #b91c1c; }
.tone-slate { background: #f1f5f9; color: #475569; }
@media (max-width: 575.98px) {
  .tv-stat { padding: .8rem .85rem; gap: .65rem; }
  .tv-stat .icon { width: 36px; height: 36px; border-radius: 10px; }
  .tv-stat .icon .tv-icon { width: 18px; height: 18px; }
  .tv-stat .label { font-size: .74rem; }
  .tv-stat .value { font-size: 1.3rem; }
  .tv-stat-sub { font-size: .7rem; }
}
@media (max-width: 419.98px) {
  .tv-stat { flex-direction: column; align-items: flex-start; }
  .tv-stat-body { width: 100%; }
}

.tv-filters .form-label { font-size: .75rem; font-weight: 600; color: var(--tv-muted); letter-spacing: 0; margin-bottom: .3rem; }
.form-control, .form-select { border-radius: 10px; border-color: #dbe1ea; font-size: .9rem; }
.form-control:focus, .form-select:focus { border-color: #8aa3e3; box-shadow: 0 0 0 .2rem rgba(36,74,165,.15); }
.form-check-input:checked { background-color: var(--tv-primary); border-color: var(--tv-primary); }
.input-group > .form-control { border-radius: 10px; }
.input-group > .form-control:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group > .form-control:not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.tv-filters .form-select { padding-right: 2rem; background-position: right .65rem center; text-overflow: ellipsis; }
.tv-filters .form-control::placeholder { color: #9aa5b5; }
.tv-filters .filter-checks { display: flex; align-items: center; min-width: 0; height: calc(1.5em + .75rem + 2px); margin: 0; padding: 0 .75rem; border: 1px solid #dbe1ea; border-radius: 10px; background: #fff; cursor: pointer; }
.tv-filters .filter-checks:hover { border-color: #b9c4d6; }
.tv-filters .filter-checks .form-check { display: flex; align-items: center; gap: .5rem; margin: 0; padding-left: 0; white-space: nowrap; min-width: 0; }
.tv-filters .filter-checks .form-check-input { float: none; margin: 0; flex-shrink: 0; cursor: pointer; }
.tv-filters .filter-checks .form-check-label { color: var(--tv-body); font-size: .88rem; cursor: pointer; overflow: hidden; text-overflow: ellipsis; }
.tv-filters { padding: .9rem 1rem; }
.tv-filterbar { display: grid; gap: .5rem; align-items: center; }
.tv-filterbar.cols-3 { grid-template-columns: minmax(220px, 1.7fr) minmax(148px, .9fr) minmax(148px, .9fr) minmax(156px, 1fr) auto; }
.tv-filterbar.cols-2 { grid-template-columns: minmax(240px, 1.8fr) minmax(180px, 1fr) minmax(168px, .95fr); }
.tv-filterbar.cols-sources { grid-template-columns: minmax(220px, 1.8fr) repeat(5, minmax(130px, 1fr)) minmax(120px, .8fr); }
.tv-filterbar .search-grow { min-width: 0; }
.tv-filterbar .form-control,
.tv-filterbar .form-select,
.tv-filterbar .filter-more-btn {
  height: 42px;
  border-color: #e2e8f0;
  background-color: #f8fafc;
  box-shadow: none;
}
.tv-filterbar .form-control:hover,
.tv-filterbar .form-select:hover,
.tv-filterbar .filter-more-btn:hover { border-color: #cbd5e1; }
.tv-filterbar .form-control:focus,
.tv-filterbar .form-select:focus { background-color: #fff; }
.tv-filterbar .form-select { width: 100%; min-width: 0; max-width: none; }
.tv-filterbar .filter-more-btn { padding-inline: .9rem; background: #fff; white-space: nowrap; }
.tv-filterbar .filter-more-btn[aria-expanded="true"] { background: var(--tv-primary); border-color: var(--tv-primary); color: #fff; }
.tv-filterbar .filter-more-btn[aria-expanded="true"] .filter-count { background: #fff; color: var(--tv-primary); }
.filter-count { display: inline-flex; align-items: center; justify-content: center; min-width: 1.15rem; height: 1.15rem; padding: 0 .3rem; border-radius: 99px; background: var(--tv-primary); color: #fff; font-size: .68rem; font-weight: 700; line-height: 1; }
.filter-more { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem .9rem; margin-top: .75rem; padding: .9rem; border-radius: 12px; background: #f8fafc; }
.filter-more[hidden] { display: none !important; }
.filter-more .form-label { text-transform: none; letter-spacing: 0; font-size: .75rem; margin-bottom: .3rem; }
.filter-more .form-select,
.filter-more .form-control { width: 100%; height: 40px; background: #fff; }
.filter-more-check { display: flex; align-items: flex-end; }
.filter-more-check .filter-checks { width: 100%; height: 40px; background: #fff; }
.range-pair { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .35rem; }
.range-pair .dash { color: #94a3b8; font-weight: 600; line-height: 1; }
.filter-chips { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .7rem; }
.filter-chip { display: inline-flex; align-items: center; gap: .3rem; background: var(--tv-primary-soft); color: var(--tv-primary-dark); border-radius: 99px; padding: .28rem .5rem .28rem .72rem; font-size: .78rem; font-weight: 600; text-decoration: none; }
.filter-chip:hover { background: #d4def6; color: var(--tv-primary-deep); }
.filter-chip .tv-icon { width: .85rem; height: .85rem; }
.filter-chip-clear { background: #fff; border: 1px solid #dbe1ea; color: var(--tv-muted); padding-left: .72rem; }
.filter-chip-clear:hover { background: #f8fafc; color: var(--tv-ink); }
.sort-select { width: auto; min-width: 9.5rem; height: 34px; border-color: #e2e8f0; background-color: #fff; }
@media (max-width: 1100px) {
  .tv-filterbar.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
  .tv-filterbar.cols-3 .search-grow,
  .tv-filterbar.cols-3 .filter-more-btn { grid-column: 1 / -1; }
  .tv-filterbar.cols-3 .filter-more-btn { justify-self: start; }
  .tv-filterbar.cols-sources { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tv-filterbar.cols-sources .search-grow { grid-column: 1 / -1; }
  .filter-more { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .tv-filterbar.cols-3,
  .tv-filterbar.cols-2,
  .tv-filterbar.cols-sources,
  .filter-more { grid-template-columns: 1fr; }
  .tv-filterbar .search-grow,
  .tv-filterbar .filter-more-btn { grid-column: auto; }
}

.btn { border-radius: 10px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; }
.btn-sm { border-radius: 8px; font-weight: 600; }
.dropdown-menu { border: 1px solid var(--tv-border); border-radius: 12px; box-shadow: 0 16px 40px rgba(15,23,42,.12); padding: .35rem; }
.dropdown-item { border-radius: 8px; font-weight: 500; }
.dropdown-item:hover, .dropdown-item:focus { background: var(--tv-primary-soft); color: var(--tv-primary-dark); }
.modal-content { border: none; border-radius: 18px; box-shadow: 0 24px 60px rgba(15,23,42,.18); }
.modal-header, .modal-footer { border-color: var(--tv-border); }
.modal-title { font-weight: 700; }
.btn-tv { background: var(--tv-primary); color: #fff; border: 1px solid var(--tv-primary); }
.btn-tv:hover, .btn-tv:focus { background: var(--tv-primary-dark); border-color: var(--tv-primary-dark); color: #fff; }
.btn-outline-secondary { border-color: #dbe1ea; color: var(--tv-body); background: #fff; }
.btn-outline-secondary:hover, .btn-outline-secondary.active { background: #f1f5f9 !important; border-color: #cbd5e1 !important; color: var(--tv-ink) !important; }
.btn-outline-primary { color: var(--tv-primary); border-color: #b9c8ee; background: #fff; }
.btn-outline-primary:hover, .btn-outline-primary:focus { background: var(--tv-primary); border-color: var(--tv-primary); color: #fff; }
.text-bg-primary { background-color: var(--tv-primary) !important; }
.btn-group .btn-outline-secondary.active { background: var(--tv-primary) !important; border-color: var(--tv-primary) !important; color: #fff !important; }
.pagination { gap: .25rem; flex-wrap: wrap; }
.pagination .page-link { display: grid; place-items: center; min-width: 36px; height: 36px; padding: 0 .6rem; border-radius: 10px !important; margin: 0; border-color: var(--tv-border); color: var(--tv-body); font-weight: 600; font-size: .85rem; }
.pagination .page-link:hover { background: var(--tv-primary-soft); border-color: #c3d0f0; color: var(--tv-primary-dark); }
.pagination .active .page-link { background: var(--tv-primary); border-color: var(--tv-primary); color: #fff; box-shadow: 0 4px 12px rgba(36,74,165,.25); }
.pagination .disabled .page-link { background: #f8fafc; color: #cbd5e1; }
.tv-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; }
.tv-pager-info { color: var(--tv-muted); font-size: .82rem; font-weight: 500; }
.tv-pager-standalone { margin-top: 1.25rem; padding: .75rem 1rem; }
@media (max-width: 575.98px) {
  .tv-pager { justify-content: center; }
  .tv-pager-info { width: 100%; text-align: center; }
}

/* ---------------------------------------------------------------- property cards */
.prop-card { overflow: hidden; height: 100%; transition: transform .15s ease, box-shadow .15s ease; }
.prop-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(15,23,42,.10); }
.prop-img { position: relative; aspect-ratio: 4 / 3; background: linear-gradient(135deg, #eef2f8 0%, #dfe6f1 100%); overflow: hidden; }
.prop-img img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.prop-card:hover .prop-img img { transform: scale(1.03); }
.prop-img .no-img { position: absolute; inset: 0; display: flex; flex-direction: column; gap: .4rem; align-items: center; justify-content: center; color: #94a3b8; font-size: .75rem; font-weight: 500; }
.prop-img .no-img .tv-icon { width: 2rem; height: 2rem; stroke-width: 1.5; }
.prop-img .badges { position: absolute; z-index: 2; top: .65rem; left: .65rem; display: flex; gap: .35rem; }
.badge { font-weight: 600; border-radius: 7px; padding: .35em .6em; }
.badge-sale { background: var(--tv-primary); color: #fff; }
.badge-rent { background: var(--tv-accent); color: #1a1a1a; }
.badge-stay { background: #ff5a5f; color: #fff; }
.badge-type { background: rgba(255,255,255,.94); color: var(--tv-ink); }
.prop-img .badge { box-shadow: 0 1px 4px rgba(15,23,42,.18); }
.badge .spinner-border-sm { width: .65rem; height: .65rem; border-width: .14em; vertical-align: -.05em; margin-right: .2rem; }

.status-badge { display: inline-flex; align-items: center; gap: .35em; font-weight: 600; text-transform: capitalize; }
.status-badge::before { content: ""; width: .45em; height: .45em; border-radius: 50%; background: currentColor; }
.status-badge:has(.spinner-border)::before { display: none; }
.status-badge.text-bg-success { background: #dcfce7 !important; color: #166534 !important; }
.status-badge.text-bg-warning { background: #fef3c7 !important; color: #92400e !important; }
.status-badge.text-bg-danger { background: #fee2e2 !important; color: #b91c1c !important; }
.status-badge.text-bg-primary { background: var(--tv-primary-soft) !important; color: var(--tv-primary-dark) !important; }
.status-badge.text-bg-info { background: #e0f2fe !important; color: #075985 !important; }
.status-badge.text-bg-secondary { background: #f1f5f9 !important; color: #475569 !important; }
.tag-light { display: inline-block; background: #f1f5f9; color: var(--tv-muted); border-radius: 6px; padding: .05rem .4rem; font-size: .68rem; font-weight: 600; }
.adapter-tag { display: inline-block; font-family: "Cascadia Code", Consolas, monospace; font-size: .75rem; background: #f1f5f9; color: var(--tv-body); border: 1px solid var(--tv-border); border-radius: 6px; padding: .1rem .45rem; }
.amenity { display: inline-flex; align-items: center; gap: .3rem; border-radius: 99px; padding: .25rem .7rem; font-size: .8rem; font-weight: 500; }
.amenity.yes { background: #dcfce7; color: #166534; }
.amenity.no { background: #f1f5f9; color: #64748b; text-decoration: line-through; }
.prop-price { font-size: 1.25rem; font-weight: 800; color: var(--tv-ink); }
.prop-price small { font-size: .75rem; font-weight: 600; color: var(--tv-muted); }
.prop-title { font-weight: 600; font-size: .95rem; color: var(--tv-ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em; text-decoration: none; }
.prop-title:hover { color: var(--tv-primary); }
.prop-loc { color: var(--tv-muted); font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prop-facts { display: flex; gap: .4rem 1rem; font-size: .83rem; color: var(--tv-body); flex-wrap: wrap; }
.prop-facts span { display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; }
.prop-card .prop-facts { flex-wrap: nowrap; overflow: hidden; padding-top: .6rem; border-top: 1px dashed var(--tv-border); min-height: 2.1rem; }
.prop-facts .tv-icon { color: var(--tv-primary); }
.prop-foot { border-top: 1px solid var(--tv-border); font-size: .75rem; color: var(--tv-muted); }
.source-pill { display: inline-block; white-space: nowrap; background: #f1f5f9; color: #334155; border-radius: 99px; padding: .18rem .6rem; font-weight: 600; font-size: .72rem; }
a.source-pill:hover { background: var(--tv-primary-soft); color: var(--tv-primary-dark); }

/* ---------------------------------------------------------------- tables */
.table { --bs-table-hover-bg: #f8fafc; margin: 0; }
.table > :not(caption) > * > * { border-color: #eef2f6; }
.table thead th, .table-light th { background: #f8fafc !important; color: var(--tv-muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .055em; font-weight: 700; white-space: nowrap; border-bottom: 1px solid var(--tv-border); }
.table-hover > tbody > tr:hover > * { background: #f4f7fd; }
.tv-card > .table-responsive, .tv-card.table-responsive { border-radius: 16px; }
.tv-card.table-responsive > .table > :not(caption) > * > *,
.tv-table > .table > :not(caption) > * > * { padding: .75rem .75rem; }
.tv-card.table-responsive > .table > :not(caption) > * > :first-child,
.tv-table > .table > :not(caption) > * > :first-child { padding-left: 1.25rem; }
.tv-card.table-responsive > .table > :not(caption) > * > :last-child,
.tv-table > .table > :not(caption) > * > :last-child { padding-right: 1.25rem; }
.tv-table > .table > tbody > tr:last-child > * { border-bottom: 0; }
.table-clickable tbody tr { cursor: pointer; }
.source-cell { min-width: 220px; }
.agency-cell { min-width: 200px; max-width: 380px; }
.website-cell { max-width: 200px; }
.website-cell a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.limit-input { width: 140px; }
@media (max-width: 575.98px) {
  .source-cell, .agency-cell { min-width: 160px; }
  .tv-card-head { padding: .85rem 1rem; }
  .tv-card-foot { padding: .75rem 1rem; }
  .tv-table > .table > :not(caption) > * > :first-child { padding-left: 1rem; }
  .tv-table > .table > :not(caption) > * > :last-child { padding-right: 1rem; }
  .action-row { padding: .85rem; }
  .action-row-controls { justify-content: stretch; }
  .action-row-controls > .btn { flex: 1; }
  .tv-filters { padding: .75rem; }
}
.source-name { font-weight: 600; color: var(--tv-ink); text-decoration: none; }
.source-name:hover { color: var(--tv-primary); }
.source-domain { color: var(--tv-muted); text-decoration: none; font-size: .8rem; }
.source-domain:hover { color: var(--tv-primary); text-decoration: underline; }
@media (max-width: 1399.98px) {
  .tv-card.table-responsive > .table > :not(caption) > * > *,
  .tv-table > .table > :not(caption) > * > * { padding-left: .55rem; padding-right: .55rem; }
  .notes-cell { max-width: 260px !important; }
}
.notes-cell { max-width: 340px; color: var(--tv-muted); font-size: .8rem; line-height: 1.45; }
.notes-cell > div { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.table-props img { width: 84px; height: 62px; object-fit: cover; border-radius: 8px; background: #e2e8f0; }
.table-props td { vertical-align: middle; }

.table-data-wrap { overflow: auto; max-height: 78vh; border-radius: 16px; }
.table-data { font-size: .84rem; }
.table-data thead th { position: sticky; top: 0; z-index: 3; border-bottom: 1px solid var(--tv-border); }
.table-data td { white-space: normal; }
.table-data img { width: 72px; height: 54px; }
.table-data .col-title { min-width: 300px; max-width: 380px; }
.table-data .col-addr { min-width: 180px; max-width: 240px; }
.table-data .col-feat { min-width: 170px; max-width: 240px; }
.desc-snippet { color: var(--tv-muted); font-size: .78rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: .15rem; }
.data-row { cursor: pointer; }
.row-chevron { color: var(--tv-muted); transition: transform .15s ease; }
.data-row.open { background: #f1f4fc; }
.data-row.open .row-chevron { transform: rotate(90deg); color: var(--tv-primary); }
.expand-row > td { background: #f8fafc; padding: 0 !important; }
.expand-inner { padding: 1.25rem 1.5rem; width: min(1400px, calc(100vw - var(--tv-sidebar-w) - 5rem)); position: sticky; left: 0; }
@media (max-width: 991.98px) { .expand-inner { width: calc(100vw - 2.5rem); } }
.section-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--tv-muted); margin-bottom: .35rem; }
.expand-thumbs { display: flex; flex-wrap: wrap; gap: .4rem; }
.expand-thumbs img { width: 96px; height: 72px; object-fit: cover; border-radius: 8px; background: #e2e8f0; }

/* ---------------------------------------------------------------- detail */
.gallery-main { aspect-ratio: 16 / 10; background: #0f172a; border-radius: 16px; overflow: hidden; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.gallery-thumbs { display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .25rem; }
.gallery-thumbs img { width: 96px; height: 72px; object-fit: cover; border-radius: 9px; cursor: pointer; opacity: .6; border: 2px solid transparent; transition: opacity .15s; }
.gallery-thumbs img.active, .gallery-thumbs img:hover { opacity: 1; border-color: var(--tv-primary); }
.back-link { display: inline-flex; align-items: center; gap: .35rem; color: var(--tv-muted); text-decoration: none; font-weight: 500; }
.back-link:hover { color: var(--tv-primary); }

.kv { display: grid; grid-template-columns: minmax(130px, 40%) 1fr; gap: .5rem 1rem; font-size: .88rem; margin: 0; }
.kv dt { color: var(--tv-muted); font-weight: 500; }
.kv dd { margin: 0; font-weight: 600; word-break: break-word; color: var(--tv-ink); }
.kv-sm { font-size: .82rem; gap: .3rem 1rem; }
.feature-chip { display: inline-block; background: var(--tv-primary-soft); color: var(--tv-primary-dark); border: 1px solid #c3d0f0; border-radius: 99px; padding: .2rem .65rem; margin: 0 .35rem .4rem 0; font-size: .8rem; }
.feature-chip.sm { font-size: .7rem; padding: .05rem .45rem; margin: 0 .25rem .2rem 0; }
pre.raw { background: #0f172a; color: #e2e8f0; border-radius: 12px; padding: 1rem; max-height: 520px; overflow: auto; font-size: .78rem; }
.description { white-space: pre-line; line-height: 1.65; color: var(--tv-body); }
.card-title-sm { display: flex; align-items: center; gap: .5rem; font-size: .95rem; font-weight: 700; letter-spacing: -.01em; color: var(--tv-ink); margin-bottom: 1rem; }
.card-title-sm .tv-icon { color: var(--tv-primary); }

/* ---------------------------------------------------------------- jobs */
.fail-list { max-height: 380px; overflow: auto; }
.fail-list td { padding: .6rem .25rem; word-break: break-all; }
.fail-list td.empty-state { padding: 2rem 1rem; border-bottom: 0; word-break: normal; }
.log-box { background: #0f172a; color: #cbd5e1; font-family: "Cascadia Code", Consolas, monospace; font-size: .78rem; border-radius: 12px; padding: 1rem; height: 380px; overflow-y: auto; }
.log-box .error { color: #fca5a5; }
.log-box .warning { color: #fcd34d; }
.progress { height: 8px; border-radius: 99px; background: #eef2f6; }

/* ---------------------------------------------------------------- misc */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; background: radial-gradient(circle at 20% 20%, #3d66c9 0, var(--tv-primary-dark) 45%, #0a1838 100%); }
.login-card { position: relative; width: 100%; max-width: 420px; border-radius: 20px; overflow: hidden; }
.login-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, var(--tv-primary) 0%, var(--tv-accent) 100%); }
.login-tagline { display: inline-block; margin-top: 1rem; padding: .25rem .75rem; border-radius: 99px; background: var(--tv-primary-soft); color: var(--tv-primary-dark); font-size: .75rem; font-weight: 600; letter-spacing: .02em; }
.tv-input-icon { position: relative; }
.tv-input-icon > .tv-icon { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--tv-muted); z-index: 2; }
.tv-input-icon > .form-control { padding-left: 2.6rem; }
.tv-input-icon.has-toggle > .form-control { padding-right: 3rem; }
.password-toggle { position: absolute; right: .5rem; top: 50%; transform: translateY(-50%); z-index: 3; display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; padding: 0; border: 0; border-radius: .5rem; background: transparent; color: var(--tv-muted); cursor: pointer; }
.password-toggle:hover, .password-toggle:focus-visible { color: var(--tv-ink); background: rgba(15, 23, 42, .06); outline: none; }
.empty-state { padding: 3.25rem 1.25rem; text-align: center; color: var(--tv-muted); }
.table .empty-state { padding: 2.75rem 1rem; }
.tv-toasts { position: fixed; top: 1rem; right: 1rem; z-index: 1090; display: flex; flex-direction: column; gap: .6rem; width: min(420px, calc(100vw - 2rem)); pointer-events: none; }
.tv-toast { display: flex; align-items: flex-start; gap: .7rem; margin: 0; padding: .85rem .9rem; background: #fff; color: var(--tv-ink); border: 1px solid #e5e9f0; border-left: 4px solid var(--tv-primary); border-radius: 14px; box-shadow: 0 12px 32px rgba(15,23,42,.16); pointer-events: auto; animation: tv-toast-in .25s ease-out; }
.tv-toast-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; background: var(--tv-primary-soft); color: var(--tv-primary); }
.tv-toast-icon .tv-icon { width: 17px; height: 17px; }
.tv-toast-text { flex: 1; min-width: 0; padding-top: .3rem; font-weight: 500; line-height: 1.4; }
.tv-toast .btn-close { flex-shrink: 0; margin-top: .1rem; }
.tv-toast.alert-success { border-left-color: #15803d; }
.tv-toast.alert-success .tv-toast-icon { background: #dcfce7; color: #15803d; }
.tv-toast.alert-danger { border-left-color: #dc2626; }
.tv-toast.alert-danger .tv-toast-icon { background: #fee2e2; color: #dc2626; }
.tv-toast.alert-warning { border-left-color: #d99a00; }
.tv-toast.alert-warning .tv-toast-icon { background: var(--tv-accent-soft); color: #9a7200; }
@keyframes tv-toast-in { from { opacity: 0; transform: translateY(-8px); } }
.tv-toast.is-leaving { opacity: 0; transform: translateX(12px); transition: opacity .25s ease, transform .25s ease; }
@media (max-width: 575.98px) {
  .tv-toasts { top: .75rem; right: .75rem; width: calc(100vw - 1.5rem); }
}
.empty-state > .tv-icon { width: 3rem; height: 3rem; color: #cbd5e1; stroke-width: 1.5; }
.empty-state .empty-icon { width: 64px; height: 64px; margin: 0 auto .9rem; border-radius: 18px; display: grid; place-items: center; background: var(--tv-primary-soft); }
.empty-state .empty-icon .tv-icon { width: 28px; height: 28px; color: var(--tv-primary); stroke-width: 1.8; }
.empty-state .empty-title { color: var(--tv-ink); font-weight: 700; font-size: 1rem; margin-bottom: .25rem; }
.state-card { max-width: 560px; margin: 2rem auto 0; padding: 0 2rem 2rem; text-align: center; overflow: hidden; }
.state-card::before { content: ""; display: block; height: 84px; margin: 0 -2rem; background: radial-gradient(120% 140% at 0% 0%, rgba(240,177,0,.35) 0%, transparent 55%), linear-gradient(135deg, var(--tv-primary-deep), var(--tv-primary)); }
.state-card .state-icon { width: 76px; height: 76px; margin: -38px auto 1rem; border-radius: 22px; display: grid; place-items: center; background: #fff; color: var(--tv-primary); box-shadow: 0 0 0 4px #fff, 0 14px 32px rgba(16,37,89,.2); }
.state-card .state-icon .tv-icon { width: 32px; height: 32px; }
.state-card.danger .state-icon { color: #dc2626; }
.alert { border-radius: 12px; border: none; }
.alert .btn-close { margin-left: auto; position: static; padding: .5rem; }
.alert-dismissible { padding-right: 1rem; }
