/* Dark interface for Sussy Shelter */

:root {
    color-scheme: dark;
    --bg: #090811;
    --bg-soft: #11101d;
    --surface: #171426;
    --surface-strong: #201a34;
    --surface-muted: #141322;
    --border: rgba(190, 169, 255, 0.16);
    --border-strong: rgba(190, 169, 255, 0.28);
    --text: #f4f1ff;
    --text-muted: #aaa2c8;
    --text-soft: #d7d0ec;
    --primary-color: #8b5cf6;
    --primary-hover: #a78bfa;
    --primary-dark: #5b21b6;
    --secondary-color: #7f88a8;
    --success-color: #20d6a2;
    --danger-color: #ff5f7a;
    --warning-color: #f6b44b;
    --info-color: #48c7ff;
    --dark-color: #090811;
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.36);
    --glow: 0 0 0 1px rgba(139, 92, 246, 0.28), 0 20px 55px rgba(91, 33, 182, 0.28);
}

* {
    scrollbar-color: rgba(167, 139, 250, 0.5) rgba(255, 255, 255, 0.05);
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at 18% -8%, rgba(139, 92, 246, 0.22), transparent 34rem),
        radial-gradient(circle at 88% 4%, rgba(72, 199, 255, 0.12), transparent 28rem),
        linear-gradient(180deg, #0d0b17 0%, var(--bg) 48%, #07070d 100%);
    color: var(--text);
    font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

a {
    color: var(--primary-hover);
}

a:hover {
    color: #c4b5fd;
}

.app-footer {
    color: var(--text-muted);
    background: rgba(10, 9, 18, 0.88);
    border-top: 1px solid var(--border);
}

.page-heading,
.d-flex.justify-content-between.align-items-center.mb-4 {
    padding: 1rem 0 0.5rem;
}

h1,
.h1 {
    color: var(--text);
    font-weight: 800;
    letter-spacing: 0;
}

h1 i,
.card-title i,
.modal-title i,
h5 i,
h6 i {
    color: var(--primary-hover);
}

p,
li {
    color: var(--text-soft);
}

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

.text-warning {
    color: var(--warning-color) !important;
}

.text-danger {
    color: var(--danger-color) !important;
}

.text-success {
    color: var(--success-color) !important;
}

.card {
    color: var(--text);
    background: linear-gradient(180deg, rgba(32, 26, 52, 0.96), rgba(20, 19, 34, 0.96));
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.card:hover {
    transform: translateY(-2px);
    border-color: rgba(167, 139, 250, 0.34);
    box-shadow: var(--glow);
}

.card-header {
    color: var(--text);
    background: rgba(255, 255, 255, 0.025);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.15rem;
    font-weight: 700;
}

.card-body {
    padding: 1.15rem;
}

.card-title {
    color: var(--text);
    font-weight: 750;
}

.card-text {
    color: inherit;
}

.bg-primary,
.bg-success,
.bg-info {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.bg-primary {
    background: linear-gradient(135deg, #7c3aed, #4c1d95) !important;
}

.bg-success {
    background: linear-gradient(135deg, #159e80, #0d5f56) !important;
}

.bg-info {
    background: linear-gradient(135deg, #2563eb, #581c87) !important;
}

.bg-primary::after,
.bg-success::after,
.bg-info::after {
    content: "";
    position: absolute;
    inset: auto -18% -45% auto;
    width: 9rem;
    height: 9rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.13);
}

.display-6 {
    font-size: 2.1rem;
    font-weight: 800;
    line-height: 1.05;
}

.btn {
    border-radius: 0.55rem;
    font-weight: 700;
    letter-spacing: 0;
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:focus,
.btn:focus-visible {
    box-shadow: 0 0 0 0.2rem rgba(139, 92, 246, 0.32);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #6d28d9);
    border-color: rgba(196, 181, 253, 0.2);
    color: #fff;
    box-shadow: 0 12px 28px rgba(109, 40, 217, 0.24);
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, var(--primary-hover), #7c3aed);
    border-color: rgba(196, 181, 253, 0.5);
    color: #fff;
}

.btn-secondary,
.btn-dark {
    color: var(--text);
    background: #2a2540;
    border-color: var(--border-strong);
}

.btn-secondary:hover,
.btn-dark:hover {
    color: var(--text);
    background: #362e55;
    border-color: rgba(196, 181, 253, 0.42);
}

.btn-warning {
    color: #190d02;
    background: linear-gradient(135deg, var(--warning-color), #f97316);
    border-color: rgba(251, 191, 36, 0.25);
}

.btn-success {
    color: #041915;
    background: linear-gradient(135deg, var(--success-color), #14b88b);
    border-color: rgba(45, 212, 191, 0.28);
}

.btn-success:hover,
.btn-success:focus {
    color: #041915;
    background: linear-gradient(135deg, #5eead4, var(--success-color));
    border-color: rgba(94, 234, 212, 0.5);
}

.btn-info {
    color: #061018;
    background: linear-gradient(135deg, var(--info-color), #38bdf8);
    border-color: rgba(125, 211, 252, 0.25);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color), #e11d48);
    border-color: rgba(251, 113, 133, 0.28);
}

.btn-outline-secondary,
.btn-outline-primary,
.btn-outline-danger {
    background: rgba(255, 255, 255, 0.025);
}

.btn-outline-secondary {
    color: var(--text-soft);
    border-color: var(--border-strong);
}

.btn-outline-secondary:hover {
    color: var(--text);
    background: rgba(139, 92, 246, 0.16);
    border-color: rgba(167, 139, 250, 0.42);
}

.btn-outline-primary {
    color: #c4b5fd;
    border-color: rgba(167, 139, 250, 0.46);
}

.btn-outline-primary:hover {
    color: #fff;
    background: rgba(139, 92, 246, 0.28);
    border-color: rgba(196, 181, 253, 0.65);
}

.btn-outline-danger {
    color: #ff9aad;
    border-color: rgba(255, 95, 122, 0.45);
}

.btn-outline-danger:hover {
    color: #fff;
    background: rgba(255, 95, 122, 0.18);
    border-color: rgba(255, 95, 122, 0.72);
}

.btn-group-sm > .btn,
.btn-sm {
    border-radius: 0.45rem;
}

.table-responsive {
    border: 1px solid var(--border);
    border-radius: 0.7rem;
    background: rgba(7, 7, 13, 0.38);
}

.table {
    color: var(--text-soft);
    margin-bottom: 0;
    border-color: var(--border);
    vertical-align: middle;
}

.table > :not(caption) > * > * {
    color: inherit;
    background-color: transparent;
    border-bottom-color: var(--border);
    padding: 0.85rem 0.9rem;
}

.table thead th {
    color: var(--text);
    background: rgba(139, 92, 246, 0.09);
    border-bottom: 1px solid var(--border-strong);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    color: var(--text-soft);
    background-color: rgba(255, 255, 255, 0.025);
}

.table-hover > tbody > tr:hover > * {
    color: var(--text);
    background-color: rgba(139, 92, 246, 0.12);
}

.badge {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    font-size: 0.72em;
    font-weight: 800;
    padding: 0.46em 0.72em;
}

.bg-secondary {
    background-color: #4b4563 !important;
}

.badge.bg-success {
    color: #041915;
    background-color: var(--success-color) !important;
}

.badge.bg-secondary {
    color: var(--text);
}

.alert {
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 0.7rem;
    box-shadow: var(--shadow);
}

#clientNotifications {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: min(24rem, calc(100vw - 2rem));
    pointer-events: none;
}

#clientNotifications .alert {
    margin: 0;
    overflow-wrap: anywhere;
    pointer-events: auto;
    backdrop-filter: blur(16px);
}

.alert-heading {
    color: var(--text);
}

.alert-info {
    background: rgba(72, 199, 255, 0.13);
    border-color: rgba(72, 199, 255, 0.28);
}

.alert-success {
    background: rgba(32, 214, 162, 0.13);
    border-color: rgba(32, 214, 162, 0.28);
}

.alert-warning {
    color: #ffe6b7;
    background: rgba(246, 180, 75, 0.14);
    border-color: rgba(246, 180, 75, 0.3);
}

.alert-danger {
    background: rgba(255, 95, 122, 0.13);
    border-color: rgba(255, 95, 122, 0.32);
}

.modal-content {
    color: var(--text);
    background: linear-gradient(180deg, #1d1830, #121120);
    border: 1px solid var(--border-strong);
    border-radius: 0.75rem;
    box-shadow: 0 1.5rem 5rem rgba(0, 0, 0, 0.55);
}

.modal-header {
    border-bottom: 1px solid var(--border);
    padding: 1.15rem 1.25rem;
}

.modal-body {
    padding: 1.25rem;
}

.modal-footer {
    border-top: 1px solid var(--border);
    padding: 1rem 1.25rem;
}

.btn-close {
    filter: invert(1) grayscale(100%) brightness(1.7);
    opacity: 0.7;
}

.form-label {
    color: var(--text);
    font-weight: 700;
}

.form-control,
.form-select {
    color: var(--text);
    background-color: rgba(8, 7, 14, 0.68);
    border: 1px solid var(--border-strong);
    border-radius: 0.55rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.form-control:disabled,
.form-select:disabled,
.form-control[readonly] {
    color: #bdb4d8;
    background-color: rgba(255, 255, 255, 0.045);
    border-color: var(--border);
}

.form-control::placeholder {
    color: #857b9f;
}

.form-control:focus,
.form-select:focus {
    color: var(--text);
    background-color: rgba(13, 11, 24, 0.9);
    border-color: var(--primary-hover);
    box-shadow: 0 0 0 0.2rem rgba(139, 92, 246, 0.24);
}

.form-select option {
    color: var(--text);
    background: #171426;
}

.input-group .btn {
    border-color: var(--border-strong);
}

.form-check-input {
    background-color: rgba(8, 7, 14, 0.8);
    border-color: var(--border-strong);
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-hover);
}

.form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(139, 92, 246, 0.24);
}

code,
pre {
    color: #ddd6fe;
    background-color: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(167, 139, 250, 0.18);
}

code {
    padding: 0.2rem 0.4rem;
    border-radius: 0.35rem;
    font-size: 0.85em;
}

pre {
    padding: 0.85rem;
    border-radius: 0.6rem;
}

hr {
    border-color: var(--border);
    opacity: 1;
}

.spinner-border {
    width: 1.5rem;
    height: 1.5rem;
    color: var(--primary-hover);
}

.app-shell.app-shell-guest {
    min-height: calc(100vh - 3.75rem - 3rem);
    align-items: center;
    justify-content: center;
}

.app-content-full {
    width: 100%;
    max-width: 920px;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: calc(100vh - 3.75rem - 3rem);
}

.login-shell {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 0;
}

.login-card {
    width: 100%;
    max-width: 420px;
    border-color: rgba(167, 139, 250, 0.3);
    box-shadow: var(--glow);
}

.subscription-header {
    background: rgba(12, 10, 22, 0.88) !important;
    border-bottom: 1px solid var(--border) !important;
    backdrop-filter: blur(18px);
}

.subscription-card {
    max-width: 58rem;
    margin-inline: auto;
}

.subscription-cabinet {
    max-width: 76rem;
    margin-inline: auto;
    animation: cabinet-fade-in 0.42s ease both;
}

.cabinet-panel {
    position: relative;
    overflow: hidden;
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(180deg, rgba(32, 26, 52, 0.96), rgba(20, 19, 34, 0.96));
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    box-shadow: var(--shadow);
    animation: cabinet-rise 0.42s ease both;
}

.cabinet-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.035) 42%, transparent 64%);
    transform: translateX(-120%);
    transition: transform 0.7s ease;
}

.cabinet-panel:hover::before {
    transform: translateX(120%);
}

.cabinet-auth-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(18rem, 0.7fr);
    gap: 1.5rem;
    align-items: center;
}

.cabinet-auth-copy h1,
.subscription-overview h1,
.cabinet-section-head h2 {
    margin: 0;
    font-weight: 850;
}

.cabinet-auth-copy p,
.subscription-overview p,
.cabinet-step p {
    margin-bottom: 0;
    color: var(--text-muted);
}

.cabinet-login-form {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
}

.subscription-overview-head {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.4rem;
}

.cabinet-status-icon,
.cabinet-step-icon {
    display: inline-grid;
    flex: 0 0 auto;
    width: 3.75rem;
    height: 3.75rem;
    place-items: center;
    border-radius: 50%;
    font-size: 1.45rem;
}

.cabinet-status-active {
    color: #041915;
    background: rgba(32, 214, 162, 0.88);
    border: 1px solid rgba(94, 234, 212, 0.5);
}

.cabinet-status-inactive,
.cabinet-status-locked {
    color: #ffb4c1;
    background: rgba(255, 95, 122, 0.1);
    border: 1px solid rgba(255, 95, 122, 0.42);
}

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

.cabinet-stat {
    position: relative;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.032);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.cabinet-stat:hover,
.cabinet-device:hover,
.cabinet-step:hover {
    transform: translateY(-2px);
    border-color: rgba(167, 139, 250, 0.38);
}

.cabinet-stat span {
    display: block;
    margin-bottom: 0.55rem;
    color: var(--text-muted);
    font-weight: 700;
}

.cabinet-stat strong {
    display: block;
    color: var(--text);
    font-size: 1.2rem;
}

.cabinet-stat-info {
    background: rgba(72, 199, 255, 0.08);
    border-color: rgba(72, 199, 255, 0.24);
}

.cabinet-stat-success {
    background: rgba(32, 214, 162, 0.08);
    border-color: rgba(32, 214, 162, 0.26);
}

.cabinet-stat-danger {
    background: rgba(255, 95, 122, 0.08);
    border-color: rgba(255, 95, 122, 0.28);
}

.cabinet-stat-warning {
    background: rgba(246, 180, 75, 0.08);
    border-color: rgba(246, 180, 75, 0.28);
}

.cabinet-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.cabinet-platform-select {
    width: min(100%, 15rem);
}

.cabinet-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.2rem;
}

.cabinet-tab {
    padding: 0.9rem 1rem;
    color: var(--text);
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--border);
    border-radius: 0.7rem;
    font-weight: 850;
    text-align: left;
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.cabinet-tab:hover,
.cabinet-tariff:hover,
.cabinet-method:hover {
    transform: translateY(-1px);
}

.cabinet-tab.active {
    color: #9ff3ff;
    background: rgba(72, 199, 255, 0.12);
    border-color: rgba(72, 199, 255, 0.42);
    box-shadow: inset 0.25rem 0 0 var(--info-color);
}

.cabinet-step {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 1.1rem;
    padding: 1.2rem;
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
}

.cabinet-step h3 {
    margin: 0 0 0.55rem;
    color: var(--text);
    font-size: 1.2rem;
    font-weight: 850;
}

.cabinet-step-purple {
    color: #c4b5fd;
    background: rgba(139, 92, 246, 0.14);
    border: 1px solid rgba(167, 139, 250, 0.35);
}

.cabinet-step-cyan {
    color: #8beeff;
    background: rgba(72, 199, 255, 0.12);
    border: 1px solid rgba(72, 199, 255, 0.32);
}

.cabinet-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.cabinet-link-box {
    margin-top: 1rem;
}

.cabinet-tariff-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.cabinet-tariff,
.cabinet-method {
    color: var(--text);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.cabinet-tariff {
    min-height: 8rem;
    padding: 1rem;
    text-align: left;
}

.cabinet-tariff span,
.cabinet-tariff strong,
.cabinet-tariff small {
    display: block;
}

.cabinet-tariff span {
    color: var(--text-muted);
    font-weight: 750;
}

.cabinet-tariff strong {
    margin-top: 0.45rem;
    color: var(--text);
    font-size: 1.6rem;
}

.cabinet-tariff small {
    margin-top: 0.4rem;
    color: var(--text-muted);
}

.cabinet-tariff.active,
.cabinet-method.active {
    background: rgba(139, 92, 246, 0.18);
    border-color: rgba(196, 181, 253, 0.58);
    box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.18), 0 14px 35px rgba(91, 33, 182, 0.25);
}

.cabinet-payment-methods {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.cabinet-method {
    padding: 0.78rem 1rem;
    font-weight: 800;
}

.cabinet-pay-button {
    min-width: min(100%, 18rem);
}

.cabinet-device-list {
    display: grid;
    gap: 0.75rem;
}

.cabinet-device {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.95rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 0.7rem;
}

.cabinet-device strong,
.cabinet-device span {
    display: block;
}

.cabinet-device span {
    color: var(--text-muted);
}

.bot-cabinet {
    max-width: 64rem;
}

.bot-profile-panel {
    background:
        radial-gradient(circle at 18% 12%, rgba(32, 214, 162, 0.16), transparent 28%),
        radial-gradient(circle at 88% 88%, rgba(139, 92, 246, 0.2), transparent 32%),
        linear-gradient(180deg, rgba(30, 24, 58, 0.98), rgba(18, 17, 31, 0.98));
}

.bot-profile-card {
    padding: 1.25rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.16), rgba(139, 92, 246, 0.12));
    border: 1px solid rgba(167, 139, 250, 0.25);
    border-radius: 0.85rem;
}

.bot-profile-card span,
.bot-profile-card strong {
    display: block;
}

.bot-profile-card span {
    color: var(--text);
    font-size: 1.45rem;
    font-weight: 850;
}

.bot-profile-card strong {
    color: var(--text-muted);
    font-weight: 700;
}

.bot-action-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
    margin-top: 1.25rem;
}

.bot-action-row .btn {
    min-height: 3.4rem;
}

.bot-balance-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background:
        linear-gradient(110deg, rgba(59, 130, 246, 0.18), rgba(139, 92, 246, 0.18)),
        rgba(255, 255, 255, 0.03);
}

.bot-balance-panel span,
.bot-balance-panel strong {
    display: block;
}

.bot-balance-panel span {
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 700;
}

.bot-balance-panel strong {
    color: var(--text);
    font-size: clamp(2rem, 7vw, 3.2rem);
    line-height: 1;
}

.bot-balance-panel p {
    max-width: 32rem;
    margin: 0;
    color: var(--text-muted);
}

.bot-tile-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.bot-tile {
    display: grid;
    min-height: 9rem;
    place-items: center;
    gap: 0.85rem;
    padding: 1rem;
    color: var(--text);
    background:
        radial-gradient(circle at top, rgba(72, 199, 255, 0.12), transparent 45%),
        rgba(255, 255, 255, 0.032);
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    font-weight: 850;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.bot-tile:hover {
    transform: translateY(-3px);
    background:
        radial-gradient(circle at top, rgba(139, 92, 246, 0.18), transparent 48%),
        rgba(255, 255, 255, 0.045);
    border-color: rgba(167, 139, 250, 0.42);
}

.bot-tile i {
    color: #8beeff;
    font-size: 1.75rem;
}

.referral-list,
.legal-grid {
    display: grid;
    gap: 0.75rem;
}

.referral-row,
.legal-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.95rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
}

.referral-row strong,
.referral-row span,
.legal-item strong,
.legal-item span {
    display: block;
}

.referral-row span,
.legal-item span {
    color: var(--text-muted);
}

.legal-item {
    align-items: flex-start;
    flex-direction: column;
}

.legal-item strong {
    color: var(--text);
    font-weight: 650;
}

.referral-status {
    flex: 0 0 auto;
    padding: 0.45rem 0.7rem;
    color: #f6b44b;
    background: rgba(246, 180, 75, 0.1);
    border: 1px solid rgba(246, 180, 75, 0.28);
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 800;
}

.referral-status.active {
    color: #20d6a2;
    background: rgba(32, 214, 162, 0.1);
    border-color: rgba(32, 214, 162, 0.28);
}

@media (max-width: 768px) {
    .cabinet-auth-panel,
    .cabinet-step,
    .cabinet-stat-grid,
    .cabinet-tariff-grid,
    .bot-action-row,
    .bot-tile-grid {
        grid-template-columns: 1fr;
    }

    .cabinet-section-head,
    .cabinet-device,
    .bot-balance-panel,
    .referral-row {
        align-items: stretch;
        flex-direction: column;
    }

    .cabinet-actions > .btn {
        width: 100%;
    }
}

@keyframes cabinet-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes cabinet-rise {
    from {
        opacity: 0;
        transform: translateY(0.7rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Sidebar layout ───────────────────────────────────────────────── */

.app-navbar {
    position: sticky;
    top: 0;
    z-index: 200;
    background: rgba(12, 10, 22, 0.88);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(18px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
}

.navbar-inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1.25rem;
    height: 3.75rem;
}

.navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--text) !important;
    font-weight: 800;
    font-size: 1.2rem;
    text-decoration: none;
}

.navbar-brand i {
    display: inline-grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border-radius: 0.55rem;
    background: linear-gradient(135deg, var(--primary-color), #6d28d9);
    box-shadow: 0 8px 22px rgba(139, 92, 246, 0.34);
    font-size: 0.85rem;
}

.sidebar-toggle {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: 0.45rem;
    width: 2.1rem;
    height: 2.1rem;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.sidebar-toggle:hover {
    color: var(--text);
    border-color: var(--border-strong);
    background: rgba(139, 92, 246, 0.12);
}

.app-shell {
    display: flex;
    min-height: calc(100vh - 3.75rem - 3rem);
}

.app-shell-guest {
    justify-content: center;
}

.app-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: rgba(10, 9, 20, 0.65);
    border-right: 1px solid var(--border);
    backdrop-filter: blur(14px);
    transition: width 0.22s ease;
    position: sticky;
    top: 3.75rem;
    height: calc(100vh - 3.75rem);
    overflow-y: auto;
    overflow-x: hidden;
}

body.sidebar-collapsed .app-sidebar {
    width: 58px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.75rem 0.5rem;
    height: 100%;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.62rem 0.75rem;
    color: var(--text-muted);
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.92rem;
    white-space: nowrap;
    border: 1px solid transparent;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.sidebar-link:hover {
    color: var(--text);
    background: rgba(139, 92, 246, 0.12);
    border-color: rgba(167, 139, 250, 0.18);
}

.sidebar-link.active {
    color: var(--primary-hover);
    background: rgba(139, 92, 246, 0.16);
    border-color: rgba(167, 139, 250, 0.32);
}

.sidebar-link i {
    width: 1.15rem;
    text-align: center;
    flex-shrink: 0;
    font-size: 0.95rem;
}

.sidebar-label {
    transition: opacity 0.18s ease;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.sidebar-collapsed .sidebar-label {
    opacity: 0;
    width: 0;
    pointer-events: none;
}

.sidebar-logout {
    color: rgba(255, 95, 122, 0.8);
}

.sidebar-logout:hover {
    color: var(--danger-color);
    background: rgba(255, 95, 122, 0.1);
    border-color: rgba(255, 95, 122, 0.28);
}

.sidebar-divider {
    height: 1px;
    background: var(--border);
    margin: 0.4rem 0.25rem;
    flex-shrink: 0;
}

.sidebar-spacer {
    flex: 1;
}

.app-content {
    flex: 1;
    min-width: 0;
    padding: 2rem 1.75rem;
}

.app-content-full {
    padding: 2rem 1.5rem;
    max-width: 900px;
    margin: 0 auto;
}

/* ── Dashboard stat cards ─────────────────────────────────────────── */

.stat-card {
    min-height: 7rem;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.35rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.1;
}

.stat-icon {
    font-size: 1.4rem;
    margin-top: 0.15rem;
    opacity: 0.85;
}

.stat-progress {
    height: 5px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 99px;
    overflow: hidden;
}

.stat-progress .progress-bar {
    border-radius: 99px;
    transition: width 0.5s ease;
}

.stat-detail {
    margin-top: 0.4rem;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.server-info-item {
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 0.6rem;
}

/* ── Panel tabs (clients page) ────────────────────────────────────── */

.panel-tabs-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.panel-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.panel-tab:hover {
    color: var(--text);
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(167, 139, 250, 0.28);
}

.panel-tab.active {
    color: var(--primary-hover);
    background: rgba(139, 92, 246, 0.16);
    border-color: rgba(167, 139, 250, 0.42);
}

/* ── Settings page ────────────────────────────────────────────────── */

.settings-tabs .nav-link {
    color: var(--text-muted);
    border-color: transparent;
    border-radius: 0.5rem 0.5rem 0 0;
    font-weight: 700;
    padding: 0.6rem 1rem;
    transition: color 0.15s ease, background 0.15s ease;
}

.settings-tabs .nav-link:hover {
    color: var(--text);
    background: rgba(139, 92, 246, 0.1);
}

.settings-tabs .nav-link.active {
    color: var(--primary-hover);
    background: rgba(139, 92, 246, 0.14);
    border-color: var(--border) var(--border) transparent;
}

.logs-output {
    margin: 0;
    padding: 1rem;
    min-height: 400px;
    max-height: 70vh;
    overflow-y: auto;
    font-size: 0.78rem;
    line-height: 1.55;
    color: #c8c3e0;
    background: rgba(5, 4, 12, 0.7);
    border-radius: 0 0 0.75rem 0.75rem;
    white-space: pre-wrap;
    word-break: break-all;
}

.panel-row {
    padding: 0.72rem 0;
    border-bottom: 1px solid var(--border);
}

.panel-row:last-child {
    border-bottom: 0;
}

.subscription-qr-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding: 1rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid var(--border);
    border-radius: 0.7rem;
}

.subscription-qr-code {
    padding: 0.75rem;
    background: #fff;
    border-radius: 0.7rem;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.34);
}

.subscription-qr-code canvas,
.subscription-qr-code img {
    display: block;
    width: 12rem;
    height: 12rem;
}

/* Custom utilities */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color), #6d28d9);
}

.bg-gradient-success {
    background: linear-gradient(135deg, var(--success-color), #0f766e);
}

.bg-gradient-info {
    background: linear-gradient(135deg, var(--info-color), #2563eb);
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.pulse {
    animation: pulse 2s infinite;
}

@media (max-width: 768px) {
    .app-sidebar {
        width: 52px;
    }

    .app-content {
        padding: 1.25rem 1rem;
    }

    .display-6 {
        font-size: 1.65rem;
    }

    .card-body {
        padding: 1rem;
    }

    .table-responsive {
        font-size: 0.875rem;
    }

    .d-flex.justify-content-between.align-items-center.mb-4 {
        align-items: flex-start !important;
        gap: 0.85rem;
        flex-direction: column;
    }

    .btn-lg {
        --bs-btn-padding-y: 0.65rem;
        --bs-btn-font-size: 1rem;
    }
}
