:root {
    --tvx-ink: #0b1220;
    --tvx-ink-2: #111c30;
    --tvx-ink-3: #1b2a44;
    --tvx-teal: #0f766e;
    --tvx-teal-2: #14b8a6;
    --tvx-amber: #d97706;
    --tvx-bg: #f4f6f9;
    --tvx-card: #ffffff;
    --tvx-line: #e5e9f0;
    --tvx-text: #162033;
    --tvx-muted: #6b768a;
    --tvx-radius: 16px;
    --tvx-shadow: 0 10px 30px rgba(11, 18, 32, 0.06);
}

* {
    box-sizing: border-box;
}

body.tvx-app {
    margin: 0;
    background: var(--tvx-bg);
    color: var(--tvx-text);
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
}

.tvx-shell {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.tvx-sidebar {
    width: 264px;
    flex: 0 0 264px;
    height: 100vh;
    position: sticky;
    top: 0;
    background:
        radial-gradient(circle at 20% 0%, rgba(20, 184, 166, 0.18), transparent 42%),
        linear-gradient(180deg, var(--tvx-ink) 0%, #0d1626 100%);
    color: #dbe3ef;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.tvx-offcanvas {
    width: 280px !important;
}

.tvx-nav {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 22px 16px 18px;
}

.tvx-brand-block {
    padding: 0 8px 24px;
}

.tvx-brand {
    display: inline-block;
    font-weight: 800;
    letter-spacing: 0.22em;
    font-size: 1.15rem;
    color: #ffffff;
}

.tvx-brand-lg {
    font-size: 1.6rem;
}

.tvx-brand-sub {
    display: block;
    margin-top: 4px;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    color: #8ea0ba;
}

.tvx-nav-section {
    margin: 18px 10px 8px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #7385a0;
}

.tvx-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 3px;
    border-radius: 10px;
    color: #c6d1e2;
    font-size: 0.92rem;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
}

.tvx-nav-link i {
    width: 20px;
    text-align: center;
    font-size: 1.02rem;
}

.tvx-nav-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
}

.tvx-nav-link.active {
    background: linear-gradient(90deg, rgba(20, 184, 166, 0.22), rgba(20, 184, 166, 0.05));
    color: #ffffff;
    box-shadow: inset 3px 0 0 var(--tvx-teal-2);
}

.tvx-nav-link.disabled {
    color: #7385a0;
    cursor: default;
}

.tvx-nav-link.disabled:hover {
    background: transparent;
    color: #7385a0;
}

.tvx-soon {
    margin-left: auto;
    font-size: 0.62rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    padding: 1px 7px;
    color: #94a5bd;
}

.tvx-nav-footer {
    margin-top: auto;
}

.tvx-phase {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    font-size: 0.8rem;
    color: #c6d1e2;
}

.tvx-phase strong {
    color: #ffffff;
}

.tvx-phase-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--tvx-teal-2);
    box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.18);
}

.tvx-version {
    margin-top: 12px;
    padding: 0 12px;
    font-size: 0.68rem;
    color: #6d7f99;
}

/* Main */
.tvx-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.tvx-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 28px;
    background: rgba(244, 246, 249, 0.86);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--tvx-line);
}

.tvx-menu-btn {
    font-size: 1.4rem;
    color: var(--tvx-ink);
    padding: 0;
}

.tvx-titleblock {
    min-width: 0;
}

.tvx-eyebrow {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--tvx-muted);
}

.tvx-page-title {
    margin: 2px 0 0;
    font-size: 1.35rem;
    font-weight: 750;
    letter-spacing: -0.02em;
    color: var(--tvx-ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tvx-topbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 14px;
}

.tvx-user {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--tvx-ink-2);
}

.tvx-content {
    padding: 28px;
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
}

/* Page head */
.tvx-page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.tvx-page-head h2 {
    margin: 4px 0 6px;
    font-size: 1.65rem;
    font-weight: 780;
    letter-spacing: -0.03em;
    color: var(--tvx-ink);
}

.tvx-page-head p {
    margin: 0;
    color: var(--tvx-muted);
    font-size: 0.92rem;
}

.tvx-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 650;
    color: var(--tvx-teal);
}

.tvx-back:hover {
    color: #0b5f59;
}

.tvx-badge-lg {
    font-size: 0.78rem;
    padding: 7px 12px;
    border-radius: 999px;
}

/* Hero */
.tvx-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    padding: 26px 28px;
    margin-bottom: 22px;
    border-radius: 20px;
    color: #ffffff;
    background:
        radial-gradient(circle at 88% 10%, rgba(20, 184, 166, 0.35), transparent 42%),
        linear-gradient(135deg, var(--tvx-ink) 0%, #14243d 70%, #0f3b3a 100%);
    box-shadow: var(--tvx-shadow);
}

.tvx-hero h2 {
    margin: 8px 0 8px;
    font-size: 1.55rem;
    font-weight: 760;
    letter-spacing: -0.025em;
}

.tvx-hero p {
    margin: 0;
    max-width: 680px;
    color: #c3cfdf;
    font-size: 0.92rem;
}

.tvx-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--tvx-teal-2);
}

.tvx-hero .tvx-kicker {
    color: #7fe3d8;
}

/* Buttons */
.tvx-btn-primary {
    --bs-btn-color: #ffffff;
    --bs-btn-hover-color: #ffffff;
    --bs-btn-active-color: #ffffff;
    border: 0;
    background: linear-gradient(135deg, var(--tvx-teal) 0%, #0b8f83 100%);
    font-weight: 650;
    border-radius: 10px;
    padding: 9px 16px;
    box-shadow: 0 8px 18px rgba(15, 118, 110, 0.22);
}

.tvx-btn-primary:hover,
.tvx-btn-primary:focus {
    background: linear-gradient(135deg, #0c655e 0%, #087c71 100%);
    box-shadow: 0 10px 22px rgba(15, 118, 110, 0.28);
}

.tvx-link {
    font-size: 0.82rem;
    font-weight: 650;
    color: var(--tvx-teal);
    white-space: nowrap;
}

.tvx-link-muted {
    color: var(--tvx-muted);
    font-size: 0.85rem;
}

/* Stats */
.tvx-stat {
    position: relative;
    height: 100%;
    padding: 18px;
    border-radius: var(--tvx-radius);
    background: var(--tvx-card);
    border: 1px solid var(--tvx-line);
    box-shadow: var(--tvx-shadow);
}

.tvx-stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 1.1rem;
    margin-bottom: 12px;
}

.tvx-icon-ink {
    background: #eef2f7;
    color: var(--tvx-ink);
}

.tvx-icon-green {
    background: #e7f7f2;
    color: #0f766e;
}

.tvx-icon-blue {
    background: #e8f1ff;
    color: #2563eb;
}

.tvx-icon-amber {
    background: #fff4e5;
    color: #b45309;
}

.tvx-stat-value {
    font-size: 1.9rem;
    font-weight: 780;
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--tvx-ink);
}

.tvx-stat-label {
    margin-top: 5px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--tvx-muted);
}

/* Cards */
.tvx-card {
    padding: 22px;
    border-radius: var(--tvx-radius);
    background: var(--tvx-card);
    border: 1px solid var(--tvx-line);
    box-shadow: var(--tvx-shadow);
}

.tvx-card.p-0 {
    padding: 0;
    overflow: hidden;
}

.tvx-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.tvx-card-head h3 {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 750;
    letter-spacing: -0.01em;
    color: var(--tvx-ink);
}

.tvx-card-head p {
    margin: 3px 0 0;
    font-size: 0.8rem;
    color: var(--tvx-muted);
}

/* Tables */
.tvx-table {
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--tvx-line);
    margin-bottom: 0;
}

.tvx-table thead th {
    padding: 11px 16px;
    background: #f8fafc;
    border-bottom: 1px solid var(--tvx-line);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--tvx-muted);
    white-space: nowrap;
}

.tvx-table tbody td {
    padding: 13px 16px;
    border-bottom: 1px solid #edf1f6;
    font-size: 0.88rem;
    vertical-align: middle;
}

.tvx-table tbody tr:last-child td {
    border-bottom: 0;
}

.tvx-table tbody tr:hover {
    background: #fafcfe;
}

.tvx-muted {
    color: var(--tvx-muted);
    font-size: 0.8rem;
}

.tvx-code {
    font-size: 0.76rem;
    color: #475569;
    background: #f1f5f9;
    border-radius: 6px;
    padding: 2px 6px;
}

/* Empty */
.tvx-empty {
    padding: 28px 18px;
    text-align: center;
    color: var(--tvx-muted);
}

.tvx-empty i {
    font-size: 1.8rem;
    color: #b6c0cf;
    display: block;
    margin-bottom: 8px;
}

.tvx-empty p {
    margin: 0;
    font-size: 0.86rem;
}

.tvx-empty-lg {
    padding: 52px 24px;
}

.tvx-empty-lg h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--tvx-ink);
    margin: 6px 0;
}

.tvx-empty-lg p {
    margin-bottom: 14px;
}

/* Timeline */
.tvx-timeline {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tvx-timeline li {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 0 0 18px 0;
}

.tvx-timeline li:not(:last-child)::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 12px;
    bottom: 0;
    width: 1px;
    background: var(--tvx-line);
}

.tvx-timeline li:last-child {
    padding-bottom: 0;
}

.tvx-timeline-dot {
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    margin-top: 6px;
    border-radius: 50%;
    background: var(--tvx-teal-2);
    box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.14);
    z-index: 1;
}

.tvx-timeline-body {
    flex: 1;
    min-width: 0;
    font-size: 0.86rem;
}

.tvx-timeline-body .tvx-muted {
    margin-top: 2px;
}

.tvx-timeline time {
    white-space: nowrap;
    font-size: 0.74rem;
}

.tvx-timeline-compact li {
    padding-bottom: 14px;
}

/* Modules */
.tvx-module {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    height: 100%;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--tvx-line);
    background: #fbfcfe;
}

.tvx-module i {
    font-size: 1.15rem;
    margin-top: 2px;
}

.tvx-module strong {
    display: block;
    font-size: 0.86rem;
    color: var(--tvx-ink);
}

.tvx-module span {
    display: block;
    margin-top: 2px;
    font-size: 0.75rem;
    color: var(--tvx-muted);
}

.tvx-module.done {
    border-color: #c7ece5;
    background: #f2fbf8;
}

.tvx-module.done i {
    color: #0f766e;
}

.tvx-module.next i {
    color: #94a3b8;
}

/* Toolbar */
.tvx-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.tvx-search {
    position: relative;
    flex: 1;
    min-width: 220px;
    max-width: 420px;
}

.tvx-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--tvx-muted);
    font-size: 0.9rem;
}

.tvx-search input {
    width: 100%;
    padding: 9px 12px 9px 34px;
    border: 1px solid var(--tvx-line);
    border-radius: 10px;
    background: #ffffff;
    font-size: 0.9rem;
    color: var(--tvx-text);
}

.tvx-search input:focus {
    outline: 0;
    border-color: var(--tvx-teal-2);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.14);
}

.tvx-filter-select {
    width: auto;
    min-width: 160px;
    border-radius: 10px;
    border-color: var(--tvx-line);
    font-size: 0.9rem;
}

.tvx-pagination {
    margin-top: 18px;
}

.tvx-pagination .pagination {
    margin: 0;
}

.tvx-pagination .page-link {
    color: var(--tvx-teal);
    border-color: var(--tvx-line);
    font-size: 0.85rem;
}

.tvx-pagination .active > .page-link {
    background: var(--tvx-teal);
    border-color: var(--tvx-teal);
    color: #ffffff;
}

.tvx-list-foot {
    margin-top: 10px;
    font-size: 0.78rem;
    color: var(--tvx-muted);
}

/* Tenant detail */
.tvx-kv-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 24px;
}

.tvx-kv {
    min-width: 0;
}

.tvx-kv span {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--tvx-muted);
    margin-bottom: 3px;
}

.tvx-kv strong {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--tvx-ink);
    overflow-wrap: anywhere;
}

.tvx-kv-wide {
    grid-column: 1 / -1;
}

.tvx-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    font-size: 0.85rem;
    border-bottom: 1px dashed #edf1f6;
}

.tvx-info-row:last-of-type {
    border-bottom: 0;
}

.tvx-info-row > span:first-child {
    color: var(--tvx-muted);
}

.tvx-info-row > span:last-child {
    font-weight: 600;
    color: var(--tvx-ink);
    text-align: right;
}

.tvx-divider {
    margin: 14px 0;
    border-color: var(--tvx-line);
    opacity: 1;
}

.tvx-wa-account {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--tvx-line);
    border-radius: 12px;
    background: #fbfcfe;
    margin-bottom: 10px;
}

.tvx-wa-account:last-of-type {
    margin-bottom: 0;
}

.tvx-wa-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #e7f7f2;
    color: #0f766e;
    font-size: 1.15rem;
    flex: 0 0 auto;
}

.tvx-error-text {
    margin-top: 3px;
    font-size: 0.76rem;
    color: #b91c1c;
}

.tvx-settings {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tvx-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #edf1f6;
    font-size: 0.82rem;
}

.tvx-setting-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.tvx-setting-row code {
    font-size: 0.72rem;
    color: #475569;
}

.tvx-setting-row > span {
    text-align: right;
    font-weight: 600;
    color: var(--tvx-ink);
}

/* Forms */
.tvx-form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

.tvx-required {
    color: #dc2626;
}

.form-label {
    font-size: 0.8rem;
    font-weight: 650;
    color: var(--tvx-ink-2);
    margin-bottom: 5px;
}

.form-control,
.form-select,
.input-group-text {
    border-color: #dbe2ec;
    font-size: 0.9rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--tvx-teal-2);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.14);
}

.input-group-text {
    background: #f8fafc;
    color: var(--tvx-muted);
}

.form-text {
    font-size: 0.74rem;
    color: var(--tvx-muted);
}

.tvx-alert {
    border: 0;
    border-radius: 12px;
    font-size: 0.88rem;
    box-shadow: 0 6px 18px rgba(11, 18, 32, 0.05);
}

/* Guest / login */
body.tvx-guest {
    margin: 0;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px 16px;
    background: #071019;
    color: #e5ecf6;
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    overflow-x: hidden;
    position: relative;
}

.tvx-guest-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(10px);
    pointer-events: none;
}

.tvx-guest-glow-a {
    width: 520px;
    height: 520px;
    top: -220px;
    right: -140px;
    background: radial-gradient(circle, rgba(20, 184, 166, 0.28), transparent 65%);
}

.tvx-guest-glow-b {
    width: 480px;
    height: 480px;
    bottom: -220px;
    left: -160px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.22), transparent 65%);
}

.tvx-guest-wrap {
    position: relative;
    z-index: 1;
    width: min(440px, 100%);
}

.tvx-guest-brand {
    text-align: center;
    margin-bottom: 20px;
}

.tvx-guest-brand .tvx-brand-sub {
    color: #8fa1bb;
}

.tvx-guest-card {
    padding: 30px 30px 26px;
    border-radius: 20px;
    background: #ffffff;
    color: var(--tvx-text);
    box-shadow: 0 26px 70px rgba(0, 0, 0, 0.38);
}

.tvx-login-head {
    margin-bottom: 22px;
}

.tvx-login-head .tvx-kicker {
    color: var(--tvx-teal);
}

.tvx-login-head h1 {
    margin: 8px 0 6px;
    font-size: 1.55rem;
    font-weight: 780;
    letter-spacing: -0.03em;
    color: var(--tvx-ink);
}

.tvx-login-head p {
    margin: 0;
    font-size: 0.86rem;
    color: var(--tvx-muted);
}

.tvx-login-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--tvx-line);
    font-size: 0.76rem;
    color: var(--tvx-muted);
}

.tvx-login-note i {
    color: var(--tvx-teal);
    margin-top: 1px;
}

.tvx-guest-foot {
    margin-top: 18px;
    text-align: center;
    font-size: 0.72rem;
    color: #7c8ea8;
}

/* Responsive */
@media (max-width: 991.98px) {
    .tvx-content {
        padding: 20px 16px 28px;
    }

    .tvx-topbar {
        padding: 14px 16px;
    }

    .tvx-page-title {
        font-size: 1.15rem;
    }

    .tvx-hero {
        padding: 22px 20px;
    }

    .tvx-hero h2 {
        font-size: 1.3rem;
    }
}

@media (max-width: 575.98px) {
    .tvx-page-head {
        align-items: flex-start;
    }

    .tvx-page-head h2 {
        font-size: 1.4rem;
    }

    .tvx-kv-grid {
        grid-template-columns: 1fr;
    }

    .tvx-card {
        padding: 18px;
    }

    .tvx-toolbar {
        align-items: stretch;
    }

    .tvx-search {
        max-width: none;
    }

    .tvx-filter-select {
        width: 100%;
    }

    .tvx-form-actions {
        flex-direction: column-reverse;
    }

    .tvx-form-actions .btn {
        width: 100%;
    }
}

/* Table combinations */
.tvx-combo-room {
    border: 1px solid var(--tvx-line);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 14px;
    background: #fbfcfe;
}

.tvx-combo-room-title {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--tvx-ink-2);
    margin-bottom: 10px;
}

.tvx-check-card {
    position: relative;
    margin: 0;
    padding: 10px 12px 10px 2.5rem;
    border: 1px solid var(--tvx-line);
    border-radius: 10px;
    background: #fff;
}

.tvx-check-card .form-check-input {
    position: absolute;
    left: 0.85rem;
    top: 1rem;
    margin: 0;
}

.tvx-check-card .form-check-label {
    font-size: 0.85rem;
    line-height: 1.3;
}

