:root {
    color-scheme: dark;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #08101a;
    color: #eaf0f8;
    --surface: rgba(17, 28, 44, .88);
    --surface-strong: #111c2c;
    --surface-soft: rgba(255, 255, 255, .045);
    --border: rgba(255, 255, 255, .09);
    --border-strong: #31445f;
    --text-muted: #9eafc4;
    --accent: #5b9cff;
    --accent-2: #7768ff;
    --success: #4bd494;
    --warning: #f1b45a;
    --danger: #ff8088;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 8% 0%, rgba(37, 86, 149, .34), transparent 36%),
        radial-gradient(circle at 92% 12%, rgba(99, 72, 196, .20), transparent 28%),
        linear-gradient(160deg, #0a121e 0%, #070b12 100%);
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }

.topbar {
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 10px 30px;
    border-bottom: 1px solid var(--border);
    background: rgba(7, 12, 20, .86);
    backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 20;
}
.topbar-main, .topbar-actions, .main-nav { display: flex; align-items: center; }
.topbar-main { gap: 34px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 11px; font-size: 1.12rem; font-weight: 760; white-space: nowrap; }
.brand-mark {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: linear-gradient(145deg, var(--accent), var(--accent-2));
    box-shadow: 0 8px 24px rgba(65, 126, 255, .25);
}
.main-nav { gap: 5px; }
.main-nav a, .link-button {
    border: 0;
    background: transparent;
    color: #c9d5e5;
    cursor: pointer;
    padding: 9px 11px;
    border-radius: 9px;
    transition: background .15s ease, color .15s ease;
}
.main-nav a:hover, .main-nav a.active, .link-button:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.main-nav a.active { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05); }
.topbar-actions { gap: 8px; white-space: nowrap; }
.topbar-actions form { margin: 0; }
.user-label { color: var(--text-muted); font-size: .9rem; margin: 0 2px 0 5px; }
.role-badge, .status-badge, .draft-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: .74rem;
    font-weight: 750;
}
.role-badge { color: #bcd5ff; background: rgba(68, 125, 231, .14); border: 1px solid rgba(83, 142, 249, .24); }

.page-shell { max-width: 1280px; margin: 0 auto; padding: 34px 28px 70px; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card, .content-card, .hero-panel, .search-panel, .category-panel, .metric-card, .article-page {
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: 0 22px 60px rgba(0, 0, 0, .25);
    border-radius: 18px;
}
.login-card { width: min(430px, 100%); padding: 32px; }
.login-heading { display: flex; gap: 14px; align-items: center; margin-bottom: 28px; }
.logo-mark { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: linear-gradient(145deg, var(--accent), var(--accent-2)); font-weight: 800; font-size: 1.25rem; }
h1, h2, h3, p { margin-top: 0; }
h1 { letter-spacing: -.035em; }
h2, h3 { letter-spacing: -.018em; }
.login-heading h1 { margin-bottom: 3px; }
.login-heading p, .muted, .field-help { color: var(--text-muted); }
label { display: block; margin: 0 0 7px; color: #d5dfec; font-size: .9rem; font-weight: 650; }
input[type="text"], input[type="password"], input[type="search"], input[type="number"], input[type="file"], textarea, select {
    width: 100%;
    border: 1px solid var(--border-strong);
    background: #0b1523;
    color: #f5f8fc;
    border-radius: 10px;
    padding: 11px 12px;
    outline: none;
}
textarea { resize: vertical; line-height: 1.55; }
select { min-height: 44px; }
input:focus, textarea:focus, select:focus { border-color: #6ba9ff; box-shadow: 0 0 0 3px rgba(70, 137, 255, .15); }
.checkbox-row { display: flex; align-items: center; gap: 9px; margin: 18px 0; }
.checkbox-row input { width: 17px; height: 17px; }
.primary-button, .secondary-button {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    padding: 10px 16px;
    cursor: pointer;
    font-weight: 720;
    border: 1px solid transparent;
}
.primary-button { width: 100%; color: white; background: linear-gradient(135deg, #3a8dff, #6c63ff); }
.primary-button:hover { filter: brightness(1.07); }
.primary-button.compact { width: auto; min-width: 140px; }
.secondary-button { background: rgba(255, 255, 255, .045); border-color: rgba(255, 255, 255, .12); color: #dce6f3; }
.secondary-button:hover { background: rgba(255, 255, 255, .08); }
.text-link, .danger-link { border: 0; background: transparent; padding: 3px; cursor: pointer; font-weight: 680; }
.text-link { color: #83b7ff; }
.danger-link { color: var(--danger); }
.validation-summary, .field-error { color: #ff9a9a; font-size: .86rem; }
.validation-summary:empty, .field-error:empty { display: none; }
.success-message, .error-message { margin: 0 0 18px; padding: 12px 14px; border-radius: 11px; }
.success-message { background: rgba(57, 196, 131, .12); color: #8ce8bd; border: 1px solid rgba(57, 196, 131, .28); }
.error-message { background: rgba(237, 88, 97, .12); color: #ffadb2; border: 1px solid rgba(237, 88, 97, .28); }

.hero-panel { display: flex; justify-content: space-between; align-items: center; gap: 28px; padding: 34px; margin-bottom: 20px; }
.hero-panel h1 { font-size: clamp(2rem, 4vw, 3.15rem); margin-bottom: 10px; }
.eyebrow { color: #7fb6ff; text-transform: uppercase; letter-spacing: .16em; font-size: .72rem; font-weight: 820; margin-bottom: 9px; }
.hero-copy { max-width: 720px; color: #aab9cc; line-height: 1.62; }
.hero-actions, .heading-actions, .form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.hero-actions { margin-top: 22px; }
.status-pill { white-space: nowrap; padding: 10px 13px; border-radius: 999px; background: rgba(43, 188, 118, .11); color: #8de3b7; border: 1px solid rgba(43, 188, 118, .25); }
.status-pill span { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: #42d68a; box-shadow: 0 0 10px rgba(66, 214, 138, .8); }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 20px; }
.metric-card { padding: 20px; }
.metric-card strong { display: block; font-size: 1.85rem; margin-top: 7px; }
.metric-label { color: var(--text-muted); font-size: .85rem; }
.dashboard-sections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.content-card { padding: 24px; }
.wide-card { grid-column: 1 / -1; }
.section-heading, .page-heading, .article-card-topline, .article-header, .article-info-bar, .attachment-row, .category-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}
.section-heading { margin-bottom: 17px; }
.section-heading h2 { margin-bottom: 0; }
.article-list { display: grid; }
.article-row { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 14px 0; border-top: 1px solid var(--border); }
.article-row:first-child { border-top: 0; padding-top: 0; }
.article-row:last-child { padding-bottom: 0; }
.article-row div { min-width: 0; }
.article-row strong { display: block; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; }
.article-row time, .view-count { color: var(--text-muted); font-size: .82rem; white-space: nowrap; }
.article-category { color: #85b8ff; font-size: .76rem; font-weight: 720; }
.update-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.update-card { padding: 16px; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 13px; min-width: 0; }
.update-card strong { display: block; margin: 7px 0; }
.update-card p { color: var(--text-muted); font-size: .88rem; line-height: 1.5; min-height: 42px; }
.update-card small { color: #8192a8; }

.page-heading { margin-bottom: 20px; }
.page-heading h1 { font-size: clamp(1.8rem, 3vw, 2.6rem); margin-bottom: 7px; }
.page-heading p { margin-bottom: 0; color: var(--text-muted); }
.compact-heading { align-items: flex-end; }
.search-panel { padding: 20px; margin-bottom: 18px; }
.search-input-wrap { position: relative; }
.search-input-wrap span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #7e91a9; font-size: 1.3rem; }
.search-input-wrap input { padding-left: 43px; font-size: 1rem; }
.search-hint { color: #7f91a7; margin: 8px 0 0; font-size: .8rem; }
.knowledge-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 18px; align-items: start; }
.category-panel { padding: 20px; position: sticky; top: 92px; }
.category-heading { margin-bottom: 16px; }
.category-heading h2 { margin: 0; font-size: 1.05rem; }
.category-heading a { color: #83b7ff; font-size: .83rem; }
.category-tree, .category-group { display: grid; gap: 6px; }
.category-group { padding: 12px 0; border-top: 1px solid var(--border); }
.category-group:first-child { border-top: 0; padding-top: 0; }
.category-root, .category-child { border-radius: 8px; padding: 8px 9px; }
.category-root { font-weight: 730; }
.category-child { color: #aebdd0; padding-left: 22px; font-size: .9rem; }
.category-root:hover, .category-child:hover, .category-root.selected, .category-child.selected { background: rgba(83, 143, 246, .11); color: #dceaff; }
.category-group p { color: #8092a8; font-size: .78rem; line-height: 1.4; margin: 0 9px 4px; }
.knowledge-results { min-width: 0; }
.result-count { min-width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: rgba(255, 255, 255, .06); color: #b9c8d9; font-weight: 760; }
.article-card-list { display: grid; gap: 12px; }
.article-card { display: block; padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 15px; transition: transform .15s ease, border-color .15s ease, background .15s ease; }
.article-card:hover { transform: translateY(-2px); border-color: rgba(99, 158, 255, .34); background: rgba(21, 34, 53, .96); }
.article-card h3 { margin: 10px 0 8px; font-size: 1.18rem; }
.article-card p { color: var(--text-muted); line-height: 1.55; margin-bottom: 15px; }
.article-card footer { display: flex; justify-content: space-between; gap: 15px; color: #7f91a8; font-size: .79rem; }
.empty-state { color: var(--text-muted); margin: 0; }
.empty-state.boxed { padding: 30px; border: 1px dashed rgba(255, 255, 255, .14); border-radius: 14px; text-align: center; }

.breadcrumb { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; color: #91a4bb; font-size: .86rem; }
.breadcrumb a:hover { color: #d7e6fa; }
.article-page { padding: 34px; }
.article-header { align-items: flex-start; }
.article-header h1 { font-size: clamp(2rem, 4vw, 3.2rem); margin: 10px 0 12px; }
.article-meta-row { display: flex; align-items: center; gap: 10px; }
.draft-badge, .status-badge.draft { color: #f2c57f; background: rgba(225, 158, 57, .12); border: 1px solid rgba(225, 158, 57, .27); }
.status-badge.published { color: #8ee5b9; background: rgba(58, 190, 126, .12); border: 1px solid rgba(58, 190, 126, .27); }
.article-lead { color: #adbed2; font-size: 1.05rem; line-height: 1.62; max-width: 850px; }
.article-info-bar { justify-content: flex-start; flex-wrap: wrap; margin: 26px 0; padding: 13px 15px; background: rgba(255, 255, 255, .035); border: 1px solid var(--border); border-radius: 11px; color: #91a3b9; font-size: .82rem; }
.article-info-bar strong { color: #dce6f2; }
.article-content { color: #e0e8f2; line-height: 1.76; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 1rem; }
.keyword-section, .attachment-section { margin-top: 32px; padding-top: 26px; border-top: 1px solid var(--border); }
.keyword-section h2, .attachment-section h2 { font-size: 1.05rem; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { padding: 7px 10px; border-radius: 999px; background: rgba(84, 143, 242, .10); border: 1px solid rgba(84, 143, 242, .22); color: #a9cbff; font-size: .82rem; }
.attachment-list { display: grid; gap: 8px; }
.attachment-row { padding: 13px 14px; border: 1px solid var(--border); border-radius: 11px; background: rgba(255, 255, 255, .025); }
.attachment-row:hover { background: rgba(255, 255, 255, .045); }
.attachment-row strong { display: block; }
.attachment-row div span { display: block; color: var(--text-muted); font-size: .78rem; margin-top: 3px; }

.table-card { padding: 0; overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { text-align: left; padding: 15px 17px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table th { color: #8395ab; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; background: rgba(255, 255, 255, .025); }
.data-table td { font-size: .88rem; color: #cfd9e6; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.table-subtext { display: block; color: #8092a8; font-size: .78rem; margin-top: 4px; max-width: 460px; }
.table-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; white-space: nowrap; }
.table-actions form { margin: 0; }
.filter-bar { display: grid; grid-template-columns: minmax(220px, 1fr) 210px auto; gap: 10px; margin-bottom: 15px; }
.editor-form { display: grid; gap: 20px; }
.form-grid { display: grid; gap: 16px; }
.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-field { min-width: 0; }
.form-field label { margin-bottom: 7px; }
.field-help { display: block; margin-top: 6px; font-size: .78rem; }
.content-editor { min-height: 390px; font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace; font-size: .9rem; }
.toggle-field { display: flex; align-items: center; gap: 12px; margin: 23px 0 0; padding: 12px; border: 1px solid var(--border); border-radius: 11px; background: rgba(255, 255, 255, .025); }
.toggle-field input { width: 18px; height: 18px; }
.toggle-field strong, .toggle-field small { display: block; }
.toggle-field small { color: var(--text-muted); margin-top: 3px; }
.form-actions { padding-top: 3px; }
.attachment-admin-card { margin-top: 18px; }
.upload-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; margin-bottom: 18px; }
.admin-attachments .attachment-row:hover { background: rgba(255, 255, 255, .025); }

.narrow-card { max-width: 620px; margin: 0 auto; }
.narrow-card .primary-button { margin-top: 20px; width: auto; min-width: 190px; }

@media (max-width: 1000px) {
    .topbar { align-items: flex-start; }
    .topbar-main { align-items: flex-start; flex-direction: column; gap: 8px; }
    .main-nav { flex-wrap: wrap; }
    .metric-grid { grid-template-columns: repeat(2, 1fr); }
    .update-grid { grid-template-columns: 1fr; }
    .knowledge-layout { grid-template-columns: 240px minmax(0, 1fr); }
    .data-table { min-width: 900px; }
    .table-card { overflow-x: auto; }
}

@media (max-width: 760px) {
    .topbar { position: static; padding: 12px 16px; flex-direction: column; gap: 8px; }
    .topbar-main { width: 100%; }
    .topbar-actions { width: 100%; overflow-x: auto; }
    .user-label, .role-badge { display: none; }
    .page-shell { padding: 24px 15px 46px; }
    .hero-panel, .page-heading, .article-header { align-items: flex-start; flex-direction: column; padding: 24px; }
    .page-heading { padding: 0; }
    .metric-grid, .dashboard-sections, .two-columns { grid-template-columns: 1fr; }
    .wide-card { grid-column: auto; }
    .knowledge-layout { grid-template-columns: 1fr; }
    .category-panel { position: static; }
    .article-page { padding: 23px; }
    .article-info-bar { align-items: flex-start; flex-direction: column; gap: 6px; }
    .filter-bar, .upload-form { grid-template-columns: 1fr; }
    .article-card footer, .article-row { align-items: flex-start; flex-direction: column; }
    .article-row { gap: 7px; }
}

/* Portal v0.3.0: amministrazione, API e dati tool */
.nav-dropdown { position: relative; }
.nav-dropdown summary { list-style: none; cursor: pointer; padding: 9px 11px; border-radius: 9px; color: #9eafc3; font-size: .9rem; font-weight: 650; user-select: none; }
.nav-dropdown summary::-webkit-details-marker { display: none; }
.nav-dropdown summary::after { content: "▾"; margin-left: 7px; font-size: .7rem; opacity: .75; }
.nav-dropdown summary:hover, .nav-dropdown summary.active, .nav-dropdown[open] summary { color: #edf4ff; background: rgba(92, 151, 249, .12); }
.nav-dropdown-menu { position: absolute; top: calc(100% + 8px); left: 0; z-index: 50; min-width: 230px; display: grid; gap: 4px; padding: 8px; background: #101b2b; border: 1px solid rgba(255, 255, 255, .11); border-radius: 12px; box-shadow: 0 18px 40px rgba(0, 0, 0, .35); }
.nav-dropdown-menu a { padding: 10px 11px; border-radius: 8px; color: #b9c8d9; }
.nav-dropdown-menu a:hover { color: #eef5ff; background: rgba(92, 151, 249, .12); }
.admin-menu { min-width: 250px; }

.heading-stat { min-width: 150px; padding: 16px 18px; text-align: right; border: 1px solid var(--border); border-radius: 13px; background: rgba(255, 255, 255, .025); }
.heading-stat span { display: block; color: var(--text-muted); font-size: .78rem; }
.heading-stat strong { display: block; margin-top: 4px; font-size: 1.7rem; }
.heading-actions { display: flex; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.inline-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.mini-badge { display: inline-flex; align-items: center; min-height: 25px; padding: 4px 8px; border-radius: 999px; color: #b7cdf0; background: rgba(75, 131, 220, .10); border: 1px solid rgba(87, 147, 242, .2); font-size: .74rem; font-weight: 700; }
.field-label { display: block; margin-bottom: 7px; color: #d8e3ef; font-weight: 700; font-size: .88rem; }
.info-field { padding: 13px 15px; border: 1px solid var(--border); border-radius: 11px; background: rgba(255, 255, 255, .025); }
.info-field p { color: var(--text-muted); margin: 0; }
.permission-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.role-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.permission-option { display: flex; align-items: flex-start; gap: 11px; padding: 15px; border: 1px solid var(--border); border-radius: 12px; background: rgba(255, 255, 255, .025); cursor: pointer; }
.permission-option:hover { border-color: rgba(101, 160, 255, .32); background: rgba(77, 135, 224, .055); }
.permission-option.disabled { opacity: .72; cursor: default; }
.permission-option input { width: 18px; height: 18px; margin-top: 2px; flex: 0 0 auto; }
.permission-option span { min-width: 0; }
.permission-option strong, .permission-option small, .permission-option code { display: block; }
.permission-option small { margin-top: 4px; color: var(--text-muted); line-height: 1.4; }
.permission-option code { margin-top: 8px; color: #7f98b8; font-size: .72rem; overflow-wrap: anywhere; }

.api-endpoint-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.endpoint-card { min-width: 0; }
.endpoint-heading { display: flex; align-items: center; gap: 9px; margin-bottom: 13px; }
.endpoint-card > code { display: block; padding: 11px 12px; border-radius: 9px; color: #a9ccff; background: rgba(0, 0, 0, .2); border: 1px solid rgba(255, 255, 255, .07); overflow-wrap: anywhere; font-size: .8rem; }
.endpoint-card p { color: var(--text-muted); margin: 12px 0 0; line-height: 1.5; font-size: .86rem; }
.method-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 46px; padding: 5px 7px; border-radius: 7px; font-size: .68rem; font-weight: 850; letter-spacing: .05em; }
.method-badge.post { color: #91e6bd; background: rgba(44, 185, 117, .12); border: 1px solid rgba(44, 185, 117, .25); }
.method-badge.get { color: #9fc8ff; background: rgba(68, 133, 232, .12); border: 1px solid rgba(68, 133, 232, .25); }
.api-guide-card { margin-bottom: 22px; }
.api-guide-card > p { color: var(--text-muted); line-height: 1.55; }
.code-block { margin: 14px 0; padding: 17px; max-width: 100%; overflow: auto; border-radius: 11px; color: #d8e5f5; background: #09121e; border: 1px solid rgba(255, 255, 255, .09); font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace; font-size: .8rem; line-height: 1.55; white-space: pre; }
.standalone-heading { margin: 26px 0 12px; }
.empty-table-cell { padding: 30px !important; text-align: center !important; color: var(--text-muted) !important; }
.compact-table th, .compact-table td { padding-top: 12px; padding-bottom: 12px; }
.secret-card { max-width: 900px; margin: 0 auto; }
.warning-panel { margin-bottom: 20px; padding: 15px 17px; border-radius: 11px; color: #f2d09a; background: rgba(218, 151, 52, .09); border: 1px solid rgba(218, 151, 52, .22); }
.warning-panel p { margin: 5px 0 0; color: #c9b795; }
.copy-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; }
.copy-field input { font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace; }
.detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: var(--border); }
.detail-grid > div { min-width: 0; padding: 14px; background: var(--surface-soft); }
.detail-grid dt { color: #8295ad; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.detail-grid dd { margin: 6px 0 0; color: #dde7f3; overflow-wrap: anywhere; }
.compact-details { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 20px; }
.tool-filter-bar { grid-template-columns: minmax(260px, 1fr) 210px 190px auto; }
.tool-data-table { min-width: 1180px; }
.result-summary { white-space: nowrap; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 15px; margin-top: 18px; color: var(--text-muted); }
.pagination a { padding: 8px 12px; border: 1px solid var(--border); border-radius: 9px; color: #b9d4fa; background: var(--surface); }
.pagination a:hover { border-color: rgba(98, 157, 248, .32); }
.payload-card, .notes-card { margin-top: 18px; }
.payload-json { max-height: 600px; }
.message-panel { margin-top: 17px; padding: 15px; border: 1px solid var(--border); border-radius: 11px; background: rgba(255, 255, 255, .025); }
.message-panel p { margin: 6px 0 0; color: var(--text-muted); white-space: pre-wrap; }
.danger-zone { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.danger-button { padding: 10px 14px; border: 1px solid rgba(224, 91, 91, .3); border-radius: 9px; color: #f1a2a2; background: rgba(202, 63, 63, .08); cursor: pointer; }
.danger-button:hover { background: rgba(202, 63, 63, .16); }


.inline-progress-value {
    display: inline-flex;
    margin-left: 8px;
    padding: 2px 7px;
    border: 1px solid rgba(96, 165, 250, .26);
    border-radius: 999px;
    color: #9ec8ff;
    font-size: .72rem;
    font-weight: 700;
}

.step-progress-compact {
    position: relative;
    width: 112px;
    height: 16px;
    margin-top: 6px;
    overflow: hidden;
    border: 1px solid rgba(96, 165, 250, .22);
    border-radius: 999px;
    background: rgba(15, 23, 42, .72);
}

.step-progress-compact > span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, rgba(59, 130, 246, .72), rgba(56, 189, 248, .72));
}

.step-progress-compact small {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #f8fbff;
    font-size: .62rem;
    font-weight: 800;
    text-shadow: 0 1px 2px #020617;
}

.download-status-heading {
    margin: 2px 0 7px;
    color: #a9bdd6;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .055em;
    text-transform: uppercase;
}

.download-status-heading.with-spacing {
    margin-top: 14px;
}

.download-status-table {
    table-layout: fixed;
}

.download-status-table th:nth-child(1) { width: 42%; }
.download-status-table th:nth-child(2) { width: 14%; }
.download-status-table th:nth-child(3) { width: 25%; }
.download-status-table th:nth-child(4) { width: 19%; }

.download-progress-cell {
    display: grid;
    grid-template-columns: minmax(74px, 1fr) auto;
    align-items: center;
    gap: 8px;
}

.download-progress-cell strong {
    min-width: 34px;
    color: #cfe4ff;
    font-size: .7rem;
    text-align: right;
}

.download-progress-track {
    display: block;
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(148, 163, 184, .16);
}

.download-progress-track > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(59, 130, 246, .9), rgba(56, 189, 248, .9));
}

@media (max-width: 1100px) {
    .api-endpoint-grid { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .role-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tool-filter-bar { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
    .nav-dropdown { position: static; }
    .nav-dropdown-menu { position: static; min-width: 0; margin-top: 5px; box-shadow: none; }
    .permission-grid, .role-grid, .detail-grid, .compact-details { grid-template-columns: 1fr; }
    .copy-field, .tool-filter-bar { grid-template-columns: 1fr; }
    .heading-stat { text-align: left; }
}
.metric-date { font-size: 1.2rem !important; }


/* Portal v0.3.1: indicatore versione */
.portal-version {
    position: fixed;
    right: 14px;
    bottom: 12px;
    z-index: 80;
    padding: 6px 9px;
    border: 1px solid rgba(255, 255, 255, .11);
    border-radius: 8px;
    color: #8ea2ba;
    background: rgba(9, 18, 30, .88);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .24);
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .02em;
    backdrop-filter: blur(8px);
}


/* Portal v0.3.3: versione visibile nella barra e nel badge fisso */
.brand-version {
    display: inline-flex;
    align-items: center;
    margin-left: 2px;
    padding: 3px 6px;
    border: 1px solid rgba(125, 161, 218, .22);
    border-radius: 6px;
    color: #8297b4;
    background: rgba(70, 111, 178, .08);
    font-size: .63rem;
    font-weight: 750;
    line-height: 1;
    letter-spacing: .02em;
}

/* Portal v0.5.0: clienti, dettagli strutturati, cronologia e comandi remoti */
.wide-table-card { overflow-x: auto; }
.tool-data-table { min-width: 1480px; }
.tool-filter-bar { grid-template-columns: minmax(280px, 1fr) 240px 190px auto; }
.customer-cell { min-width: 240px; }
.inline-customer-form { display: flex; align-items: center; gap: 7px; margin-top: 8px; }
.inline-customer-form select { min-width: 150px; max-width: 210px; padding: 7px 9px; font-size: .76rem; }
.inline-customer-form.wide { margin: 0; }
.inline-customer-form.wide select { min-width: 280px; max-width: none; }
.status-detail-cell { min-width: 250px; }
.status-detail-text { display: -webkit-box; margin-top: 8px; max-width: 320px; overflow: hidden; color: var(--text-muted); font-size: .78rem; line-height: 1.35; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.status-badge.warning { color: #f2ca88; background: rgba(211, 144, 42, .11); border-color: rgba(211, 144, 42, .24); }
.base-detail-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.primary-detail-card { margin-bottom: 18px; }
.customer-assignment-panel { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 18px; padding: 15px; border: 1px solid var(--border); border-radius: 12px; background: rgba(255, 255, 255, .025); }
.customer-assignment-panel > div { display: grid; gap: 4px; }
.breakable { overflow-wrap: anywhere; white-space: normal; }
.issue-card { margin-bottom: 18px; }
.error-section { border-color: rgba(220, 83, 83, .22); background: linear-gradient(180deg, rgba(139, 39, 39, .055), var(--surface)); }
.issue-list { display: grid; gap: 9px; }
.issue-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: start; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: rgba(255, 255, 255, .022); }
.issue-row.error { border-color: rgba(218, 79, 79, .22); }
.issue-row.warning { border-color: rgba(211, 144, 42, .2); }
.issue-row p { margin: 4px 0 0; color: var(--text-muted); white-space: pre-wrap; }
.success-text { margin: 0; color: #83d5a9; }
.accordion-stack { display: grid; gap: 10px; }
.compact-accordion { padding: 0; overflow: hidden; }
.compact-accordion > summary, .payload-collapsible > summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 15px 18px; list-style: none; cursor: pointer; }
.compact-accordion > summary::-webkit-details-marker, .payload-collapsible > summary::-webkit-details-marker { display: none; }
.compact-accordion > summary::after, .payload-collapsible > summary::after { content: "▾"; color: var(--text-muted); font-size: .8rem; transition: transform .15s ease; }
.compact-accordion[open] > summary::after, .payload-collapsible[open] > summary::after { transform: rotate(180deg); }
.compact-accordion > summary span:first-child, .payload-collapsible > summary span:first-child { display: grid; gap: 3px; }
.compact-accordion > summary small, .payload-collapsible > summary small { color: var(--text-muted); font-weight: 500; }
.accordion-body { border-top: 1px solid var(--border); }
.accordion-body.table-card { border-radius: 0; border-right: 0; border-bottom: 0; border-left: 0; }
.operation-stack { margin-bottom: 18px; }
.operation-steps-table { min-width: 980px; }
.remote-command-section { margin-top: 20px; }
.remote-command-form { margin-bottom: 20px; padding: 15px; border: 1px solid var(--border); border-radius: 12px; background: rgba(255, 255, 255, .02); }
.command-submit-field { justify-content: end; }
.payload-collapsible { margin-top: 20px; padding: 0; overflow: hidden; }
.payload-block { max-height: 650px; margin: 0; border: 0; border-radius: 0; }
.form-grid.three-columns { grid-template-columns: 1.4fr .7fr auto; }
.checkbox-row { display: inline-flex; align-items: center; gap: 9px; color: var(--text-muted); }
.checkbox-row input { width: 18px; height: 18px; }

@media (max-width: 1100px) {
    .base-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .customer-assignment-panel { align-items: stretch; flex-direction: column; }
    .form-grid.three-columns { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
    .base-detail-grid, .form-grid.three-columns { grid-template-columns: 1fr; }
    .inline-customer-form.wide { align-items: stretch; flex-direction: column; }
    .inline-customer-form.wide select { min-width: 0; width: 100%; }
}

/* Portal v0.5.4: tabelle compatte e aggiornamento puntuale tramite push server */
.page-shell.tool-data-shell {
    max-width: 1780px;
    padding-right: 18px;
    padding-left: 18px;
}

.tool-data-shell .tool-page-heading {
    margin-right: 4px;
    margin-left: 4px;
}

.tool-data-shell .wide-table-card {
    overflow-x: hidden;
}

.tool-data-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}

.tool-data-table th,
.tool-data-table td {
    min-width: 0;
    padding: 12px 9px;
    overflow-wrap: anywhere;
    vertical-align: top;
}

.tool-data-table th {
    font-size: .69rem;
    line-height: 1.25;
    letter-spacing: .055em;
}

.tool-data-table td {
    font-size: .81rem;
    line-height: 1.35;
}

.tool-data-table strong {
    line-height: 1.3;
}

.tool-data-table .table-subtext {
    max-width: none;
    margin-top: 3px;
    font-size: .71rem;
    line-height: 1.3;
}

.install-assistant-table .col-last-push { width: 11%; }
.install-assistant-table .col-customer { width: 15%; }
.install-assistant-table .col-workstation { width: 15%; }
.install-assistant-table .col-beone { width: 10%; }
.install-assistant-table .col-operation { width: 13%; }
.install-assistant-table .col-progress { width: 9%; }
.install-assistant-table .col-remote-commands { width: 11%; }
.install-assistant-table .col-status { width: 12%; }
.install-assistant-table .col-actions { width: 4%; }

.beone-tool-table .col-last-push { width: 12%; }
.beone-tool-table .col-customer { width: 17%; }
.beone-tool-table .col-workstation { width: 17%; }
.beone-tool-table .col-beone { width: 10%; }
.beone-tool-table .col-system { width: 16%; }
.beone-tool-table .col-results { width: 10%; }
.beone-tool-table .col-status { width: 13%; }
.beone-tool-table .col-actions { width: 5%; }

.tool-data-table .customer-cell,
.tool-data-table .status-detail-cell {
    min-width: 0;
}

.tool-data-table .inline-customer-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px;
    margin-top: 6px;
}

.tool-data-table .inline-customer-form select {
    width: 100%;
    min-width: 0;
    max-width: none;
    min-height: 30px;
    padding: 5px 6px;
    font-size: .69rem;
}

.tool-data-table .inline-customer-form .text-link {
    padding: 2px;
    font-size: .7rem;
}

.tool-data-table .status-detail-text {
    max-width: none;
    margin-top: 5px;
    font-size: .7rem;
    line-height: 1.3;
    -webkit-line-clamp: 2;
}

.tool-data-table .status-badge {
    padding: 4px 7px;
    font-size: .68rem;
}

.tool-data-table .table-actions {
    justify-content: center;
    padding-right: 5px;
    padding-left: 5px;
}

.tool-data-table .table-actions .text-link {
    font-size: .73rem;
}

.tool-filter-bar {
    grid-template-columns: minmax(260px, 1fr) minmax(170px, 220px) minmax(140px, 180px) auto minmax(190px, auto);
    align-items: stretch;
}

.tool-refresh-control {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    min-width: 0;
}

.tool-refresh-control small {
    max-width: 130px;
    color: var(--text-muted);
    font-size: .68rem;
    line-height: 1.25;
}

.tool-refresh-button {
    min-width: 108px;
    gap: 7px;
    white-space: nowrap;
}

.refresh-icon {
    display: inline-block;
    font-size: 1.05rem;
    line-height: 1;
    transform-origin: center;
}

.tool-refresh-button.is-refreshing .refresh-icon {
    animation: tool-refresh-spin .8s linear infinite;
}

.tool-data-table tbody tr.tool-row-live-update td:first-child {
    animation: tool-row-live-marker .65s ease-out;
}

@keyframes tool-refresh-spin {
    to { transform: rotate(360deg); }
}

@keyframes tool-row-live-marker {
    0% { box-shadow: inset 3px 0 rgba(99, 166, 255, .9); }
    100% { box-shadow: inset 0 0 rgba(99, 166, 255, 0); }
}

@media (max-width: 1280px) {
    .page-shell.tool-data-shell {
        padding-right: 10px;
        padding-left: 10px;
    }

    .tool-data-table th,
    .tool-data-table td {
        padding-right: 6px;
        padding-left: 6px;
    }

    .tool-filter-bar {
        grid-template-columns: minmax(240px, 1fr) 180px 150px auto auto;
    }

    .tool-refresh-control small {
        display: none;
    }
}

@media (max-width: 980px) {
    .tool-filter-bar {
        grid-template-columns: 1fr 1fr;
    }

    .tool-refresh-control {
        justify-content: flex-start;
    }

    .tool-data-table th,
    .tool-data-table td {
        padding: 8px 4px;
        font-size: .7rem;
    }

    .tool-data-table th,
    .tool-data-table .table-subtext,
    .tool-data-table .status-detail-text {
        font-size: .62rem;
    }

    .tool-data-table .inline-customer-form {
        display: block;
    }

    .tool-data-table .inline-customer-form .text-link {
        display: inline-block;
        margin-top: 3px;
    }
}


/* v0.5.6: azioni sulla singola operazione */
.operation-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .55rem .75rem;
    border-bottom: 1px solid var(--border-color, rgba(148, 163, 184, .18));
}

.operation-toolbar form {
    margin: 0;
}

/* v0.5.7: step compatti, comandi dalla griglia e aggiornamento live dettaglio */
.install-assistant-table .col-last-push { width: 11%; }
.install-assistant-table .col-customer { width: 13%; }
.install-assistant-table .col-workstation { width: 14%; }
.install-assistant-table .col-beone { width: 9%; }
.install-assistant-table .col-operation { width: 12%; }
.install-assistant-table .col-progress { width: 8%; }
.install-assistant-table .col-remote-commands { width: 15%; }
.install-assistant-table .col-status { width: 14%; }
.install-assistant-table .col-actions { width: 4%; }

.remote-command-grid-cell {
    min-width: 0;
}

.grid-command-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 4px;
    margin: 5px 0 2px;
}

.grid-command-form select {
    width: 100%;
    min-width: 0;
    min-height: 29px;
    padding: 4px 5px;
    font-size: .66rem;
}

.grid-command-form .text-link {
    padding: 2px;
    font-size: .69rem;
}

.detail-live-status {
    color: var(--text-muted);
    font-size: .72rem;
    white-space: nowrap;
}

.operation-step-summary.is-expandable {
    cursor: pointer;
}

.operation-step-summary.is-expandable:hover td {
    background: rgba(96, 165, 250, .045);
}

.step-expand-button {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 2px 7px;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.step-expand-button strong {
    min-width: 0;
    overflow-wrap: anywhere;
}

.step-expand-button small {
    grid-column: 2;
    color: var(--text-muted);
    font-size: .68rem;
}

.step-expand-icon {
    grid-row: 1 / span 2;
    color: var(--accent, #63a6ff);
    font-size: 1.15rem;
    line-height: 1;
    transition: transform .16s ease;
}

.operation-step-summary.is-expanded .step-expand-icon {
    transform: rotate(90deg);
}

.operation-step-history > td {
    padding: 0 !important;
    background: rgba(2, 8, 23, .22);
}

.step-history-panel {
    padding: 8px 14px 12px 46px;
    border-bottom: 1px solid var(--border-color, rgba(148, 163, 184, .18));
}

.nested-step-table {
    margin: 0;
    font-size: .78rem;
}

.nested-step-table th,
.nested-step-table td {
    padding: 7px 9px;
}

@media (max-width: 1100px) {
    .grid-command-form {
        display: block;
    }

    .grid-command-form .text-link {
        display: inline-block;
        margin-top: 3px;
    }

    .step-history-panel {
        padding-left: 12px;
    }
}


/* v0.5.8: dialoghi in-app, notifica versione e azioni compatte */
[hidden] { display: none !important; }

body.dialog-open { overflow: hidden; }

.version-update-notice {
    position: fixed;
    top: 84px;
    right: 22px;
    z-index: 80;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 13px;
    width: min(560px, calc(100vw - 32px));
    padding: 15px 16px;
    border: 1px solid rgba(99, 166, 255, .38);
    border-radius: 15px;
    background: rgba(14, 27, 45, .97);
    box-shadow: 0 22px 70px rgba(0, 0, 0, .46), 0 0 0 1px rgba(99, 166, 255, .06) inset;
    backdrop-filter: blur(18px);
    animation: version-notice-in .22s ease-out;
}

.version-update-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #a9ceff;
    background: rgba(74, 139, 255, .14);
    border: 1px solid rgba(99, 166, 255, .25);
}

.version-update-icon svg,
.icon-button svg,
.app-dialog-icon svg {
    width: 21px;
    height: 21px;
    fill: currentColor;
}

.version-update-copy { min-width: 0; }
.version-update-copy strong { display: block; margin-bottom: 3px; }
.version-update-copy span { display: block; color: var(--text-muted); font-size: .84rem; line-height: 1.35; }
.version-update-button { min-width: 132px; }

@keyframes version-notice-in {
    from { opacity: 0; transform: translateY(-8px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.app-dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(2, 7, 14, .74);
    backdrop-filter: blur(9px);
    animation: app-dialog-fade .16s ease-out;
}

.app-dialog {
    width: min(500px, 100%);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 17px;
    padding: 24px;
    border: 1px solid rgba(128, 169, 226, .24);
    border-radius: 19px;
    background: linear-gradient(155deg, rgba(20, 34, 54, .99), rgba(10, 18, 30, .99));
    box-shadow: 0 34px 90px rgba(0, 0, 0, .58), 0 0 0 1px rgba(255, 255, 255, .025) inset;
    animation: app-dialog-in .2s ease-out;
}

.app-dialog-icon {
    width: 45px;
    height: 45px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: #9bc8ff;
    background: rgba(74, 139, 255, .13);
    border: 1px solid rgba(99, 166, 255, .25);
}

.app-dialog-content { min-width: 0; }
.app-dialog-content .eyebrow { margin-bottom: 5px; }
.app-dialog-content h2 { margin-bottom: 8px; font-size: 1.35rem; }
.app-dialog-content p:last-child { margin-bottom: 0; color: #b6c4d7; line-height: 1.58; overflow-wrap: anywhere; }

.app-dialog-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 4px;
}

.app-dialog-actions .secondary-button,
.app-dialog-actions .primary-button { min-width: 116px; }

.app-dialog-backdrop.is-danger .app-dialog-icon {
    color: #ffadb3;
    background: rgba(255, 95, 108, .11);
    border-color: rgba(255, 111, 122, .26);
}

.app-dialog-backdrop.is-danger [data-app-dialog-confirm] {
    background: linear-gradient(135deg, #d84f5c, #b9344b);
}

@keyframes app-dialog-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes app-dialog-in {
    from { opacity: 0; transform: translateY(8px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.icon-button {
    position: relative;
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(123, 176, 255, .18);
    border-radius: 10px;
    color: #87bcff;
    background: rgba(75, 137, 225, .07);
    cursor: pointer;
    transition: transform .14s ease, background .14s ease, border-color .14s ease, color .14s ease;
}

.icon-button:hover,
.icon-button:focus-visible {
    color: #d9eaff;
    background: rgba(75, 137, 225, .16);
    border-color: rgba(123, 176, 255, .34);
    transform: translateY(-1px);
    outline: none;
}

.icon-button[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    z-index: 25;
    width: max-content;
    max-width: 180px;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: #e8f1fc;
    background: #101b2b;
    box-shadow: 0 10px 26px rgba(0, 0, 0, .32);
    font-size: .7rem;
    font-weight: 650;
    opacity: 0;
    pointer-events: none;
    transform: translateY(3px);
    transition: opacity .12s ease, transform .12s ease;
}

.icon-button[data-tooltip]:hover::after,
.icon-button[data-tooltip]:focus-visible::after {
    opacity: 1;
    transform: translateY(0);
}

.install-assistant-table .col-actions { width: 2.8%; }
.beone-tool-table .col-actions { width: 2.8%; }
.tool-data-table .table-actions { padding-right: 3px; padding-left: 3px; }
.grid-command-form optgroup { color: #b8c8db; background: #0b1523; font-weight: 750; }
.grid-command-form option { color: #f5f8fc; font-weight: 500; }

@media (max-width: 720px) {
    .version-update-notice {
        top: 76px;
        right: 16px;
        grid-template-columns: auto minmax(0, 1fr);
    }

    .version-update-button {
        grid-column: 1 / -1;
        width: 100%;
    }

    .app-dialog {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .app-dialog-icon { width: 40px; height: 40px; }
    .app-dialog-actions { grid-column: 1; }
    .app-dialog-actions > * { flex: 1; }
}

/* v0.5.9: dashboard strumenti, notifiche compatte e dettagli operativi */
body.dialog-open { overflow: auto; }

.flash-message {
    position: fixed;
    left: 16px;
    bottom: 12px;
    z-index: 90;
    width: min(820px, calc(100vw - 220px));
    margin: 0;
    box-shadow: 0 14px 42px rgba(0, 0, 0, .34);
    backdrop-filter: blur(12px);
    animation: portal-toast-in .18s ease-out;
}

.flash-message.is-hiding {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .2s ease, transform .2s ease;
}

@keyframes portal-toast-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.app-dialog-backdrop {
    background: transparent;
    backdrop-filter: none;
    padding: 18px;
}

.app-dialog {
    width: min(450px, 100%);
    padding: 21px;
    border-color: rgba(128, 169, 226, .34);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .035) inset;
}

.tool-dashboard-hero {
    align-items: center;
}

.dashboard-online-panel {
    min-width: 260px;
    display: grid;
    justify-items: end;
    gap: 7px;
    text-align: right;
}

.dashboard-online-panel small,
.metric-card small {
    color: var(--text-muted);
    font-size: .76rem;
}

.tool-metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-card-alert {
    border-color: rgba(255, 112, 124, .24);
    background: linear-gradient(155deg, rgba(117, 31, 43, .16), var(--surface));
}

.metric-card-warning {
    border-color: rgba(241, 180, 90, .23);
    background: linear-gradient(155deg, rgba(124, 79, 19, .13), var(--surface));
}

.dashboard-tool-activity {
    padding: 0;
    overflow: hidden;
}

.dashboard-tool-activity > .section-heading {
    padding: 20px 22px 16px;
    margin: 0;
    border-bottom: 1px solid var(--border);
}

.dashboard-activity-list {
    display: grid;
}

.dashboard-activity-row {
    display: grid;
    grid-template-columns: 150px minmax(170px, 1.05fr) minmax(210px, 1.35fr) minmax(150px, .8fr) 110px 18px;
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    transition: background .14s ease;
}

.dashboard-activity-row:first-child { border-top: 0; }
.dashboard-activity-row:hover { background: rgba(91, 156, 255, .055); }
.dashboard-activity-row > * { min-width: 0; }

.activity-tool-badge {
    display: inline-flex;
    width: fit-content;
    padding: 5px 8px;
    border: 1px solid rgba(93, 165, 255, .24);
    border-radius: 8px;
    color: #a9ceff;
    background: rgba(65, 125, 220, .1);
    font-size: .72rem;
    font-weight: 760;
}

.activity-tool-badge.install {
    color: #a9e8c8;
    border-color: rgba(75, 212, 148, .24);
    background: rgba(75, 212, 148, .08);
}

.activity-main,
.activity-operation,
.activity-result {
    display: grid;
    gap: 3px;
}

.activity-main span,
.activity-operation span,
.activity-result small,
.dashboard-activity-row time {
    color: var(--text-muted);
    font-size: .74rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.activity-result .status-badge { width: fit-content; }
.activity-open-icon { color: #7fb6ff; font-size: 1.35rem; text-align: right; }

.detail-grid-wide { grid-column: span 2; }

.operation-history-section,
.remote-command-section {
    margin-top: 18px;
    padding: 0;
    overflow: hidden;
}

.operation-history-section > summary,
.remote-command-section > summary,
.operation-accordion > summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
}

.operation-history-section > summary::after,
.remote-command-section > summary::after,
.operation-accordion > summary::after {
    justify-self: end;
}

.operation-history-body,
.remote-command-body {
    padding: 14px;
}

.operation-history-body .operation-stack {
    margin: 0;
}

.operation-accordion {
    box-shadow: none;
    background: rgba(10, 19, 31, .62);
}

.operation-summary-copy {
    min-width: 0;
}

.operation-status-badge {
    min-width: 105px;
    justify-content: center;
    justify-self: end;
    margin: 0;
}

.remote-command-body .remote-command-form {
    margin: 0 0 14px;
}

@media (max-width: 1200px) {
    .tool-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-activity-row {
        grid-template-columns: 130px minmax(150px, 1fr) minmax(190px, 1.2fr) minmax(140px, .8fr) 100px 18px;
        gap: 10px;
    }
}

@media (max-width: 820px) {
    .flash-message {
        right: 12px;
        left: 12px;
        bottom: 54px;
        width: auto;
    }

    .dashboard-online-panel {
        min-width: 0;
        justify-items: start;
        text-align: left;
    }

    .tool-metric-grid { grid-template-columns: 1fr; }
    .dashboard-activity-row {
        grid-template-columns: 1fr auto;
        gap: 8px;
    }
    .activity-tool-badge,
    .activity-main,
    .activity-operation,
    .activity-result { grid-column: 1; }
    .dashboard-activity-row time { grid-column: 2; grid-row: 1; }
    .activity-open-icon { grid-column: 2; grid-row: 2 / span 3; align-self: center; }
    .detail-grid-wide { grid-column: span 1; }
}

/* v0.5.11: log operazione caricato su richiesta, area scorrevole stabile */
.operation-summary-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-width: 160px;
    margin-left: auto;
}

.operation-log-button {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 10px;
    font-size: 18px;
    line-height: 1;
}

.operation-log-dialog {
    width: min(1100px, calc(100vw - 56px));
    height: min(820px, calc(100dvh - 56px));
    max-width: none;
    max-height: none;
    padding: 0;
    border: 1px solid var(--border-color, #2b4059);
    border-radius: 18px;
    background: #0d1a2a;
    color: #f4f8ff;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .46);
    overflow: hidden;
}

.operation-log-dialog[open] {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
}

.operation-log-dialog::backdrop {
    background: rgba(2, 8, 16, .18);
    backdrop-filter: blur(1.5px);
}

.operation-log-dialog-header,
.operation-log-dialog-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 20px;
    background: #122338;
    position: relative;
    z-index: 2;
}

.operation-log-dialog-header {
    border-bottom: 1px solid #29415e;
}

.operation-log-dialog-header h3 {
    margin: 2px 0 0;
}

.operation-log-dialog-header small {
    display: block;
    margin-top: 4px;
    color: #8fb3db;
}

.operation-log-dialog-footer {
    border-top: 1px solid #29415e;
    min-height: 72px;
}

.operation-log-dialog-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.operation-log-status {
    color: #8fb3db;
    font-size: .85rem;
}

.operation-log-scroll {
    min-height: 0;
    overflow: auto;
    scrollbar-gutter: stable both-edges;
    overscroll-behavior: contain;
    background: #08131f;
}

.operation-log-content {
    margin: 0;
    padding: 20px;
    min-width: 100%;
    min-height: 100%;
    box-sizing: border-box;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    tab-size: 4;
    font: 12.5px/1.55 Consolas, "Cascadia Mono", "Courier New", monospace;
    color: #dbeaff;
    background: transparent;
}

.operation-log-scroll {
    scrollbar-width: auto;
    scrollbar-color: #527aa8 #0d1a2a;
}

.operation-log-scroll::-webkit-scrollbar {
    width: 13px;
    height: 13px;
}

.operation-log-scroll::-webkit-scrollbar-track {
    background: #0d1a2a;
}

.operation-log-scroll::-webkit-scrollbar-thumb {
    min-height: 42px;
    border: 3px solid #0d1a2a;
    border-radius: 999px;
    background: #527aa8;
}

.operation-log-scroll::-webkit-scrollbar-thumb:hover {
    background: #6f98c7;
}

@media (max-width: 760px) {
    .operation-summary-actions {
        min-width: auto;
    }

    .operation-log-dialog {
        width: calc(100vw - 24px);
        height: calc(100dvh - 24px);
    }

    .operation-log-dialog-header,
    .operation-log-dialog-footer {
        padding: 14px;
    }

    .operation-log-dialog-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .operation-log-dialog-actions {
        width: 100%;
        justify-content: flex-end;
    }
}



/* v0.5.12: parametri strutturati per Avvia installazione */
.app-dialog-backdrop.has-install-fields .app-dialog {
    width: min(620px, 100%);
}

.app-dialog-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 17px;
    padding-top: 16px;
    border-top: 1px solid rgba(128, 169, 226, .16);
}

.app-dialog-field { display: grid; gap: 7px; }
.app-dialog-field label { color: #9dbde8; font-size: .76rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.app-dialog-field select { width: 100%; min-height: 42px; }
.app-dialog-validation { grid-column: 1 / -1; color: #ff9da6; font-weight: 700; }

@media (max-width: 620px) {
    .app-dialog-fields { grid-template-columns: 1fr; }
}


/* v0.5.13: identita compatta, componenti remoti e notifiche nuovi record */
.identity-accordion { margin-bottom: 18px; overflow: visible; }
.identity-accordion > summary.identity-summary-row {
    display: grid;
    grid-template-columns: 1.05fr 1.25fr 1.7fr 1.15fr .8fr auto;
    gap: 12px;
    align-items: center;
    padding: 15px 18px;
}
.identity-summary-value { min-width: 0; display: grid; gap: 3px; }
.identity-summary-value small { color: #83a6d5; font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .055em; }
.identity-summary-value strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.identity-summary-status { justify-self: end; }
.identity-detail-body { padding-top: 0; }
.identity-detail-body .base-detail-grid { margin-top: 0; }

.app-dialog-components {
    grid-column: 1 / -1;
    border: 1px solid #314761;
    border-radius: 12px;
    padding: 12px 14px 10px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px 14px;
    margin: 2px 0 0;
}
.app-dialog-components legend { padding: 0 6px; color: #9dbde8; font-size: .76rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.app-dialog-components label { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: #e5eefb; }
.app-dialog-components input { width: 17px; height: 17px; accent-color: #5a78ff; }

.notification-center { position: relative; }
.notification-bell {
    position: relative;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 1px solid #29405c;
    border-radius: 10px;
    color: #9cb9dd;
    background: #101b2b;
    cursor: pointer;
}
.notification-bell:hover, .notification-bell.has-unread { color: #fff; border-color: #4b6f9b; background: #17263a; }
.notification-bell svg { width: 19px; height: 19px; fill: currentColor; }
.notification-count {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: #ff5364;
    color: #fff;
    font-size: .65rem;
    font-weight: 900;
    box-shadow: 0 0 0 3px #07111f;
}
.notification-panel {
    position: absolute;
    z-index: 1300;
    right: 0;
    top: calc(100% + 10px);
    width: min(390px, calc(100vw - 24px));
    max-height: 460px;
    overflow: hidden;
    border: 1px solid #2c425e;
    border-radius: 14px;
    background: #0d1a2b;
    box-shadow: 0 18px 50px rgba(0,0,0,.42);
}
.notification-panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 15px; border-bottom: 1px solid #273a52; }
.notification-panel-header div { display: grid; gap: 2px; }
.notification-panel-header small { color: #86a5cd; }
.notification-list { max-height: 390px; overflow-y: auto; padding: 6px; }
.notification-item { display: grid; gap: 4px; padding: 11px 12px; border-radius: 10px; color: #e7f0ff; text-decoration: none; }
.notification-item:hover { background: #17283e; }
.notification-item.is-unread { background: #142b42; box-shadow: inset 3px 0 #55a7ff; }
.notification-item span { color: #88a9d3; font-size: .76rem; }
.notification-empty { margin: 0; padding: 22px 14px; text-align: center; color: #829fc4; }
.portal-toast-stack { position: fixed; z-index: 1450; right: 18px; bottom: 48px; display: grid; gap: 10px; width: min(430px, calc(100vw - 28px)); pointer-events: none; }
.portal-toast { pointer-events: auto; display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 13px 14px; border: 1px solid #32628e; border-radius: 14px; background: #10273b; color: #fff; box-shadow: 0 18px 45px rgba(0,0,0,.38); animation: portal-toast-in .18s ease-out; }
.portal-toast > div { display: grid; gap: 2px; min-width: 0; }
.portal-toast small { color: #7fc9ff; font-weight: 800; text-transform: uppercase; letter-spacing: .055em; }
.portal-toast strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast-close { border: 0; background: transparent; color: #9db8d8; font-size: 1.25rem; cursor: pointer; }
.portal-toast.is-hiding { opacity: 0; transform: translateY(8px); transition: .22s ease; }
@keyframes portal-toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1200px) {
    .identity-accordion > summary.identity-summary-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .identity-summary-status { justify-self: start; }
}
@media (max-width: 720px) {
    .identity-accordion > summary.identity-summary-row { grid-template-columns: 1fr; }
    .app-dialog-components { grid-template-columns: 1fr; }
    .notification-panel { position: fixed; right: 12px; top: 62px; }
}

/* Customer synchronization */
.customer-sync-heading { align-items: flex-end; }
.sync-status-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.sync-config-card, .sync-rules-card, .sync-history-card { margin-bottom: 18px; }
.sync-config-card { padding: 24px; }
.section-heading-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.section-heading-row h2 { margin: 2px 0 0; }
.source-badge { display: inline-flex; align-items: center; min-height: 28px; padding: 4px 10px; border: 1px solid rgba(126, 170, 255, .28); border-radius: 999px; background: rgba(66, 111, 188, .12); color: var(--text-muted); font-size: .78rem; white-space: nowrap; }
.sync-form-grid { display: grid; grid-template-columns: 2fr .7fr 1.2fr 1.2fr; gap: 16px; }
.sync-form-grid .field-wide { grid-column: span 2; }
.compact-options { margin-top: 16px; }
.section-divider { height: 1px; margin: 24px 0; background: var(--border); }
.sync-schedule-grid { display: grid; grid-template-columns: 1.2fr .8fr .8fr; gap: 16px; align-items: end; }
.switch-row { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; }
.switch-row input { width: 42px; height: 22px; accent-color: var(--accent); }
.sync-form-actions { justify-content: flex-end; margin-top: 22px; }
.sync-rule-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.sync-rule-grid > div { display: flex; flex-direction: column; gap: 5px; min-height: 86px; padding: 15px; border: 1px solid var(--border); border-radius: 12px; background: rgba(255,255,255,.018); }
.sync-rule-grid span { color: var(--text-muted); font-size: .88rem; line-height: 1.35; }
.sync-run-list { display: grid; gap: 10px; }
.sync-run-item { border: 1px solid var(--border); border-radius: 13px; background: rgba(255,255,255,.018); overflow: hidden; }
.sync-run-item > summary { display: grid; grid-template-columns: auto auto auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; list-style: none; }
.sync-run-item > summary::-webkit-details-marker { display: none; }
.sync-run-summary { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sync-run-body { padding: 0 16px 16px; border-top: 1px solid var(--border); }
.sync-run-metrics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; padding: 14px 0; }
.sync-run-metrics > div { display: flex; flex-direction: column; gap: 3px; padding: 11px; border-radius: 10px; background: rgba(255,255,255,.025); }
.sync-run-metrics span, .sync-run-meta { color: var(--text-muted); font-size: .78rem; }
.sync-log { max-height: 380px; margin: 14px 0 0; padding: 14px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; background: #07111f; color: #d8e6ff; font: .8rem/1.45 Consolas, "Courier New", monospace; white-space: pre-wrap; word-break: break-word; }
.status-badge.warning { border-color: rgba(245, 178, 73, .36); background: rgba(245, 178, 73, .12); color: #ffd081; }
.status-badge.failed { border-color: rgba(255, 94, 111, .36); background: rgba(255, 94, 111, .12); color: #ff98a5; }
.status-badge.running { border-color: rgba(91, 157, 255, .36); background: rgba(91, 157, 255, .12); color: #9bc4ff; }
@media (max-width: 1100px) {
    .sync-status-grid, .sync-rule-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sync-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sync-run-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
    .sync-status-grid, .sync-rule-grid, .sync-form-grid, .sync-schedule-grid { grid-template-columns: 1fr; }
    .sync-form-grid .field-wide { grid-column: auto; }
    .sync-run-item > summary { grid-template-columns: auto 1fr auto; }
    .sync-run-summary { grid-column: 1 / -1; }
    .sync-run-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}


/* v0.5.17: versione ambiente sincronizzata e setup consigliato */
.app-dialog-install-context {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.app-dialog-install-context > div {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid rgba(121, 163, 220, .22);
    border-radius: 10px;
    background: rgba(15, 34, 56, .72);
}
.app-dialog-install-context span {
    color: #8fb3df;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .055em;
    text-transform: uppercase;
}
.app-dialog-install-context strong {
    color: #f2f7ff;
    font-size: .92rem;
}
@media (max-width: 680px) {
    .app-dialog-install-context { grid-template-columns: 1fr; }
}

/* Catalogo BeOne 0.5.18 */
.catalog-language-list {
    display: grid;
    gap: 0.75rem;
}

.catalog-version-block + .catalog-version-block {
    margin-top: 0.9rem;
}

.catalog-version-block p {
    margin: 0.35rem 0 0;
    line-height: 1.65;
    color: var(--text-muted);
    overflow-wrap: anywhere;
}

.inline-stats {
    display: flex;
    gap: 1rem;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.inline-stats strong {
    color: var(--text-primary);
}

.separated-row {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.inline-link {
    display: inline-block;
    margin-top: 0.45rem;
    color: var(--accent-soft);
    font-weight: 700;
    text-decoration: none;
}

.inline-link:hover {
    text-decoration: underline;
}

/* v0.5.21: nome utente BeOne obbligatorio per Avvia installazione */
.app-dialog-field-wide {
    grid-column: 1 / -1;
}

.app-dialog-field input[data-app-dialog-install-beone-user] {
    width: 100%;
}

/* Portal v1.0.12: storico multi-push BeOneTool con dettagli caricati su richiesta */
.beonetool-history-heading {
    margin-top: 20px;
    margin-bottom: 10px;
}

.beonetool-push-history {
    gap: 8px;
}

.beonetool-push-accordion {
    border-left: 3px solid rgba(92, 155, 255, .45);
}

.beonetool-push-accordion.has-errors {
    border-left-color: rgba(230, 95, 95, .78);
}

.beonetool-push-accordion.has-warnings {
    border-left-color: rgba(221, 158, 61, .78);
}

.beonetool-push-accordion.is-success {
    border-left-color: rgba(70, 194, 133, .72);
}

.beonetool-push-summary {
    min-height: 54px;
}

.beonetool-push-summary strong {
    font-size: .92rem;
    line-height: 1.35;
}

.beonetool-push-body {
    background: rgba(5, 13, 24, .18);
}

.beonetool-push-loading {
    padding: 18px;
    color: var(--text-muted);
    text-align: center;
}

.beonetool-push-loading.is-error {
    color: #ef9a9a;
}

.beonetool-push-detail {
    display: grid;
    gap: 16px;
    padding: 16px;
}


.beonetool-push-section,
.beonetool-push-checks {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, .018);
}

.beonetool-push-section.has-errors {
    border-color: rgba(220, 83, 83, .24);
    background: rgba(139, 39, 39, .045);
}

.beonetool-push-section.has-warnings {
    border-color: rgba(211, 144, 42, .22);
}

.beonetool-push-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.beonetool-push-section-heading h3 {
    margin: 0;
    font-size: 1rem;
}

.beonetool-push-check-stack {
    gap: 8px;
}

.nested-check-accordion {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(7, 18, 32, .32);
}

.nested-check-accordion > summary {
    padding: 12px 14px;
}

.nested-check-accordion .data-table {
    min-width: 920px;
}


@media (max-width: 760px) {
    .beonetool-push-summary strong {
        font-size: .84rem;
    }

    .beonetool-push-section-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }
}


/* Portal v1.0.14: versione BeOne nel cliente e ripristino BeOne / sistema */
.install-assistant-table .col-last-push { width: 11%; }
.install-assistant-table .col-customer { width: 18%; }
.install-assistant-table .col-workstation { width: 16%; }
.install-assistant-table .col-operation { width: 14%; }
.install-assistant-table .col-progress { width: 10%; }
.install-assistant-table .col-remote-commands { width: 14%; }
.install-assistant-table .col-status { width: 13%; }
.install-assistant-table .col-actions { width: 4%; }

.beone-tool-table .col-last-push { width: 13%; }
.beone-tool-table .col-customer { width: 21%; }
.beone-tool-table .col-workstation { width: 18%; }
.beone-tool-table .col-system { width: 20%; }
.beone-tool-table .col-results { width: 10%; }
.beone-tool-table .col-status { width: 13%; }
.beone-tool-table .col-actions { width: 5%; }


/* Portal v1.0.15: riepilogo generale dall'ultimo push e versione BeOne evidenziata */
.customer-beone-version {
    display: inline-flex;
    align-items: center;
    margin-left: .38rem;
    padding: .08rem .42rem;
    border: 1px solid rgba(91, 157, 255, .3);
    border-radius: 999px;
    background: rgba(91, 157, 255, .1);
    color: #b8d3ff;
    font-size: .72rem;
    font-weight: 750;
    line-height: 1.35;
    white-space: nowrap;
}

.beonetool-push-detail {
    gap: 12px;
}

/* v1.0.17: dashboard operativa con statistiche a schede */
.dashboard-analytics {
    padding: 0;
    margin-bottom: 20px;
    overflow: hidden;
}

.dashboard-analytics-heading {
    align-items: flex-end;
    margin: 0;
    padding: 20px 22px 0;
    border-bottom: 1px solid var(--border);
}

.dashboard-analytics-heading h2 {
    margin-bottom: 18px;
}

.dashboard-tab-list {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    min-width: 0;
}

.dashboard-tab {
    position: relative;
    min-height: 43px;
    padding: 9px 14px 12px;
    border: 0;
    border-radius: 9px 9px 0 0;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: .84rem;
    font-weight: 720;
    white-space: nowrap;
}

.dashboard-tab:hover {
    color: #eaf0f8;
    background: rgba(255, 255, 255, .04);
}

.dashboard-tab::after {
    content: "";
    position: absolute;
    right: 10px;
    bottom: -1px;
    left: 10px;
    height: 2px;
    border-radius: 2px 2px 0 0;
    background: transparent;
}

.dashboard-tab.is-active {
    color: #dceaff;
    background: rgba(91, 156, 255, .07);
}

.dashboard-tab.is-active::after {
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.dashboard-tab:focus-visible {
    outline: 2px solid #6ba9ff;
    outline-offset: -3px;
}

.dashboard-tab-panel {
    padding: 22px;
}

.dashboard-tab-panel[hidden] {
    display: none;
}

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

.dashboard-kpi,
.dashboard-provider-summary {
    min-width: 0;
    padding: 17px 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, .025);
}

.dashboard-kpi > span,
.dashboard-provider-summary > span {
    display: block;
    color: var(--text-muted);
    font-size: .8rem;
}

.dashboard-kpi > strong,
.dashboard-provider-summary > strong {
    display: block;
    margin: 7px 0 5px;
    color: #f4f8fd;
    font-size: clamp(1.35rem, 2.2vw, 1.85rem);
    line-height: 1.12;
}

.dashboard-kpi > small,
.dashboard-provider-summary > small {
    color: #8294aa;
    font-size: .75rem;
    line-height: 1.4;
}

.dashboard-kpi-alert {
    border-color: rgba(255, 128, 136, .24);
    background: rgba(117, 31, 43, .11);
}

.dashboard-chart-section {
    min-width: 0;
    padding: 17px 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(8, 16, 27, .38);
}

.dashboard-chart-section.compact {
    height: 100%;
}

.dashboard-chart-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 15px;
}

.dashboard-chart-heading h3 {
    margin: 0 0 3px;
    font-size: .98rem;
}

.dashboard-chart-heading p {
    margin: 0;
    color: var(--text-muted);
    font-size: .76rem;
}

.dashboard-column-chart {
    display: grid;
    grid-template-columns: repeat(6, minmax(48px, 1fr));
    align-items: end;
    gap: 12px;
    min-height: 210px;
}

.dashboard-column-item {
    display: grid;
    grid-template-rows: 24px 150px 22px;
    align-items: end;
    gap: 6px;
    min-width: 0;
    text-align: center;
}

.dashboard-column-item > strong {
    color: #dce8f8;
    font-size: .78rem;
}

.dashboard-column-item > small {
    overflow: hidden;
    color: #8395ab;
    font-size: .68rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-column-track {
    position: relative;
    width: min(42px, 74%);
    height: 150px;
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .045);
    border-radius: 8px 8px 5px 5px;
    background: rgba(255, 255, 255, .035);
}

.dashboard-column-track > span {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    min-height: 0;
    border-radius: 7px 7px 4px 4px;
    background: linear-gradient(180deg, var(--accent), var(--accent-2));
}

.dashboard-provider-layout {
    display: grid;
    grid-template-columns: minmax(220px, .7fr) minmax(0, 2fr);
    gap: 16px;
    align-items: stretch;
}

.dashboard-provider-summary {
    display: grid;
    align-content: center;
}

.dashboard-provider-chart {
    display: grid;
    align-content: center;
    gap: 22px;
    padding: 19px 20px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(8, 16, 27, .38);
}

.dashboard-provider-row {
    display: grid;
    grid-template-columns: minmax(130px, .45fr) minmax(180px, 1.6fr) 72px;
    align-items: center;
    gap: 14px;
}

.dashboard-provider-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
}

.dashboard-provider-label span {
    overflow: hidden;
    color: #d9e4f2;
    text-overflow: ellipsis;
}

.dashboard-provider-label strong {
    color: #f4f8fd;
    font-size: .82rem;
}

.dashboard-provider-row > small {
    color: var(--text-muted);
    font-size: .72rem;
    text-align: right;
    white-space: nowrap;
}

.dashboard-horizontal-track {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, .06);
}

.dashboard-horizontal-track > span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
}

.dashboard-horizontal-track > .sharepoint {
    background: linear-gradient(90deg, #4f96ff, #70b6ff);
}

.dashboard-horizontal-track > .ftp {
    background: linear-gradient(90deg, #7768ff, #a18dff);
}

.dashboard-horizontal-track > .error {
    background: linear-gradient(90deg, #ff7781, #f1b45a);
}

.dashboard-error-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
    gap: 16px;
}

.dashboard-error-layout > div:first-child {
    display: grid;
    gap: 16px;
}

.dashboard-error-trend {
    grid-template-columns: repeat(14, minmax(28px, 1fr));
    gap: 7px;
    min-height: 174px;
}

.dashboard-error-trend .dashboard-column-item {
    grid-template-rows: 20px 112px 20px;
    gap: 5px;
}

.dashboard-error-trend .dashboard-column-track {
    width: min(24px, 72%);
    height: 112px;
}

.dashboard-error-trend .dashboard-column-track > span {
    background: linear-gradient(180deg, #ff8c94, #d95d6b);
}

.dashboard-error-trend .dashboard-column-item > small {
    font-size: .59rem;
}

.dashboard-ranked-bars {
    display: grid;
    gap: 17px;
}

.dashboard-ranked-row {
    display: grid;
    gap: 7px;
}

.dashboard-ranked-label {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}

.dashboard-ranked-label span {
    overflow: hidden;
    color: #d7e2ef;
    font-size: .78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-ranked-label strong {
    color: #f2f6fb;
    font-size: .78rem;
}

.dashboard-empty-chart {
    min-height: 160px;
    display: grid;
    place-items: center;
    margin: 0;
}

@media (max-width: 980px) {
    .dashboard-analytics-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 0;
    }

    .dashboard-analytics-heading h2 {
        margin-bottom: 8px;
    }

    .dashboard-tab-list {
        width: 100%;
        overflow-x: auto;
    }

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

    .dashboard-provider-layout,
    .dashboard-error-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {
    .dashboard-tab-panel {
        padding: 15px;
    }

    .dashboard-tab {
        padding-right: 11px;
        padding-left: 11px;
        font-size: .78rem;
    }

    .dashboard-column-chart,
    .dashboard-error-trend {
        overflow-x: auto;
        grid-template-columns: repeat(6, minmax(52px, 1fr));
        padding-bottom: 5px;
    }

    .dashboard-error-trend {
        grid-template-columns: repeat(14, minmax(38px, 1fr));
    }

    .dashboard-provider-row {
        grid-template-columns: 1fr auto;
    }

    .dashboard-provider-row .dashboard-horizontal-track {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .dashboard-provider-row > small {
        grid-column: 2;
        grid-row: 1;
    }
}

/* BeOneOps 1.0.18: colonna comandi remoti anche per BeOneTool. */
.beone-tool-table .col-last-push { width: 11%; }
.beone-tool-table .col-customer { width: 18%; }
.beone-tool-table .col-workstation { width: 15%; }
.beone-tool-table .col-system { width: 16%; }
.beone-tool-table .col-results { width: 8%; }
.beone-tool-table .col-remote-commands { width: 14%; }
.beone-tool-table .col-status { width: 14%; }
.beone-tool-table .col-actions { width: 4%; }
