:root {
    --bg: #07101f;
    --bg-soft: #0b1526;
    --sidebar: #081120;

    --panel: rgba(16, 29, 48, 0.82);
    --panel-2: rgba(19, 35, 58, 0.92);

    --border: rgba(119, 157, 208, 0.13);

    --text: #f3f7ff;
    --muted: #8493aa;

    --blue: #4f8cff;
    --cyan: #48c6ef;
    --green: #35d49a;
    --red: #ff6474;
    --orange: #ffb85c;

    --radius: 17px;
}


* {
    box-sizing: border-box;
}


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


body {
    margin: 0;

    background:
        radial-gradient(
            circle at 85% 0%,
            rgba(50, 92, 165, 0.18),
            transparent 32%
        ),
        var(--bg);

    color: var(--text);

    font-family:
        Inter,
        Segoe UI,
        system-ui,
        sans-serif;
}


button,
input,
select {
    font: inherit;
}


button {
    cursor: pointer;
}


.hidden {
    display: none !important;
}


/* =========================================================
   AUTH
========================================================= */

.auth-shell {
    min-height: 100vh;

    position: relative;

    display: grid;
    place-items: center;

    overflow: hidden;

    padding: 28px;
}


.auth-background {
    position: fixed;
    inset: 0;

    background:
        radial-gradient(
            circle at 15% 20%,
            rgba(79, 140, 255, 0.19),
            transparent 30%
        ),
        radial-gradient(
            circle at 80% 10%,
            rgba(112, 92, 255, 0.16),
            transparent 28%
        ),
        radial-gradient(
            circle at 50% 100%,
            rgba(72, 198, 239, 0.08),
            transparent 38%
        );

    pointer-events: none;
}


.auth-card {
    width: min(100%, 520px);

    position: relative;
    z-index: 1;

    padding: 30px;

    background:
        linear-gradient(
            145deg,
            rgba(17, 31, 52, 0.96),
            rgba(10, 21, 37, 0.96)
        );

    border: 1px solid rgba(119, 157, 208, 0.16);
    border-radius: 22px;

    box-shadow:
        0 28px 70px rgba(0, 0, 0, 0.32);
}


.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;

    margin-bottom: 28px;
}


.auth-brand-icon {
    flex: 0 0 auto;
}


.auth-step {
    display: none;
}


.auth-step.active {
    display: block;
}


.auth-heading {
    margin-bottom: 22px;
}


.auth-heading h1 {
    margin: 0;

    font-size: 24px;
    font-weight: 700;
}


.auth-heading p {
    margin: 8px 0 0;

    color: var(--muted);

    font-size: 13px;
    line-height: 1.6;
}


.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}


.auth-form label {
    display: flex;
    flex-direction: column;
    gap: 7px;

    color: #a0aec2;
    font-size: 11px;
}


.auth-submit {
    width: 100%;

    margin-top: 2px;
}


.auth-error {
    padding: 11px 13px;

    color: #ff9aa5;

    background: rgba(255, 100, 116, 0.08);

    border: 1px solid rgba(255, 100, 116, 0.18);
    border-radius: 10px;

    font-size: 11px;
    line-height: 1.45;
}


.auth-link {
    align-self: center;

    padding: 3px;

    font-size: 11px;
}


.auth-footer {
    margin-top: 25px;

    color: #5f6e83;

    text-align: center;
    font-size: 10px;
}


.otp-input {
    text-align: center;

    font-size: 22px;
    font-weight: 700;

    letter-spacing: 0.3em;
}


.setup-content {
    display: grid;
    grid-template-columns: 34px 1fr;
    gap: 14px;

    margin-bottom: 19px;
}


.setup-number {
    width: 30px;
    height: 30px;

    display: grid;
    place-items: center;

    color: white;

    background:
        linear-gradient(
            145deg,
            #3e7ef2,
            #665bea
        );

    border-radius: 9px;

    font-size: 11px;
    font-weight: 700;
}


.setup-content strong {
    display: block;

    font-size: 12px;
}


.setup-content p {
    margin: 5px 0 0;

    color: var(--muted);

    font-size: 11px;
    line-height: 1.55;
}


.setup-wide {
    min-width: 0;
}


.qr-container {
    min-height: 145px;

    display: grid;
    place-items: center;

    margin-top: 14px;
    padding: 15px;

    background: rgba(255, 255, 255, 0.025);

    border: 1px solid var(--border);
    border-radius: 13px;
}


.qr-placeholder {
    display: flex;
    flex-direction: column;
    gap: 6px;

    text-align: center;
}


.qr-placeholder strong {
    font-size: 12px;
}


.qr-placeholder span {
    color: var(--muted);

    font-size: 10px;
}


.totp-secret-box {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;

    margin-top: 12px;
}


.totp-secret-box span {
    grid-column: 1 / -1;

    color: var(--muted);

    font-size: 10px;
}


.totp-secret-box code {
    min-width: 0;

    padding: 10px 12px;

    overflow-wrap: anywhere;

    color: #b9cfff;

    background: #0c1728;

    border: 1px solid var(--border);
    border-radius: 9px;

    font-size: 11px;
}


.setup-form {
    margin-top: 13px;
}


.recovery-warning {
    margin-bottom: 16px;
    padding: 12px 14px;

    color: #ffd395;

    background: rgba(255, 184, 92, 0.07);

    border: 1px solid rgba(255, 184, 92, 0.18);
    border-radius: 11px;

    font-size: 11px;
    line-height: 1.5;
}


.recovery-codes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 9px;
}


.recovery-codes code {
    padding: 11px;

    color: #dce7f7;

    text-align: center;

    background: rgba(255, 255, 255, 0.025);

    border: 1px solid var(--border);
    border-radius: 9px;

    font-size: 11px;
}


.recovery-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;

    margin-top: 18px;
}


/* =========================================================
   APPLICATION
========================================================= */

.app {
    min-height: 100vh;

    display: grid;
    grid-template-columns: 250px 1fr;
}


.sidebar {
    min-height: 100vh;

    position: sticky;
    top: 0;

    display: flex;
    flex-direction: column;

    padding: 25px 18px;

    background:
        linear-gradient(
            180deg,
            rgba(10, 20, 36, 0.98),
            rgba(7, 15, 28, 0.98)
        );

    border-right: 1px solid var(--border);
}


.brand {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 2px 8px 29px;
}


.brand-icon {
    width: 42px;
    height: 42px;

    display: grid;
    place-items: center;

    border-radius: 12px;

    font-size: 21px;
    font-weight: 800;

    background:
        linear-gradient(
            145deg,
            var(--blue),
            #705cff
        );

    box-shadow:
        0 10px 30px rgba(79, 140, 255, 0.28);
}


.brand-title {
    font-size: 17px;
    font-weight: 700;
}


.brand-subtitle {
    margin-top: 3px;

    color: var(--muted);

    font-size: 11px;
}


.nav {
    display: flex;
    flex-direction: column;
    gap: 7px;
}


.nav-item {
    width: 100%;

    display: flex;
    align-items: center;
    gap: 12px;

    padding: 12px 14px;

    color: #aebbd0;
    background: transparent;

    border: 1px solid transparent;
    border-radius: 11px;

    text-align: left;
}


.nav-item:hover {
    background: rgba(255, 255, 255, 0.035);
}


.nav-item.active {
    color: white;

    background:
        linear-gradient(
            90deg,
            rgba(64, 114, 232, 0.23),
            rgba(64, 114, 232, 0.08)
        );

    border-color: rgba(79, 140, 255, 0.18);
}


.nav-item.disabled {
    opacity: 0.38;
    cursor: default;
}


.nav-icon {
    width: 22px;

    text-align: center;
}


.sidebar-footer {
    margin-top: auto;

    padding: 20px 7px 4px;
}


.system-status {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 13px;

    background: rgba(255, 255, 255, 0.03);

    border: 1px solid var(--border);
    border-radius: 12px;
}


.system-status strong {
    display: block;

    font-size: 12px;
}


.system-status small {
    color: var(--muted);

    font-size: 10px;
}


.status-dot {
    width: 9px;
    height: 9px;

    border-radius: 50%;
}


.status-dot.online {
    background: var(--green);

    box-shadow: 0 0 13px var(--green);
}


.status-dot.offline {
    background: var(--red);

    box-shadow: 0 0 13px var(--red);
}


.main {
    padding: 27px 31px 45px;

    overflow: hidden;
}


.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin-bottom: 28px;
}


.topbar h1 {
    margin: 0;

    font-size: 27px;
}


.topbar p {
    margin: 6px 0 0;

    color: var(--muted);

    font-size: 13px;
}


.topbar-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}


.tenant-selector {
    display: flex;
    flex-direction: column;
    gap: 5px;
}


.tenant-selector label {
    color: var(--muted);

    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}


select,
input {
    color: var(--text);

    padding: 10px 12px;

    background: #101c2e;

    border: 1px solid var(--border);
    border-radius: 9px;

    outline: none;
}


select:focus,
input:focus {
    border-color: rgba(79, 140, 255, 0.6);
}


.user-menu {
    position: relative;
}


.user-card {
    min-width: 210px;

    display: flex;
    align-items: center;
    gap: 10px;

    padding: 7px 11px;

    color: var(--text);

    background: rgba(255, 255, 255, 0.035);

    border: 1px solid var(--border);
    border-radius: 12px;

    text-align: left;
}


.user-card:hover {
    background: rgba(255, 255, 255, 0.055);
}


.avatar {
    width: 35px;
    height: 35px;

    flex: 0 0 auto;

    display: grid;
    place-items: center;

    border-radius: 50%;

    font-size: 11px;
    font-weight: 700;

    background:
        linear-gradient(
            145deg,
            #446be8,
            #8259d9
        );
}


.user-info {
    min-width: 0;
    flex: 1;
}


.user-card strong {
    display: block;

    overflow: hidden;

    text-overflow: ellipsis;
    white-space: nowrap;

    font-size: 11px;
}


.user-card span {
    color: var(--muted);

    font-size: 10px;
}


.user-chevron {
    flex: 0 0 auto;
}


.user-dropdown {
    width: 240px;

    position: absolute;
    right: 0;
    top: calc(100% + 8px);

    z-index: 20;

    padding: 12px;

    background: #101c2e;

    border: 1px solid var(--border);
    border-radius: 12px;

    box-shadow:
        0 18px 40px rgba(0, 0, 0, 0.3);
}


.user-dropdown-info strong {
    display: block;

    overflow-wrap: anywhere;

    font-size: 11px;
}


.user-dropdown-info span {
    display: block;

    margin-top: 5px;

    color: var(--muted);

    font-size: 10px;
}


.dropdown-divider {
    height: 1px;

    margin: 11px 0;

    background: var(--border);
}


.logout-button {
    width: 100%;

    padding: 9px 10px;

    color: #ff9aa5;

    background: rgba(255, 100, 116, 0.06);

    border: 1px solid rgba(255, 100, 116, 0.14);
    border-radius: 8px;

    text-align: left;
}


.logout-button:hover {
    background: rgba(255, 100, 116, 0.1);
}


.view {
    display: none;
}


.view.active {
    display: block;
}


.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 17px;

    margin-bottom: 18px;
}


.kpi-card,
.panel {
    background:
        linear-gradient(
            145deg,
            rgba(18, 33, 55, 0.91),
            rgba(12, 24, 41, 0.89)
        );

    border: 1px solid var(--border);
    border-radius: var(--radius);

    box-shadow:
        0 13px 35px rgba(0, 0, 0, 0.12);
}


.kpi-card {
    padding: 19px 20px;
}


.kpi-label {
    color: var(--muted);

    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}


.kpi-value {
    margin-top: 9px;

    font-size: 31px;
    line-height: 1;
    font-weight: 700;
}


.kpi-value.success {
    color: var(--green);
}


.kpi-value.danger {
    color: var(--red);
}


.kpi-foot {
    margin-top: 9px;

    color: #77869d;

    font-size: 11px;
}


.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 18px;
}


.panel {
    padding: 21px;
}


.panel-large {
    min-height: 250px;
}


.full-width {
    grid-column: 1 / -1;
}


.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin-bottom: 18px;
}


.panel-header h2,
.section-heading h2 {
    margin: 0;

    font-size: 15px;
}


.panel-header p,
.section-heading p {
    margin: 5px 0 0;

    color: var(--muted);

    font-size: 11px;
}


.device-summary {
    min-height: 170px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 60px;
}


.ring {
    --online-percent: 0%;

    width: 138px;
    height: 138px;

    display: grid;
    place-items: center;

    border-radius: 50%;

    background:
        radial-gradient(
            circle,
            #101d30 56%,
            transparent 57%
        ),
        conic-gradient(
            var(--green) 0 var(--online-percent),
            rgba(255, 255, 255, 0.07)
            var(--online-percent) 100%
        );

    box-shadow:
        0 0 35px rgba(53, 212, 154, 0.08);
}


.ring div {
    text-align: center;
}


.ring strong {
    display: block;

    font-size: 26px;
}


.ring span {
    color: var(--muted);

    font-size: 10px;
}


.summary-stats {
    min-width: 190px;

    display: flex;
    flex-direction: column;
    gap: 16px;
}


.summary-stats > div {
    display: grid;
    grid-template-columns: 12px 1fr auto;
    gap: 8px;
    align-items: center;

    color: #bac5d6;

    font-size: 12px;
}


.summary-stats strong {
    color: white;
}


.legend-dot {
    width: 7px;
    height: 7px;

    border-radius: 50%;
}


.green {
    background: var(--green);
}


.red {
    background: var(--red);
}


.blue {
    background: var(--blue);
}


.agent-overview {
    display: grid;
    gap: 13px;
}


.agent-stat {
    display: flex;
    justify-content: space-between;

    padding: 14px;

    background: rgba(255, 255, 255, 0.025);

    border: 1px solid var(--border);
    border-radius: 11px;
}


.agent-stat span {
    color: var(--muted);

    font-size: 12px;
}


.primary-button,
.secondary-button,
.text-button {
    border-radius: 9px;
}


.primary-button {
    padding: 11px 16px;

    color: white;

    background:
        linear-gradient(
            135deg,
            #3e7ef2,
            #665bea
        );

    border: 0;
}


.primary-button:hover {
    filter: brightness(1.06);
}


.primary-button:disabled,
.secondary-button:disabled {
    opacity: 0.55;
    cursor: wait;
}


.secondary-button {
    padding: 9px 13px;

    color: #dce6f5;

    background: #17263b;

    border: 1px solid var(--border);
}


.text-button {
    color: #79a7ff;

    background: transparent;

    border: 0;
}


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


table {
    width: 100%;

    border-collapse: collapse;
}


th {
    padding: 10px 12px;

    color: #73839b;

    text-align: left;

    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;

    border-bottom: 1px solid var(--border);
}


td {
    padding: 14px 12px;

    color: #d7e0ee;

    font-size: 12px;

    border-bottom:
        1px solid rgba(119, 157, 208, 0.08);
}


.empty-table {
    padding: 24px;

    color: var(--muted);

    text-align: center;
}


.device-name {
    color: white;

    font-weight: 600;
}


.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    padding: 5px 9px;

    border-radius: 999px;

    font-size: 10px;
    font-weight: 600;
}


.badge.online {
    color: #7ee8bf;

    background: rgba(53, 212, 154, 0.1);
}


.badge.offline {
    color: #ff8994;

    background: rgba(255, 100, 116, 0.1);
}


.badge.profile {
    color: #8eb3ff;

    background: rgba(79, 140, 255, 0.1);
}


.section-heading {
    margin-bottom: 18px;
}


.agent-grid {
    display: grid;
    grid-template-columns:
        minmax(300px, 0.9fr)
        minmax(430px, 1.4fr);

    gap: 18px;
}


.form-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}


.form-stack label {
    display: flex;
    flex-direction: column;
    gap: 7px;

    color: #8999af;

    font-size: 11px;
}


.profile-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}


.profile-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 15px;

    padding: 14px;

    background: rgba(255, 255, 255, 0.025);

    border: 1px solid var(--border);
    border-radius: 11px;
}


.profile-title {
    font-size: 12px;
    font-weight: 600;
}


.profile-meta {
    margin-top: 5px;

    color: var(--muted);

    font-size: 10px;
}


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

@media (max-width: 1050px) {

    .app {
        grid-template-columns: 200px 1fr;
    }

    .kpi-grid {
        grid-template-columns:
            repeat(2, 1fr);
    }

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

    .full-width {
        grid-column: auto;
    }
}


@media (max-width: 760px) {

    .auth-shell {
        padding: 16px;
    }

    .auth-card {
        padding: 23px;
    }

    .recovery-codes {
        grid-template-columns: 1fr;
    }

    .recovery-actions {
        flex-direction: column;
    }

    .app {
        display: block;
    }

    .sidebar {
        min-height: auto;
        position: relative;
    }

    .main {
        padding: 20px;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 18px;
    }

    .topbar-actions {
        width: 100%;

        align-items: stretch;
        flex-direction: column;
    }

    .tenant-selector {
        width: 100%;
    }

    .tenant-selector select {
        width: 100%;
    }

    .user-menu {
        width: 100%;
    }

    .user-card {
        width: 100%;
    }

    .user-dropdown {
        width: 100%;
    }

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

    .device-summary {
        flex-direction: column;
        gap: 25px;
    }
}


/* =========================================================
   LOCAL TOTP QR CODE
========================================================= */

.qr-container img,
.qr-container canvas {
    display: block;

    max-width: 100%;
    height: auto;

    padding: 10px;

    background: #ffffff;

    border-radius: 10px;

    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.18);
}


/* =========================================================
   FRONTEND v0.6.0
========================================================= */

:root {
    --accent-secondary: #665bea;

    --panel-color: #122137;
    --sidebar-color: #081120;

    --panel-opacity: 0.91;
    --sidebar-opacity: 0.98;
    --login-opacity: 0.96;

    --login-overlay-opacity: 0.35;
    --login-background-image: none;

    --input-bg: #101c2e;
    --dropdown-bg: #101c2e;
    --table-row-hover: rgba(255, 255, 255, 0.025);
}


/* =========================================================
   LIGHT THEME
========================================================= */

html[data-theme="light"] {
    --bg: #eef3f9;
    --bg-soft: #e5ecf5;

    --panel-color: #ffffff;
    --sidebar-color: #ffffff;

    --border: rgba(38, 60, 90, 0.13);

    --text: #172033;
    --muted: #68768b;

    --input-bg: #f4f7fb;
    --dropdown-bg: #ffffff;

    --table-row-hover:
        rgba(36, 74, 130, 0.035);
}


html[data-theme="light"] body {
    background:
        radial-gradient(
            circle at 85% 0%,
            rgba(79, 140, 255, 0.09),
            transparent 32%
        ),
        var(--bg);
}


html[data-theme="light"] .nav-item {
    color: #526176;
}


html[data-theme="light"] .nav-item.active {
    color: #245bc4;
}


html[data-theme="light"] td,
html[data-theme="light"] .device-name,
html[data-theme="light"] .summary-stats strong {
    color: var(--text);
}


html[data-theme="light"] th {
    color: #748399;
}


html[data-theme="light"] .secondary-button {
    color: #27364c;
    background: #edf2f8;
}


html[data-theme="light"] .auth-form label,
html[data-theme="light"] .form-stack label {
    color: #5e6c80;
}


/* =========================================================
   CUSTOMIZABLE SURFACES
========================================================= */

.sidebar {
    background:
        rgb(
            from var(--sidebar-color)
            r g b /
            var(--sidebar-opacity)
        );
}


.kpi-card,
.panel {
    background:
        rgb(
            from var(--panel-color)
            r g b /
            var(--panel-opacity)
        );

    backdrop-filter: blur(14px);
}


.auth-card {
    background:
        rgb(
            from var(--panel-color)
            r g b /
            var(--login-opacity)
        );

    backdrop-filter: blur(18px);
}


select,
input {
    color: var(--text);
    background: var(--input-bg);
}


.user-dropdown {
    color: var(--text);
    background: var(--dropdown-bg);
}


/* =========================================================
   LOGIN BACKGROUND
========================================================= */

.auth-background {
    position: fixed;
    inset: 0;

    overflow: hidden;

    background-color: #07101f;

    background-image:
        radial-gradient(
            circle at 15% 20%,
            rgba(79, 140, 255, 0.19),
            transparent 30%
        ),
        radial-gradient(
            circle at 80% 10%,
            rgba(112, 92, 255, 0.16),
            transparent 28%
        );

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}


/*
 * Riempimento dello schermo.
 *
 * Usa la stessa immagine in modalità cover,
 * leggermente ingrandita e sfocata.
 * Serve a riempire le zone che rimarrebbero
 * libere usando contain.
 */
.auth-background::before {
    content: "";

    position: absolute;
    inset: -30px;

    background-image:
        var(--login-background-image);

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    filter:
        blur(24px)
        brightness(0.55);

    transform: scale(1.04);

    z-index: 0;
}


/*
 * Immagine principale.
 *
 * Rimane completamente visibile e mantiene
 * il proprio rapporto d'aspetto.
 */
.auth-background::after {
    content: "";

    position: absolute;
    inset: 0;

    background-image:
        linear-gradient(
            rgba(
                4,
                10,
                20,
                var(--login-overlay-opacity)
            ),
            rgba(
                4,
                10,
                20,
                var(--login-overlay-opacity)
            )
        ),
        var(--login-background-image);

    background-size:
        100% 100%,
        contain;

    background-position:
        center,
        center;

    background-repeat:
        no-repeat,
        no-repeat;

    z-index: 1;
}


/* =========================================================
   AVATARS
========================================================= */

.avatar-image {
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}


.settings-avatar {
    width: 64px;
    height: 64px;

    font-size: 16px;
}


.table-avatar {
    width: 34px;
    height: 34px;

    flex: 0 0 auto;

    display: grid;
    place-items: center;

    color: white;

    background:
        linear-gradient(
            145deg,
            var(--blue),
            var(--accent-secondary)
        );

    border-radius: 50%;

    font-size: 10px;
    font-weight: 700;
}


/* =========================================================
   USERS
========================================================= */

.panel-actions {
    display: flex;
    align-items: center;
    gap: 9px;
}


.users-summary {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 12px;

    margin-bottom: 20px;
}


.users-summary-card {
    padding: 14px 16px;

    background:
        rgba(255, 255, 255, 0.025);

    border: 1px solid var(--border);
    border-radius: 11px;
}


.users-summary-card span {
    display: block;

    color: var(--muted);

    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}


.users-summary-card strong {
    display: block;

    margin-top: 7px;

    color: var(--text);

    font-size: 23px;
}


.user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}


.user-cell strong {
    display: block;

    color: var(--text);

    font-size: 11px;
}


.user-cell small {
    display: block;

    max-width: 210px;

    margin-top: 3px;

    overflow: hidden;

    color: var(--muted);

    text-overflow: ellipsis;
    white-space: nowrap;

    font-size: 9px;
}


.table-actions {
    text-align: right;
}


.users-table tbody tr:hover {
    background: var(--table-row-hover);
}


/* =========================================================
   SETTINGS
========================================================= */

.settings-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 18px;
}


.profile-settings {
    display: flex;
    align-items: center;
    gap: 16px;
}


.profile-settings strong {
    display: block;

    color: var(--text);

    font-size: 13px;
}


.profile-settings span {
    display: block;

    margin-top: 4px;

    color: var(--muted);

    font-size: 11px;
}


.settings-note {
    margin-top: 16px;

    color: var(--muted);

    font-size: 10px;
    line-height: 1.55;
}


/* =========================================================
   MODALS
========================================================= */

.modal-backdrop {
    position: fixed;
    inset: 0;

    z-index: 100;

    display: grid;
    place-items: center;

    padding: 22px;

    background:
        rgba(2, 7, 14, 0.7);

    backdrop-filter: blur(8px);
}


.modal-card {
    width: min(100%, 520px);
    max-height: calc(100vh - 44px);

    overflow-y: auto;

    padding: 23px;

    color: var(--text);

    background:
        rgb(
            from var(--panel-color)
            r g b / 0.98
        );

    border: 1px solid var(--border);
    border-radius: 17px;

    box-shadow:
        0 25px 70px
        rgba(0, 0, 0, 0.35);
}


.modal-card-small {
    width: min(100%, 440px);
}


.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;

    margin-bottom: 20px;
}


.modal-header h2 {
    margin: 0;

    font-size: 16px;
}


.modal-header p {
    margin: 5px 0 0;

    color: var(--muted);

    font-size: 11px;
}


.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;

    margin-top: 5px;
}


.icon-button {
    width: 33px;
    height: 33px;

    flex: 0 0 auto;

    display: grid;
    place-items: center;

    padding: 0;

    color: var(--muted);
    background: transparent;

    border: 1px solid var(--border);
    border-radius: 9px;

    font-size: 18px;
}


.icon-button:hover {
    color: var(--text);

    background:
        rgba(255, 255, 255, 0.04);
}


/* =========================================================
   BUTTONS
========================================================= */

.primary-button {
    background:
        linear-gradient(
            135deg,
            var(--blue),
            var(--accent-secondary)
        );
}


.danger-button {
    padding: 9px 13px;

    color: #ff9aa5;

    background:
        rgba(255, 100, 116, 0.08);

    border:
        1px solid
        rgba(255, 100, 116, 0.18);

    border-radius: 9px;
}


/* =========================================================
   MOBILE NAVIGATION PREPARATION
========================================================= */

.mobile-menu-button {
    display: none;

    width: 40px;
    height: 40px;

    place-items: center;

    padding: 0;

    color: var(--text);
    background:
        rgba(255, 255, 255, 0.035);

    border: 1px solid var(--border);
    border-radius: 10px;

    font-size: 20px;
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 760px) {

    body {
        overflow-x: hidden;
    }


    .app {
        display: block;
    }


    .sidebar {
        min-height: auto;

        position: relative;

        padding: 14px;
    }


    .brand {
        padding-bottom: 14px;
    }


    .nav {
        display: grid;
        grid-template-columns:
            repeat(4, minmax(0, 1fr));

        gap: 7px;
    }


    .nav-item {
        min-height: 58px;

        justify-content: center;

        flex-direction: column;
        gap: 4px;

        padding: 8px 5px;

        text-align: center;

        font-size: 9px;
    }


    .nav-icon {
        width: auto;

        font-size: 16px;
    }


    .nav-item.disabled {
        display: none;
    }


    .sidebar-footer {
        display: none;
    }


    .main {
        padding:
            18px 14px 32px;
    }


    .topbar {
        margin-bottom: 20px;
    }


    .topbar h1 {
        font-size: 22px;
    }


    .topbar p {
        font-size: 11px;
    }


    .panel {
        padding: 16px;
    }


    .panel-header {
        align-items: flex-start;

        flex-direction: column;

        gap: 12px;
    }


    .panel-actions {
        width: 100%;
    }


    .panel-actions button {
        flex: 1;
    }


    .users-summary {
        grid-template-columns: 1fr;
    }


    /*
     * Su mobile la tabella utenti
     * diventa un elenco di card.
     */

    .users-table,
    .users-table thead,
    .users-table tbody,
    .users-table tr,
    .users-table td {
        display: block;
        width: 100%;
    }


    .users-table thead {
        display: none;
    }


    .users-table tr {
        margin-bottom: 12px;
        padding: 14px;

        background:
            rgba(255, 255, 255, 0.02);

        border: 1px solid var(--border);
        border-radius: 12px;
    }


    .users-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 15px;

        padding: 8px 0;

        border: 0;
    }


    .users-table td:first-child {
        justify-content: flex-start;

        padding-top: 0;
        padding-bottom: 12px;

        border-bottom:
            1px solid var(--border);
    }


    .users-table td:last-child {
        justify-content: stretch;

        padding-top: 12px;
    }


    .users-table td:last-child button {
        width: 100%;
    }


    .user-cell {
        align-items: center;
    }


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


    .modal-backdrop {
        align-items: end;

        padding: 0;
    }


    .modal-card,
    .modal-card-small {
        width: 100%;
        max-height: 92vh;

        padding: 20px 17px;

        border-radius:
            18px 18px 0 0;
    }


    .modal-actions {
        flex-direction: column-reverse;
    }


    .modal-actions button {
        width: 100%;
    }


    .form-stack input,
    .form-stack select {
        width: 100%;
        min-height: 44px;
    }


    .auth-card {
        width: 100%;
    }
}


/* =========================================================
   VERY SMALL MOBILE
========================================================= */

@media (max-width: 430px) {

    .nav {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }


    .topbar-actions {
        gap: 10px;
    }


    .user-card {
        min-width: 0;
    }


    .kpi-card {
        padding: 16px;
    }


    .kpi-value {
        font-size: 27px;
    }
}


/* =========================================================
   USER ACTIONS v0.6.0
========================================================= */

.user-row-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.user-row-actions button {
    padding: 7px 9px;
    white-space: nowrap;
    font-size: 10px;
}

.user-row-actions button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

@media (max-width: 760px) {

    .user-row-actions {
        width: 100%;

        display: grid;
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .user-row-actions button {
        width: 100%;
        min-height: 40px;
    }
}

@media (max-width: 430px) {

    .user-row-actions {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   APPEARANCE CONTROLS v0.6.0
========================================================= */

.appearance-color-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 12px;
}


.appearance-color-grid label {
    min-width: 0;
}


input[type="color"] {
    width: 100%;
    height: 44px;

    padding: 4px;

    cursor: pointer;
}


.appearance-range {
    display: flex;
    flex-direction: column;

    gap: 8px;
}


.appearance-range > div {
    display: flex;
    justify-content: space-between;
    align-items: center;

    gap: 16px;
}


.appearance-range span {
    color: var(--muted);

    font-size: 11px;
}


.appearance-range strong {
    color: var(--text);

    font-size: 11px;
}


.appearance-range input[type="range"] {
    width: 100%;

    padding: 0;

    accent-color: var(--blue);
}


.profile-appearance-form {
    margin-top: 18px;
}


#appearance-reset {
    align-self: flex-start;

    margin-top: 4px;
}


@media (max-width: 760px) {

    .appearance-color-grid {
        grid-template-columns: 1fr;
    }


    input[type="color"] {
        min-height: 48px;
    }


    .appearance-range {
        gap: 10px;
    }


    #appearance-reset {
        width: 100%;
        min-height: 44px;
    }
}


/* =========================================================
   GLOBAL BRANDING v0.6.0
========================================================= */

.global-branding-controls {
    display: flex;
    flex-direction: column;
    gap: 18px;

    margin-top: 22px;
    padding-top: 22px;

    border-top:
        1px solid
        rgba(255, 255, 255, 0.08);
}


.global-branding-heading {
    display: flex;
    flex-direction: column;
    gap: 5px;
}


.global-branding-heading strong {
    font-size: 15px;
    font-weight: 700;
}


.global-branding-heading span {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}


.branding-background-preview {
    position: relative;

    width: 100%;
    min-height: 180px;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;

    border-radius: 14px;

    border:
        1px solid
        rgba(255, 255, 255, 0.09);

    background-color:
        rgba(255, 255, 255, 0.025);

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}


.branding-background-preview span {
    padding: 20px;

    color: var(--muted);
    font-size: 13px;

    text-align: center;
}


.branding-file-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}


.branding-file-actions button {
    min-width: 150px;
}


#branding-login-background-file {
    display: block;

    width: 100%;
    margin-top: 8px;

    color: var(--text);
}


#branding-login-background-file::file-selector-button {
    margin-right: 12px;

    padding: 8px 12px;

    border: 0;
    border-radius: 8px;

    cursor: pointer;

    background: var(--blue);
    color: white;
}


html[data-theme="light"]
.global-branding-controls {
    border-top-color:
        rgba(0, 0, 0, 0.08);
}


html[data-theme="light"]
.branding-background-preview {
    border-color:
        rgba(0, 0, 0, 0.10);

    background-color:
        rgba(0, 0, 0, 0.025);
}


@media (max-width: 720px) {

    .branding-background-preview {
        min-height: 140px;
    }


    .branding-file-actions {
        flex-direction: column;
    }


    .branding-file-actions button {
        width: 100%;
    }

}


/* =========================================================
   PROFILE AVATAR v0.6.0
========================================================= */

.profile-avatar-controls {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 18px;
}

.profile-avatar-controls input[type="file"] {
    width: 100%;
    box-sizing: border-box;
}

.profile-avatar-controls
input[type="file"]::file-selector-button {
    margin-right: 12px;
    padding: 9px 14px;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
}

.profile-avatar-preview {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 92px;
}

.profile-avatar-preview .avatar {
    width: 82px;
    height: 82px;
    min-width: 82px;
    border-radius: 50%;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    overflow: hidden;
}

.avatar.avatar-image {
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.profile-avatar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.profile-avatar-actions button {
    min-width: 150px;
}


@media (max-width: 720px) {

    .profile-avatar-preview {
        justify-content: center;
    }

    .profile-avatar-actions {
        flex-direction: column;
    }

    .profile-avatar-actions button {
        width: 100%;
    }
}



/* =========================================================
   REPOSITORIES v0.7.0
========================================================= */

.repository-summary {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 12px;

    margin-bottom: 20px;
}


.repository-summary-card {
    display: flex;
    flex-direction: column;
    gap: 7px;

    min-width: 0;

    padding: 15px 17px;

    background:
        rgba(255, 255, 255, 0.025);

    border:
        1px solid var(--border);

    border-radius: 12px;
}


.repository-summary-card span {
    color: var(--muted);

    font-size: 11px;
    font-weight: 600;

    text-transform: uppercase;
    letter-spacing: 0.04em;
}


.repository-summary-card strong {
    color: var(--text);

    font-size: 21px;
    font-weight: 700;
}


.repository-summary-card strong.success {
    color: var(--success);
}


.repository-summary-card strong.danger {
    color: var(--danger);
}


.repository-field-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 12px;
}


.repository-type-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;

    padding: 15px;

    background:
        rgba(255, 255, 255, 0.018);

    border:
        1px solid var(--border);

    border-radius: 12px;
}


.repository-type-fields.hidden {
    display: none;
}


.repository-row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;

    gap: 6px;
}


.repository-row-actions button {
    padding: 7px 9px;

    white-space: nowrap;

    font-size: 10px;
}


.repository-capacity {
    min-width: 130px;
}


.repository-capacity-value {
    display: flex;
    justify-content: space-between;

    gap: 10px;

    margin-bottom: 6px;

    color: var(--muted);

    font-size: 10px;
}


.repository-capacity-bar {
    height: 5px;

    overflow: hidden;

    background:
        rgba(255, 255, 255, 0.07);

    border-radius: 999px;
}


.repository-capacity-bar > span {
    display: block;

    width: 0;
    height: 100%;

    background: var(--blue);

    border-radius: inherit;
}


.form-hint {
    margin: 0;

    color: var(--muted);

    font-size: 11px;
    line-height: 1.6;
}


@media (max-width: 1050px) {

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

}


@media (max-width: 760px) {

    .repository-summary {
        grid-template-columns: 1fr;
    }


    .repository-field-grid {
        grid-template-columns: 1fr;
    }


    .repositories-table,
    .repositories-table tbody,
    .repositories-table tr,
    .repositories-table td {
        display: block;

        width: 100%;
    }


    .repositories-table thead {
        display: none;
    }


    .repositories-table tr {
        margin-bottom: 12px;
        padding: 14px;

        background:
            rgba(255, 255, 255, 0.02);

        border:
            1px solid var(--border);

        border-radius: 12px;
    }


    .repositories-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;

        gap: 15px;

        padding: 8px 0;

        border: 0;
    }


    .repositories-table td:first-child {
        justify-content: flex-start;

        padding-top: 0;
        padding-bottom: 12px;

        border-bottom:
            1px solid var(--border);
    }


    .repositories-table td:last-child {
        padding-top: 12px;
    }


    .repository-row-actions {
        width: 100%;

        display: grid;
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }


    .repository-row-actions button {
        width: 100%;
        min-height: 40px;
    }


    .repository-capacity {
        width: 100%;
    }

}


@media (max-width: 430px) {

    .repository-row-actions {
        grid-template-columns: 1fr;
    }

}



/* =========================================================
   TNN BRAND + MODERN NAV ICONS v0.7.0
========================================================= */

.brand-shield {
    display: flex;
    align-items: center;
    justify-content: center;
}


.brand-shield svg {
    width: 27px;
    height: 27px;

    fill:
        rgba(79, 140, 255, 0.16);

    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}


.brand-shield-check {
    fill: none;
    stroke-width: 2;
}


.auth-brand-icon.brand-shield svg {
    width: 31px;
    height: 31px;
}


.nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}


.nav-icon svg {
    width: 17px;
    height: 17px;

    fill: none;

    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}


/* =========================================================
   DASHBOARD STORAGE v0.7.0
========================================================= */

.storage-overview-panel,
.repository-dashboard-panel {
    min-height: 280px;
}


.storage-total-layout {
    display: flex;
    align-items: center;

    gap: 28px;

    min-height: 190px;
}


.storage-ring {
    --storage-used: 0%;

    width: 145px;
    height: 145px;

    flex: 0 0 auto;

    display: grid;
    place-items: center;

    border-radius: 50%;

    background:
        conic-gradient(
            var(--blue)
                0 var(--storage-used),
            rgba(255, 255, 255, 0.10)
                var(--storage-used) 100%
        );

    position: relative;
}


.storage-ring::after {
    content: "";

    position: absolute;
    inset: 15px;

    border-radius: 50%;

    background: var(--panel);
}


.storage-ring > div {
    position: relative;
    z-index: 1;

    display: flex;
    flex-direction: column;
    align-items: center;

    text-align: center;
}


.storage-ring strong {
    color: var(--text);

    font-size: 19px;
    font-weight: 750;
}


.storage-ring span {
    margin-top: 3px;

    color: var(--muted);

    font-size: 10px;
}


.storage-legend {
    flex: 1;

    display: flex;
    flex-direction: column;

    gap: 14px;
}


.storage-legend > div {
    display: grid;
    grid-template-columns:
        10px minmax(0, 1fr) auto;

    align-items: center;

    gap: 9px;

    color: var(--muted);

    font-size: 12px;
}


.storage-legend strong {
    color: var(--text);

    font-size: 12px;
}


.storage-dot {
    width: 8px;
    height: 8px;

    border-radius: 50%;
}


.storage-dot.used {
    background: var(--blue);
}


.storage-dot.free {
    background:
        rgba(255, 255, 255, 0.28);
}


.storage-dot.unknown {
    background: var(--accent-secondary);
}


.dashboard-repository-list {
    display: flex;
    flex-direction: column;

    gap: 5px;
}


.dashboard-repository-item {
    display: flex;
    align-items: center;

    gap: 11px;

    padding: 10px 0;

    border-bottom:
        1px solid var(--border);
}


.dashboard-repository-item:last-child {
    border-bottom: 0;
}


.dashboard-repository-icon {
    width: 34px;
    height: 34px;

    flex: 0 0 auto;

    display: grid;
    place-items: center;

    color: var(--blue);

    background:
        rgba(79, 140, 255, 0.08);

    border:
        1px solid
        rgba(79, 140, 255, 0.16);

    border-radius: 9px;
}


.dashboard-repository-icon svg {
    width: 17px;
    height: 17px;

    fill: none;

    stroke: currentColor;
    stroke-width: 1.6;
}


.dashboard-repository-main {
    flex: 1;
    min-width: 0;
}


.dashboard-repository-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;

    gap: 12px;

    margin-bottom: 8px;
}


.dashboard-repository-heading > div:first-child {
    min-width: 0;

    display: flex;
    flex-direction: column;

    gap: 2px;
}


.dashboard-repository-heading strong {
    overflow: hidden;

    color: var(--text);

    font-size: 12px;

    text-overflow: ellipsis;
    white-space: nowrap;
}


.dashboard-repository-heading span {
    color: var(--muted);

    font-size: 10px;
}


.dashboard-repository-capacity {
    display: grid;
    grid-template-columns:
        minmax(90px, 1fr)
        auto
        34px;

    align-items: center;

    gap: 10px;

    color: var(--muted);

    font-size: 10px;
}


.dashboard-repository-capacity strong {
    color: var(--text);

    text-align: right;

    font-size: 10px;
}


.dashboard-repository-empty {
    padding: 28px 0;

    color: var(--muted);

    text-align: center;

    font-size: 12px;
}


/* Repository table readability */

.repositories-table th {
    font-size: 10px;
}


.repositories-table td {
    font-size: 12px;
}


.repository-capacity-value {
    font-size: 11px;
}


.repository-row-actions button {
    font-size: 11px;
}


/* Responsive storage */

@media (max-width: 1050px) {

    .storage-total-layout {
        align-items: flex-start;
    }

}


@media (max-width: 760px) {

    .storage-total-layout {
        flex-direction: column;
        align-items: center;
    }


    .storage-legend {
        width: 100%;
    }


    .dashboard-repository-capacity {
        grid-template-columns:
            minmax(70px, 1fr)
            auto;
    }


    .dashboard-repository-capacity strong {
        display: none;
    }

}



/* =========================================================
   TNN SHIELD v2
========================================================= */

.brand-shield svg {
    width: 29px;
    height: 32px;

    overflow: visible;

    fill: none;

    stroke-linecap: round;
    stroke-linejoin: round;
}


.auth-brand-icon.brand-shield svg {
    width: 33px;
    height: 37px;
}


.tnn-shield-outer {
    fill:
        rgba(79, 140, 255, 0.18);

    stroke: var(--blue);

    stroke-width: 1.8;
}


.tnn-shield-inner {
    fill:
        rgba(79, 140, 255, 0.07);

    stroke:
        rgba(255, 255, 255, 0.82);

    stroke-width: 1.2;
}


.tnn-shield-mark {
    fill: none;

    stroke: #ffffff;

    stroke-width: 2.1;
}


/* =========================================================
   SIDEBAR STORAGE
========================================================= */

.sidebar-storage {
    margin-top: auto;
    margin-bottom: 14px;

    padding: 15px 13px;

    background:
        rgba(255, 255, 255, 0.025);

    border:
        1px solid var(--border);

    border-radius: 13px;
}


.sidebar-storage-title {
    margin-bottom: 13px;

    color: var(--text);

    font-size: 11px;
    font-weight: 700;
}


.sidebar-storage-ring {
    --storage-used: 0%;

    width: 110px;
    height: 110px;

    margin: 0 auto 15px;

    display: grid;
    place-items: center;

    position: relative;

    border-radius: 50%;

    background:
        conic-gradient(
            var(--blue)
                0 var(--storage-used),
            rgba(255, 255, 255, 0.10)
                var(--storage-used) 100%
        );
}


.sidebar-storage-ring::after {
    content: "";

    position: absolute;
    inset: 13px;

    border-radius: 50%;

    background: var(--sidebar-color);
}


.sidebar-storage-ring > div {
    position: relative;
    z-index: 1;

    display: flex;
    flex-direction: column;

    align-items: center;

    text-align: center;
}


.sidebar-storage-ring strong {
    color: var(--text);

    font-size: 15px;
    font-weight: 750;
}


.sidebar-storage-ring span {
    margin-top: 2px;

    color: var(--muted);

    font-size: 8px;
}


.sidebar-storage-legend {
    display: flex;
    flex-direction: column;

    gap: 8px;
}


.sidebar-storage-legend > div {
    display: grid;

    grid-template-columns:
        7px minmax(0, 1fr) auto;

    align-items: center;

    gap: 6px;

    font-size: 9px;
}


.sidebar-storage-legend span {
    color: var(--muted);
}


.sidebar-storage-legend strong {
    color: var(--text);

    font-size: 9px;
}


.sidebar-storage-dot {
    width: 6px;
    height: 6px;

    border-radius: 50%;
}


.sidebar-storage-dot.used {
    background: var(--blue);
}


.sidebar-storage-dot.free {
    background:
        rgba(255, 255, 255, 0.30);
}


.sidebar-storage-dot.repositories {
    background: var(--accent-secondary);
}


/* Hide old dashboard storage-total styles safely */

.storage-overview-panel {
    display: none;
}


/* =========================================================
   SIDEBAR HEIGHT / SCROLL
========================================================= */

.sidebar {
    display: flex;
    flex-direction: column;
}


.nav {
    flex: 0 0 auto;
}


.sidebar-footer {
    margin-top: 0;
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 980px) {

    .sidebar-storage {
        display: none;
    }

}



/* =========================================================
   TNN BACKUP CLOUD BRAND v0.7.0
========================================================= */

.brand-cloud-icon {
    width: 48px;
    height: 38px;

    flex: 0 0 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    color: inherit;

    background: transparent !important;

    border: 0 !important;
    border-radius: 0 !important;

    box-shadow: none !important;

    overflow: visible;
}


.brand-cloud-icon img {
    display: block;

    width: 48px;
    height: 38px;

    object-fit: contain;

    object-position: center;

    background: transparent;
}


/* Login leggermente più grande */

.auth-brand-icon.brand-cloud-icon {
    width: 54px;
    height: 43px;

    flex-basis: 54px;
}


.auth-brand-icon.brand-cloud-icon img {
    width: 54px;
    height: 43px;
}


/* Mantiene logo e testo ben allineati */

.brand,
.auth-brand {
    align-items: center;
}


/* Mobile */

@media (max-width: 760px) {

    .brand-cloud-icon {
        width: 42px;
        height: 33px;

        flex-basis: 42px;
    }


    .brand-cloud-icon img {
        width: 42px;
        height: 33px;
    }


    .auth-brand-icon.brand-cloud-icon {
        width: 50px;
        height: 39px;

        flex-basis: 50px;
    }


    .auth-brand-icon.brand-cloud-icon img {
        width: 50px;
        height: 39px;
    }

}



/* =========================================================
   REPOSITORY HEALTH CHECK
========================================================= */

.repository-health-panel {
    display: flex;
    flex-direction: column;

    gap: 14px;

    padding: 16px;

    border:
        1px solid var(--border);

    border-radius: 12px;

    background:
        rgba(255, 255, 255, 0.025);
}


.repository-health-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 18px;
}


.repository-health-header > div {
    display: flex;
    flex-direction: column;

    gap: 4px;
}


.repository-health-header strong {
    color: var(--text);

    font-size: 13px;
    font-weight: 700;
}


.repository-health-header span {
    color: var(--muted);

    font-size: 11px;
    line-height: 1.45;
}


.repository-health-switch {
    display: flex;
    align-items: center;

    gap: 7px;

    flex: 0 0 auto;

    cursor: pointer;
}


.repository-health-switch span {
    color: var(--text);

    font-size: 11px;
    font-weight: 650;
}


.repository-health-settings {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        minmax(150px, 0.42fr);

    gap: 12px;

    transition:
        opacity 0.15s ease;
}


.repository-health-settings.repository-health-disabled {
    opacity: 0.45;
}


.repository-health-current {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 10px;

    padding-top: 12px;

    border-top:
        1px solid var(--border);
}


.repository-health-current > div {
    display: flex;
    flex-direction: column;

    gap: 3px;
}


.repository-health-current span {
    color: var(--muted);

    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.045em;
}


.repository-health-current strong {
    color: var(--text);

    font-size: 11px;
    font-weight: 650;
}


/* Table */

.repository-last-test {
    display: flex;
    flex-direction: column;

    gap: 3px;

    margin-bottom: 7px;
}


.repository-last-test strong {
    font-size: 11px;
    font-weight: 650;
}


.repository-last-test span {
    max-width: 250px;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    color: var(--muted);

    font-size: 9px;
}


.repository-health-table {
    display: flex;
    flex-direction: column;

    align-items: flex-start;

    gap: 3px;
}


.repository-health-state {
    display: inline-flex;
    align-items: center;

    min-height: 19px;

    padding: 2px 7px;

    border-radius: 999px;

    font-size: 9px;
    font-weight: 700;
}


.repository-health-state.success {
    color: var(--success);

    background:
        rgba(43, 197, 120, 0.10);

    border:
        1px solid
        rgba(43, 197, 120, 0.18);
}


.repository-health-state.error {
    color: var(--danger);

    background:
        rgba(255, 91, 113, 0.10);

    border:
        1px solid
        rgba(255, 91, 113, 0.18);
}


.repository-health-state.pending {
    color: var(--warning);

    background:
        rgba(255, 190, 72, 0.10);

    border:
        1px solid
        rgba(255, 190, 72, 0.18);
}


.repository-health-state.disabled {
    color: var(--muted);

    background:
        rgba(255, 255, 255, 0.035);

    border:
        1px solid var(--border);
}


.repository-health-agent,
.repository-health-next {
    color: var(--muted);

    font-size: 9px;
}


/* Responsive */

@media (max-width: 760px) {

    .repository-health-header {
        flex-direction: column;
    }


    .repository-health-settings {
        grid-template-columns:
            1fr;
    }


    .repository-health-current {
        grid-template-columns:
            1fr;
    }

}
