/* =========================================================
   TELEGRAM STARS MANAGER
   Tema nero futuristico - stile globale
   ========================================================= */


/* =========================
   RESET E VARIABILI
   ========================= */

:root {
    --background: #000000;
    --background-soft: #050505;
    --surface: #090909;
    --surface-light: #0e0e10;
    --surface-hover: #151519;

    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);

    --text: #f7f7f8;
    --text-soft: #b8b8c2;
    --text-muted: #747480;

    --accent: #8b5cf6;
    --accent-light: #a78bfa;
    --accent-blue: #3b82f6;
    --accent-cyan: #22d3ee;

    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;

    --radius-small: 10px;
    --radius-medium: 16px;
    --radius-large: 22px;

    --shadow-card:
        0 18px 45px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.025);

    --sidebar-width: 288px;
}


* {
    box-sizing: border-box;
}


html {
    min-width: 320px;
    background: var(--background);
    color-scheme: dark;
}


body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    background: var(--background);
    color: var(--text);
    font-family:
        "Space Grotesk",
        "Segoe UI Variable",
        "Segoe UI",
        Arial,
        sans-serif;
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}


button,
input,
select,
textarea {
    font: inherit;
}


a {
    color: var(--accent-light);
}


::selection {
    background: rgba(139, 92, 246, 0.35);
    color: #ffffff;
}


/* =========================
   SFONDO
   ========================= */

.app-background {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(
            circle at 72% 8%,
            rgba(139, 92, 246, 0.08),
            transparent 25%
        ),
        radial-gradient(
            circle at 42% 92%,
            rgba(34, 211, 238, 0.04),
            transparent 28%
        ),
        linear-gradient(
            rgba(255, 255, 255, 0.012) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.012) 1px,
            transparent 1px
        );
    background-size:
        auto,
        auto,
        44px 44px,
        44px 44px;
}


/* =========================
   LAYOUT
   ========================= */

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


.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    display: flex;
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    height: 100vh;
    flex-direction: column;
    padding: 26px 20px 20px;
    overflow-y: auto;
    background:
        linear-gradient(
            180deg,
            rgba(11, 11, 13, 0.98),
            rgba(3, 3, 4, 0.99)
        );
    border-right: 1px solid var(--border);
    box-shadow: 22px 0 55px rgba(0, 0, 0, 0.28);
}


.content {
    width: calc(100% - var(--sidebar-width));
    min-width: 0;
    margin-left: var(--sidebar-width);
    padding: 42px;
}


.content-shell {
    width: 100%;
    max-width: 1680px;
    margin: 0 auto;
}


/* =========================
   BRAND SIDEBAR
   ========================= */

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 0 8px 25px;
    border-bottom: 1px solid var(--border);
}


.brand-icon {
    display: grid;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    place-items: center;
    border: 1px solid rgba(167, 139, 250, 0.28);
    border-radius: 14px;
    background:
        linear-gradient(
            145deg,
            rgba(139, 92, 246, 0.22),
            rgba(59, 130, 246, 0.08)
        );
    color: #ffffff;
    font-size: 21px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 0 28px rgba(139, 92, 246, 0.12);
}


.brand-copy {
    min-width: 0;
}


.brand-eyebrow {
    display: block;
    margin-bottom: 1px;
    color: var(--accent-light);
    font-family: "Rajdhani", sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.2em;
    line-height: 1;
    text-transform: uppercase;
}


.sidebar h2 {
    margin: 0;
    overflow: hidden;
    color: #ffffff;
    font-family: "Rajdhani", sans-serif;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.025em;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* =========================
   NAVIGAZIONE
   ========================= */

.sidebar-navigation {
    flex: 1;
    padding-top: 22px;
}


.menu-section {
    margin-bottom: 24px;
}


.menu-section-title {
    display: block;
    padding: 0 12px;
    margin-bottom: 8px;
    color: #595965;
    font-family: "Rajdhani", sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.19em;
    text-transform: uppercase;
}


.menu-item {
    position: relative;
    display: flex;
    min-height: 46px;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    margin-bottom: 5px;
    overflow: hidden;
    border: 1px solid transparent;
    border-radius: 12px;
    color: #9d9da8;
    text-decoration: none;
    transition:
        color 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}


.menu-item::before {
    position: absolute;
    top: 10px;
    bottom: 10px;
    left: 0;
    width: 2px;
    border-radius: 999px;
    background: var(--accent-light);
    content: "";
    opacity: 0;
    transform: scaleY(0.35);
    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
}


.menu-item:hover {
    border-color: rgba(255, 255, 255, 0.055);
    background: rgba(255, 255, 255, 0.035);
    color: #ffffff;
    transform: translateX(2px);
}


.menu-item.active {
    border-color: rgba(139, 92, 246, 0.22);
    background:
        linear-gradient(
            90deg,
            rgba(139, 92, 246, 0.18),
            rgba(139, 92, 246, 0.055)
        );
    color: #ffffff;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.025),
        0 8px 22px rgba(0, 0, 0, 0.18);
}


.menu-item.active::before {
    opacity: 1;
    transform: scaleY(1);
}


.menu-icon {
    display: grid;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    place-items: center;
    color: #858590;
    font-family: "Rajdhani", sans-serif;
    font-size: 19px;
    font-weight: 700;
    transition: color 0.2s ease;
}


.menu-item:hover .menu-icon,
.menu-item.active .menu-icon {
    color: var(--accent-light);
}


.menu-label {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    font-size: 14px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}


.menu-badge {
    padding: 3px 7px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.035);
    color: #666670;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}


/* =========================
   FOOTER SIDEBAR
   ========================= */

.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.018);
}


.sidebar-footer strong,
.sidebar-footer small {
    display: block;
}


.sidebar-footer strong {
    color: #d4d4d8;
    font-size: 12px;
    font-weight: 600;
}


.sidebar-footer small {
    margin-top: 1px;
    color: #656570;
    font-size: 10px;
}


.system-indicator {
    width: 9px;
    height: 9px;
    flex: 0 0 9px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 14px rgba(34, 197, 94, 0.65);
}


/* =========================
   TITOLI E TESTI
   ========================= */

.content h1 {
    margin: 0 0 30px;
    color: #ffffff;
    font-family: "Rajdhani", sans-serif;
    font-size: clamp(34px, 4vw, 48px);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.08;
}


.content h2 {
    color: #f3f3f5;
    font-family: "Rajdhani", sans-serif;
    font-weight: 700;
    letter-spacing: -0.01em;
}


.content h3 {
    color: #e9e9ec;
}


.content > .content-shell > p,
.page-heading p {
    max-width: 900px;
    margin-top: -18px;
    margin-bottom: 28px;
    color: var(--text-soft);
}


small,
.form-help {
    color: var(--text-muted);
}


code {
    padding: 3px 7px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #050505;
    color: #c9bfff;
    font-family: Consolas, monospace;
}


/* =========================
   CARD
   ========================= */

.card,
.real-test-card,
.access-card {
    position: relative;
    padding: 26px;
    margin-top: 22px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-large);
    background:
        linear-gradient(
            145deg,
            rgba(14, 14, 16, 0.98),
            rgba(7, 7, 8, 0.98)
        );
    box-shadow: var(--shadow-card);
}


.card::after,
.real-test-card::after,
.access-card::after {
    position: absolute;
    top: 0;
    right: 40px;
    left: 40px;
    height: 1px;
    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(167, 139, 250, 0.24),
            transparent
        );
    content: "";
    pointer-events: none;
}


.card h2,
.real-test-card h2,
.access-card h2 {
    margin: 0 0 20px;
    font-size: 25px;
}


.dashboard-card {
    margin-top: 26px;
}


/* =========================
   STATISTICHE
   ========================= */

.statistiche,
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin: 0 0 26px;
}


.stat-card,
.stat-box,
.stats-grid > .card {
    position: relative;
    min-height: 136px;
    padding: 23px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-medium);
    background:
        linear-gradient(
            145deg,
            rgba(14, 14, 16, 0.98),
            rgba(6, 6, 7, 0.98)
        );
    box-shadow:
        0 15px 38px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.025);
    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        background 0.2s ease;
}


.stat-card::before,
.stat-box::before,
.stats-grid > .card::before {
    position: absolute;
    top: 0;
    right: 0;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.1);
    content: "";
    filter: blur(28px);
    transform: translate(25%, -35%);
}


.stat-card:hover,
.stat-box:hover,
.stats-grid > .card:hover {
    border-color: rgba(139, 92, 246, 0.25);
    background:
        linear-gradient(
            145deg,
            rgba(17, 17, 20, 0.98),
            rgba(7, 7, 8, 0.98)
        );
    transform: translateY(-2px);
}


.stat-card h3,
.stat-box span,
.stats-grid > .card h3 {
    position: relative;
    z-index: 1;
    display: block;
    margin: 0;
    color: #81818c;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.45;
}


.stat-card p,
.stat-box strong,
.metric {
    position: relative;
    z-index: 1;
    display: block;
    margin: 16px 0 0;
    color: #ffffff;
    font-family: "Rajdhani", sans-serif;
    font-size: 38px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
}


/* =========================
   FORM
   ========================= */

form {
    margin: 0;
}


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


.form-group,
.real-test-field,
.access-field {
    min-width: 0;
}


.form-group label,
.real-test-field label,
.access-field label {
    display: block;
    margin-bottom: 8px;
    color: #d6d6dc;
    font-size: 13px;
    font-weight: 600;
}


.form-help {
    margin: 7px 0 0;
    font-size: 12px;
    line-height: 1.5;
}


input,
select,
textarea {
    width: 100%;
    min-height: 46px;
    padding: 11px 13px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-small);
    outline: none;
    background: #050506;
    color: #f4f4f5;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}


input::placeholder,
textarea::placeholder {
    color: #555560;
}


input:hover,
select:hover,
textarea:hover {
    border-color: rgba(255, 255, 255, 0.2);
}


input:focus,
select:focus,
textarea:focus {
    border-color: rgba(139, 92, 246, 0.8);
    background: #08080a;
    box-shadow:
        0 0 0 3px rgba(139, 92, 246, 0.12),
        0 0 24px rgba(139, 92, 246, 0.06);
}


select {
    cursor: pointer;
}


.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}


.primary-button,
.secondary-button,
.danger-button,
.real-test-button,
.access-button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 15px;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        background 0.18s ease,
        box-shadow 0.18s ease;
}


.primary-button,
.real-test-button,
.access-button {
    border-color: rgba(167, 139, 250, 0.35);
    background:
        linear-gradient(
            135deg,
            #7c3aed,
            #4f46e5
        );
    color: #ffffff;
    box-shadow:
        0 8px 24px rgba(79, 70, 229, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.14);
}


.primary-button:hover,
.real-test-button:hover,
.access-button:hover {
    box-shadow:
        0 12px 30px rgba(79, 70, 229, 0.27),
        inset 0 1px 0 rgba(255, 255, 255, 0.16);
    transform: translateY(-1px);
}


.secondary-button {
    border-color: var(--border-strong);
    background: rgba(255, 255, 255, 0.045);
    color: #d7d7dc;
}


.secondary-button:hover {
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.075);
}


.danger-button,
.real-test-stop {
    border-color: rgba(239, 68, 68, 0.22);
    background: rgba(239, 68, 68, 0.11);
    color: #ff7b7b;
}


.danger-button:hover,
.real-test-stop:hover {
    border-color: rgba(239, 68, 68, 0.38);
    background: rgba(239, 68, 68, 0.18);
}


button:active,
.primary-button:active,
.secondary-button:active,
.danger-button:active {
    transform: translateY(0);
}


/* =========================
   FILTRI STATISTICHE
   ========================= */

.stats-filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 20px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius-medium);
    background:
        linear-gradient(
            145deg,
            rgba(12, 12, 14, 0.98),
            rgba(6, 6, 7, 0.98)
        );
}


.stats-filters button,
.stats-filters a {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    padding: 11px 14px;
    border-radius: var(--radius-small);
    font-weight: 700;
    text-decoration: none;
}


.stats-filters button {
    border: 1px solid rgba(167, 139, 250, 0.35);
    background:
        linear-gradient(
            135deg,
            #7c3aed,
            #4f46e5
        );
    color: #ffffff;
    cursor: pointer;
}


.stats-filters a {
    border: 1px solid var(--border-strong);
    background: rgba(255, 255, 255, 0.035);
    color: #c7c7cd;
}


/* =========================
   TABELLE
   ========================= */

.table-container,
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 14px;
}


table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 14px;
}


.table-container table,
.table-responsive table {
    margin-top: 0;
}


thead {
    background: #050506;
}


th,
td {
    padding: 15px 16px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}


th {
    color: #81818c;
    font-family: "Rajdhani", sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}


td {
    color: #dcdce1;
    font-size: 13px;
}


tbody tr {
    transition:
        background 0.18s ease,
        color 0.18s ease;
}


tbody tr:hover {
    background: rgba(139, 92, 246, 0.045);
}


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


td a {
    color: var(--accent-light);
    font-weight: 600;
    text-decoration: none;
}


td a:hover {
    text-decoration: underline;
}


/* =========================
   GRAFICI
   ========================= */

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


.card canvas {
    display: block;
    width: 100%;
    max-width: 100%;
}


/* =========================
   STATO, AVVISI E BLOCCHI
   ========================= */

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}


.status-active {
    border-color: rgba(34, 197, 94, 0.2);
    background: rgba(34, 197, 94, 0.09);
    color: #55dc82;
}


.status-inactive {
    border-color: rgba(239, 68, 68, 0.2);
    background: rgba(239, 68, 68, 0.09);
    color: #ff7777;
}


.empty-state {
    padding: 28px;
    border: 1px dashed var(--border-strong);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.018);
    text-align: center;
}


.empty-state h3 {
    margin-top: 0;
}


.subscription-flow,
.form-note,
.real-test-warning,
.access-note {
    padding: 16px;
    border: 1px solid rgba(139, 92, 246, 0.18);
    border-radius: 12px;
    background: rgba(139, 92, 246, 0.055);
    color: #c9c9d1;
    line-height: 1.7;
}


.real-test-alert,
.access-alert {
    padding: 13px 15px;
    margin-top: 15px;
    border: 1px solid var(--border);
    border-radius: 10px;
}


.real-test-success,
.success {
    border-color: rgba(34, 197, 94, 0.22);
    background: rgba(34, 197, 94, 0.09);
}


.real-test-error,
.error {
    border-color: rgba(239, 68, 68, 0.22);
    background: rgba(239, 68, 68, 0.09);
}


/* =========================
   PAGINE SPECIALI ESISTENTI
   ========================= */

.page-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}


.page-heading h1 {
    margin-bottom: 8px;
}


.action-stack {
    display: flex;
    min-width: 220px;
    flex-wrap: wrap;
    gap: 8px;
}


.link-preview,
.channel-detail {
    display: block;
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 11px;
}


.link-preview {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


.real-test-wrap,
.access-wrap {
    width: 100%;
    max-width: none;
}


.real-test-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 230px 180px;
    gap: 14px;
    align-items: end;
}


.access-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 180px;
    gap: 14px;
    align-items: end;
}


.real-test-table,
.access-table {
    width: 100%;
    margin-top: 18px;
    border-collapse: collapse;
}


.real-test-stop {
    min-height: 36px;
    padding: 8px 11px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
}


/* =========================
   SCROLLBAR
   ========================= */

* {
    scrollbar-width: thin;
    scrollbar-color: #27272d #070708;
}


::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}


::-webkit-scrollbar-track {
    background: #070708;
}


::-webkit-scrollbar-thumb {
    border: 2px solid #070708;
    border-radius: 999px;
    background: #27272d;
}


::-webkit-scrollbar-thumb:hover {
    background: #34343c;
}


/* =========================
   RESPONSIVE
   ========================= */

@media (max-width: 1200px) {

    .statistiche,
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}


@media (max-width: 980px) {

    :root {
        --sidebar-width: 246px;
    }

    .sidebar {
        padding-right: 14px;
        padding-left: 14px;
    }

    .content {
        padding: 30px;
    }

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

    .real-test-form,
    .access-form {
        grid-template-columns: 1fr;
    }

}


@media (max-width: 760px) {

    .layout {
        display: block;
    }

    .sidebar {
        position: relative;
        width: 100%;
        min-width: 0;
        height: auto;
        max-height: none;
        padding: 18px;
        overflow: visible;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .sidebar-navigation {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .menu-section {
        margin-bottom: 0;
    }

    .sidebar-footer {
        margin-top: 18px;
    }

    .content {
        width: 100%;
        margin-left: 0;
        padding: 24px 18px 34px;
    }

    .content h1 {
        margin-bottom: 24px;
        font-size: 34px;
    }

    .form-grid,
    .stats-filters {
        grid-template-columns: 1fr;
    }

    .card,
    .real-test-card,
    .access-card {
        padding: 20px;
        border-radius: 17px;
    }

}


@media (max-width: 540px) {

    .sidebar-navigation {
        grid-template-columns: 1fr;
    }

    .statistiche,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .sidebar-brand {
        padding-bottom: 18px;
    }

    .content {
        padding-right: 14px;
        padding-left: 14px;
    }

    .content h1 {
        font-size: 31px;
    }

    .stat-card,
    .stat-box,
    .stats-grid > .card {
        min-height: 122px;
    }

    .stat-card p,
    .stat-box strong,
    .metric {
        font-size: 34px;
    }

    .page-heading {
        display: block;
    }

}

.money-equivalent {
    display: block;
    margin-top: 8px;
    color: var(--accent-cyan);
    font-family: "Space Grotesk", sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0;
}

/* ==========================
   AMMINISTRAZIONE BOT
========================== */

.dashboard-grid.two-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.info-stack {
    display: grid;
    gap: 14px;
    margin: 18px 0;
}

.info-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.025);
}

.info-row strong {
    min-width: 24px;
}

.muted-text {
    color: var(--text-muted, #8d96aa);
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.table-actions form {
    margin: 0;
}

.button-small {
    padding: 8px 12px;
    font-size: 0.82rem;
}

.button-danger {
    border: 1px solid rgba(255, 92, 121, 0.45);
    background: rgba(255, 92, 121, 0.12);
    color: #ff8aa1;
}

.button-danger:hover {
    background: rgba(255, 92, 121, 0.2);
}

.status-success {
    color: #6ee7b7;
    border-color: rgba(110, 231, 183, 0.3);
    background: rgba(110, 231, 183, 0.08);
}

.status-warning {
    color: #facc15;
    border-color: rgba(250, 204, 21, 0.3);
    background: rgba(250, 204, 21, 0.08);
}

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

/* ==========================
   COMUNICAZIONI
   ========================== */
.communications-layout{display:grid;grid-template-columns:minmax(0,2fr) minmax(260px,.75fr);gap:22px;align-items:start;margin-bottom:22px}.communication-form{display:flex;flex-direction:column;gap:18px}.communication-form label{display:flex;flex-direction:column;gap:8px;font-weight:600}.communication-form small,.muted{color:var(--text-muted,#8992a8);font-weight:400}.communication-form textarea{resize:vertical;min-height:180px}.form-grid.two-columns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.communication-options{border:1px solid rgba(255,255,255,.09);border-radius:14px;padding:16px;display:flex;flex-direction:column;gap:12px}.communication-options legend{padding:0 8px;font-weight:700}.radio-row{display:flex!important;flex-direction:row!important;align-items:center;gap:9px!important}.radio-row input{width:auto}.compact-fields{margin-left:26px}.duration-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-left:26px}.communication-help{position:sticky;top:22px}.flow-step{padding:12px 0;border-bottom:1px solid rgba(255,255,255,.07)}.communications-history{margin-top:22px}.table-wrapper{overflow-x:auto}.actions-cell{display:flex;flex-wrap:wrap;gap:8px}.actions-cell form{margin:0}.status-pill{display:inline-flex;padding:4px 8px;border-radius:999px;background:rgba(255,255,255,.08);font-size:12px}.status-pill.success{background:rgba(45,196,129,.14)}.status-pill.error{background:rgba(255,91,108,.14)}.small{padding:7px 10px;font-size:12px}.danger-button{background:rgba(255,91,108,.14);border:1px solid rgba(255,91,108,.32);color:#ff8795;border-radius:9px;cursor:pointer}.secondary-button{background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.12);color:inherit;border-radius:9px;cursor:pointer}@media(max-width:980px){.communications-layout{grid-template-columns:1fr}.communication-help{position:static}}@media(max-width:680px){.form-grid.two-columns,.duration-grid{grid-template-columns:1fr}.compact-fields,.duration-grid{margin-left:0}}


/* COMUNICAZIONI: MEDIA E PULSANTI MULTIPLI */
.media-uploader{display:flex;flex-direction:column;gap:12px;padding:16px;border:1px dashed rgba(255,255,255,.16);border-radius:14px;background:rgba(255,255,255,.025)}
.media-preview{display:grid;gap:12px;padding:12px;border:1px solid rgba(255,255,255,.09);border-radius:12px;background:rgba(0,0,0,.16)}
.media-preview img,.media-preview video{display:block;width:100%;max-height:360px;object-fit:contain;border-radius:10px;background:#090b12}
.media-preview-meta{display:flex;align-items:center;justify-content:space-between;gap:12px}
.button-editor{gap:14px}.button-row-editor{display:flex;flex-wrap:wrap;gap:10px;padding:12px;border:1px solid rgba(255,255,255,.08);border-radius:12px;background:rgba(255,255,255,.02)}
.button-item{display:grid;grid-template-columns:minmax(150px,1fr) minmax(210px,1.4fr) 36px 36px;gap:8px;flex:1 1 540px;align-items:center}
.button-icon{width:36px;height:36px;padding:0;border:1px solid rgba(255,255,255,.14);border-radius:9px;background:rgba(255,255,255,.06);color:inherit;font-size:20px;cursor:pointer}
.button-icon:hover{background:rgba(255,255,255,.12)}
.telegram-preview{overflow:hidden;border:1px solid rgba(255,255,255,.12);border-radius:20px;background:linear-gradient(180deg,rgba(32,45,66,.92),rgba(18,24,38,.96));padding:18px;min-height:300px}
.telegram-preview-media{display:flex;align-items:center;justify-content:center;min-height:90px;margin-bottom:10px;border-radius:12px;background:rgba(0,0,0,.2);color:var(--text-muted,#8992a8);text-align:center;padding:12px}
.telegram-preview-text{white-space:pre-wrap;overflow-wrap:anywhere;padding:12px;border-radius:12px;background:rgba(45,196,129,.13);line-height:1.5}
.telegram-preview-buttons{display:grid;gap:6px;margin-top:7px}.telegram-button-row{display:flex;gap:6px}.telegram-button-row span{flex:1;padding:8px 9px;border-radius:8px;background:rgba(47,139,255,.22);text-align:center;font-size:12px}
@media(max-width:760px){.button-item{grid-template-columns:1fr}.button-icon{width:100%}.media-preview-meta{align-items:flex-start;flex-direction:column}}

/* ==========================
   IMPOSTAZIONI
========================== */
.settings-page-header { align-items: center; }
.settings-health-pill { display:inline-flex; align-items:center; gap:9px; padding:10px 14px; border:1px solid var(--border-color, #26324a); border-radius:999px; background:rgba(15,23,42,.55); font-size:13px; font-weight:700; }
.settings-health-pill span { width:9px; height:9px; border-radius:50%; background:#f59e0b; box-shadow:0 0 14px currentColor; }
.settings-health-pill.is-ok span { background:#22c55e; }
.settings-health-pill.is-error span { background:#ef4444; }
.settings-tabs { display:flex; gap:8px; overflow-x:auto; padding:7px; margin-bottom:20px; border:1px solid rgba(148,163,184,.14); border-radius:16px; background:rgba(15,23,42,.72); }
.settings-tab { flex:0 0 auto; border:0; background:transparent; color:#94a3b8; padding:11px 15px; border-radius:11px; font:inherit; font-size:13px; font-weight:700; cursor:pointer; }
.settings-tab:hover { color:#e2e8f0; background:rgba(255,255,255,.04); }
.settings-tab.active { color:#fff; background:linear-gradient(135deg, rgba(99,102,241,.92), rgba(59,130,246,.82)); box-shadow:0 8px 22px rgba(59,130,246,.2); }
.settings-panel { display:none; }
.settings-panel.active { display:block; animation:settingsFade .18s ease; }
@keyframes settingsFade { from { opacity:0; transform:translateY(4px); } to { opacity:1; transform:none; } }
.settings-grid { display:grid; gap:20px; }
.settings-grid.two-columns { grid-template-columns:minmax(0,1.35fr) minmax(300px,.65fr); }
.settings-card { padding:22px; }
.settings-card-header { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:22px; }
.settings-card-header > div { display:flex; align-items:flex-start; gap:13px; }
.settings-card-header h2 { margin:0 0 4px; font-size:18px; }
.settings-card-header p { margin:0; color:#94a3b8; font-size:13px; }
.settings-icon { display:grid; place-items:center; width:40px; height:40px; border-radius:12px; background:rgba(99,102,241,.13); border:1px solid rgba(99,102,241,.24); font-size:18px; }
.form-grid { display:grid; gap:16px; }
.form-grid.two-columns { grid-template-columns:repeat(2,minmax(0,1fr)); }
.form-group.full { grid-column:1/-1; }
.form-group { display:flex; flex-direction:column; gap:7px; }
.form-group > span, .stars-equation label > span { color:#cbd5e1; font-size:12px; font-weight:700; }
.form-group small { color:#64748b; font-size:11px; line-height:1.45; }
.settings-subsection { margin-top:22px; padding-top:20px; border-top:1px solid rgba(148,163,184,.12); }
.settings-subsection h3 { margin:0 0 12px; font-size:14px; }
.toggle-list { display:grid; gap:10px; }
.toggle-row { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:13px 14px; border:1px solid rgba(148,163,184,.12); border-radius:13px; background:rgba(15,23,42,.42); cursor:pointer; }
.toggle-row > span { display:flex; flex-direction:column; gap:3px; }
.toggle-row strong { font-size:13px; }
.toggle-row small { color:#7c8ba1; font-size:11px; }
.toggle-row input { position:absolute; opacity:0; pointer-events:none; }
.toggle-row i { position:relative; width:42px; height:23px; border-radius:999px; background:#334155; flex:0 0 auto; transition:.2s; }
.toggle-row i::after { content:""; position:absolute; top:3px; left:3px; width:17px; height:17px; border-radius:50%; background:#fff; transition:.2s; }
.toggle-row input:checked + i { background:#4f46e5; }
.toggle-row input:checked + i::after { transform:translateX(19px); }
.danger-toggle input:checked + i { background:#ef4444; }
.form-actions { display:flex; justify-content:flex-end; margin-top:22px; }
.preview-stack { display:grid; gap:10px; }
.preview-setting { display:flex; justify-content:space-between; gap:18px; padding:13px 0; border-bottom:1px solid rgba(148,163,184,.1); }
.preview-setting span { color:#94a3b8; font-size:12px; }
.preview-setting strong { text-align:right; font-size:13px; }
.info-box, .warning-box { margin-top:18px; padding:14px; border-radius:12px; font-size:12px; line-height:1.55; }
.info-box { background:rgba(59,130,246,.09); border:1px solid rgba(59,130,246,.2); color:#bfdbfe; }
.warning-box { background:rgba(245,158,11,.09); border:1px solid rgba(245,158,11,.22); color:#fde68a; }
.warning-box strong { display:block; margin-bottom:4px; color:#fbbf24; }
.warning-box p { margin:0; }
.stars-equation { display:grid; grid-template-columns:1fr auto 1fr; align-items:end; gap:16px; }
.stars-equation label { display:flex; flex-direction:column; gap:7px; }
.stars-equation .equals { padding-bottom:12px; font-size:24px; color:#64748b; }
.rate-preview, .calculator-result { margin-top:18px; padding:17px; border-radius:14px; background:linear-gradient(135deg,rgba(99,102,241,.14),rgba(59,130,246,.08)); border:1px solid rgba(99,102,241,.24); display:flex; justify-content:space-between; align-items:center; }
.rate-preview span, .calculator-result span { color:#a5b4fc; font-size:12px; font-weight:700; }
.rate-preview strong, .calculator-result strong { font-size:19px; }
.input-with-suffix { display:flex; }
.input-with-suffix input { border-radius:10px 0 0 10px !important; }
.input-with-suffix span { display:grid; place-items:center; padding:0 12px; border:1px solid rgba(148,163,184,.18); border-left:0; border-radius:0 10px 10px 0; color:#94a3b8; background:rgba(15,23,42,.75); font-size:12px; }
.service-status-list { display:grid; gap:9px; }
.service-status { display:flex; gap:11px; align-items:center; padding:12px; border-radius:12px; background:rgba(15,23,42,.48); border:1px solid rgba(148,163,184,.1); }
.service-status > div { display:flex; flex-direction:column; gap:2px; }
.service-status strong { font-size:13px; }
.service-status small { color:#7c8ba1; font-size:11px; }
.status-dot { width:10px; height:10px; border-radius:50%; background:#64748b; box-shadow:0 0 12px currentColor; }
.status-dot.ok { background:#22c55e; }
.status-dot.warning { background:#f59e0b; }
.status-dot.error { background:#ef4444; }
.disk-meter { margin-top:18px; }
.disk-meter > div:first-child { display:flex; justify-content:space-between; font-size:12px; margin-bottom:8px; }
.disk-meter small { color:#64748b; font-size:11px; }
.meter { height:8px; background:#1e293b; border-radius:999px; overflow:hidden; margin-bottom:7px; }
.meter i { display:block; height:100%; border-radius:999px; background:linear-gradient(90deg,#4f46e5,#38bdf8); }
.backup-actions { display:grid; gap:14px; }
.backup-actions form { padding:15px; border-radius:13px; border:1px solid rgba(148,163,184,.12); background:rgba(15,23,42,.45); }
.backup-actions p { margin:9px 0 0; color:#7c8ba1; font-size:11px; line-height:1.5; }
.backup-list { display:grid; gap:8px; max-height:390px; overflow:auto; }
.backup-row { display:flex; justify-content:space-between; align-items:center; gap:14px; padding:12px; color:inherit; text-decoration:none; border:1px solid rgba(148,163,184,.11); border-radius:11px; background:rgba(15,23,42,.4); }
.backup-row:hover { border-color:rgba(99,102,241,.45); }
.backup-row div { display:flex; flex-direction:column; gap:3px; min-width:0; }
.backup-row strong { font-size:12px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.backup-row small { color:#64748b; font-size:10px; }
.backup-row > span { color:#a5b4fc; font-size:11px; font-weight:700; }
.maintenance-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; }
.maintenance-card { padding:22px; }
.maintenance-card > span { font-size:25px; }
.maintenance-card h3 { margin:12px 0 7px; font-size:16px; }
.maintenance-card p { color:#8795aa; font-size:12px; line-height:1.55; overflow-wrap:anywhere; }
.settings-log-list { display:grid; gap:7px; max-height:580px; overflow:auto; }
.settings-log-row { display:flex; align-items:center; gap:12px; padding:11px 12px; border-radius:11px; background:rgba(15,23,42,.42); border:1px solid rgba(148,163,184,.09); }
.settings-log-row > div { display:flex; flex-direction:column; gap:3px; }
.settings-log-row strong { font-size:12px; }
.settings-log-row small { color:#64748b; font-size:10px; }
.log-level { min-width:55px; text-align:center; padding:5px 7px; border-radius:999px; background:#334155; color:#cbd5e1; font-size:9px; font-weight:800; text-transform:uppercase; }
.log-level.info { background:rgba(59,130,246,.14); color:#93c5fd; }
.log-level.warning { background:rgba(245,158,11,.14); color:#fbbf24; }
.log-level.error { background:rgba(239,68,68,.14); color:#fca5a5; }
.info-table { display:grid; }
.info-table > div { display:flex; justify-content:space-between; gap:16px; padding:13px 0; border-bottom:1px solid rgba(148,163,184,.1); }
.info-table span { color:#8492a6; font-size:12px; }
.info-table strong { font-size:12px; text-align:right; }
.btn-danger-soft { background:rgba(239,68,68,.1); color:#fca5a5; border:1px solid rgba(239,68,68,.25); }
.empty-state.compact { padding:25px 10px; }
.muted { color:#64748b; font-size:11px; line-height:1.5; }
@media (max-width:1100px) { .settings-grid.two-columns { grid-template-columns:1fr; } .maintenance-grid { grid-template-columns:1fr 1fr; } }
@media (max-width:700px) { .form-grid.two-columns, .maintenance-grid, .stars-equation { grid-template-columns:1fr; } .stars-equation .equals { padding:0; text-align:center; } .settings-card { padding:17px; } .settings-card-header { flex-direction:column; } }

/* === AUTENTICAZIONE E MULTI-PANNELLO === */
.login-body{min-height:100vh;margin:0;background:#05070b;color:#f6f7fb;font-family:"Space Grotesk",sans-serif;display:grid;place-items:center}.login-shell{width:min(440px,calc(100% - 32px))}.login-card{padding:38px;border:1px solid rgba(255,255,255,.1);border-radius:24px;background:rgba(12,16,24,.96);box-shadow:0 30px 80px rgba(0,0,0,.45)}.login-card h1{margin:8px 0;font-size:30px}.login-logo{margin-bottom:20px}.login-copy,.login-note{color:#9aa3b2}.login-note{display:block;margin-top:20px;text-align:center}.login-card .settings-form{display:grid;gap:18px;margin-top:26px}.login-card label{display:grid;gap:8px;font-weight:600}.login-card input,.panel-account-card input{width:100%;box-sizing:border-box;padding:12px 14px;border:1px solid rgba(255,255,255,.12);border-radius:10px;background:#080b11;color:#fff}.primary-button,.secondary-button,.sidebar-logout{border:0;border-radius:10px;padding:11px 16px;cursor:pointer;font-weight:700}.primary-button{background:#f2d35b;color:#111}.secondary-button{background:#242b36;color:#fff}.alert{padding:12px 15px;border-radius:10px;margin:14px 0}.alert-error,.alert.error{background:rgba(255,73,94,.12);border:1px solid rgba(255,73,94,.4);color:#ff9eaa}.alert-success,.alert.success{background:rgba(66,211,146,.12);border:1px solid rgba(66,211,146,.4);color:#8ef0c0}.sidebar-account{margin-top:auto;padding:16px;border-top:1px solid rgba(255,255,255,.08);display:grid;gap:9px}.sidebar-account strong,.sidebar-account small{display:block}.sidebar-account small{color:#8d96a5}.sidebar-logout{width:100%;background:#171c25;color:#dce2eb;padding:8px}.panels-list{display:grid;gap:16px}.panel-account-card{border:1px solid rgba(255,255,255,.09);background:rgba(255,255,255,.025);border-radius:16px;padding:18px}.panel-account-head,.panel-actions{display:flex;align-items:center;justify-content:space-between;gap:12px}.panel-account-head small{display:block;color:#8f98a7;margin-top:4px}.panel-account-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:18px 0}.panel-account-fields label{display:grid;gap:7px}.check-row{display:flex!important;align-items:center;gap:8px}.check-row input{width:auto}.status-pill{padding:6px 10px;border-radius:999px;font-size:12px}.status-active{background:rgba(62,208,139,.15);color:#7ce8b6}.status-inactive{background:rgba(255,82,103,.15);color:#ff98a5}.settings-card-wide{grid-column:span 2}@media(max-width:900px){.panel-account-fields{grid-template-columns:1fr}.settings-card-wide{grid-column:auto}}
