.brand::before {
    content: "";
    position: absolute;
    inset: 18% 8% 18% 8%;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(198, 161, 90, 0.28) 0%, rgba(198, 161, 90, 0) 72%);
    filter: blur(16px);
    opacity: 0.7;
    z-index: 0;
    animation: brand-aurora 4.6s ease-in-out infinite;
}

.brand::after {
    content: "";
    position: absolute;
    top: -18%;
    left: -32%;
    width: 26%;
    height: 136%;
    background: linear-gradient(110deg, rgba(255, 255, 255, 0) 0%, rgba(255, 244, 214, 0.12) 35%, rgba(255, 224, 153, 0.68) 50%, rgba(255, 255, 255, 0) 68%);
    transform: skewX(-18deg);
    filter: blur(2px);
    opacity: 0.85;
    pointer-events: none;
    z-index: 2;
    animation: brand-shimmer 5.2s ease-in-out infinite;
}
:root {
    --bg: #0b0c0f;
    --ink: #e7eaee;
    --brand: #c6a15a;
    --brand-dark: #8f6f35;
    --accent: #7f8a96;
    --card: rgba(20, 22, 27, 0.88);
    --border: rgba(220, 224, 230, 0.12);
    --ok: #66c992;
    --warn: #d1a24d;
    --bad: #d06767;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    color: var(--ink);
    background: radial-gradient(circle at 18% 16%, rgba(255, 255, 255, 0.08), transparent 24%),
        radial-gradient(circle at 82% 10%, rgba(198, 161, 90, 0.18), transparent 28%),
        linear-gradient(140deg, #07080a 0%, #15181d 44%, #0b0c0f 100%);
    min-height: 100vh;
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
}

body.page-welcome::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: url("images/welcome-trading-bg.svg");
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    opacity: 0.94;
    z-index: -3;
    pointer-events: none;
    animation: welcome-bg-drift 24s ease-in-out infinite alternate;
}

body.page-welcome::after {
    content: "";
    position: fixed;
    inset: 0;
    background: linear-gradient(180deg, rgba(7, 8, 10, 0.2) 0%, rgba(7, 8, 10, 0.34) 38%, rgba(7, 8, 10, 0.48) 100%);
    z-index: -2;
    pointer-events: none;
}

.bg-shape {
    position: fixed;
    z-index: -1;
    border-radius: 50%;
    opacity: 0.22;
    filter: blur(10px);
}

.bg-shape-1 {
    width: 360px;
    height: 360px;
    top: -80px;
    right: -90px;
    background: rgba(198, 161, 90, 0.45);
}

.bg-shape-2 {
    width: 280px;
    height: 280px;
    left: -110px;
    bottom: 40px;
    background: rgba(116, 126, 139, 0.34);
}

.container {
    max-width: none;
    width: 100%;
    margin: 1rem auto 2rem;
    padding: 0 clamp(1rem, 2vw, 2.5rem);
}

body.page-welcome main.container {
    max-width: none;
    width: 100vw;
    margin: 0;
    padding: 0;
}

main.container {
    flex: 1 0 auto;
}

footer {
    margin-top: auto;
    flex-shrink: 0;
}

#demoCanvas {
    display: block;
    width: 100%;
}

.card {
    background: linear-gradient(180deg, rgba(40, 43, 49, 0.62) 0%, rgba(17, 19, 23, 0.94) 100%),
        repeating-linear-gradient(100deg, rgba(255, 255, 255, 0.028) 0 2px, rgba(255, 255, 255, 0) 2px 7px);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(5px);
}

.site-header {
    margin: 1rem auto;
    max-width: none;
    width: 100%;
    padding: 0.8rem clamp(1rem, 2vw, 2.5rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 50;
}

.header-runtime-status {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    padding: 0 0.8rem;
}

.server-status-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.38rem 0.82rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: 1px solid transparent;
    white-space: nowrap;
}

.server-status-online {
    color: #b7f6d0;
    background: rgba(46, 140, 91, 0.2);
    border-color: rgba(102, 201, 146, 0.45);
}

.server-status-offline {
    color: #ffd4d4;
    background: rgba(170, 56, 56, 0.2);
    border-color: rgba(208, 103, 103, 0.52);
}

.server-status-warning {
    color: #ffe5bb;
    background: rgba(171, 118, 42, 0.24);
    border-color: rgba(209, 162, 77, 0.54);
}

.brand {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    padding: 0.2rem 0;
}



.brand-logo {
    display: block;
    height: 84px;
    width: auto;
    max-width: min(480px, 87vw);
    object-fit: contain;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 0 10px rgba(198, 161, 90, 0.28)) drop-shadow(0 0 18px rgba(198, 161, 90, 0.12));
    transform-origin: center;
    animation: brand-float 4.6s ease-in-out infinite, brand-glow 3.2s ease-in-out infinite;
}

@keyframes brand-float {
    0%,
    100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-1px) scale(1.012);
    }
}

@keyframes brand-glow {
    0%,
    100% {
        filter: drop-shadow(0 0 10px rgba(198, 161, 90, 0.24)) drop-shadow(0 0 18px rgba(198, 161, 90, 0.1));
    }
    50% {
        filter: drop-shadow(0 0 14px rgba(245, 210, 132, 0.42)) drop-shadow(0 0 28px rgba(198, 161, 90, 0.2));
    }
}

@keyframes brand-shimmer {
    0% {
        left: -32%;
        opacity: 0;
    }
    10% {
        opacity: 0.85;
    }
    55% {
        left: 118%;
        opacity: 0.75;
    }
    100% {
        left: 118%;
        opacity: 0;
    }
}

@keyframes brand-aurora {
    0%,
    100% {
        transform: scale(0.98);
        opacity: 0.48;
    }
    50% {
        transform: scale(1.04);
        opacity: 0.82;
    }
}

@media (prefers-reduced-motion: reduce) {
    .brand::before,
    .brand::after,
    .brand-logo {
        animation: none;
    }
}

.dropdown {
    position: relative;
    z-index: 60;
    padding-bottom: 0.55rem;
    margin-bottom: -0.55rem;
}

.dropdown::after {
    content: "";
    position: absolute;
    top: 100%;
    right: 0;
    width: 100%;
    height: 0.7rem;
}

.dropdown-toggle {
    border: none;
    border-radius: 12px;
    padding: 0.6rem 1rem;
    background: linear-gradient(180deg, #d5b16d 0%, #a67f3d 100%);
    color: #141518;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 8px 18px rgba(0, 0, 0, 0.22);
    cursor: pointer;
}

.dropdown-toggle:hover {
    background: linear-gradient(180deg, #dfbc78 0%, #8f6f35 100%);
}

.dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 0.18rem);
    min-width: 220px;
    display: block;
    padding: 0.5rem;
    border-radius: 12px;
    background: rgba(17, 19, 23, 0.96);
    border: 1px solid var(--border);
    box-shadow: 0 18px 30px rgba(0, 0, 0, 0.36);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(6px);
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s linear 0.16s;
}

.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition-delay: 0s;
}

.dropdown-menu form {
    margin: 0;
}

.dropdown-menu button {
    width: 100%;
    margin: 0.2rem 0;
    text-align: left;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--ink);
    padding: 0.55rem 0.7rem;
    cursor: pointer;
}

.dropdown-menu button:hover {
    background: rgba(198, 161, 90, 0.16);
}

.admin-status-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
}

.admin-status-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.85rem;
    background: rgba(14, 16, 20, 0.5);
}

.admin-status-card h3 {
    margin-top: 0;
    margin-bottom: 0.45rem;
}

.inline-check {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.admin-status-log-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.admin-status-log-head h2 {
    margin: 0;
}

.grid-two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.panel {
    padding: 1.25rem;
}

.form-stack {
    display: grid;
    gap: 0.5rem;
}

.welcome-flow {
    max-width: 980px;
    margin: 0 auto;
    display: grid;
    gap: 1rem;
    position: relative;
    z-index: 1;
    padding: 1.2rem 0 2rem;
}

.welcome-hero-card {
    padding: 0;
    overflow: hidden;
    border-color: rgba(198, 161, 90, 0.22);
    background: linear-gradient(180deg, rgba(18, 21, 25, 0.28) 0%, rgba(10, 12, 15, 0.42) 100%),
        repeating-linear-gradient(100deg, rgba(255, 255, 255, 0.02) 0 2px, rgba(255, 255, 255, 0) 2px 7px);
    backdrop-filter: blur(10px);
}

.welcome-hero-body {
    padding: 3rem 2.6rem;
    text-align: center;
    background: linear-gradient(180deg, rgba(14, 16, 20, 0.12) 0%, rgba(14, 16, 20, 0.32) 100%);
}

.welcome-hero-body h1 {
    font-size: clamp(2.6rem, 6vw, 4.4rem);
    margin: 0 0 0.9rem;
    letter-spacing: 0.04em;
    color: #f3ddae;
    text-shadow: 0 0 14px rgba(198, 161, 90, 0.16), 0 0 28px rgba(198, 161, 90, 0.18), 0 0 56px rgba(198, 161, 90, 0.12);
    animation: welcome-title-glow 5.8s ease-in-out infinite;
}

.welcome-hero-body p {
    font-size: 1.1rem;
    line-height: 1.75;
    margin: 0 0 1rem;
    color: rgba(231, 234, 238, 0.88);
}

.welcome-copy-card {
    background: linear-gradient(180deg, rgba(24, 27, 32, 0.22) 0%, rgba(15, 17, 21, 0.46) 100%),
        repeating-linear-gradient(100deg, rgba(255, 255, 255, 0.018) 0 2px, rgba(255, 255, 255, 0) 2px 7px);
    border-color: rgba(220, 224, 230, 0.14);
    backdrop-filter: blur(8px);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.24);
}

.welcome-copy-card h2 {
    margin-top: 0;
    color: #ecd29b;
    letter-spacing: 0.02em;
}

.welcome-copy-card p {
    line-height: 1.65;
    margin: 0 0 0.8rem;
    color: rgba(231, 234, 238, 0.82);
}

.welcome-copy-card p:last-child {
    margin-bottom: 0;
}

.welcome-auth-links {
    margin: 0.85rem 0 0;
    text-align: center;
}

.welcome-auth-links a {
    color: #f0cd8e;
    text-decoration: none;
    border-bottom: 1px solid rgba(240, 205, 142, 0.36);
    padding-bottom: 0.08rem;
}

.welcome-auth-links a:hover {
    color: #f7ddb0;
    border-bottom-color: rgba(247, 221, 176, 0.68);
}

.welcome-auth-panel {
    max-width: 640px;
    margin: 0 auto;
    width: 100%;
}

.welcome-auth-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.welcome-auth-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(7, 8, 10, 0.72);
    backdrop-filter: blur(2px);
    animation: welcome-auth-backdrop-fade 220ms ease-out;
}

.welcome-auth-dialog {
    position: relative;
    width: min(560px, 100%);
    max-height: 90vh;
    overflow: auto;
    z-index: 1;
    box-shadow: 0 20px 42px rgba(12, 20, 28, 0.28);
    animation: welcome-auth-dialog-in 260ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.welcome-auth-close-btn {
    position: absolute;
    right: 0.85rem;
    top: 0.85rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--ink);
    text-decoration: none;
    padding: 0.35rem 0.6rem;
    font-size: 0.85rem;
    font-weight: 700;
}

.welcome-auth-close-btn:hover {
    background: rgba(198, 161, 90, 0.16);
}

@keyframes welcome-auth-backdrop-fade {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes welcome-auth-dialog-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes welcome-bg-drift {
    0% {
        transform: scale(1.03) translate3d(-1.4%, 0, 0);
    }
    100% {
        transform: scale(1.08) translate3d(1.8%, -0.6%, 0);
    }
}

@keyframes welcome-title-glow {
    0%,
    100% {
        text-shadow: 0 0 14px rgba(198, 161, 90, 0.14), 0 0 28px rgba(198, 161, 90, 0.16), 0 0 56px rgba(198, 161, 90, 0.08);
    }
    50% {
        text-shadow: 0 0 18px rgba(232, 202, 140, 0.22), 0 0 38px rgba(198, 161, 90, 0.24), 0 0 72px rgba(198, 161, 90, 0.16);
    }
}

@media (prefers-reduced-motion: reduce) {
    .welcome-auth-backdrop,
    .welcome-auth-dialog,
    body.page-welcome::before,
    .welcome-hero-body h1 {
        animation: none;
    }
}

@media (max-width: 720px) {
    body.page-welcome::before {
        background-position: 62% center;
        opacity: 0.86;
    }

    .welcome-hero-body {
        padding: 2.2rem 1.25rem;
    }
}

.account-register-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.account-register-head h2 {
    margin: 0;
}

.collapsible-panel {
    margin-top: 0.5rem;
}

.collapsible-panel.is-collapsed {
    display: none;
}

.account-form-actions {
    margin-top: 0.35rem;
}

.table-wrap {
    overflow-x: auto;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.75rem;
    font-size: 0.92rem;
}

.users-table-compact {
    font-size: 0.82rem;
}

.users-table-compact th,
.users-table-compact td {
    padding: 0.38rem;
}

.users-table-compact .inline-form {
    gap: 0.3rem;
}

.users-table-compact .inline-form select {
    min-width: 82px;
    padding: 0.35rem 0.45rem;
}

.users-table-compact button[type="submit"],
.users-table-compact .danger-btn {
    padding: 0.38rem 0.5rem;
    font-size: 0.8rem;
}

.users-table-signal-mini {
    font-size: 0.66rem;
    width: max-content;
    table-layout: auto;
}

.users-table-signal-mini th,
.users-table-signal-mini td {
    padding: 0.22rem 0.3rem;
    white-space: nowrap;
    text-align: center;
}

.users-table th,
.users-table td {
    border-bottom: 1px solid var(--border);
    padding: 0.5rem;
    text-align: left;
    white-space: nowrap;
}

.admin-payments-table {
    table-layout: fixed;
    font-size: 0.84rem;
}

.admin-payments-table th,
.admin-payments-table td {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    vertical-align: top;
}

.admin-payments-table td form.inline-form {
    flex-wrap: wrap;
}

.users-table th {
    background: rgba(198, 161, 90, 0.14);
}

.pricing-tier-table tbody td {
    transition: background-color 0.16s ease;
}

.pricing-tier-table tbody tr:hover td {
    background: rgba(198, 161, 90, 0.1);
}

.inline-form {
    display: flex;
    gap: 0.45rem;
    align-items: center;
}

.inline-form select {
    min-width: 95px;
}

.invite-code-badge {
    display: inline-block;
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    font-family: monospace;
    font-weight: 700;
    border: 1px solid transparent;
}

.invite-code-pending {
    background: rgba(209, 162, 77, 0.14);
    color: #f0cd8e;
    border-color: rgba(209, 162, 77, 0.38);
}

.invite-code-granted {
    background: rgba(102, 201, 146, 0.15);
    color: #9ce3bb;
    border-color: rgba(102, 201, 146, 0.35);
}

.invite-code-denide {
    background: rgba(208, 103, 103, 0.15);
    color: #efaaaa;
    border-color: rgba(208, 103, 103, 0.35);
}

.masked-key {
    font-family: monospace;
    letter-spacing: 1px;
    color: rgba(231, 234, 238, 0.78);
}

.revealed-key {
    font-family: monospace;
    font-size: 0.78rem;
    color: #f0cd8e;
    white-space: normal;
    word-break: break-all;
}

.systems-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.dashboard-system-grid {
    margin-top: 0.75rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.7rem;
}

.dashboard-system-card {
    border: 1px solid rgba(220, 224, 230, 0.14);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(34, 37, 42, 0.94) 0%, rgba(16, 18, 22, 0.94) 100%);
    padding: 0.72rem;
    font-size: 0.84rem;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

.dashboard-card-top-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.dashboard-system-card h2 {
    margin-top: 0;
    margin-bottom: 0.42rem;
    font-size: 0.9rem;
    line-height: 1.25;
    flex: 1;
}

.dashboard-state-badge {
    display: inline-block;
    margin-bottom: 0;
    border-radius: 999px;
    padding: 0.12rem 0.5rem;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.dashboard-state-waiting {
    background: rgba(209, 162, 77, 0.14);
    color: #f0cd8e;
    border: 1px solid rgba(209, 162, 77, 0.34);
}

.dashboard-state-active {
    background: rgba(102, 201, 146, 0.14);
    color: #9ce3bb;
    border: 1px solid rgba(102, 201, 146, 0.32);
}

.dashboard-state-paused {
    background: rgba(100, 130, 200, 0.13);
    color: #9ab0d8;
    border: 1px solid rgba(100, 130, 200, 0.30);
}

.dashboard-system-card p {
    margin: 0.16rem 0;
}

.dashboard-system-meta-grid {
    margin-top: 0.55rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem;
}

.dashboard-system-meta-box {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    padding: 0.45rem;
    display: grid;
    gap: 0.15rem;
}

.dashboard-system-meta-box span {
    font-size: 0.72rem;
    color: rgba(231, 234, 238, 0.72);
}

.dashboard-system-meta-box strong {
    font-size: 0.8rem;
}

.dashboard-editable-box {
    cursor: default;
}

.dashboard-editable-box input {
    width: 100%;
    margin-top: 0.2rem;
    font-size: 0.76rem;
    padding: 0.34rem 0.42rem;
    border-color: rgba(220, 224, 230, 0.18);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.04) 100%);
    color: #f4f6f8;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.dashboard-editable-box input:focus {
    outline: none;
    border-color: rgba(198, 161, 90, 0.6);
    box-shadow: 0 0 0 2px rgba(198, 161, 90, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.dashboard-editable-box input:disabled {
    opacity: 0.82;
    color: rgba(231, 234, 238, 0.86);
}

.dashboard-editable-box small {
    font-size: 0.68rem;
    color: rgba(231, 234, 238, 0.58);
}

.dashboard-time-input-wrap {
    position: relative;
    margin-top: 0.2rem;
}

.dashboard-time-input-wrap input[type="time"] {
    padding-right: 2rem;
    color-scheme: dark;
}

.dashboard-time-input-wrap input[type="time"]::-webkit-calendar-picker-indicator {
    opacity: 0;
    position: absolute;
    right: 0.2rem;
    width: 1.45rem;
    height: calc(100% - 0.2rem);
    cursor: pointer;
}

.dashboard-time-icon {
    position: absolute;
    right: 0.45rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 0.95rem;
    color: #efd29a;
    text-shadow: 0 0 10px rgba(198, 161, 90, 0.3);
    opacity: 0.98;
}

.dashboard-number-input-wrap {
    margin-top: 0.2rem;
    display: grid;
    grid-template-columns: 1.55rem minmax(0, 1fr) 1.55rem;
    gap: 0.18rem;
    align-items: center;
}

.dashboard-number-input-wrap input[type="number"] {
    margin-top: 0;
    min-width: 0;
    padding: 0.34rem 0.28rem;
    text-align: center;
    font-weight: 700;
    color: #f8fbff;
    caret-color: #f3ddae;
    opacity: 1;
    -moz-appearance: textfield;
}

.dashboard-number-input-wrap input[type="number"]:disabled {
    color: #f4f6f8;
    -webkit-text-fill-color: #f4f6f8;
    opacity: 1;
}

.dashboard-number-input-wrap input[type="number"]::-webkit-outer-spin-button,
.dashboard-number-input-wrap input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.dashboard-step-btn {
    margin-top: 0;
    border: 1px solid rgba(198, 161, 90, 0.32);
    border-radius: 8px;
    width: 1.55rem;
    min-width: 1.55rem;
    min-height: 1.55rem;
    padding: 0;
    background: linear-gradient(180deg, rgba(214, 178, 103, 0.96) 0%, rgba(146, 111, 48, 0.96) 100%);
    color: #121316;
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 3px 8px rgba(0, 0, 0, 0.2);
}

.dashboard-step-btn:hover:not(:disabled) {
    background: linear-gradient(180deg, rgba(231, 197, 127, 0.98) 0%, rgba(166, 127, 61, 0.98) 100%);
}

.dashboard-step-btn:active:not(:disabled) {
    transform: translateY(1px);
}

.dashboard-step-btn:disabled {
    opacity: 0.42;
    cursor: not-allowed;
}

.dashboard-save-btn {
    margin-top: 0.42rem;
    font-size: 0.74rem;
    padding: 0.35rem 0.46rem;
}

.dashboard-pnl-row {
    margin-top: 0.48rem;
}

/* ---- Candle chart ---- */
.dashboard-greeting {
    font-size: 1.35rem;
    font-weight: 600;
    margin: 0 0 1.2rem 0;
    color: #ffffff;
}
.dashboard-chart-wrap {
    margin-top: 0.6rem;
    border-radius: 10px;
    overflow: hidden;
    background: #1a1d2e;
}

.dashboard-chart-toolbar {
    display: flex;
    gap: 4px;
    padding: 5px 8px 4px;
    background: #1a1d2e;
}

.chart-zoom-btn {
    background: #2a2d3e;
    color: #c8d0e4;
    border: 1px solid #3a3d4e;
    border-radius: 5px;
    padding: 2px 10px;
    font-size: 0.74rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.chart-zoom-btn:hover {
    background: #3a3d4e;
}

.chart-zoom-btn.active {
    background: #c6a15a;
    color: #141518;
    border-color: #c6a15a;
}

.dashboard-chart {
    width: 100%;
    display: block;
}

.dashboard-candle-placeholder {
    margin-top: 0.3rem;
    min-height: 110px;
    border: 1px dashed var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.5rem;
    color: rgba(231, 234, 238, 0.72);
    font-size: 0.78rem;
}

.dashboard-system-actions {
    margin-top: 0.5rem;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.35rem;
}

.dashboard-action-form {
    margin: 0;
}

.dashboard-action-btn {
    margin-top: 0;
    width: 100%;
    text-align: center;
    font-size: 0.76rem;
    padding: 0.35rem 0.3rem;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
}

.dashboard-action-start {
    background: #2f8f5b !important;
    color: #fff !important;
}

.dashboard-action-start:hover:not(:disabled) {
    background: #257248 !important;
}

.dashboard-action-stop {
    background: #a02828 !important;
    color: #fff !important;
}

.dashboard-action-stop:hover:not(:disabled) {
    background: #811f1f !important;
}

.dashboard-action-profit {
    background: #2a6fb5 !important;
    color: #fff !important;
}

.dashboard-action-profit:hover:not(:disabled) {
    background: #215b93 !important;
}

.dashboard-action-details {
    background: #6b7280 !important;
    color: #fff !important;
}

.dashboard-action-details:hover:not(:disabled) {
    background: #575d69 !important;
}

.dashboard-action-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

@media (max-width: 980px) {
    .dashboard-system-grid {
        grid-template-columns: repeat(2, minmax(280px, 1fr));
    }
}

.period-options-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.6rem;
    margin-top: 0.5rem;
}

.period-option-form {
    margin: 0;
}

.period-option-btn {
    width: 100%;
    min-height: 64px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(42, 45, 51, 0.94) 0%, rgba(20, 22, 27, 0.94) 100%);
    color: var(--ink);
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.period-option-selected {
    background: linear-gradient(180deg, rgba(102, 201, 146, 0.92) 0%, rgba(49, 125, 82, 0.92) 100%) !important;
    color: #09110c;
    border-color: #66c992;
    box-shadow: 0 8px 18px rgba(49, 125, 82, 0.28);
}

.period-option-btn:hover:not(:disabled) {
    border-color: rgba(198, 161, 90, 0.5);
    box-shadow: 0 6px 16px rgba(198, 161, 90, 0.14);
    transform: translateY(-1px);
}

.period-option-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.payment-method-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
    margin-top: 0.5rem;
}

.payment-method-form {
    margin: 0;
}

.payment-detail-box {
    margin-top: 0.8rem;
    padding: 0.9rem;
    line-height: 1.5;
}

.system-card {
    min-height: 220px;
}

.system-card h2 {
    margin-top: 0;
}

.loyalty-panel {
    border: 1px solid rgba(15, 70, 95, 0.2);
    background:
        radial-gradient(circle at 12% 14%, rgba(255, 225, 172, 0.45), transparent 34%),
        radial-gradient(circle at 90% 0%, rgba(160, 230, 255, 0.35), transparent 30%),
        linear-gradient(125deg, rgba(255, 255, 255, 0.95), rgba(242, 250, 255, 0.92));
}

.loyalty-top-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.9rem;
    align-items: stretch;
}

.loyalty-current-level {
    border-radius: 14px;
    border: 1px solid rgba(31, 42, 51, 0.15);
    padding: 0.8rem 0.9rem;
    display: grid;
    gap: 0.2rem;
}

.loyalty-level-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(31, 42, 51, 0.8);
}

.loyalty-level-bronze {
    background: linear-gradient(120deg, rgba(199, 125, 76, 0.2), rgba(255, 242, 228, 0.95));
}

.loyalty-level-silver {
    background: linear-gradient(120deg, rgba(150, 161, 175, 0.24), rgba(246, 250, 255, 0.95));
}

.loyalty-level-gold {
    background: linear-gradient(120deg, rgba(228, 173, 60, 0.23), rgba(255, 251, 236, 0.95));
}

.loyalty-level-diamond {
    background: linear-gradient(120deg, rgba(67, 173, 216, 0.2), rgba(234, 250, 255, 0.95));
}

.loyalty-level-elite {
    background: linear-gradient(120deg, rgba(30, 86, 145, 0.26), rgba(230, 245, 255, 0.95));
}

.loyalty-score {
    min-width: 180px;
    border-radius: 14px;
    background: #103947;
    color: #fff;
    padding: 0.8rem 0.95rem;
    display: grid;
    align-content: center;
    justify-items: end;
    gap: 0.12rem;
}

.loyalty-score strong {
    font-size: 1.4rem;
    line-height: 1.1;
}

.loyalty-score small {
    color: rgba(255, 255, 255, 0.85);
    text-align: right;
}

.loyalty-progress-wrap {
    margin-top: 0.8rem;
}

.loyalty-progress-track {
    width: 100%;
    height: 12px;
    border-radius: 999px;
    background: rgba(16, 57, 71, 0.15);
    overflow: hidden;
}

.loyalty-progress-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #1d9a85 0%, #30b56d 46%, #f2c14c 100%);
    transition: width 0.35s ease;
}

.loyalty-next-text {
    margin: 0.45rem 0 0;
    color: rgba(231, 234, 238, 0.78);
    font-weight: 600;
}

.loyalty-next-text-complete {
    color: #9ce3bb;
}

.loyalty-levels-wrap {
    margin-top: 0.9rem;
    overflow-x: auto;
}

.loyalty-levels-bar {
    min-width: 760px;
    display: grid;
    grid-template-columns: repeat(5, minmax(136px, 1fr));
    gap: 0.6rem;
}

.loyalty-level-col {
    border: 1px solid rgba(31, 42, 51, 0.2);
    border-radius: 12px;
    padding: 0.7rem 0.55rem;
    display: grid;
    justify-items: center;
    text-align: center;
    gap: 0.2rem;
    opacity: 0.5;
    filter: grayscale(35%);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.loyalty-level-icon {
    width: 28px;
    height: 28px;
    display: inline-block;
    border: 1px solid rgba(0, 0, 0, 0.24);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.5);
}

.loyalty-level-name {
    font-size: 0.9rem;
}

.loyalty-level-state {
    margin-top: 0.14rem;
    border-radius: 999px;
    padding: 0.1rem 0.45rem;
    font-size: 0.74rem;
    background: rgba(0, 0, 0, 0.14);
    color: rgba(0, 0, 0, 0.7);
}

.loyalty-tier-bronze {
    background: linear-gradient(165deg, #f2cfb3 0%, #c98356 48%, #8a4f2b 100%);
    color: #3b1f10;
}

.loyalty-tier-bronze .loyalty-level-icon {
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #f7dfcd 0%, #c98356 58%, #8a4f2b 100%);
}

.loyalty-tier-silver {
    background: linear-gradient(165deg, #f6f9ff 0%, #c7d0dc 44%, #8f9aa8 100%);
    color: #1e2838;
}

.loyalty-tier-silver .loyalty-level-icon {
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #ffffff 0%, #c7d0dc 52%, #8f9aa8 100%);
}

.loyalty-tier-gold {
    background: linear-gradient(165deg, #fff2be 0%, #e5bf48 45%, #b0841f 100%);
    color: #3b2a00;
}

.loyalty-tier-gold .loyalty-level-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    transform: rotate(45deg);
    background: linear-gradient(150deg, #fff2be 0%, #e5bf48 50%, #b0841f 100%);
}

.loyalty-tier-diamond {
    background: linear-gradient(165deg, #eefbff 0%, #a6dff2 44%, #58a8c7 100%);
    color: #05384c;
}

.loyalty-tier-diamond .loyalty-level-icon {
    width: 26px;
    height: 26px;
    transform: rotate(45deg);
    border-radius: 4px;
    background: linear-gradient(145deg, #f7feff 0%, #9edcf2 54%, #4f9ec0 100%);
}

.loyalty-tier-elite {
    background: linear-gradient(165deg, #e3efff 0%, #799ed1 44%, #2f4f7f 100%);
    color: #071a33;
}

.loyalty-tier-elite .loyalty-level-icon {
    border-radius: 6px;
    clip-path: polygon(0 100%, 0 46%, 16% 58%, 28% 34%, 42% 58%, 58% 24%, 74% 58%, 88% 36%, 100% 58%, 100% 100%);
    background: linear-gradient(160deg, #eff5ff 0%, #8fb0dd 46%, #315382 100%);
}

.loyalty-level-col.is-reached {
    opacity: 1;
    filter: none;
    border-color: rgba(14, 58, 78, 0.38);
}

.loyalty-level-col.is-current {
    animation: loyalty-current-fade 2.4s ease-in-out infinite;
}

.loyalty-level-col.is-current .loyalty-level-icon {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.45), 0 0 14px rgba(255, 255, 255, 0.55);
}

@keyframes loyalty-current-fade {
    0% {
        opacity: 1;
        transform: translateY(0);
        box-shadow: 0 10px 22px rgba(16, 57, 71, 0.2);
    }
    50% {
        opacity: 0.68;
        transform: translateY(-1px);
        box-shadow: 0 6px 14px rgba(16, 57, 71, 0.1);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        box-shadow: 0 10px 22px rgba(16, 57, 71, 0.2);
    }
}

.system-card-active {
    border-color: rgba(47, 143, 91, 0.45);
}

.system-card-inactive {
    opacity: 0.8;
    border-style: dashed;
}

#purchased-products-overview {
    overflow-x: auto;
}

.dashboard-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.75rem;
    font-size: 0.92rem;
}

.dashboard-table th,
.dashboard-table td {
    border-bottom: 1px solid var(--border);
    padding: 0.5rem;
    text-align: left;
    white-space: nowrap;
}

.dashboard-table th {
    background: rgba(14, 124, 134, 0.08);
}

.product-row-expired {
    background: rgba(160, 40, 40, 0.06);
}

.status-badge {
    display: inline-block;
    min-width: 42px;
    text-align: center;
    padding: 0.16rem 0.48rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    border: 1px solid transparent;
}

.status-paid,
.status-approved {
    background: rgba(102, 201, 146, 0.15);
    color: #9ce3bb;
    border-color: rgba(102, 201, 146, 0.34);
}

.status-unpaid,
.status-pending {
    background: rgba(208, 103, 103, 0.15);
    color: #efaaaa;
    border-color: rgba(208, 103, 103, 0.34);
}

.countdown-timer {
    display: inline-block;
    padding: 0.14rem 0.44rem;
    border-radius: 8px;
    font-weight: 700;
}

.countdown-active {
    color: #9ce3bb;
    background: rgba(102, 201, 146, 0.14);
}

.countdown-expired {
    color: #efaaaa;
    background: rgba(208, 103, 103, 0.14);
}

.product-card-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 0.5rem;
    align-items: start;
}

.product-pick-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(35, 38, 43, 0.94) 0%, rgba(18, 20, 24, 0.94) 100%);
    padding: 0.7rem;
    text-align: left;
    display: grid;
    gap: 0.28rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.product-pick-card {
    cursor: default;
    height: 100%;
    min-width: 0;
    overflow: hidden;
}

.product-pick-hit-area {
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
    text-align: left;
    cursor: pointer;
    display: grid;
    gap: 0.28rem;
    width: 100%;
    min-width: 0;
    white-space: normal;
}

.product-image-wrap {
    position: relative;
    width: 100%;
    min-width: 0;
}

.product-image-tooltip {
    position: absolute;
    left: 50%;
    bottom: 0.6rem;
    transform: translate(-50%, 6px);
    width: calc(100% - 1rem);
    padding: 0.55rem 0.65rem;
    border-radius: 10px;
    background: rgba(31, 42, 51, 0.94);
    color: #fff;
    font-size: 0.78rem;
    line-height: 1.35;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
}

.product-image-wrap.show-tooltip .product-image-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
    transition-delay: 0s;
}

.product-card-head {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.18rem;
    align-items: start;
}

.product-card-description,
.product-card-name {
    display: block;
    font-size: 0.62rem;
    line-height: 1.2;
}

.product-card-description {
    text-align: left;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    color: #f0cd8e;
}

.product-card-name {
    font-weight: 700;
    flex: 0 0 auto;
    color: #f0cd8e;
}

.product-account-picker {
    display: grid;
    gap: 0.3rem;
    min-width: 0;
}

.product-account-picker label {
    font-size: 0.82rem;
}

.product-account-picker select {
    width: 100%;
    max-width: 100%;
    font-size: 0.82rem;
    padding: 0.45rem 0.55rem;
}

.product-pick-image {
    width: 100%;
    max-width: 100%;
    display: block;
    height: 240px;
    object-fit: contain;
    object-position: center;
    background: linear-gradient(180deg, rgba(57, 61, 69, 0.92) 0%, rgba(28, 31, 36, 0.92) 100%);
    border-radius: 10px;
    border: 1px solid var(--border);
}

.product-pick-card:hover {
    border-color: rgba(198, 161, 90, 0.5);
    box-shadow: 0 6px 16px rgba(198, 161, 90, 0.14);
    transform: translateY(-1px);
}

.product-pick-selected {
    border-color: #c6a15a;
    box-shadow: 0 8px 18px rgba(198, 161, 90, 0.18);
    background: linear-gradient(180deg, rgba(60, 51, 31, 0.94) 0%, rgba(24, 22, 18, 0.96) 100%);
}

.product-pick-card-disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.product-pick-card-disabled:hover {
    transform: none;
    border-color: var(--border);
    box-shadow: none;
}

.invite-send-form {
    margin-bottom: 0.8rem;
}

.secondary-btn,
.danger-btn {
    margin-top: 0.25rem;
    border: none;
    border-radius: 10px;
    padding: 0.55rem 0.8rem;
    cursor: pointer;
    font-weight: 600;
}

.secondary-btn {
    background: linear-gradient(180deg, rgba(97, 104, 112, 0.95) 0%, rgba(54, 59, 66, 0.95) 100%);
    color: #f1f3f6;
    border: 1px solid rgba(220, 224, 230, 0.14);
}

.secondary-btn:hover {
    background: linear-gradient(180deg, rgba(114, 121, 130, 0.95) 0%, rgba(62, 68, 76, 0.95) 100%);
}

.danger-btn {
    background: linear-gradient(180deg, rgba(160, 74, 74, 0.95) 0%, rgba(104, 38, 38, 0.95) 100%);
    color: #fff0f0;
}

.danger-btn:hover {
    background: linear-gradient(180deg, rgba(177, 82, 82, 0.95) 0%, rgba(122, 44, 44, 0.95) 100%);
}

.smtp-panel {
    margin-top: 0.9rem;
    padding: 0.9rem;
    border: 1px dashed var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
}

.smtp-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.smtp-debug {
    margin-top: 0.8rem;
    padding: 0.75rem;
    font-size: 0.9rem;
}

.smtp-hint {
    margin-top: 0.7rem;
    font-size: 0.9rem;
    color: rgba(231, 234, 238, 0.8);
}

label {
    font-size: 0.9rem;
    font-weight: 600;
}

input,
select,
button {
    font: inherit;
}

input,
select {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.55rem 0.7rem;
    background: rgba(255, 255, 255, 0.05);
    color: var(--ink);
}

button[type="submit"] {
    margin-top: 0.25rem;
    border: none;
    border-radius: 10px;
    padding: 0.65rem 0.8rem;
    background: linear-gradient(180deg, #d5b16d 0%, #a67f3d 100%);
    color: #141518;
    font-weight: 600;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 8px 18px rgba(0, 0, 0, 0.2);
}

button[type="submit"]:hover {
    background: linear-gradient(180deg, #dfbc78 0%, #8f6f35 100%);
}

.alert {
    margin-bottom: 1rem;
    padding: 0.8rem 1rem;
}

.alert-success {
    border-left: 6px solid var(--ok);
}

.alert-error {
    border-left: 6px solid var(--bad);
}

.alert-warning {
    border-left: 6px solid var(--warn);
}

.site-footer {
    position: relative;
    max-width: 1100px;
    margin: 1.6rem auto 0;
    text-align: center;
    padding: 1.2rem 1rem 1.5rem;
    color: rgba(231, 234, 238, 0.72);
}

.site-footer::before {
    content: "";
    display: block;
    width: min(220px, 42vw);
    height: 1px;
    margin: 0 auto 0.85rem;
    background: linear-gradient(90deg, rgba(198, 161, 90, 0) 0%, rgba(198, 161, 90, 0.4) 50%, rgba(198, 161, 90, 0) 100%);
}

.site-footer small {
    display: inline-block;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    color: rgba(231, 234, 238, 0.58);
    text-shadow: 0 0 12px rgba(198, 161, 90, 0.06);
}

@media (max-width: 820px) {
    .grid-two {
        grid-template-columns: 1fr;
    }

    .systems-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-system-grid {
        grid-template-columns: 1fr;
    }

    .admin-status-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-system-meta-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-system-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .period-options-row {
        grid-template-columns: 1fr;
    }

    .payment-method-row {
        grid-template-columns: 1fr;
    }

    .product-card-grid {
        grid-template-columns: 1fr;
    }

    .site-header {
        margin: 0.8rem;
        flex-wrap: wrap;
        gap: 0.6rem;
        justify-content: center;
    }

    .header-runtime-status {
        order: 3;
        width: 100%;
        padding: 0;
        justify-content: center;
    }

    .loyalty-top-row {
        grid-template-columns: 1fr;
    }

    .loyalty-score {
        justify-items: start;
        text-align: left;
    }

    .loyalty-score small {
        text-align: left;
    }

    .loyalty-levels-bar {
        min-width: 680px;
        grid-template-columns: repeat(5, minmax(120px, 1fr));
    }

    .account-register-head {
        flex-direction: column;
        align-items: flex-start;
    }
}
