/* ==========================================================================
   TrueHosting panel theme
   Design tokens are taken verbatim from truehosting.net so the panel and the
   marketing site read as one product.
   Loaded after AdminLTE/Bootstrap, so this file is allowed to override them.
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&family=Montserrat:wght@600;700;800&display=swap");

:root {
    /* Brand */
    --brand: #065bf1;
    --brand-light: #3b7ffa;
    --brand-dark: #0442bd;
    --brand-hover: #2a6df5;

    /* Surfaces — layered, the way Paymenter stacks them: the page is the
       darkest layer and every panel sits a step above it. */
    --bg-primary: #12121a;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a22;
    --surface: #1a1a22;
    --surface-hover: #212129;

    /* Status */
    --success: #22c55e;
    --warning: #f5a524;
    --danger: #ef4444;
    --info: #3b7ffa;

    /* Text */
    --text-primary: #eef1f7;
    --text-secondary: rgba(238, 241, 247, 0.7);
    --text-muted: rgba(238, 241, 247, 0.45);

    /* Panels */
    --glass-bg: #1a1a22;
    --glass-strong: #212129;
    --glass-border: #2a2a33;
    --glass-blur: blur(14px);

    /* Elevation */
    --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 26px rgba(0, 0, 0, 0.36);
    --shadow-lg: 0 18px 40px rgba(0, 0, 0, 0.45);
    --glow-brand: 0 0 0 1px rgba(6, 91, 241, 0.2), 0 8px 24px rgba(6, 91, 241, 0.25);

    /* Gradients */
    --gradient-main: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%);

    /* Motion */
    --transition-fast: all 0.16s cubic-bezier(0.4, 0, 0.2, 1);
    --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

    /* Geometry */
    --radius-card: 12px;
    --radius-btn: 6px;
    --radius-input: 6px;
    --radius-sm: 6px;
    --sidebar-w: 268px;
    --sidebar-w-collapsed: 78px;
    --topbar-h: 68px;
    --content-max: 1480px;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

html,
body {
    min-height: 100%;
}

body.th-body,
body.th-body.dark-mode {
    background-color: var(--bg-primary) !important;
}

body.th-body {
    margin: 0;
    font-family: "Poppins", "Segoe UI", system-ui, sans-serif;
    font-size: 0.925rem;
    line-height: 1.65;
    color: var(--text-primary);
    background: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
}

body.th-body h1,
body.th-body h2,
body.th-body h3,
body.th-body h4,
body.th-body h5,
body.th-body .th-display {
    font-family: "Montserrat", "Poppins", sans-serif;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.th-body a {
    color: var(--brand-light);
    text-decoration: none;
    transition: var(--transition-fast);
}

.th-body a:hover {
    color: #6b9dfc;
    text-decoration: none;
}

.th-body ::selection {
    background: rgba(6, 91, 241, 0.4);
}

/* Firefox ignores ::-webkit-scrollbar, so it gets the standard properties.
   Without this the horizontal scrollbar on wide tables renders light grey. */
.th-body,
.th-body * {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.th-body ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.th-body ::-webkit-scrollbar-track {
    background: transparent;
}

.th-body ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border: 2px solid transparent;
    background-clip: content-box;
    border-radius: 999px;
}

.th-body ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.22);
    background-clip: content-box;
}

[x-cloak] {
    display: none !important;
}

/* --------------------------------------------------------------------------
   Shell
   -------------------------------------------------------------------------- */

.th-shell {
    min-height: 100vh;
    min-height: 100dvh;
    padding-left: var(--sidebar-w);
    transition: padding-left 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.th-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    width: var(--sidebar-w);
    height: 100vh;
    height: 100dvh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--glass-border);
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.th-main {
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

/* Collapsed rail */
.th-collapsed .th-sidebar {
    width: var(--sidebar-w-collapsed);
}

.th-collapsed .th-shell {
    padding-left: var(--sidebar-w-collapsed);
}

/* Only the desktop rail collapses. On a phone the sidebar is off-canvas and
   must stay readable even when the rail was left collapsed on a desktop. */
@media (min-width: 992px) {
    .th-collapsed .th-sidebar .th-nav-label,
    .th-collapsed .th-sidebar .th-brand-text,
    .th-collapsed .th-sidebar .th-nav-badge,
    .th-collapsed .th-sidebar .th-sidebar-foot {
        display: none;
    }

    /* The group heading becomes the rule that separated it anyway. */
    .th-collapsed .th-sidebar .th-nav-group-title {
        height: 1px;
        margin: 0.8rem 0.5rem 0.6rem;
        padding: 0;
        overflow: hidden;
        background: var(--glass-border);
        color: transparent;
    }

    .th-collapsed .th-sidebar .th-nav-link {
        justify-content: center;
        gap: 0;
        padding-left: 0;
        padding-right: 0;
    }

    .th-collapsed .th-brand {
        justify-content: center;
        gap: 0;
        padding: 0 0.5rem;
    }
}

/* --------------------------------------------------------------------------
   Sidebar: brand
   -------------------------------------------------------------------------- */

.th-brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    height: var(--topbar-h);
    padding: 0 1.1rem;
    flex: 0 0 auto;
    border-bottom: 1px solid var(--glass-border);
    overflow: hidden;
}

.th-brand:hover {
    text-decoration: none;
}

.th-brand-logo {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.th-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    transition: opacity 0.2s ease;
}

.th-brand-name {
    font-family: "Montserrat", sans-serif;
    font-weight: 800;
    font-size: 1.02rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.th-brand-sub {
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Sidebar: navigation
   -------------------------------------------------------------------------- */

.th-nav {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.9rem 0.65rem 1.2rem;
}

.th-nav-group-title {
    padding: 1.1rem 0.75rem 0.4rem;
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-muted);
    transition: opacity 0.2s ease;
}

.th-nav-group-title:first-child {
    padding-top: 0.2rem;
}

.th-nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.62rem 0.75rem;
    margin-bottom: 0.15rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    transition: var(--transition-fast);
}

.th-nav-link:hover {
    color: var(--text-primary);
    background: rgba(6, 91, 241, 0.07);
    text-decoration: none;
}

.th-nav-link .th-nav-icon {
    flex: 0 0 auto;
    width: 20px;
    text-align: center;
    font-size: 0.98rem;
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.th-nav-link:hover .th-nav-icon {
    color: var(--brand-light);
}

/* Active item: a faint brand wash, with the label itself carrying the colour. */
.th-nav-link.active {
    color: var(--brand-light);
    background: rgba(6, 91, 241, 0.1);
}

.th-nav-link.active .th-nav-icon {
    color: var(--brand-light);
}

.th-nav-label {
    flex: 1 1 auto;
    transition: opacity 0.2s ease;
}

.th-nav-badge {
    flex: 0 0 auto;
    padding: 0.08rem 0.45rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(59, 127, 250, 0.16);
    color: var(--brand-light);
    transition: opacity 0.2s ease;
}

.th-nav-badge.th-badge-success {
    background: rgba(34, 197, 94, 0.16);
    color: #4ade80;
}

.th-sidebar-foot {
    flex: 0 0 auto;
    padding: 0.85rem 1rem;
    border-top: 1px solid var(--glass-border);
    font-size: 0.72rem;
    color: var(--text-muted);
    transition: opacity 0.2s ease;
}

/* --------------------------------------------------------------------------
   Topbar
   -------------------------------------------------------------------------- */

.th-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    height: var(--topbar-h);
    padding: 0 1.4rem;
    background: rgba(18, 18, 26, 0.86);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-border);
}

.th-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border: 1px solid transparent;
    border-radius: var(--radius-btn);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.th-icon-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--glass-border);
}

.th-topbar-title {
    min-width: 0;
    margin: 0;
    font-size: 1.02rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.th-topbar-spacer {
    flex: 1 1 auto;
}

/* Credits chip — the panel's money indicator, so it carries the brand fill. */
.th-credits {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.85rem;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-btn);
    background: var(--surface);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.875rem;
    /* Only colours move: animating shadow/transform here made the chip
       shimmer while the dropdown was opening. */
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.th-credits:hover {
    color: var(--text-primary);
    background: var(--surface-hover);
    border-color: rgba(255, 255, 255, 0.16);
    text-decoration: none;
}

.th-credits i {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.th-user-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.3rem 0.75rem 0.3rem 0.4rem;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-btn);
    background: var(--glass-bg);
    color: var(--text-primary);
    font-size: 0.86rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.th-user-chip:hover {
    color: var(--text-primary);
    border-color: rgba(59, 127, 250, 0.4);
    text-decoration: none;
}

.th-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.th-dot {
    position: absolute;
    top: 6px;
    right: 7px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--danger);
    box-shadow: 0 0 0 2px #12121a;
}

/* --------------------------------------------------------------------------
   Content
   -------------------------------------------------------------------------- */

.th-content {
    flex: 1 1 auto;
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 1.75rem 1.4rem 2.5rem;
}

.th-page-head {
    margin-bottom: 1.5rem;
}

.th-page-title {
    margin: 0 0 0.25rem;
    font-size: 1.65rem;
    font-weight: 800;
}

.th-page-sub {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.th-footer {
    padding: 1.2rem 1.4rem 2rem;
    border-top: 1px solid var(--glass-border);
    color: var(--text-muted);
    font-size: 0.8rem;
}

.th-footer a {
    color: var(--text-secondary);
}

/* Mobile overlay for the off-canvas sidebar */
.th-overlay {
    position: fixed;
    inset: 0;
    z-index: 1035;
    background: rgba(4, 6, 11, 0.6);
    backdrop-filter: blur(2px);
}

@media (max-width: 991.98px) {
    .th-sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
    }

    .th-sidebar.th-open {
        transform: translateX(0);
    }

    .th-shell,
    .th-collapsed .th-shell {
        padding-left: 0;
    }

    .th-content {
        padding: 1.25rem 1rem 2rem;
    }

    .th-topbar {
        padding: 0 1rem;
    }
}

/* ==========================================================================
   Own components
   ========================================================================== */

/* Glass card ------------------------------------------------------------- */

.th-card {
    position: relative;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.th-card-head {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--glass-border);
}

.th-card-head i {
    color: var(--brand-light);
}

.th-card-title {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 700;
}

.th-card-body {
    padding: 1.25rem;
}

.th-card-actions {
    margin-left: auto;
}

/* Stat tile -------------------------------------------------------------- */

.th-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(188px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.th-stat {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.9rem 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-card);
    transition: var(--transition);
}

.th-stat:hover {
    border-color: rgba(59, 127, 250, 0.3);
    background: var(--surface-hover);
}

.th-stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    font-size: 0.92rem;
    background: rgba(6, 91, 241, 0.14);
    color: var(--brand-light);
}

.th-stat-icon.is-success {
    background: rgba(34, 197, 94, 0.14);
    color: #4ade80;
}

.th-stat-icon.is-warning {
    background: rgba(245, 165, 36, 0.14);
    color: #fbbf24;
}

.th-stat-icon.is-danger {
    background: rgba(239, 68, 68, 0.14);
    color: #f87171;
}

.th-stat-body {
    min-width: 0;
}

.th-stat-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.th-stat-value {
    display: block;
    font-family: "Montserrat", sans-serif;
    font-size: 1.28rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-primary);
}

.th-stat-value sup {
    /* Bootstrap's reboot gives every sup `top: -.5em`, which floated the unit
       above the figure. Put it back on the same baseline. */
    position: static;
    top: 0;
    vertical-align: baseline;
    line-height: inherit;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-left: 0.2rem;
}

/* Buttons ---------------------------------------------------------------- */

.th-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.62rem 1.2rem;
    border: 1px solid transparent;
    border-radius: var(--radius-btn);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.th-btn-primary {
    background: var(--brand);
    color: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.th-btn-primary:hover {
    background: var(--brand-hover);
    color: #fff;
    text-decoration: none;
}

.th-btn-ghost {
    background: var(--surface);
    border-color: var(--glass-border);
    color: var(--text-secondary);
}

.th-btn-ghost:hover {
    background: var(--surface-hover);
    border-color: var(--glass-border);
    color: var(--text-primary);
    text-decoration: none;
}

.th-btn-block {
    width: 100%;
}

/* Status pill ------------------------------------------------------------ */

.th-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.65rem;
    border-radius: var(--radius-sm);
    font-size: 0.74rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
}

.th-status::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.th-status.is-online {
    background: rgba(34, 197, 94, 0.14);
    color: #4ade80;
}

.th-status.is-suspended {
    background: rgba(239, 68, 68, 0.14);
    color: #f87171;
}

.th-status.is-pending {
    background: rgba(245, 165, 36, 0.14);
    color: #fbbf24;
}

/* Spec chips (CPU / RAM / disk on a server card) -------------------------- */

.th-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0.85rem 0 0;
    padding: 0;
    list-style: none;
}

.th-spec {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.28rem 0.6rem;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.th-spec i {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* Server / plan card grid ------------------------------------------------ */

.th-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.1rem;
}

.th-server-card {
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.th-server-card:hover {
    border-color: rgba(255, 255, 255, 0.16);
    background: var(--surface-hover);
}

.th-server-head {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.th-server-name {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    word-break: break-word;
}

.th-server-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.th-card-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 1rem;
}

/* Pricing / plan card ---------------------------------------------------- */

.th-plan {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 1.6rem 1.4rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
}

.th-plan:hover {
    border-color: rgba(255, 255, 255, 0.16);
    background: var(--surface-hover);
}

.th-plan-featured {
    border-color: rgba(59, 127, 250, 0.4);
}

/* Thin brand rule along the top edge of a featured plan. */
.th-plan-featured::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-main);
}

.th-plan-tag {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-sm);
    background: var(--gradient-main);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.th-plan-name {
    margin: 0 0 0.3rem;
    font-size: 1.1rem;
    font-weight: 700;
}

.th-plan-desc {
    margin: 0 0 1.1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.th-plan-price {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    margin-bottom: 0.2rem;
}

.th-plan-amount {
    font-family: "Montserrat", sans-serif;
    font-size: 2.1rem;
    font-weight: 800;
    line-height: 1;
    color: var(--text-primary);
}

.th-plan-unit {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.th-plan-note {
    margin-bottom: 1.2rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Empty state ------------------------------------------------------------ */

.th-empty {
    padding: 3rem 1.5rem;
    text-align: center;
    border: 1px dashed var(--glass-border);
    border-radius: var(--radius-card);
    background: rgba(255, 255, 255, 0.02);
}

.th-empty > i {
    display: block;
    font-size: 2rem;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
}

.th-empty-title {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
    font-weight: 700;
}

.th-empty-text {
    margin: 0 auto 1.3rem;
    max-width: 420px;
    color: var(--text-muted);
    font-size: 0.88rem;
}

/* Auth screens -----------------------------------------------------------
   Near-black, split layout: the pitch on the left, a bordered form card on
   the right. The form half is the wider one — it is what people came for.
   ------------------------------------------------------------------------ */

.th-auth {
    display: grid;
    grid-template-columns: 0.82fr 1fr;
    min-height: 100vh;
    background: var(--bg-primary);
}

.th-auth-pitch {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 2.6rem 3rem;
    overflow: hidden;
    border-right: 1px solid rgba(255, 255, 255, 0.07);
    background: var(--bg-secondary);
}

/* One faint brand glow, low enough not to lift the black. */
.th-auth-pitch::after {
    content: "";
    position: absolute;
    top: 18%;
    left: -20%;
    width: 70%;
    height: 55%;
    border-radius: 50%;
    background: rgba(6, 91, 241, 0.13);
    filter: blur(90px);
    pointer-events: none;
}

.th-auth-brand {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    align-self: flex-start;
}

.th-auth-logo {
    height: 38px;
    width: auto;
    border-radius: var(--radius-sm);
}

.th-auth-brand-name {
    font-family: "Montserrat", sans-serif;
    font-weight: 700;
    font-size: 1.02rem;
    color: var(--text-primary);
}

.th-auth-middle {
    position: relative;
    z-index: 1;
    margin: auto 0;
    padding: 2.5rem 0;
}

.th-auth-title {
    margin: 0 0 0.6rem;
    font-size: 2.45rem;
    line-height: 1.12;
    font-weight: 800;
}

/* The second headline line carries the brand gradient, not italics. */
.th-auth-title em {
    font-style: normal;
    background: linear-gradient(135deg, var(--brand-light) 0%, #ffffff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.th-auth-lead {
    max-width: 440px;
    margin: 0 0 2rem;
    color: var(--text-muted);
    font-size: 0.98rem;
}

/* Feature rows: bordered tiles, not bullet points. */
.th-auth-points {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.7rem;
    max-width: 530px;
}

.th-auth-points li {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: var(--radius-card);
    background: rgba(255, 255, 255, 0.02);
    font-size: 0.89rem;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.th-auth-points li:hover {
    border-color: rgba(59, 127, 250, 0.3);
    background: rgba(6, 91, 241, 0.06);
}

.th-auth-points i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    border-radius: var(--radius-sm);
    background: rgba(6, 91, 241, 0.16);
    color: var(--brand-light);
    font-size: 0.82rem;
}

.th-auth-foot {
    position: relative;
    z-index: 1;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.th-auth-foot-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.1rem;
    margin-bottom: 0.8rem;
}

.th-auth-foot-links a {
    color: var(--text-secondary);
}

.th-auth-stats {
    display: flex;
    gap: 2.2rem;
    margin-top: 2.2rem;
    padding-top: 1.6rem;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.th-auth-stat-value {
    display: block;
    font-family: "Montserrat", sans-serif;
    font-size: 1.55rem;
    font-weight: 800;
    line-height: 1;
}

.th-auth-stat-label {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* ---- Form side ---- */

.th-auth-form-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2.5rem;
    background: var(--bg-primary);
}

.th-auth-card {
    width: 100%;
    max-width: 560px;
    padding: 2.5rem 2.6rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: var(--glass-bg);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

.th-auth-card-title {
    margin: 0 0 0.35rem;
    font-size: 1.6rem;
    font-weight: 800;
}

.th-auth-card-sub {
    margin: 0 0 1.9rem;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.th-auth-alt {
    margin-top: 1.5rem;
    padding-top: 1.4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    text-align: center;
    font-size: 0.86rem;
    color: var(--text-muted);
}

.th-field {
    margin-bottom: 1.1rem;
}

.th-label {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Input with a leading icon */
.th-input-wrap {
    position: relative;
}

.th-input-wrap > i {
    position: absolute;
    top: 50%;
    left: 0.95rem;
    transform: translateY(-50%);
    font-size: 0.85rem;
    color: var(--text-muted);
    pointer-events: none;
}

.th-body .th-input-wrap .form-control {
    padding-left: 2.6rem;
    background: var(--bg-primary);
    border-color: rgba(255, 255, 255, 0.09);
}

.th-body .th-input-wrap .form-control:focus {
    background: var(--bg-primary);
    border-color: var(--brand);
}

.th-divider {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 1.4rem 0;
    color: var(--text-muted);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.th-divider::before,
.th-divider::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}

.th-discord-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.68rem 1rem;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-btn);
    background: #5865f2;
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
}

.th-discord-btn:hover {
    background: #4752c4;
    color: #fff;
    text-decoration: none;
}

@media (max-width: 1199.98px) {
    .th-auth-pitch {
        padding: 2.2rem;
    }

    .th-auth-title {
        font-size: 2.1rem;
    }
}

@media (max-width: 991.98px) {
    .th-auth {
        grid-template-columns: 1fr;
    }

    .th-auth-pitch {
        display: none;
    }

    .th-auth-form-wrap {
        padding: 2rem 1rem;
    }

    .th-auth-card {
        padding: 1.8rem 1.4rem;
        border: none;
        box-shadow: none;
        background: transparent;
    }
}

/* ==========================================================================
   Bootstrap 4 / AdminLTE overrides
   Most of the panel (admin pages, tables, forms) is inherited from the
   `default` theme and uses these classes, so restyling them here modernises
   those pages without rewriting their Blade files.
   ========================================================================== */

/* AdminLTE page wrappers used by inherited views ------------------------- */

.th-body .content-header {
    padding: 0 0 1.2rem;
}

.th-body .content-header h1 {
    font-size: 1.6rem;
    font-weight: 800;
    margin: 0;
}

.th-body .content {
    padding: 0;
}

.th-body .container-fluid {
    padding-left: 0;
    padding-right: 0;
}

.th-body .breadcrumb {
    padding: 0;
    margin: 0;
    background: transparent;
    font-size: 0.82rem;
}

.th-body .breadcrumb-item,
.th-body .breadcrumb-item a,
.th-body .breadcrumb-item.active {
    color: var(--text-muted);
}

.th-body .breadcrumb-item + .breadcrumb-item::before {
    color: var(--text-muted);
}

/* Cards ------------------------------------------------------------------ */

.th-body .card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-sm);
    color: var(--text-primary);
    margin-bottom: 1.1rem;
}

.th-body .card-header {
    background: transparent;
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 1.25rem;
}

.th-body .card-title {
    float: none;
    margin: 0;
    font-family: "Montserrat", sans-serif;
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text-primary);
}

.th-body .card-header .card-title i {
    color: var(--brand-light);
}

.th-body .card-body {
    padding: 1.25rem;
}

.th-body .card-footer {
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--glass-border);
    padding: 1rem 1.25rem;
}

.th-body .card.card-primary:not(.card-outline) > .card-header,
.th-body .card.card-info > .card-header,
.th-body .card.card-default > .card-header {
    background: transparent;
    color: var(--text-primary);
}

.th-body .card.card-outline {
    border-top-width: 1px;
}

/* AdminLTE info-box / small-box ------------------------------------------ */

.th-body .info-box,
.th-body .small-box {
    background: var(--glass-bg) !important;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-sm) !important;
    color: var(--text-primary) !important;
    min-height: auto;
    padding: 0.35rem;
}

.th-body .info-box .info-box-icon {
    border-radius: 13px;
    width: 52px;
    height: 52px;
    font-size: 1.1rem;
    background: rgba(6, 91, 241, 0.16) !important;
    color: var(--brand-light) !important;
    box-shadow: none !important;
}

.th-body .info-box .info-box-icon.bg-success {
    background: rgba(34, 197, 94, 0.16) !important;
    color: #4ade80 !important;
}

.th-body .info-box .info-box-icon.bg-warning {
    background: rgba(245, 165, 36, 0.16) !important;
    color: #fbbf24 !important;
}

.th-body .info-box .info-box-icon.bg-danger {
    background: rgba(239, 68, 68, 0.16) !important;
    color: #f87171 !important;
}

.th-body .info-box .info-box-text,
.th-body .small-box p {
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.th-body .info-box .info-box-number,
.th-body .small-box h3 {
    font-family: "Montserrat", sans-serif;
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--text-primary);
}

/* Buttons ---------------------------------------------------------------- */

.th-body .btn {
    border-radius: var(--radius-btn);
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.5rem 1.05rem;
    transition: var(--transition);
    box-shadow: none;
}

.th-body .btn:focus,
.th-body .btn.focus {
    box-shadow: 0 0 0 3px rgba(6, 91, 241, 0.3);
}

.th-body .btn-sm {
    padding: 0.33rem 0.7rem;
    font-size: 0.8rem;
}

.th-body .btn-primary {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.th-body .btn-primary:hover {
    background: var(--brand-hover);
    border-color: var(--brand-hover);
    box-shadow: 0 6px 18px rgba(6, 91, 241, 0.35);
}

.th-body .btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--glass-border);
    color: var(--text-secondary);
}

.th-body .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(59, 127, 250, 0.35);
    color: var(--text-primary);
}

.th-body .btn-success {
    background: var(--success);
    border-color: var(--success);
    color: #06230f;
}

.th-body .btn-success:hover {
    background: #16a34a;
    border-color: #16a34a;
    color: #fff;
}

.th-body .btn-danger {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.th-body .btn-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
}

.th-body .btn-warning {
    background: var(--warning);
    border-color: var(--warning);
    color: #2a1a00;
}

.th-body .btn-warning:hover {
    background: #e0940f;
    border-color: #e0940f;
}

.th-body .btn-info {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.th-body .btn-info:hover {
    background: var(--brand-hover);
    border-color: var(--brand-hover);
}

.th-body .btn-outline-primary,
.th-body .btn-outline-info {
    border-color: rgba(59, 127, 250, 0.5);
    color: var(--brand-light);
    background: transparent;
}

.th-body .btn-outline-primary:hover,
.th-body .btn-outline-info:hover {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.th-body .btn-outline-secondary {
    border-color: var(--glass-border);
    color: var(--text-secondary);
}

.th-body .btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.th-body .btn-outline-danger {
    border-color: rgba(239, 68, 68, 0.5);
    color: #f87171;
    background: transparent;
}

.th-body .btn-outline-danger:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.th-body .btn-link {
    color: var(--brand-light);
}

/* Forms ------------------------------------------------------------------ */

.th-body label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.th-body .form-control,
.th-body .custom-select,
.th-body textarea.form-control {
    background: var(--bg-primary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-input);
    color: var(--text-primary);
    font-size: 0.9rem;
    padding: 0.6rem 0.85rem;
    height: auto;
    transition: var(--transition-fast);
    box-shadow: none;
}

.th-body .form-control:focus,
.th-body .custom-select:focus {
    background: var(--bg-primary);
    border-color: var(--brand);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(6, 91, 241, 0.22);
}

.th-body .form-control::placeholder {
    color: var(--text-muted);
}

.th-body .form-control:disabled,
.th-body .form-control[readonly] {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
}

.th-body .form-control.is-invalid {
    border-color: var(--danger);
}

.th-body .invalid-feedback,
.th-body .text-danger {
    color: #f87171 !important;
    font-size: 0.8rem;
}

.th-body .form-text,
.th-body small.text-muted,
.th-body .text-muted {
    color: var(--text-muted) !important;
}

.th-body .input-group-text {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-input);
    color: var(--text-muted);
}

.th-body .custom-control-label::before {
    background: var(--bg-primary);
    border: 1px solid var(--glass-border);
}

.th-body .custom-control-input:checked ~ .custom-control-label::before {
    background: var(--brand);
    border-color: var(--brand);
}

.th-body .custom-switch .custom-control-label::after {
    background: var(--text-secondary);
}

/* Tables ----------------------------------------------------------------- */

.th-body .table {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0;
}

.th-body .table thead th {
    border-bottom: 1px solid var(--glass-border);
    border-top: none;
    padding: 0.7rem 0.85rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: transparent;
}

.th-body .table td,
.th-body .table th {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0.75rem 0.85rem;
    vertical-align: middle;
}

.th-body .table-hover tbody tr:hover,
.th-body .table tbody tr:hover {
    background: rgba(255, 255, 255, 0.035);
    color: var(--text-primary);
}

.th-body .table-striped tbody tr:nth-of-type(odd) {
    background: rgba(255, 255, 255, 0.018);
}

.th-body .table-bordered,
.th-body .table-bordered td,
.th-body .table-bordered th {
    border-color: var(--glass-border);
}

/* DataTables ------------------------------------------------------------- */

.th-body .dataTables_wrapper .dataTables_length,
.th-body .dataTables_wrapper .dataTables_filter,
.th-body .dataTables_wrapper .dataTables_info,
.th-body .dataTables_wrapper .dataTables_processing,
.th-body .dataTables_wrapper .dataTables_paginate {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.th-body .dataTables_wrapper .dataTables_filter input,
.th-body .dataTables_wrapper .dataTables_length select {
    background: var(--bg-primary);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
    padding: 0.35rem 0.6rem;
}

.th-body .dataTables_wrapper .dataTables_paginate .paginate_button,
.th-body .page-link {
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 8px !important;
    color: var(--text-secondary) !important;
    margin: 0 2px;
    padding: 0.3rem 0.7rem;
}

.th-body .dataTables_wrapper .dataTables_paginate .paginate_button:hover,
.th-body .page-link:hover {
    background: rgba(255, 255, 255, 0.09) !important;
    color: var(--text-primary) !important;
}

.th-body .dataTables_wrapper .dataTables_paginate .paginate_button.current,
.th-body .page-item.active .page-link {
    background: var(--brand) !important;
    border-color: var(--brand) !important;
    color: #fff !important;
}

.th-body .pagination {
    gap: 2px;
}

/* Select2 ---------------------------------------------------------------- */

.th-body .select2-container--default .select2-selection--single,
.th-body .select2-container--default .select2-selection--multiple {
    background: var(--bg-primary);
    border: 1px solid var(--glass-border) !important;
    border-radius: var(--radius-input);
    min-height: 42px;
}

.th-body .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--text-primary);
    line-height: 40px;
}

.th-body .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px;
}

.select2-dropdown {
    background: var(--glass-strong);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-primary);
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: var(--brand);
}

.select2-search--dropdown .select2-search__field {
    background: var(--bg-primary);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
}

.th-body .select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: rgba(6, 91, 241, 0.2);
    border: 1px solid rgba(59, 127, 250, 0.35);
    border-radius: 7px;
    color: var(--text-primary);
}

/* Badges ----------------------------------------------------------------- */

.th-body .badge {
    padding: 0.3em 0.6em;
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.th-body .badge-primary,
.th-body .badge-info {
    background: rgba(6, 91, 241, 0.2);
    color: #9dc0ff;
}

.th-body .badge-success {
    background: rgba(34, 197, 94, 0.18);
    color: #4ade80;
}

.th-body .badge-warning {
    background: rgba(245, 165, 36, 0.18);
    color: #fbbf24;
}

.th-body .badge-danger {
    background: rgba(239, 68, 68, 0.18);
    color: #f87171;
}

.th-body .badge-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
}

/* Alerts & callouts ------------------------------------------------------ */

.th-body .alert {
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-card);
    background: var(--glass-bg);
    color: var(--text-secondary);
    padding: 0.9rem 1.1rem;
    font-size: 0.88rem;
}

.th-body .alert-success,
.th-body .callout-success {
    border-left: 3px solid var(--success);
    background: rgba(34, 197, 94, 0.08);
}

.th-body .alert-danger,
.th-body .callout-danger {
    border-left: 3px solid var(--danger);
    background: rgba(239, 68, 68, 0.08);
}

.th-body .alert-warning,
.th-body .callout-warning {
    border-left: 3px solid var(--warning);
    background: rgba(245, 165, 36, 0.08);
}

.th-body .alert-info,
.th-body .alert-primary,
.th-body .callout-info {
    border-left: 3px solid var(--brand-light);
    background: rgba(6, 91, 241, 0.09);
}

.th-body .callout {
    border-radius: var(--radius-card);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow: none;
    margin-bottom: 1.1rem;
}

.th-body .alert .close {
    color: var(--text-muted);
    text-shadow: none;
    opacity: 1;
}

/* Modals ----------------------------------------------------------------- */

.th-body .modal-content {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-lg);
    color: var(--text-primary);
}

.th-body .modal-header,
.th-body .modal-footer {
    border-color: var(--glass-border);
    padding: 1rem 1.25rem;
}

.th-body .modal-title {
    font-family: "Montserrat", sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
}

.th-body .modal-body {
    padding: 1.25rem;
}

.th-body .modal-header .close {
    color: var(--text-muted);
    text-shadow: none;
    opacity: 1;
}

.th-body .modal-backdrop.show {
    opacity: 0.72;
}

/* Dropdowns -------------------------------------------------------------- */

.th-body .dropdown-menu {
    background: var(--glass-strong);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-lg);
    padding: 0.35rem;
    min-width: 224px;
}

/* `.th-body a` and AdminLTE both target these anchors, so the selector is
   deliberately specific enough to settle it. */
.th-body .dropdown-menu a.dropdown-item,
.th-body .dropdown-menu .dropdown-item {
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.875rem;
    padding: 0.5rem 0.65rem;
    display: flex;
    align-items: center;
    gap: 0.1rem;
}

.th-body .dropdown-menu a.dropdown-item:hover,
.th-body .dropdown-menu a.dropdown-item:focus,
.th-body .dropdown-menu a.dropdown-item:active,
.th-body .dropdown-menu .dropdown-item:hover,
.th-body .dropdown-menu .dropdown-item:focus {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.th-body .dropdown-menu .dropdown-item i {
    color: var(--text-muted);
}

.th-body .dropdown-menu .dropdown-item:hover i,
.th-body .dropdown-menu .dropdown-item:focus i {
    color: var(--text-secondary);
}

.th-body .dropdown-divider {
    border-color: var(--glass-border);
    margin: 0.3rem 0.15rem;
}

/* AdminLTE centres dropdown headers; this is a left-aligned menu. */
.th-body .dropdown-menu .dropdown-header {
    text-align: left;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.45rem 0.65rem 0.3rem;
}

/* Tabs ------------------------------------------------------------------- */

.th-body .nav-tabs {
    border-bottom: 1px solid var(--glass-border);
    gap: 0.2rem;
}

.th-body .nav-tabs .nav-link {
    border: none;
    border-radius: 10px 10px 0 0;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.6rem 1rem;
}

.th-body .nav-tabs .nav-link:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    border: none;
}

.th-body .nav-tabs .nav-link.active {
    background: transparent;
    border: none;
    color: var(--text-primary);
    box-shadow: inset 0 -2px 0 var(--brand-light);
}

.th-body .nav-pills .nav-link {
    border-radius: 10px;
    color: var(--text-secondary);
    font-weight: 500;
}

.th-body .nav-pills .nav-link.active {
    background: var(--brand);
    color: #fff;
}

.th-body .tab-content {
    padding-top: 1.2rem;
}

/* Progress bars ---------------------------------------------------------- */

.th-body .progress {
    background: rgba(255, 255, 255, 0.07);
    border-radius: 999px;
    height: 8px;
}

.th-body .progress-bar {
    background: var(--gradient-main);
    border-radius: 999px;
}

.th-body .progress-bar.bg-success {
    background: var(--success);
}

.th-body .progress-bar.bg-warning {
    background: var(--warning);
}

.th-body .progress-bar.bg-danger {
    background: var(--danger);
}

/* Misc helpers used by inherited views ----------------------------------- */

.th-body hr {
    border-color: var(--glass-border);
}

.th-body code,
.th-body pre {
    background: var(--bg-primary);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: #9dc0ff;
    padding: 0.15rem 0.4rem;
    font-size: 0.85rem;
}

.th-body pre {
    padding: 0.9rem 1rem;
}

.th-body .list-group-item {
    background: transparent;
    border-color: var(--glass-border);
    color: var(--text-secondary);
}

.th-body .bg-white,
.th-body .bg-light {
    background: var(--glass-bg) !important;
    color: var(--text-primary) !important;
}

.th-body .text-dark {
    color: var(--text-primary) !important;
}

.th-body .close {
    color: var(--text-muted);
    text-shadow: none;
}

.th-body .popover,
.th-body .tooltip-inner {
    background: var(--glass-strong);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text-primary);
}

/* SweetAlert2 ------------------------------------------------------------ */

.swal2-popup {
    background: var(--glass-strong) !important;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-card) !important;
    color: var(--text-primary) !important;
    font-family: "Poppins", sans-serif !important;
}

.swal2-title,
.swal2-html-container {
    color: var(--text-primary) !important;
}

.swal2-styled.swal2-confirm {
    background: var(--brand) !important;
    border-radius: var(--radius-btn) !important;
    font-weight: 600;
}

.swal2-styled.swal2-cancel {
    background: rgba(255, 255, 255, 0.08) !important;
    border-radius: var(--radius-btn) !important;
    font-weight: 600;
}

/* Keep the debugbar from inheriting the panel's font stack. */
.phpdebugbar {
    font-family: Menlo, Monaco, Consolas, monospace !important;
}

/* --------------------------------------------------------------------------
   Anchor-based components
   `.th-body a` is an element+class selector, so it outranks a bare component
   class. These rules restore each component's own colour.
   -------------------------------------------------------------------------- */

.th-body a.th-nav-link {
    color: var(--text-secondary);
}

.th-body a.th-nav-link:hover {
    color: var(--text-primary);
}

.th-body a.th-nav-link.active {
    color: var(--brand-light);
}

.th-body a.th-brand,
.th-body a.th-brand:hover {
    color: var(--text-primary);
}

.th-body a.th-credits,
.th-body a.th-credits:hover {
    color: var(--text-primary);
}

.th-body a.th-user-chip,
.th-body a.th-user-chip:hover {
    color: var(--text-primary);
}

.th-body a.th-icon-btn {
    color: var(--text-secondary);
}

.th-body a.th-icon-btn:hover {
    color: var(--text-primary);
}

.th-body a.th-btn-primary,
.th-body a.th-btn-primary:hover {
    color: #fff;
}

.th-body a.th-btn-ghost {
    color: var(--text-secondary);
}

.th-body a.th-btn-ghost:hover {
    color: var(--text-primary);
}

.th-body a.th-discord-btn,
.th-body a.th-discord-btn:hover {
    color: #fff;
}

/* Disabled actions: links gated by permission, buttons gated by form state. */
.th-body a.th-btn.disabled {
    opacity: 0.45;
    pointer-events: none;
}

.th-btn:disabled,
.th-btn.disabled,
.th-body .btn:disabled,
.th-body .btn.disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

.th-btn:disabled:hover,
.th-btn.disabled:hover {
    transform: none;
}

/* ==========================================================================
   Motion
   Interaction feedback only. No entrance choreography: content is there when
   the page is there.
   ========================================================================== */

/* Hover states resolve quickly; the pointer should not outrun them. */
.th-nav-link,
.th-icon-btn,
.th-user-chip,
.th-credits,
.th-btn,
.th-body .btn {
    transition: background-color 0.13s ease, border-color 0.13s ease,
                color 0.13s ease, box-shadow 0.13s ease, transform 0.13s ease;
}

.th-card,
.th-server-card,
.th-plan,
.th-stat {
    transition: border-color 0.15s ease, background-color 0.15s ease,
                box-shadow 0.15s ease;
}

/* Press feedback: the click should land somewhere. */
.th-body .btn:active,
.th-btn:active,
.th-icon-btn:active,
.th-credits:active {
    transform: translateY(1px);
    transition-duration: 0.04s;
}

/* Keyboard focus must stay visible everywhere. */
.th-body a:focus-visible,
.th-body button:focus-visible,
.th-body .form-control:focus-visible,
.th-btn:focus-visible {
    outline: 2px solid var(--brand-light);
    outline-offset: 2px;
}

.th-body .table tbody tr {
    transition: background-color 0.12s ease;
}

.th-nav-link .th-nav-icon {
    transition: color 0.13s ease;
}

@media (prefers-reduced-motion: reduce) {
    .th-body *,
    .th-body *::before,
    .th-body *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==========================================================================
   Dashboard hero
   ========================================================================== */

.th-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.4rem 1.5rem;
    margin-bottom: 1.25rem;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-card);
    background:
        radial-gradient(640px 220px at 0% 0%, rgba(6, 91, 241, 0.14), transparent 70%),
        var(--glass-bg);
}

.th-hero-eyebrow {
    display: block;
    margin-bottom: 0.15rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.th-hero-name {
    color: var(--brand-light);
}

.th-hero-status {
    margin: 0.3rem 0 0;
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.th-hero-status .th-sep {
    margin: 0 0.5rem;
    color: var(--text-muted);
}

.th-hero-clock {
    flex: 0 0 auto;
    text-align: right;
}

.th-hero-time {
    display: block;
    font-family: "Montserrat", sans-serif;
    font-size: 1.85rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
}

.th-hero-date {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}

@media (max-width: 575.98px) {
    .th-hero {
        flex-direction: column;
        gap: 0.9rem;
    }

    .th-hero-clock {
        text-align: left;
    }
}

/* Quick actions strip */
.th-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

/* ==========================================================================
   Browser autofill
   Firefox and Chrome paint their own pale-yellow fill over the input. An
   inset shadow is the only reliable way to cover it in both.
   ========================================================================== */

.th-body input:-webkit-autofill,
.th-body input:-webkit-autofill:hover,
.th-body input:-webkit-autofill:focus,
.th-body textarea:-webkit-autofill,
.th-body select:-webkit-autofill {
    -webkit-text-fill-color: var(--text-primary);
    -webkit-box-shadow: 0 0 0 1000px #12121a inset;
    box-shadow: 0 0 0 1000px #12121a inset;
    caret-color: var(--text-primary);
    /* Outlast the browser's own background transition. */
    transition: background-color 60000s ease-in-out 0s;
}

.th-body input:autofill,
.th-body textarea:autofill,
.th-body select:autofill {
    -webkit-text-fill-color: var(--text-primary);
    box-shadow: 0 0 0 1000px #12121a inset;
    caret-color: var(--text-primary);
    filter: none;
}

/* ==========================================================================
   Avatar picker (Slim)
   The library ships a ripple and half-second fades. Both are replaced with a
   plain, quick overlay.
   ========================================================================== */

.th-body .slim {
    border: 1px solid var(--glass-border) !important;
    background: var(--surface);
    overflow: hidden;
}

/* The "drip" ripple is the library's flourish; it does not belong here. */
.th-body .slim-drip {
    display: none !important;
}

.th-body .slim-area,
.th-body .slim-label,
.th-body .slim-btn,
.th-body .slim-btn-group button {
    transition: opacity 0.15s ease, background-color 0.13s ease,
                border-color 0.13s ease !important;
}

/* Caption sits over the image and fades in on hover only. */
.th-body .slim-label {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 0.6rem;
    background: rgba(0, 0, 0, 0.62);
    color: var(--text-primary);
    font-family: "Poppins", sans-serif;
    font-size: 0.74rem;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
}

.th-body .slim:hover .slim-label {
    opacity: 1;
}

.th-body .slim-btn-group {
    padding-top: 0;
}

.th-body .slim-btn {
    width: 28px;
    height: 28px;
    margin: 0.25rem;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    background-color: rgba(0, 0, 0, 0.75);
    background-size: 12px 12px;
    opacity: 0.85;
}

.th-body .slim-btn:hover {
    background-color: var(--brand);
    border-color: var(--brand);
    opacity: 1;
}

/* The cropping dialog should match the panel, not the library default. */
.th-body .slim-popover {
    background: rgba(0, 0, 0, 0.82);
}

.th-body .slim-image-editor {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-card);
}

.th-body .slim-editor-btn {
    border-radius: var(--radius-btn);
    font-family: "Poppins", sans-serif;
    font-weight: 600;
}

/* ==========================================================================
   Avatar picker
   Replaces the Slim widget: an image, two buttons, a hidden file input.
   ========================================================================== */

.th-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.th-avatar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.7rem;
    width: max-content;
    min-width: 140px;
    max-width: 220px;
}

.th-avatar-img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    background: var(--surface);
}

.th-avatar-actions {
    display: flex;
    gap: 0.4rem;
}

.th-btn-sm {
    padding: 0.34rem 0.6rem;
    font-size: 0.78rem;
}

.th-avatar-hint {
    display: block;
    max-width: 100%;
    color: var(--text-muted);
    font-size: 0.72rem;
    line-height: 1.35;
    text-align: center;
    overflow-wrap: anywhere;
}

.th-avatar-hint.is-error {
    color: #f87171;
}

/* ==========================================================================
   Server creation page
   ========================================================================== */

/* The form was centred while every other page starts at the left edge. */
.th-body #serverForm {
    justify-content: flex-start !important;
}

/* Alerts sit between .card-header and .card-body, so they miss the body's
   padding and run to the card edges. The utility classes on them are
   !important, hence the override. */
.th-body .card > .alert,
.th-body .card > .callout {
    margin: 1.25rem 1.25rem 0 !important;
}

/* A <label> styled as a button must not keep the form-label bottom margin. */
.th-body label.th-btn {
    margin-bottom: 0;
}

/* ==========================================================================
   Analytics
   ========================================================================== */

.th-period {
    display: inline-flex;
    padding: 0.2rem;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-btn);
    background: var(--surface);
}

.th-body a.th-period-item {
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background-color 0.13s ease, color 0.13s ease;
}

.th-body a.th-period-item:hover {
    color: var(--text-primary);
}

.th-body a.th-period-item.active {
    background: var(--brand);
    color: #fff;
}

/* Period-over-period change shown under a headline number. */
.th-delta {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.15rem;
    font-size: 0.72rem;
    font-weight: 600;
}

.th-delta i {
    font-size: 0.62rem;
}

.th-delta.is-up {
    color: #4ade80;
}

.th-delta.is-down {
    color: #f87171;
}

.th-delta.is-flat {
    color: var(--text-muted);
    font-weight: 500;
}

.th-stat-note {
    display: block;
    margin-top: 0.1rem;
    font-size: 0.71rem;
    color: var(--text-muted);
}

/* Charts need a fixed box: Chart.js sizes the canvas to its parent. */
.th-chart {
    position: relative;
    height: 280px;
}

.th-card-body.p-0 .table {
    margin-bottom: 0;
}

.th-card-body.p-0 .table thead th:first-child,
.th-card-body.p-0 .table tbody td:first-child {
    padding-left: 1.25rem;
}

.th-card-body.p-0 .table thead th:last-child,
.th-card-body.p-0 .table tbody td:last-child {
    padding-right: 1.25rem;
}

/* ==========================================================================
   Checkout
   ========================================================================== */

.th-gateways {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 0.6rem;
}

.th-gateway {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.55rem;
    padding: 0.95rem 1rem;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-card);
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.18s ease, background-color 0.18s ease;
}

.th-gateway:hover:not(:disabled) {
    border-color: rgba(59, 127, 250, 0.4);
    background: var(--surface-hover);
}

.th-gateway:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.th-gateway.is-selected {
    border-color: var(--brand);
    background: rgba(6, 91, 241, 0.1);
    color: var(--text-primary);
}

.th-gateway-logo {
    height: 26px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

.th-gateway-name {
    font-size: 0.88rem;
    font-weight: 600;
}

/* Tick appears only on the chosen method. */
.th-gateway-check {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font-size: 0.6rem;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.th-gateway.is-selected .th-gateway-check {
    opacity: 1;
    transform: scale(1);
}

/* Coupon ----------------------------------------------------------------- */

.th-coupon {
    display: flex;
    gap: 0.5rem;
}

.th-coupon .form-control {
    flex: 1 1 auto;
    min-width: 0;
}

.th-coupon .th-btn {
    flex: 0 0 auto;
}

.th-coupon-applied {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin-top: 0.8rem;
}

/* Order summary ---------------------------------------------------------- */

.th-sticky {
    position: sticky;
    top: calc(var(--topbar-h) + 1.25rem);
}

.th-order-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.th-order-qty {
    margin-left: auto;
    font-family: "Montserrat", sans-serif;
    font-weight: 700;
    white-space: nowrap;
}

.th-summary {
    margin-top: 1.1rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--glass-border);
}

.th-summary-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.86rem;
    color: var(--text-secondary);
}

.th-summary-row.is-discount {
    color: #4ade80;
}

.th-summary-total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.9rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--glass-border);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.th-summary-total strong {
    font-family: "Montserrat", sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

@media (max-width: 991.98px) {
    .th-sticky {
        position: static;
    }
}

/* ==========================================================================
   Area switch
   Moves between the client panel and the administration context.
   ========================================================================== */

.th-area-switch-wrap {
    flex: 0 0 auto;
    padding: 0.65rem;
    border-top: 1px solid var(--glass-border);
}

.th-body a.th-area-switch {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.62rem 0.75rem;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 0.86rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.th-body a.th-area-switch:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
    text-decoration: none;
}

.th-body a.th-area-switch i {
    flex: 0 0 auto;
    width: 20px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Entering the admin context is the one place the brand colour is used here. */
.th-body a.th-area-switch.is-admin {
    border-color: var(--glass-border);
    background: var(--surface);
    color: var(--text-secondary);
}

.th-body a.th-area-switch.is-admin:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.th-body a.th-area-switch.is-admin i {
    color: var(--text-muted);
}

/* Collapsed rail: icon only. */
@media (min-width: 992px) {
    .th-collapsed .th-area-switch-wrap .th-nav-label {
        display: none;
    }

    .th-collapsed .th-body a.th-area-switch,
    .th-collapsed a.th-area-switch {
        justify-content: center;
        gap: 0;
        padding-left: 0;
        padding-right: 0;
    }
}

/* ==========================================================================
   Mobile
   ========================================================================== */

/* Keep the sidebar's bottom controls clear of the iOS home indicator and of
   Safari's collapsing toolbar. */
.th-area-switch-wrap {
    padding-bottom: calc(0.65rem + env(safe-area-inset-bottom, 0px));
}

.th-sidebar-foot {
    padding-bottom: calc(0.85rem + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 991.98px) {
    /* The off-canvas sidebar scrolls as one column so nothing can be stranded
       under the browser chrome. */
    .th-sidebar {
        width: min(86vw, var(--sidebar-w));
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .th-topbar {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }

    .th-content {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
        padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
    }

    /* Touch targets: the topbar controls were sized for a mouse. */
    .th-icon-btn {
        width: 42px;
        height: 42px;
    }

    .th-user-chip,
    .th-credits {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }

    .th-hero {
        padding: 1.1rem 1.1rem;
    }

    .th-hero-time {
        font-size: 1.5rem;
    }

    /* Wide admin tables stay usable by scrolling rather than squashing. */
    .th-body .table-responsive,
    .th-card-body.p-0 {
        overflow-x: auto;
    }

    .th-period {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 575.98px) {
    .th-stats {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .th-page-title {
        font-size: 1.4rem;
    }

    .th-actions .th-btn {
        flex: 1 1 auto;
        justify-content: center;
    }

    .th-actions .ml-auto {
        margin-left: 0 !important;
    }
}

/* ==========================================================================
   Page transition
   One short fade when a page arrives. No stagger, no movement.
   ========================================================================== */

@keyframes th-page-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* `backwards` and not `both`: a filling animation on opacity keeps the element
   a stacking context for good, which would bury every Bootstrap modal under the
   body-level backdrop. */
.th-content {
    animation: th-page-in 0.16s ease-out backwards;
}

/* Dim the outgoing page while the next one is still loading, so a slow
   navigation does not look frozen. */
.th-body.th-leaving .th-content {
    opacity: 0.55;
    transition: opacity 0.12s ease-out;
}

@media (prefers-reduced-motion: reduce) {
    .th-content {
        animation: none;
    }

    .th-body.th-leaving .th-content {
        opacity: 1;
    }
}

/* Centred auth card: used by the password flows, which have no sales pitch. */
.th-auth-center {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 2.5rem 1rem calc(2.5rem + env(safe-area-inset-bottom, 0px));
    background: var(--bg-primary);
}

.th-auth-center .th-auth-card {
    max-width: 440px;
}

.th-auth-center .th-auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
}

/* Server connection address ------------------------------------------------ */

.th-address {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.85rem;
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    font-size: 0.82rem;
}

.th-address > i {
    flex: 0 0 auto;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.th-body .th-address code {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--text-primary);
    font-size: 0.82rem;
    overflow-wrap: anywhere;
}

.th-address-copy {
    flex: 0 0 auto;
    padding: 0.2rem 0.35rem;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.13s ease, background-color 0.13s ease;
}

.th-address-copy:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

/* Keep the server card actions on one row: the primary button flexes, the
   icon buttons stay at their intrinsic width. */
.th-card-foot .th-btn {
    flex: 0 0 auto;
    padding-left: 0.6rem;
    padding-right: 0.6rem;
}

.th-card-foot .th-btn:first-child {
    flex: 1 1 auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

/* ==========================================================================
   Plan builder
   ========================================================================== */

.th-slider {
    margin-bottom: 1.4rem;
}

.th-slider:last-child {
    margin-bottom: 0;
}

.th-slider-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.th-slider-value {
    font-family: "Montserrat", sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.th-slider-scale {
    display: flex;
    justify-content: space-between;
    margin-top: 0.3rem;
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* Range input, styled in both engines. */
.th-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: var(--bg-primary);
    border: 1px solid var(--glass-border);
    outline: none;
    cursor: pointer;
}

.th-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--brand);
    border: 2px solid var(--surface);
    cursor: pointer;
    transition: background-color 0.13s ease;
}

.th-range::-webkit-slider-thumb:hover {
    background: var(--brand-hover);
}

.th-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--brand);
    border: 2px solid var(--surface);
    cursor: pointer;
}

.th-range:focus-visible {
    outline: 2px solid var(--brand-light);
    outline-offset: 3px;
}

.th-discount-tag {
    display: inline-block;
    margin-left: 0.3rem;
    padding: 0.05rem 0.35rem;
    border-radius: var(--radius-sm);
    background: rgba(34, 197, 94, 0.16);
    color: #4ade80;
    font-size: 0.7rem;
    font-weight: 600;
}

/* The plan cards on the index are links. */
.th-body a.th-plan,
.th-body a.th-plan:hover {
    color: var(--text-secondary);
    text-decoration: none;
}

/* Renewal controls on a directly paid server. */
.th-renew {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.9rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--glass-border);
}

.th-renew form {
    flex: 1 1 auto;
}

.th-renew .th-btn {
    width: 100%;
    justify-content: center;
}

/* ==========================================================================
   Create server
   Configuration on the left, the packages for that location beside it. The
   two halves share one grid so they always line up along the top edge.
   ========================================================================== */

.th-create {
    display: grid;
    grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
    align-items: start;
    /* The two halves are separate steps, so they get more air between them
       than two cards in the same section would. */
    gap: 2.25rem;
}

.th-create-config {
    position: sticky;
    top: calc(var(--topbar-h, 64px) + 1rem);
}

.th-create-config .th-card-body {
    position: relative;
}

.th-create-config .form-group label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.th-create-config .form-group label .fa-info-circle {
    margin-left: 0.3rem;
    color: var(--text-muted);
    cursor: pointer;
}

.th-create-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(18, 18, 26, 0.72);
    color: var(--text-secondary);
    font-size: 1.4rem;
}

/* The placeholder has to fill the column, otherwise it collapses to a strip
   next to a tall configuration card. */
.th-create-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 320px;
    margin: 0;
}

.th-plan-slots {
    flex: 0 0 auto;
    padding: 0.18rem 0.5rem;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    font-size: 0.74rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.th-plan-specs {
    margin: 0.4rem 0 0;
    padding: 0.8rem 0 0;
    border-top: 1px solid var(--glass-border);
    list-style: none;
    font-size: 0.82rem;
}

.th-plan-specs li {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.22rem 0;
    color: var(--text-secondary);
}

.th-plan-specs li > span:first-child {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--text-muted);
}

.th-plan-specs li > span:first-child i {
    width: 0.95rem;
    text-align: center;
    font-size: 0.75rem;
}

.th-plan-specs li > span:last-child {
    text-align: right;
    font-weight: 600;
}

/* Both actions are full width here, unlike the server card where they sit
   on one row. */
.th-create-products .th-card-foot {
    flex-direction: column;
}

.th-create-products .th-card-foot .th-btn,
.th-create-products .th-card-foot .th-btn:first-child {
    flex: 0 0 auto;
    width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
}

/* The figure is the first thing read here, but it shares the line with the
   period, so it is a notch smaller than on the pricing page. */
.th-create-products .th-plan-price {
    flex-wrap: wrap;
    margin-bottom: 0.45rem;
}

.th-create-products .th-plan-amount {
    font-size: 1.75rem;
}

.th-create-products .th-plan {
    padding: 1.3rem 1.2rem;
}

.th-create-products .th-grid {
    grid-template-columns: repeat(auto-fill, minmax(276px, 1fr));
}

@media (max-width: 1199.98px) {
    .th-create {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.75rem;
    }

    .th-create-config {
        position: static;
    }

    .th-create-hint {
        min-height: 200px;
    }
}

/* Two price lists side by side: label, credits, money. */
.th-pricegrid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 0.5rem 0.75rem;
}

.th-pricegrid-head {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    text-align: center;
}

@media (max-width: 575.98px) {
    .th-pricegrid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    /* The spacer above the label column has nothing to line up with here. */
    .th-pricegrid > span:first-child {
        display: none;
    }

    .th-pricegrid > label {
        grid-column: 1 / -1;
        margin: 0.4rem 0 0;
    }
}

/* ==========================================================================
   Popovers and tooltips
   Bootstrap ships these in white with near-black text, which was unreadable
   against the dark panel.
   ========================================================================== */

.th-body .popover {
    background: var(--glass-strong);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-lg);
    font-family: inherit;
    max-width: 320px;
}

.th-body .popover-header {
    background: transparent;
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-primary);
    font-size: 0.86rem;
    font-weight: 700;
}

.th-body .popover-body {
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.5;
}

/* The arrow is drawn from two borders, so both have to follow the surface. */
.th-body .bs-popover-top > .arrow::after,
.th-body .bs-popover-auto[x-placement^="top"] > .arrow::after {
    border-top-color: var(--glass-strong);
}

.th-body .bs-popover-bottom > .arrow::after,
.th-body .bs-popover-auto[x-placement^="bottom"] > .arrow::after {
    border-bottom-color: var(--glass-strong);
}

.th-body .bs-popover-left > .arrow::after,
.th-body .bs-popover-auto[x-placement^="left"] > .arrow::after {
    border-left-color: var(--glass-strong);
}

.th-body .bs-popover-right > .arrow::after,
.th-body .bs-popover-auto[x-placement^="right"] > .arrow::after {
    border-right-color: var(--glass-strong);
}

.th-body .bs-popover-top > .arrow::before { border-top-color: var(--glass-border); }
.th-body .bs-popover-bottom > .arrow::before { border-bottom-color: var(--glass-border); }
.th-body .bs-popover-left > .arrow::before { border-left-color: var(--glass-border); }
.th-body .bs-popover-right > .arrow::before { border-right-color: var(--glass-border); }

.th-body .bs-popover-bottom .popover-header::before {
    border-bottom-color: var(--glass-border);
}

.th-body .tooltip-inner {
    background: var(--glass-strong);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.8rem;
    max-width: 280px;
}

.th-body .bs-tooltip-top .arrow::before { border-top-color: var(--glass-strong); }
.th-body .bs-tooltip-bottom .arrow::before { border-bottom-color: var(--glass-strong); }
.th-body .bs-tooltip-left .arrow::before { border-left-color: var(--glass-strong); }
.th-body .bs-tooltip-right .arrow::before { border-right-color: var(--glass-strong); }

/* The little question marks that open them. */
.th-body .th-hint,
.th-body label > .fa-info-circle {
    margin-left: 0.3rem;
    color: var(--text-muted);
    font-size: 0.76rem;
    cursor: help;
    transition: color 0.15s ease;
}

.th-body .th-hint:hover,
.th-body label > .fa-info-circle:hover {
    color: var(--brand-light);
}

/* ==========================================================================
   Notifications
   SweetAlert carries its own white theme; this puts it on the panel's
   surface so an error or a saved-settings toast looks like the rest.
   ========================================================================== */

/* Only a real dialog dims the page. A toast shares the same container, and
   dimming that painted a dark slab around the corner of the screen. */
.th-body .swal2-container:not(.swal2-toast-shown) {
    backdrop-filter: blur(2px);
}

.th-body .swal2-container.swal2-backdrop-show:not(.swal2-toast-shown) {
    background: rgba(4, 6, 11, 0.62);
}

.th-body .swal2-container.swal2-toast-shown,
.th-body .swal2-container.swal2-toast-shown.swal2-backdrop-show {
    background: transparent;
    backdrop-filter: none;
    padding: 0.9rem;
}

.th-body .swal2-popup {
    background: var(--glass-strong);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-lg);
    color: var(--text-primary);
    font-family: inherit;
    padding: 1.6rem 1.5rem 1.35rem;
}

/* Spacing around the icon only. Its size, ring and the lines that draw the
   tick and the cross are SweetAlert's own geometry and must stay untouched. */
.th-body .swal2-icon {
    margin-top: 0.2rem;
    margin-bottom: 0.9rem;
}

.th-body .swal2-title {
    font-family: "Montserrat", sans-serif;
    font-size: 1.12rem;
    font-weight: 700;
    color: var(--text-primary);
    padding: 0;
}

.th-body .swal2-html-container,
.th-body .swal2-content {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.55;
    margin-top: 0.7rem;
}

.th-body .swal2-actions {
    gap: 0.5rem;
    margin-top: 1.3rem;
}

.th-body .swal2-styled {
    margin: 0;
    padding: 0.58rem 1.2rem;
    border: 1px solid transparent;
    border-radius: var(--radius-btn);
    font-size: 0.88rem;
    font-weight: 600;
    box-shadow: none;
}

.th-body .swal2-styled:focus {
    box-shadow: none;
    outline: 2px solid var(--brand-light);
    outline-offset: 2px;
}

.th-body .swal2-styled.swal2-confirm {
    background: var(--brand);
    color: #fff;
}

.th-body .swal2-styled.swal2-confirm:hover {
    background: var(--brand-hover);
}

.th-body .swal2-styled.swal2-cancel,
.th-body .swal2-styled.swal2-deny {
    background: var(--surface);
    border-color: var(--glass-border);
    color: var(--text-secondary);
}

.th-body .swal2-styled.swal2-cancel:hover,
.th-body .swal2-styled.swal2-deny:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.th-body .swal2-input,
.th-body .swal2-select,
.th-body .swal2-textarea {
    background: var(--surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-btn);
    color: var(--text-primary);
    box-shadow: none;
}

.th-body .swal2-input:focus,
.th-body .swal2-select:focus,
.th-body .swal2-textarea:focus {
    border-color: var(--brand-light);
    box-shadow: none;
}

.th-body .swal2-validation-message {
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
    border-radius: var(--radius-sm);
}

.th-body .swal2-close {
    color: var(--text-muted);
    box-shadow: none;
}

.th-body .swal2-close:hover {
    color: var(--text-primary);
}

/* Toasts sit in the corner and carry their own, tighter spacing. The surface
   is restated here because SweetAlert injects its own `.swal2-popup.swal2-toast`
   rule into the head at runtime, which ties on specificity and lands later. */
.th-body .swal2-popup.swal2-toast {
    /* The card surface, not the lighter one used for dialogs: a toast sits on
       top of the page rather than over a dimmed backdrop, so the lighter grey
       read as a slab stuck to the corner. */
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-card);
    color: var(--text-primary);
    padding: 0.7rem 0.9rem;
    box-shadow: var(--shadow-lg);
    /* Keeps the timer bar inside the rounded corners. */
    overflow: hidden;
}

/* The bar is flush with the bottom edge, so it has to follow the corners
   rather than square them off. */
.th-body .swal2-popup.swal2-toast .swal2-timer-progress-bar-container {
    height: 3px;
    border-bottom-left-radius: var(--radius-card);
    border-bottom-right-radius: var(--radius-card);
    overflow: hidden;
}

.th-body .swal2-popup.swal2-toast .swal2-title {
    font-size: 0.88rem;
    font-weight: 600;
    margin: 0;
}

.th-body .swal2-timer-progress-bar {
    background: var(--brand);
}

/* The gateway in the order summary is shown by its wordmark. */
.th-pay-with {
    display: inline-flex;
    align-items: center;
}

.th-pay-with-logo {
    height: 20px;
    max-width: 92px;
    object-fit: contain;
}

/* A gateway logo is its wordmark, so the name under it would only repeat it.
   It comes back when the logo cannot be loaded. */
.th-gateway .th-gateway-name {
    display: none;
}

.th-gateway.is-logoless .th-gateway-name {
    display: block;
}

/* ==========================================================================
   Configurator: choices still to make
   The sliders start at the plan's minimum, which is a starting point rather
   than a decision, so nothing is orderable until it has been made one.
   ========================================================================== */

.th-required {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-top: 1rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: var(--radius-sm);
    background: rgba(239, 68, 68, 0.08);
    color: #fca5a5;
    font-size: 0.82rem;
}

.th-required > i {
    margin-top: 0.15rem;
    font-size: 0.9rem;
}

.th-required strong {
    display: block;
    margin-bottom: 0.2rem;
    color: #fecaca;
}

.th-required ul {
    margin: 0;
    padding-left: 1.05rem;
}

.th-body .form-control.is-invalid,
.th-body select.form-control.is-invalid {
    border-color: rgba(239, 68, 68, 0.6);
    background-image: none;
}

/* A filter that is either on or off, next to the period selector. */
.th-body a.th-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.42rem 0.75rem;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-btn);
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    transition: var(--transition-fast);
}

.th-body a.th-toggle:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
    text-decoration: none;
}

.th-body a.th-toggle i {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.th-body a.th-toggle.is-on {
    border-color: rgba(59, 127, 250, 0.4);
    background: rgba(6, 91, 241, 0.12);
    color: var(--brand-light);
}

.th-body a.th-toggle.is-on i {
    color: var(--brand-light);
}

/* Power controls on a server card. */
.th-power {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.9rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--glass-border);
}

.th-power .th-btn {
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
    gap: 0.4rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.th-power .th-btn i {
    font-size: 0.72rem;
}

/* The pill animates between states, so the change is noticed without
   anything jumping around. */
.th-status {
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* ==========================================================================
   Trial server
   ========================================================================== */

/* Step indicator above the wizard. */
.th-steps {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.6rem;
}

.th-step {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-muted);
    font-size: 0.86rem;
    font-weight: 600;
    white-space: nowrap;
}

.th-step-no {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    background: var(--surface);
    font-size: 0.8rem;
}

.th-step.is-done {
    color: var(--text-primary);
}

.th-step.is-done .th-step-no {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.th-step-line {
    flex: 1 1 auto;
    height: 1px;
    background: var(--glass-border);
}

/* A package card that is also a radio button. */
.th-body label.th-trial-pick {
    cursor: pointer;
    margin: 0;
}

.th-body label.th-trial-pick.is-picked {
    border-color: rgba(59, 127, 250, 0.55);
    background: var(--surface-hover);
}

.th-body label.th-trial-pick.is-picked::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-main);
}

.th-body label.th-trial-pick:focus-within {
    outline: 2px solid var(--brand-light);
    outline-offset: 2px;
}

/* A trial server stands out in the list. */
.th-server-card.is-trial {
    border-color: rgba(250, 204, 21, 0.35);
}

.th-server-card.is-trial::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #facc15, #f59e0b);
}

.th-status.is-trial {
    background: rgba(250, 204, 21, 0.14);
    color: #fde047;
}

.th-trial-note {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.9rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid rgba(250, 204, 21, 0.3);
    border-radius: var(--radius-sm);
    background: rgba(250, 204, 21, 0.07);
    color: #fde047;
    font-size: 0.8rem;
}

.th-trial-note i {
    font-size: 0.8rem;
}

/* The buy / extend row on a trial card. */
.th-trial-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.75rem;
}

.th-trial-actions .th-btn {
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
}

/* The buy dialog's figures. */
.th-buy-rows {
    text-align: left;
    font-size: 0.88rem;
}

.th-buy-rows > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-secondary);
}

.th-buy-rows > div:last-child {
    border-bottom: 0;
    padding-top: 0.7rem;
    font-weight: 700;
    color: var(--text-primary);
}

.th-buy-rows .th-buy-short {
    color: #fca5a5;
}
