@import url("https://fonts.googleapis.com/css2?family=Epilogue:wght@400;500;600;700&family=Outfit:wght@500;600;700;800&display=swap");

/* ——— Merchant app shell ——— */
.tx-app {
    font-family: Satoshi, Epilogue, system-ui, sans-serif !important;
    background:
        radial-gradient(ellipse 80% 50% at 100% -20%, rgba(0, 62, 137, 0.08), transparent 55%),
        radial-gradient(ellipse 50% 40% at 0% 100%, rgba(255, 184, 77, 0.06), transparent 50%),
        var(--tx-page, #F9F7F2) !important;
    color: var(--tx-text, #0c1222) !important;
    min-height: 100vh;
}

.tx-app h1,
.tx-app h2,
.tx-app h3,
.tx-app h4,
.tx-app .font-bold {
    font-family: Outfit, Epilogue, sans-serif;
    color: var(--tx-text, #0f172a) !important;
    letter-spacing: -0.02em;
}

/* Topbar */
.tx-app header,
.tx-app .tx-topbar {
    background: rgba(249, 247, 242, 0.94) !important;
    color: var(--tx-text, #0f172a) !important;
    border-bottom: 1px solid var(--tx-border, #e2e8f0) !important;
    backdrop-filter: blur(14px);
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.tx-app #menuBtn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--tx-border, #e2e8f0);
    background: var(--tx-panel, #fff);
    color: var(--tx-text, #0f172a);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (min-width: 1024px) {
    .tx-app #menuBtn {
        display: none !important;
    }
}

.tx-app #menuBtn:hover {
    background: var(--tx-raised, #f8fafc);
}

.tx-app .tx-topbar .glass {
    background: var(--tx-raised, #f8fafc) !important;
    border: 1px solid var(--tx-border, #e2e8f0) !important;
    color: var(--tx-text, #0c1222) !important;
    box-shadow: none !important;
}

/* Sidebar rail */
.tx-app aside,
.tx-app #sidebar,
.tx-app .dashify-rail {
    background: var(--tx-panel, #fff) !important;
    color: var(--tx-text, #0f172a) !important;
    border-right: 1px solid var(--tx-border, #e2e8f0) !important;
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.04);
}

.tx-app #sidebar {
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), width 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    flex-direction: column;
}

.tx-app .sidebar-rail-tools {
    display: none;
    justify-content: flex-end;
    padding: 0.65rem 0.85rem 0;
}

.tx-app .sidebar-collapse-btn,
.tx-app .tx-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--tx-border, #e2e8f0);
    background: var(--tx-raised, #f8fafc);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--tx-text, #0f172a);
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.tx-app .sidebar-collapse-btn:hover,
.tx-app .tx-icon-btn:hover {
    background: #eff6ff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
}

.tx-app .tx-nav-section {
    margin: 0 0 0.4rem;
    padding: 0 0.75rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #334155;
}

.tx-app .tx-nav-group {
    margin-bottom: 0.45rem;
}

.tx-app .tx-nav-group-toggle {
    display: flex !important;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    min-height: 46px;
    padding: 0.55rem 0.75rem !important;
    border-radius: 14px !important;
    border: 0;
    background: transparent !important;
    color: #0c1222 !important;
    font: inherit;
    font-weight: 700;
    font-size: 0.9rem;
    text-align: left;
    cursor: pointer;
}

.tx-app .tx-nav-group-toggle:hover {
    background: #eff6ff !important;
    color: #003e89 !important;
}

.tx-app .tx-nav-group.is-open > .tx-nav-group-toggle {
    background: #e8f0fa !important;
    color: #003e89 !important;
}

.tx-app .tx-nav-chevron {
    margin-left: auto;
    display: inline-flex;
    width: 18px;
    height: 18px;
    color: #64748b;
    transition: transform 0.2s ease;
}

.tx-app .tx-nav-chevron svg {
    width: 16px;
    height: 16px;
}

.tx-app .tx-nav-group.is-open .tx-nav-chevron {
    transform: rotate(180deg);
    color: #003e89;
}

.tx-app .tx-nav-group-panel {
    display: grid;
    gap: 0.2rem;
    padding: 0.15rem 0 0.35rem 0.55rem;
    margin: 0 0 0.25rem 0.85rem;
    border-left: 2px solid rgba(0, 62, 137, 0.16);
}

.tx-app .tx-nav-group-panel[hidden] {
    display: none !important;
}

.tx-app .tx-nav-group-panel .tx-nav-link {
    min-height: 42px;
    padding: 0.4rem 0.65rem !important;
    font-size: 0.875rem;
}

.tx-app .sidebar-nav-scroll {
    flex: 1 1 auto;
    overflow-y: auto;
}

.tx-app .sidebar-footer {
    margin-top: auto;
    padding: 0.75rem 1rem 1.25rem;
    border-top: 1px solid var(--tx-border, #e2e8f0);
    background: linear-gradient(180deg, transparent, rgba(248, 250, 252, 0.96));
}

html[data-trinix-theme="dark"] .tx-app .sidebar-footer,
body.tx-app.tx-dark .sidebar-footer {
    background: linear-gradient(180deg, transparent, rgba(18, 26, 42, 0.98));
    border-top-color: rgba(148, 163, 184, 0.2);
}

.tx-app .tx-topbar {
    backdrop-filter: blur(14px) saturate(1.15);
    -webkit-backdrop-filter: blur(14px) saturate(1.15);
    border-bottom: 1px solid var(--tx-border, #e2e8f0);
    background: rgba(255, 255, 255, 0.86) !important;
    transition: box-shadow 0.25s ease, background 0.25s ease;
}

.tx-app .tx-main {
    transition: margin-left 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Collapsed icon rail (desktop) */
@media (min-width: 1024px) {
    .tx-app .sidebar-rail-tools { display: flex !important; }

    html.tx-sidebar-collapsed .tx-app #sidebar {
        width: 5.25rem !important;
    }

    html.tx-sidebar-collapsed .tx-app .tx-main,
    html.tx-sidebar-collapsed .tx-app main.lg\:ml-72 {
        margin-left: 5.25rem !important;
    }

    html.tx-sidebar-collapsed .tx-app .tx-nav-label,
    html.tx-sidebar-collapsed .tx-app .tx-nav-section,
    html.tx-sidebar-collapsed .tx-app .tx-nav-chevron,
    html.tx-sidebar-collapsed .tx-app .sidebar-drawer-title {
        display: none !important;
    }

    html.tx-sidebar-collapsed .tx-app .tx-nav-group-panel {
        display: grid !important;
        margin: 0;
        padding: 0;
        border: 0;
        gap: 0.25rem;
    }

    html.tx-sidebar-collapsed .tx-app .tx-nav-group-panel[hidden] {
        display: grid !important;
    }

    html.tx-sidebar-collapsed .tx-app .tx-nav-group-toggle {
        display: none !important;
    }

    html.tx-sidebar-collapsed .tx-app .tx-nav-link,
    html.tx-sidebar-collapsed .tx-app .tx-nav-group-toggle {
        justify-content: center;
        padding-inline: 0.55rem !important;
        position: relative;
    }

    html.tx-sidebar-collapsed .tx-app .tx-nav-link[data-tooltip]:hover::after,
    html.tx-sidebar-collapsed .tx-app .tx-nav-group-toggle[data-tooltip]:hover::after {
        content: attr(data-tooltip);
        position: absolute;
        left: calc(100% + 10px);
        top: 50%;
        transform: translateY(-50%);
        white-space: nowrap;
        background: #0c1222;
        color: #fff;
        font-size: 0.75rem;
        font-weight: 600;
        padding: 0.4rem 0.65rem;
        border-radius: 8px;
        z-index: 60;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
    }
}

.tx-app .sidebar-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1rem 0.5rem;
    border-bottom: 1px solid var(--tx-border, #e2e8f0);
    margin-bottom: 0.5rem;
}

@media (min-width: 1024px) {
    .tx-app .sidebar-drawer-head {
        display: none !important;
    }

    .tx-app #sidebar.sidebar,
    .tx-app aside#sidebar {
        top: 4rem !important;
        height: calc(100dvh - 4rem) !important;
        height: calc(100vh - 4rem) !important;
        z-index: 30 !important;
        transform: none !important;
    }

    .tx-app main.lg\:ml-72,
    .tx-app .tx-main.lg\:ml-72,
    .tx-app main.tx-main {
        margin-left: 18rem !important; /* w-72 */
        width: auto !important;
        max-width: none !important;
    }
}

.tx-app .sidebar-drawer-title {
    font-family: Outfit, sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
}

.tx-app .sidebar-close-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--tx-border, #e2e8f0);
    background: var(--tx-raised, #f8fafc);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--tx-text, #0f172a);
}

.tx-app .tx-nav-link {
    display: flex !important;
    align-items: center;
    gap: 0.75rem;
    min-height: 46px;
    padding: 0.55rem 0.75rem !important;
    border-radius: 14px !important;
    color: var(--tx-muted, #334155) !important;
    font-weight: 550;
    font-size: 0.925rem;
    text-decoration: none !important;
    background: transparent !important;
    transition: background 0.2s ease, color 0.2s ease;
}

.tx-app .tx-nav-ico {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: var(--tx-raised, #f1f5f9);
    color: #2563eb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tx-app .tx-nav-ico svg,
.tx-app .tx-nav-ico .tx-icon {
    width: 18px;
    height: 18px;
}

.tx-app .tx-nav-link:hover {
    background: #eff6ff !important;
    color: #1d4ed8 !important;
}

.tx-app .tx-nav-link.is-active {
    background: #0c1222 !important;
    color: #fff !important;
}

.tx-app .tx-nav-link.is-active .tx-nav-ico {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.tx-app .tx-nav-logout {
    color: #dc2626 !important;
    margin-top: 0.75rem;
}

.tx-app .tx-nav-logout .tx-nav-ico {
    background: #fef2f2;
    color: #dc2626;
}

.tx-app .tx-nav-logout:hover {
    background: #fef2f2 !important;
    color: #b91c1c !important;
}

.tx-drawer-overlay {
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
}

body.drawer-open {
    overflow: hidden !important;
}

/* Cards / glass */
.tx-app .glass,
.tx-app .bg-gray-900,
.tx-app .bg-gray-900\/60,
.tx-app .bg-gray-900\/70,
.tx-app .bg-gray-900\/80,
.tx-app .bg-gray-900\/90,
.tx-app .bg-gray-800,
.tx-app .bg-gray-800\/50,
.tx-app .bg-gray-800\/40,
.tx-app .border-gray-800,
.tx-app .border-gray-700 {
    background: var(--tx-panel, #fff) !important;
    color: var(--tx-text, #0c1222) !important;
    border-color: var(--tx-border, #e2e8f0) !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.04);
    border-radius: 1.15rem;
}

.tx-app .text-white,
.tx-app .text-gray-300,
.tx-app .text-gray-400,
.tx-app .text-gray-500 {
    color: #334155 !important;
}

.tx-app form.text-white,
.tx-app .text-white.mb-2,
.tx-app h1.text-white {
    color: var(--tx-text, #0c1222) !important;
}

.tx-app .bg-blue-600,
.tx-app a.bg-blue-600,
.tx-app button.bg-blue-600,
.tx-app .btn-primary {
    background: var(--tx-brand, #003e89) !important;
    color: #fff !important;
    border-radius: 999px;
}
.tx-app .btn-primary:hover,
.tx-app a.bg-blue-600:hover,
.tx-app button.bg-blue-600:hover {
    background: var(--tx-brand-hover, #002e67) !important;
}

.tx-app aside a:not(.tx-nav-link),
.tx-app #sidebar a:not(.tx-nav-link),
.tx-app .dashify-link {
    color: var(--tx-muted, #334155) !important;
    border-radius: 12px;
}

.tx-app tr:hover td {
    background: #f8fafc !important;
}

.tx-app main > * {
    animation: tx-app-rise 0.45s ease both;
}

.tx-app main > *:nth-child(2) { animation-delay: 0.06s; }
.tx-app main > *:nth-child(3) { animation-delay: 0.12s; }

.tx-app .empty-state {
    background: var(--tx-panel, #fff);
    border: 1px dashed #93c5fd;
    border-radius: 1.35rem;
    padding: 3rem 1.5rem;
    text-align: center;
    box-shadow: none;
}

.tx-app .empty-state a,
.tx-app .tx-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1rem;
    background: #0c1222;
    color: #fff !important;
    border-radius: 999px;
    padding: 0.8rem 1.2rem;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.tx-app .empty-state a:hover,
.tx-app .tx-btn:hover { transform: translateY(-2px); }

.tx-app .tx-chip-btn {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: 1px solid var(--tx-border, #e2e8f0);
    background: #f8fafc;
    color: #0c1222;
    font: inherit;
    font-weight: 650;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.tx-app .tx-chip-btn:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.tx-app .tx-channel-list {
    display: grid;
    gap: 0.65rem;
}

.tx-app .tx-channel-row {
    display: grid;
    grid-template-columns: minmax(7rem, 9rem) 1fr auto;
    gap: 0.75rem;
    align-items: center;
    font-size: 0.9rem;
}

.tx-app .tx-bar {
    display: inline-block;
    height: 10px;
    max-width: 100%;
    background: linear-gradient(90deg, #003e89, #3b82f6);
    border-radius: 99px;
    vertical-align: middle;
}

@media (max-width: 640px) {
    .tx-app .tx-channel-row {
        grid-template-columns: 1fr auto;
    }
    .tx-app .tx-channel-row .tx-bar {
        grid-column: 1 / -1;
        width: 100% !important;
        max-width: none;
    }
}

.tx-app button:active,
.tx-app .tx-btn:active { transform: translateY(1px) scale(0.98); }

/* Quick action tiles */
.tx-app .tx-action-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.tx-app .tx-action-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1.25rem 1.35rem;
    background: var(--tx-panel, #fff);
    border: 1px solid var(--tx-border, #e2e8f0);
    border-radius: 1.15rem;
    text-decoration: none !important;
    color: inherit !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.tx-app .tx-action-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
    border-color: rgba(37, 99, 235, 0.25);
}

.tx-app .tx-action-ico {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #eff6ff;
    color: #2563eb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tx-app .tx-action-ico svg {
    width: 22px;
    height: 22px;
}

.tx-app .tx-action-card h4 {
    font-size: 0.98rem;
    font-weight: 700;
    margin: 0;
}

.tx-app .tx-action-card p {
    margin: 0;
    font-size: 0.82rem;
    color: var(--tx-muted, #334155) !important;
}

.tx-app .tx-page-head {
    margin-bottom: 1.75rem;
}

.tx-app .tx-page-head h1 {
    font-size: clamp(1.65rem, 3vw, 2rem);
    margin: 0;
}

.tx-app .tx-page-head p {
    margin: 0.35rem 0 0;
    color: var(--tx-muted, #334155) !important;
}

.tx-app .tx-panel-card {
    background: var(--tx-surface-card, var(--tx-panel, #fff));
    border: 1px solid var(--tx-border-card, var(--tx-border, #e2e8f0));
    border-radius: 1.15rem;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 28px rgba(15, 23, 42, 0.05);
    padding: 0;
    border-left: 3px solid transparent;
}

.tx-app section.grid > .tx-panel-card:nth-child(4n + 1) { border-left-color: var(--tx-brand, #003e89); }
.tx-app section.grid > .tx-panel-card:nth-child(4n + 2) { border-left-color: var(--tx-accent-teal, #0f6b4c); }
.tx-app section.grid > .tx-panel-card:nth-child(4n + 3) { border-left-color: var(--tx-accent-sky, #1d6bb8); }
.tx-app section.grid > .tx-panel-card:nth-child(4n + 4) { border-left-color: var(--tx-accent-amber, #b45309); }

.tx-app .tx-panel-card.p-5,
.tx-app .tx-panel-card.p-6 {
    padding: 1.25rem 1.35rem !important;
}

.tx-app .tx-panel-card > h2,
.tx-app .tx-panel-card > h3 {
    margin: 0 0 0.75rem;
    font-size: 1.1rem;
}

.tx-app .tx-panel-card .tx-panel-head {
    padding: 1.15rem 1.35rem;
    border-bottom: 1px solid var(--tx-border, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

/* Stat / metric cards */
.tx-app .tx-stat-grid,
.tx-app main > section.grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.tx-app .tx-stat-card,
.tx-app .tx-panel-card.p-5 > p.tx-note + strong,
.tx-app section.grid > .tx-panel-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-height: 108px;
    justify-content: space-between;
}

.tx-app section.grid > .tx-panel-card strong {
    font-size: clamp(1.5rem, 2.5vw, 1.85rem);
    letter-spacing: -0.03em;
    color: #0c1222 !important;
    font-family: Outfit, Epilogue, sans-serif;
}

.tx-app .tx-note {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--tx-muted, #334155) !important;
}

/* Forms */
.tx-app .tx-form,
.tx-app form.tx-form,
.tx-app .tx-panel-card form {
    display: grid;
    gap: 0.85rem;
    margin-top: 1rem;
}

.tx-app .tx-form-row {
    display: grid;
    gap: 0.85rem;
}

@media (min-width: 768px) {
    .tx-app .tx-form-row.is-2 { grid-template-columns: 1fr 1fr; }
    .tx-app .tx-form-row.is-3 { grid-template-columns: 1fr 1fr 1fr; }
}

.tx-app label,
.tx-app .tx-field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 650;
    color: #334155;
    margin-bottom: 0.35rem;
}

.tx-app .tx-form input,
.tx-app .tx-form select,
.tx-app .tx-form textarea,
.tx-app .tx-panel-card input:not([type="checkbox"]):not([type="radio"]),
.tx-app .tx-panel-card select,
.tx-app .tx-panel-card textarea,
.tx-app .glass input,
.tx-app .glass select,
.tx-app .glass textarea {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--tx-border, #e2e8f0) !important;
    border-radius: 12px !important;
    padding: 0.7rem 0.95rem !important;
    background: #fff !important;
    color: var(--tx-text, #0c1222) !important;
    font: inherit;
    box-shadow: none !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tx-app .tx-form textarea,
.tx-app .tx-panel-card textarea {
    min-height: 110px;
    resize: vertical;
}

.tx-app .tx-form input:focus,
.tx-app .tx-form select:focus,
.tx-app .tx-form textarea:focus,
.tx-app .tx-panel-card input:focus,
.tx-app .tx-panel-card select:focus,
.tx-app .tx-panel-card textarea:focus,
.tx-app .glass input:focus,
.tx-app .glass select:focus,
.tx-app .glass textarea:focus {
    outline: none !important;
    border-color: #93c5fd !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}

.tx-app .tx-form .tx-btn,
.tx-app .tx-panel-card .tx-btn {
    margin-top: 0;
    justify-self: start;
    min-height: 46px;
}

/* Tables */
.tx-app .tx-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 0 0 1.15rem 1.15rem;
}

.tx-app .tx-table,
.tx-app table.tx-table,
.tx-app .tx-panel-card table {
    width: 100%;
    border-collapse: collapse;
    min-width: 480px;
}

.tx-app .tx-table th,
.tx-app .tx-table td,
.tx-app .tx-panel-card table th,
.tx-app .tx-panel-card table td {
    text-align: left;
    padding: 0.85rem 1.15rem;
    border-bottom: 1px solid var(--tx-border, #e2e8f0);
    font-size: 0.9rem;
    vertical-align: middle;
}

.tx-app .tx-table th,
.tx-app .tx-panel-card table th {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #334155 !important;
    background: #f8fafc;
}

.tx-app .tx-table tr:last-child td,
.tx-app .tx-panel-card table tr:last-child td {
    border-bottom: 0;
}

.tx-app .tx-table tbody tr:hover td {
    background: #f8fafc;
}

.tx-app main.tx-main,
.tx-app main.lg\:ml-72 {
    max-width: 100%;
}

.tx-app main > section + section {
    margin-top: 0;
}

.tx-app main.space-y-6 > * + * {
    margin-top: 1.25rem;
}

@media (max-width: 1024px) {
    .tx-app .tx-stat-grid,
    .tx-app main > section.grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .tx-app .tx-stat-grid,
    .tx-app main > section.grid,
    .tx-app .tx-action-grid {
        grid-template-columns: 1fr !important;
    }

    .tx-app .tx-main,
    .tx-app main.lg\:ml-72 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .tx-app .tx-panel-card.p-5,
    .tx-app .tx-panel-card.p-6 {
        padding: 1.1rem 1.05rem !important;
    }

    .tx-app .tx-form .tx-btn,
    .tx-app .tx-panel-card .tx-btn,
    .tx-app .empty-state a {
        width: 100%;
        justify-content: center;
    }
}

.tx-app .tx-status {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 650;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.tx-app .status-active,
.tx-app .tx-status-active {
    background: #ecfdf5;
    color: #047857 !important;
}

.tx-app .status-pending,
.tx-app .tx-status-pending {
    background: #fffbeb;
    color: #b45309 !important;
}

.tx-app .status-draft,
.tx-app .tx-status-draft {
    background: #f1f5f9;
    color: #475569 !important;
}

.tx-app .tx-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--tx-border, #e2e8f0);
    background: var(--tx-raised, #f8fafc);
    color: var(--tx-muted, #475569);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tx-app .tx-icon-btn:hover {
    color: #1d4ed8;
    border-color: #bfdbfe;
    background: #eff6ff;
}

.tx-app .tx-icon-btn svg {
    width: 16px;
    height: 16px;
}

.tx-theme-btn {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #2563eb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex: 0 0 auto;
}

.tx-icon,
[data-lucide] {
    display: inline-block;
    vertical-align: middle;
}

@keyframes tx-app-rise {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

@media (max-width: 1023px) {
    .tx-app .tx-action-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tx-app .tx-topbar,
    .tx-app header.tx-topbar {
        z-index: 120 !important;
    }

    .tx-app #sidebar {
        z-index: 110 !important;
        box-shadow: 8px 0 40px rgba(15, 23, 42, 0.18);
    }

    .tx-drawer-overlay,
    .tx-app #overlay {
        z-index: 100 !important;
    }

    .tx-app #overlay.hidden,
    .tx-drawer-overlay.hidden {
        display: none !important;
        pointer-events: none !important;
    }
}

@media (max-width: 640px) {
    .tx-app .tx-action-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tx-app main > *,
    .tx-app #sidebar { animation: none !important; transition: none !important; }
}

/* Dark */
body.tx-app.tx-dark,
html[data-trinix-theme="dark"] body.tx-app {
    background:
        radial-gradient(ellipse 70% 45% at 90% -10%, rgba(37, 99, 235, 0.14), transparent 55%),
        var(--tx-page) !important;
    color: var(--tx-text) !important;
}

html[data-trinix-theme="dark"] .tx-app header,
html[data-trinix-theme="dark"] .tx-app .tx-topbar,
html[data-trinix-theme="dark"] .tx-app aside,
html[data-trinix-theme="dark"] .tx-app #sidebar,
html[data-trinix-theme="dark"] .tx-app .dashify-rail,
body.tx-app.tx-dark header,
body.tx-app.tx-dark .tx-topbar,
body.tx-app.tx-dark aside,
body.tx-app.tx-dark #sidebar {
    background: var(--tx-panel) !important;
    color: var(--tx-text) !important;
    border-color: var(--tx-border) !important;
}

html[data-trinix-theme="dark"] .tx-app .glass,
html[data-trinix-theme="dark"] .tx-app .tx-action-card,
html[data-trinix-theme="dark"] .tx-app .tx-panel-card,
html[data-trinix-theme="dark"] .tx-app .empty-state,
body.tx-app.tx-dark .glass,
body.tx-app.tx-dark .tx-action-card,
body.tx-app.tx-dark .tx-panel-card {
    background: var(--tx-panel) !important;
    color: var(--tx-text) !important;
    border-color: var(--tx-border) !important;
}

html[data-trinix-theme="dark"] .tx-app .tx-nav-link {
    color: var(--tx-muted) !important;
}

html[data-trinix-theme="dark"] .tx-app .tx-nav-ico {
    background: var(--tx-raised);
    color: #93c5fd;
}

html[data-trinix-theme="dark"] .tx-app .tx-nav-link.is-active {
    background: #1e293b !important;
    color: #fff !important;
}

html[data-trinix-theme="dark"] .tx-app .tx-action-ico {
    background: rgba(37, 99, 235, 0.2);
    color: #93c5fd;
}

html[data-trinix-theme="dark"] .tx-app h1,
html[data-trinix-theme="dark"] .tx-app h2,
html[data-trinix-theme="dark"] .tx-app h3,
html[data-trinix-theme="dark"] .tx-app h4,
body.tx-app.tx-dark h1,
body.tx-app.tx-dark h2,
body.tx-app.tx-dark h3,
body.tx-app.tx-dark h4 {
    color: var(--tx-text) !important;
}

html[data-trinix-theme="dark"] .tx-app .text-gray-400,
html[data-trinix-theme="dark"] .tx-app .text-gray-500,
html[data-trinix-theme="dark"] .tx-app .text-gray-300,
body.tx-app.tx-dark .text-gray-400,
body.tx-app.tx-dark .text-gray-300 {
    color: var(--tx-muted) !important;
}

html[data-trinix-theme="dark"] .tx-app tr:hover td {
    background: var(--tx-raised) !important;
}

html[data-trinix-theme="dark"] .tx-app thead,
html[data-trinix-theme="dark"] .tx-app .bg-gray-900\/70 {
    background: var(--tx-raised) !important;
}

html[data-trinix-theme="dark"] .tx-app .btn-primary,
html[data-trinix-theme="dark"] .tx-app .empty-state a,
html[data-trinix-theme="dark"] .tx-app .tx-btn,
html[data-trinix-theme="dark"] .tx-app .bg-blue-600 {
    background: var(--tx-brand, #003e89) !important;
    color: #fff !important;
}

html[data-trinix-theme="dark"] .tx-theme-btn,
html[data-trinix-theme="dark"] .theme-toggle,
html[data-trinix-theme="dark"] .tx-app #menuBtn,
html[data-trinix-theme="dark"] .tx-app .sidebar-close-btn,
html[data-trinix-theme="dark"] .tx-app .tx-icon-btn {
    background: var(--tx-raised) !important;
    color: var(--tx-text) !important;
    border-color: var(--tx-border) !important;
}

html[data-trinix-theme="dark"] .tx-app input,
html[data-trinix-theme="dark"] .tx-app textarea,
html[data-trinix-theme="dark"] .tx-app select {
    background: var(--tx-surface-inset, var(--tx-page)) !important;
    color: var(--tx-text) !important;
    border-color: var(--tx-border) !important;
}

/* ——— Password show/hide ——— */
.tx-pass-wrap {
    position: relative;
    display: block;
    width: 100%;
}
.tx-pass-wrap .tx-pass-input,
.tx-pass-wrap input[type="password"],
.tx-pass-wrap input[type="text"] {
    width: 100%;
    padding-right: 3rem !important;
}
.tx-pass-toggle {
    position: absolute;
    top: 50%;
    right: 0.35rem;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--tx-muted, #64748b);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.tx-pass-toggle:hover,
.tx-pass-toggle:focus-visible {
    color: var(--tx-brand, #003e89);
    background: var(--tx-glow-brand, rgba(0, 62, 137, 0.1));
    outline: none;
}

/* ——— Role surfaces + accent edges ——— */
.tx-muted { color: var(--tx-muted) !important; }

.tx-surface-card,
.tx-app .glass,
.tx-app .card-bg,
.tx-app .tx-card,
.tx-app .empty-state {
    background: var(--tx-surface-card, var(--tx-panel)) !important;
    border: 1px solid var(--tx-border-card, var(--tx-border)) !important;
    color: var(--tx-text) !important;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.tx-surface-form,
.tx-app form.tx-surface-form,
.tx-app .tx-form,
.tx-app .form-card {
    background: var(--tx-surface-form) !important;
    border: 1px solid var(--tx-border-form) !important;
    color: var(--tx-text) !important;
}

.tx-surface-table,
.tx-app table,
.tx-app .tx-table {
    background: var(--tx-surface-table) !important;
    border-color: var(--tx-border-table) !important;
}

.tx-surface-table-head,
.tx-app thead,
.tx-app thead th {
    background: var(--tx-surface-table-head) !important;
    color: var(--tx-text) !important;
}

.tx-surface-modal,
.tx-app .trinix-response-modal-dialog,
.tx-app .panel-notif-modal-dialog {
    background: var(--tx-surface-modal) !important;
    border: 1px solid var(--tx-border-modal) !important;
    box-shadow: 0 24px 64px rgba(12, 18, 34, 0.28);
}

.tx-surface-inset,
.tx-app .tx-inset {
    background: var(--tx-surface-inset) !important;
    border: 1px solid var(--tx-border) !important;
}

.tx-app input,
.tx-app textarea,
.tx-app select {
    background: var(--tx-surface-inset) !important;
    border: 1px solid var(--tx-border-form) !important;
    color: var(--tx-text) !important;
    font-size: 16px;
}

.tx-app input:focus,
.tx-app textarea:focus,
.tx-app select:focus {
    outline: 2px solid var(--tx-accent-sky);
    outline-offset: 1px;
    border-color: var(--tx-brand) !important;
}

.tx-edge-brand { border-left: 3px solid var(--tx-brand) !important; }
.tx-edge-teal { border-left: 3px solid var(--tx-accent-teal) !important; }
.tx-edge-amber { border-left: 3px solid var(--tx-accent-amber) !important; }
.tx-edge-rose { border-left: 3px solid var(--tx-accent-rose) !important; }

.tx-app .glass.tx-edge-brand,
.tx-app .card-bg.tx-edge-brand,
.tx-app .stat-card,
.tx-app .dashify-stat {
    border-left: 3px solid var(--tx-brand);
}

.tx-app tr:hover td {
    background: var(--tx-glow-brand) !important;
}

/* AJAX toasts */
.tx-toast-host {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1200;
    display: grid;
    gap: 0.55rem;
    width: min(22rem, calc(100vw - 1.5rem));
    pointer-events: none;
}
.tx-toast {
    pointer-events: auto;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    background: var(--tx-surface-modal, #fff);
    color: var(--tx-text, #0c1222);
    border: 1px solid var(--tx-border-modal, rgba(15, 23, 42, 0.12));
    border-left: 3px solid var(--tx-brand, #003e89);
    box-shadow: 0 16px 40px rgba(12, 18, 34, 0.18);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    font-size: 0.92rem;
    font-weight: 600;
}
.tx-toast.is-in { opacity: 1; transform: none; }
.tx-toast.is-success { border-left-color: var(--tx-accent-teal, #0f6b4c); }
.tx-toast.is-error { border-left-color: var(--tx-accent-rose, #b42318); }
.tx-toast.is-info { border-left-color: var(--tx-accent-sky, #1d6bb8); }

.tx-app .tx-btn.is-busy,
.tx-app button.is-busy {
    opacity: 0.72;
    cursor: wait;
}

/* Admin dark glass → token surfaces */
.tx-app .bg-gray-900\/60,
.tx-app .bg-gray-900\/90,
.tx-app .bg-gray-900\/80 {
    background: var(--tx-surface-card) !important;
    border-color: var(--tx-border-card) !important;
    color: var(--tx-text) !important;
}
.tx-app .bg-gray-800\/50,
.tx-app .bg-gray-800 {
    background: var(--tx-surface-inset) !important;
}
.tx-app table thead,
.tx-app thead.bg-gray-800\/50,
.tx-app thead.bg-gray-900\/70 {
    background: var(--tx-surface-table-head) !important;
}
.tx-app .glass {
    background: var(--tx-surface-card) !important;
    border: 1px solid var(--tx-border-card) !important;
    color: var(--tx-text) !important;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.tx-app .tx-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 0 0 1.15rem 1.15rem;
}
.tx-app .tx-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--tx-surface-table);
}
.tx-app .tx-table th {
    background: var(--tx-surface-table-head);
    text-align: left;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--tx-muted);
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--tx-border-table);
}
.tx-app .tx-table td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--tx-border-table);
    color: var(--tx-text);
    vertical-align: middle;
}

/* Readable body/muted copy on dashboard surfaces */
.tx-app,
.tx-app main,
.tx-app .tx-main {
    color: var(--tx-text, #0b1220) !important;
}
.tx-app p,
.tx-app li,
.tx-app label,
.tx-app .tx-note,
.tx-app .rx-lead,
.tx-app .tx-page-head p {
    color: var(--tx-muted, #1f2937) !important;
}

/* Placeholders were nearly invisible on white inputs */
.tx-app input::placeholder,
.tx-app textarea::placeholder,
.tx-app select::placeholder,
.tx-app .tx-panel-card input::placeholder,
.tx-app .tx-panel-card textarea::placeholder,
.tx-app .glass input::placeholder,
.tx-app form.tx-ajax input::placeholder,
.tx-app form.tx-ajax textarea::placeholder {
    color: #64748b !important;
    opacity: 1 !important;
}
html[data-trinix-theme="dark"] .tx-app input::placeholder,
html[data-trinix-theme="dark"] .tx-app textarea::placeholder,
body.tx-app.tx-dark input::placeholder,
body.tx-app.tx-dark textarea::placeholder {
    color: #94a3b8 !important;
    opacity: 1 !important;
}

/* Ensure typed values stay dark on light fields even in dark theme */
html[data-trinix-theme="dark"] .tx-app .tx-panel-card input:not([type="checkbox"]):not([type="radio"]),
html[data-trinix-theme="dark"] .tx-app .tx-panel-card textarea,
html[data-trinix-theme="dark"] .tx-app .tx-panel-card select,
html[data-trinix-theme="dark"] .tx-app form.tx-ajax input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
html[data-trinix-theme="dark"] .tx-app form.tx-ajax textarea,
html[data-trinix-theme="dark"] .tx-app form.tx-ajax select {
    background: #0f172a !important;
    color: #f1f5f9 !important;
    border-color: rgba(148, 163, 184, 0.35) !important;
}
html[data-trinix-theme="dark"] .tx-app .tx-panel-card label,
html[data-trinix-theme="dark"] .tx-app form.tx-ajax label,
html[data-trinix-theme="dark"] .tx-app th {
    color: #e2e8f0 !important;
}
.tx-app h1,
.tx-app h2,
.tx-app h3,
.tx-app h4,
.tx-app strong,
.tx-app .tx-page-head h1 {
    color: var(--tx-text, #0b1220) !important;
}
html[data-trinix-theme="light"] .tx-app .text-gray-400,
html[data-trinix-theme="light"] .tx-app .text-gray-500,
html[data-trinix-theme="light"] .tx-app .text-slate-400,
html[data-trinix-theme="light"] .tx-app .text-slate-500,
html[data-trinix-theme="light"] .tx-app .opacity-70 {
    color: #1f2937 !important;
    opacity: 1 !important;
}
html[data-trinix-theme="dark"] .tx-app p,
html[data-trinix-theme="dark"] .tx-app .tx-note,
html[data-trinix-theme="dark"] .tx-app .text-gray-400,
html[data-trinix-theme="dark"] .tx-app .text-gray-500 {
    color: #e2e8f0 !important;
}
html[data-trinix-theme="dark"] .tx-app h1,
html[data-trinix-theme="dark"] .tx-app h2,
html[data-trinix-theme="dark"] .tx-app h3 {
    color: #f8fafc !important;
}
.tx-app .tx-logo-on-dark { display: none; }
html[data-trinix-theme="dark"] .tx-app .tx-logo-on-light { display: none; }
html[data-trinix-theme="dark"] .tx-app .tx-logo-on-dark { display: inline-block; }

.tx-app .tx-chip-btn.is-active {
    background: var(--tx-glow-brand, rgba(0, 62, 137, 0.12));
    color: var(--tx-brand, #003e89);
    border-color: var(--tx-brand, #003e89);
    font-weight: 600;
}

.tx-app .tx-surface-form label,
.tx-app .tx-panel-card label,
.tx-app form.tx-ajax label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--tx-muted, #5b657a);
    margin-bottom: 0.35rem;
}

.tx-app .tx-surface-form input,
.tx-app .tx-surface-form select,
.tx-app .tx-surface-form textarea,
.tx-app form.tx-ajax input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.tx-app form.tx-ajax select,
.tx-app form.tx-ajax textarea {
    width: 100%;
    border: 1px solid var(--tx-border-form, rgba(15, 23, 42, 0.14));
    background: var(--tx-surface-inset, #fff);
    color: var(--tx-text, #0c1222);
    border-radius: 0.75rem;
    padding: 0.7rem 0.9rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tx-app .tx-surface-form input:focus,
.tx-app .tx-surface-form select:focus,
.tx-app .tx-surface-form textarea:focus,
.tx-app form.tx-ajax input:focus,
.tx-app form.tx-ajax select:focus,
.tx-app form.tx-ajax textarea:focus {
    outline: none;
    border-color: var(--tx-brand, #003e89);
    box-shadow: 0 0 0 3px var(--tx-glow-brand, rgba(0, 62, 137, 0.16));
}

.tx-app .tx-surface-form input:disabled,
.tx-app form.tx-ajax input:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.tx-app main .rounded-2xl,
.tx-app main .rounded-xl {
    border-color: var(--tx-border-card, rgba(15, 23, 42, 0.1));
}

.tx-app table.w-full {
    border-collapse: collapse;
}
.tx-app table.w-full th {
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--tx-muted);
    background: var(--tx-surface-table-head);
}
.tx-app table.w-full td,
.tx-app table.w-full th {
    border-bottom: 1px solid var(--tx-border-table, rgba(15, 23, 42, 0.08));
}

.tx-app .tab-content.hidden {
    display: none !important;
}
