:root {
    --p3000-blue: #173b7a;
    --p3000-blue-2: #2156a5;
    --p3000-green: #1f9d55;
    --p3000-orange: #f4a261;
    --p3000-bg: #f3f6fb;
    --p3000-text: #1f2937;
    --p3000-muted: #667085;
    --p3000-card: #ffffff;
    --p3000-border: #dbe4f0;
    --p3000-danger: #b42318;
    --shadow-soft: 0 18px 45px rgba(23, 59, 122, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--p3000-text);
    background: var(--p3000-bg);
}

a {
    color: inherit;
}

.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 26px;
    background:
        radial-gradient(circle at top left, rgba(31, 157, 85, 0.16), transparent 34%),
        radial-gradient(circle at bottom right, rgba(244, 162, 97, 0.18), transparent 32%),
        linear-gradient(135deg, #173b7a 0%, #235aa8 45%, #f3f6fb 45%, #f3f6fb 100%);
}

.login-card {
    width: min(100%, 440px);
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 24px;
    box-shadow: var(--shadow-soft);
    padding: 34px;
}

.denied-card {
    text-align: center;
}

.login-logo,
.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: linear-gradient(135deg, var(--p3000-blue), var(--p3000-green));
    font-weight: 900;
    letter-spacing: -1px;
    box-shadow: 0 12px 28px rgba(23, 59, 122, 0.18);
}

.login-logo {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    font-size: 20px;
    margin-bottom: 18px;
}

.login-kicker,
.page-kicker {
    color: var(--p3000-green);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 12px;
    font-weight: 800;
    margin: 0 0 6px;
}

.login-card h1,
.topbar h1 {
    margin: 0;
    color: var(--p3000-blue);
    line-height: 1.12;
}

.login-card h1 {
    font-size: 34px;
}

.login-subtitle,
.login-help,
.empty-state p {
    color: var(--p3000-muted);
    line-height: 1.55;
}

.login-subtitle {
    margin: 10px 0 24px;
}

.login-form label {
    display: block;
    font-weight: 800;
    margin: 16px 0 8px;
}

.login-form input {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--p3000-border);
    background: #ffffff;
    color: var(--p3000-text);
    font-size: 16px;
    outline: none;
}

.login-form input:focus {
    border-color: var(--p3000-blue-2);
    box-shadow: 0 0 0 4px rgba(33, 86, 165, 0.14);
}

.primary-button {
    width: 100%;
    min-height: 50px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--p3000-blue), var(--p3000-blue-2));
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-weight: 900;
    font-size: 16px;
    margin-top: 22px;
    cursor: pointer;
}

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

.login-help {
    font-size: 13px;
    margin: 18px 0 0;
}

.password-policy,
.notice-box {
    background: #f8fbff;
    border: 1px solid var(--p3000-border);
    border-radius: 14px;
    color: var(--p3000-muted);
    line-height: 1.5;
}

.password-policy {
    margin-top: 16px;
    padding: 13px 14px;
    font-size: 13px;
}

.password-policy strong,
.notice-box strong {
    display: block;
    color: var(--p3000-blue);
    margin-bottom: 4px;
}

.password-policy code,
.notice-box code {
    color: var(--p3000-blue);
    font-weight: 800;
    word-break: break-word;
}

.notice-box {
    margin-top: 18px;
    padding: 16px;
    text-align: left;
}

.notice-box p {
    margin: 6px 0 0;
}

.alert {
    padding: 13px 14px;
    border-radius: 12px;
    margin: 0 0 18px;
    font-weight: 700;
}

.alert-error {
    background: #fff1f0;
    color: var(--p3000-danger);
    border: 1px solid #ffd2cc;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 292px 1fr;
}

.sidebar {
    background: linear-gradient(180deg, var(--p3000-blue), #102b5b);
    color: #ffffff;
    padding: 24px 18px;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.brand-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 6px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
    margin-bottom: 18px;
}

.brand-mark {
    width: 52px;
    height: 52px;
    border-radius: 15px;
    font-size: 15px;
    background: linear-gradient(135deg, var(--p3000-green), var(--p3000-orange));
}

.brand-title {
    font-size: 20px;
    font-weight: 900;
}

.brand-subtitle {
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
    margin-top: 2px;
}

.main-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.34) transparent;
}

.main-menu::-webkit-scrollbar {
    width: 6px;
}

.main-menu::-webkit-scrollbar-track {
    background: transparent;
}

.main-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.34);
    border-radius: 999px;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    padding: 13px 14px;
    border-radius: 14px;
    color: rgba(255, 255, 255, 0.86);
    font-weight: 800;
}

.menu-link:hover,
.menu-link.active {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.menu-link.active {
    box-shadow: inset 4px 0 0 var(--p3000-orange);
}

.menu-icon {
    width: 22px;
    text-align: center;
    opacity: 0.92;
}

.sidebar-footer {
    flex: 0 0 auto;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.menu-link-logout {
    background: rgba(0, 0, 0, 0.16);
    color: #ffffff;
}

.menu-link-logout:hover {
    background: rgba(255, 255, 255, 0.16);
}

.main-area {
    padding: 28px;
    min-width: 0;
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    margin-bottom: 22px;
}

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

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    border: 1px solid var(--p3000-border);
    border-radius: 18px;
    padding: 10px 12px;
    box-shadow: 0 8px 22px rgba(23, 59, 122, 0.07);
    max-width: 360px;
}

.user-avatar {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #e7eefb;
    color: var(--p3000-blue);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
}

.user-chip strong,
.user-chip small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-chip small {
    color: var(--p3000-muted);
    font-size: 12px;
    margin-top: 2px;
}

.content-card {
    background: var(--p3000-card);
    border: 1px solid var(--p3000-border);
    border-radius: 24px;
    box-shadow: 0 14px 38px rgba(23, 59, 122, 0.08);
    min-height: calc(100vh - 126px);
    padding: 28px;
}

.empty-state {
    min-height: 360px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    border: 2px dashed #d7e1ee;
    border-radius: 20px;
    background: linear-gradient(180deg, #ffffff, #f9fbfe);
    padding: 28px;
}

.empty-icon {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eef5ff;
    color: var(--p3000-blue);
    font-size: 32px;
    font-weight: 900;
    margin-bottom: 16px;
}

.empty-state h2 {
    color: var(--p3000-blue);
    margin: 0 0 8px;
}

.empty-state p {
    max-width: 640px;
    margin: 0;
}

@media (max-width: 900px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: relative;
        height: auto;
        padding: 16px;
        overflow: visible;
    }

    .brand-box {
        padding-bottom: 14px;
        margin-bottom: 14px;
    }

    .main-menu {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        overflow: visible;
        padding-right: 0;
    }

    .sidebar-footer {
        margin-top: 12px;
        padding-top: 12px;
    }

    .main-area {
        padding: 18px;
    }

    .topbar {
        align-items: stretch;
        flex-direction: column;
    }

    .user-chip {
        max-width: none;
    }

    .content-card {
        min-height: 360px;
        padding: 18px;
    }
}

@media (min-width: 901px) and (max-height: 820px) {
    .sidebar {
        padding: 16px 14px;
    }

    .brand-box {
        padding: 2px 4px 14px;
        margin-bottom: 10px;
    }

    .brand-mark {
        width: 46px;
        height: 46px;
        border-radius: 13px;
    }

    .main-menu {
        gap: 4px;
    }

    .menu-link {
        gap: 10px;
        padding: 10px 12px;
        border-radius: 12px;
    }

    .sidebar-footer {
        margin-top: 8px;
        padding-top: 8px;
    }
}

@media (max-width: 560px) {
    .login-body {
        padding: 14px;
        align-items: flex-start;
    }

    .login-card {
        padding: 24px;
        border-radius: 20px;
    }

    .login-card h1 {
        font-size: 28px;
    }

    .main-menu {
        grid-template-columns: 1fr;
    }

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

/* Manager 3000 - Gestione Ticket */
.alert-success {
    background: #eaf8f0;
    color: #11613a;
    border: 1px solid #bfe8cf;
}
.alert-info {
    background: #eef5ff;
    color: var(--p3000-blue);
    border: 1px solid #c7d9ee;
}
.ticket-hero,
.panel-box,
.ticket-head {
    background: #ffffff;
    border: 1px solid var(--p3000-border);
    border-radius: 22px;
    box-shadow: 0 12px 30px rgba(23, 59, 122, 0.08);
}
.ticket-hero,
.ticket-head {
    padding: clamp(22px, 4vw, 34px);
    margin-bottom: 22px;
    background:
        radial-gradient(circle at top right, rgba(244, 162, 97, 0.18), transparent 28%),
        #ffffff;
}
.ticket-hero h2,
.ticket-head h2,
.panel-header h2 {
    color: var(--p3000-blue);
    margin: 0;
}
.ticket-hero p {
    color: var(--p3000-muted);
    line-height: 1.6;
    margin: 10px 0 0;
    max-width: 820px;
}
.ticket-eyebrow {
    display: inline-block;
    color: var(--p3000-orange);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 12px;
    margin-bottom: 8px;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}
.stat-card {
    padding: 20px;
    background: #ffffff;
    border: 1px solid var(--p3000-border);
    border-radius: 20px;
    box-shadow: 0 10px 24px rgba(23, 59, 122, 0.07);
}
.stat-card span {
    display: block;
    font-weight: 800;
    color: var(--p3000-muted);
    font-size: 13px;
}
.stat-card strong {
    display: block;
    color: var(--p3000-blue);
    font-size: 34px;
    margin-top: 8px;
}
.panel-box {
    padding: 24px;
    margin-bottom: 22px;
}
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}
.panel-header span,
.field-help,
.ticket-table small {
    color: var(--p3000-muted);
    font-weight: 700;
    font-size: 12px;
}
.ticket-filters {
    display: grid;
    grid-template-columns: 1.3fr 100px repeat(4, minmax(145px, 1fr)) auto;
    align-items: end;
    gap: 14px;
}
.form,
.form-row {
    display: grid;
    gap: 10px;
}
.form {
    gap: 16px;
}
.form-row label,
.check-row {
    font-weight: 800;
    color: var(--p3000-blue);
    font-size: 14px;
}
.form-row input,
.form-row select,
.form-row textarea,
.ticket-filters input,
.ticket-filters select {
    width: 100%;
    min-height: 46px;
    padding: 12px 14px;
    border-radius: 13px;
    border: 1px solid var(--p3000-border);
    background: #ffffff;
    color: var(--p3000-text);
    font: inherit;
    outline: none;
}
.form-row textarea {
    min-height: 150px;
    resize: vertical;
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus,
.ticket-filters input:focus,
.ticket-filters select:focus {
    border-color: var(--p3000-blue-2);
    box-shadow: 0 0 0 4px rgba(33, 86, 165, 0.12);
}
.filter-actions,
.form-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.inline-button,
.small-button,
.secondary-button,
.light-button {
    min-height: 44px;
    border: 0;
    border-radius: 999px;
    padding: 11px 17px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-weight: 900;
    cursor: pointer;
    white-space: nowrap;
}
.inline-button {
    width: auto;
    margin-top: 0;
}
.secondary-button {
    background: var(--p3000-blue);
    color: #ffffff;
}
.light-button {
    background: #eef2f7;
    color: var(--p3000-blue);
}
.table-wrap {
    overflow-x: auto;
}
.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1000px;
}
.table th,
.table td {
    text-align: left;
    padding: 14px 12px;
    border-bottom: 1px solid var(--p3000-border);
    vertical-align: middle;
}
.table th {
    color: var(--p3000-blue);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.table tr:hover td {
    background: #f8fbff;
}
.ticket-code {
    color: var(--p3000-blue);
    font-weight: 900;
}
.ticket-table strong,
.ticket-table small {
    display: block;
}
.dot-note,
.internal-label {
    display: inline-flex;
    margin-left: 8px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #eaf8f0;
    color: #11613a;
    font-size: 11px;
    font-weight: 900;
}
.internal-label {
    background: #fff9db;
    color: #806000;
}
.badge,
.priority {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}
.badge-open { background: #fff4e7; color: #8a4f0e; }
.badge-work { background: #eef5ff; color: var(--p3000-blue); }
.badge-wait { background: #fff9db; color: #806000; }
.badge-closed { background: #edf2f7; color: #4a5568; }
.badge-neutral { background: #f1f5f9; color: #334155; }
.priority-low { background: #eef8f1; color: #166534; }
.priority-normal { background: #eef5ff; color: var(--p3000-blue); }
.priority-high { background: #fff4e7; color: #8a4f0e; }
.priority-urgent { background: #fdecec; color: #9d1f2e; }
.compact-empty {
    min-height: auto;
    padding: 32px 18px;
}
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}
.pagination a {
    display: grid;
    place-items: center;
    min-width: 36px;
    height: 36px;
    border-radius: 999px;
    background: #eef2f7;
    color: var(--p3000-blue);
    font-weight: 900;
    text-decoration: none;
}
.pagination a.active {
    background: var(--p3000-blue);
    color: #ffffff;
}
.ticket-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

/* Manager 3000 v0.8.5 - Log accessi Posta 3000 e Ticket 3000 */
.access-log-hero {
    background:
        radial-gradient(circle at top right, rgba(140, 0, 0, 0.12), transparent 30%),
        radial-gradient(circle at bottom left, rgba(204, 204, 204, 0.24), transparent 28%),
        #ffffff;
}

.access-log-source-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.access-log-source-tab {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 17px 20px;
    border: 1px solid var(--ui-border);
    border-radius: 17px;
    background: #ffffff;
    color: var(--ui-text-dark);
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(23, 59, 122, 0.06);
}

.access-log-source-tab span {
    font-weight: 900;
}

.access-log-source-tab small {
    color: var(--ui-muted);
    font-size: 12px;
    font-weight: 800;
}

.access-log-source-tab:hover,
.access-log-source-tab.active {
    border-color: var(--ui-primary);
    background: var(--ui-primary-soft);
}

.access-log-source-tab.active {
    box-shadow: inset 4px 0 0 var(--ui-primary), 0 8px 20px rgba(23, 59, 122, 0.08);
}

.access-log-source-description {
    margin: 5px 0 0;
    color: var(--ui-muted);
    font-size: 13px;
    line-height: 1.45;
}

.access-log-filters {
    display: grid;
    grid-template-columns: minmax(180px, 0.9fr) minmax(155px, 0.75fr) minmax(155px, 0.75fr) minmax(260px, 1.4fr) auto;
    align-items: end;
    gap: 14px;
}

.access-log-filters small {
    color: var(--ui-muted);
    font-size: 11px;
    line-height: 1.35;
}

.access-log-filters input:disabled {
    background: #f1f3f5;
    border-color: #d8dde3;
    color: var(--ui-muted);
    cursor: not-allowed;
    opacity: 0.72;
}

.access-log-last-card strong {
    font-size: clamp(18px, 2vw, 25px);
    line-height: 1.25;
}

.access-log-table {
    min-width: 1120px;
}

.access-log-table th:nth-child(1) { width: 150px; }
.access-log-table th:nth-child(2) { width: 170px; }
.access-log-table th:nth-child(3) { width: 150px; }
.access-log-table th:nth-child(4) { width: 135px; }
.access-log-table th:nth-child(5) { width: 130px; }
.access-log-table th:nth-child(6) { width: 200px; }

.access-log-table strong,
.access-log-table small {
    display: block;
}

.access-log-table small {
    margin-top: 4px;
    color: var(--ui-muted);
    font-size: 10px;
    line-height: 1.35;
}

.access-result {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.access-result-ok {
    background: #edf8ef;
    color: #17653d;
}

.access-result-error {
    background: #fff2f2;
    color: var(--ui-primary);
}

.access-result-neutral {
    background: #f1f5f9;
    color: #334155;
}

.access-log-ip {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
}

.pagination-gap {
    display: grid;
    place-items: center;
    min-width: 24px;
    color: var(--ui-muted);
    font-weight: 900;
}

.access-log-page-note {
    margin: 12px 0 0;
    color: var(--ui-muted);
    font-size: 12px;
    font-weight: 700;
}

.access-log-danger-panel {
    border-color: #f0b8b8;
    background: #fffafa;
}

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

.access-log-clean-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px;
    border: 1px solid #f2cccc;
    border-radius: 16px;
    background: #ffffff;
}

.access-log-clean-card > div {
    display: grid;
    gap: 4px;
}

.access-log-clean-card strong {
    color: var(--ui-text-dark);
}

.access-log-clean-card code {
    color: var(--ui-primary);
    font-size: 12px;
    font-weight: 800;
}

.access-log-clean-card span {
    color: var(--ui-muted);
    font-size: 12px;
    font-weight: 700;
}

.small-button.danger-button {
    border: 0;
    background: #a32121;
    color: #ffffff;
    cursor: pointer;
}

.small-button.danger-button:hover:not(:disabled) {
    background: #841919;
}

@media (max-width: 1180px) {
    .access-log-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .access-log-agency-filter,
    .access-log-filters .filter-actions {
        grid-column: 1 / -1;
    }
}

@media (max-width: 680px) {
    .access-log-source-tabs,
    .access-log-clean-grid {
        grid-template-columns: 1fr;
    }

    .access-log-filters {
        grid-template-columns: 1fr;
    }

    .access-log-agency-filter,
    .access-log-filters .filter-actions {
        grid-column: auto;
    }

    .access-log-clean-card {
        align-items: flex-start;
        flex-direction: column;
    }
}
.back-link {
    display: inline-block;
    margin-bottom: 14px;
    color: var(--p3000-blue);
    font-weight: 900;
    text-decoration: none;
}
.ticket-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    color: var(--p3000-muted);
    font-weight: 700;
    margin-top: 12px;
}
.detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 0;
}
.detail-grid div,
.ticket-description-box,
.events-box {
    padding: 14px;
    border-radius: 14px;
    background: #f8fbff;
    border: 1px solid var(--p3000-border);
}
.detail-grid dt {
    font-weight: 900;
    color: var(--p3000-blue);
    font-size: 13px;
    margin-bottom: 6px;
}
.detail-grid dd {
    margin: 0;
    color: var(--p3000-text);
    overflow-wrap: anywhere;
}
.ticket-description-box {
    margin-top: 16px;
}
.ticket-description-box strong {
    display: block;
    color: var(--p3000-blue);
    margin-bottom: 8px;
}
.ticket-description-box p {
    margin: 0;
    color: var(--p3000-text);
    line-height: 1.6;
}
.message {
    border: 1px solid var(--p3000-border);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 14px;
    background: #f8fbff;
}
.message-manager {
    background: #eef5ff;
    border-color: #c7d9ee;
}
.message-internal {
    background: #fffdf0;
    border-color: #ffe08a;
}
.message__head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
    color: var(--p3000-blue);
}
.message__head span {
    color: var(--p3000-muted);
    font-size: 13px;
}
.message p {
    margin: 0;
    line-height: 1.6;
}
.attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}
.attachment-link {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid var(--p3000-border);
    padding: 8px 12px;
    font-weight: 900;
    color: var(--p3000-blue);
    text-decoration: none;
}
.attachment-link span {
    color: var(--p3000-muted);
    font-size: 12px;
}
.ticket-two-columns {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr);
    gap: 22px;
    align-items: start;
}
.check-row {
    display: flex;
    gap: 10px;
    align-items: center;
    color: var(--p3000-text);
    background: #f8fbff;
    border: 1px solid var(--p3000-border);
    border-radius: 14px;
    padding: 13px 14px;
}
.check-row input {
    width: 18px;
    height: 18px;
}
.events-box {
    margin-top: 20px;
}
.events-box h3 {
    color: var(--p3000-blue);
    margin: 0 0 12px;
}
.events-box ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}
.events-box li {
    display: grid;
    gap: 4px;
    border-bottom: 1px solid var(--p3000-border);
    padding-bottom: 10px;
}
.events-box li:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}
.events-box strong {
    color: var(--p3000-blue);
    font-size: 12px;
}
.events-box span,
.events-box p {
    color: var(--p3000-muted);
    line-height: 1.45;
    margin: 0;
}

@media (max-width: 1180px) {
    .ticket-filters {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .filter-actions {
        grid-column: 1 / -1;
    }
}

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

@media (max-width: 680px) {
    .stats-grid,
    .detail-grid,
    .ticket-filters {
        grid-template-columns: 1fr;
    }
    .panel-header,
    .ticket-head {
        flex-direction: column;
        align-items: flex-start;
    }
    .table {
        min-width: 880px;
    }
}

/* Manager 3000 - Crea Agenzia */
.agency-hero {
    background:
        radial-gradient(circle at top right, rgba(31, 157, 85, 0.16), transparent 30%),
        radial-gradient(circle at bottom left, rgba(244, 162, 97, 0.16), transparent 28%),
        #ffffff;
}
.agency-summary-grid,
.agency-grid {
    display: grid;
    gap: 14px;
}
.agency-summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.agency-summary-grid div {
    padding: 16px;
    border: 1px solid var(--p3000-border);
    background: #f8fbff;
    border-radius: 16px;
}
.agency-summary-grid strong,
.agency-summary-grid span {
    display: block;
}
.agency-summary-grid strong {
    color: var(--p3000-blue);
    margin-bottom: 6px;
    font-size: 13px;
}
.agency-summary-grid span {
    color: var(--p3000-text);
    font-weight: 900;
    overflow-wrap: anywhere;
}
.agency-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.agency-grid .wide {
    grid-column: span 2;
}
.agency-form .panel-box {
    box-shadow: none;
}
.agency-form input[readonly] {
    background: #eef5ff;
    color: var(--p3000-blue);
    font-weight: 900;
}
.agency-confirm-box {
    background: #f8fbff;
}
.result-list {
    margin: 0;
    padding-left: 22px;
    display: grid;
    gap: 9px;
    color: var(--p3000-text);
    line-height: 1.5;
}
.result-list li::marker {
    color: var(--p3000-green);
    font-weight: 900;
}

@media (max-width: 1080px) {
    .agency-summary-grid,
    .agency-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .agency-summary-grid,
    .agency-grid {
        grid-template-columns: 1fr;
    }
    .agency-grid .wide {
        grid-column: auto;
    }
}

/* Manager 3000 - Gestione Agenzie */
.agency-table {
    min-width: 1120px;
}

.agency-table tbody tr.agency-row-active td {
    background: #ecf9f1;
}
.agency-table tbody tr.agency-row-inactive td {
    background: #fff0f0;
}
.agency-table tbody tr.agency-row-active:hover td {
    background: #dff4e8;
}
.agency-table tbody tr.agency-row-inactive:hover td {
    background: #ffe3e3;
}
.agency-card-active {
    background: #ecf9f1;
    border-color: #bfe8cf;
}
.agency-card-inactive {
    background: #fff0f0;
    border-color: #f7c8c8;
}
.agency-card-active .ticket-meta span,
.agency-card-inactive .ticket-meta span {
    background: rgba(255, 255, 255, 0.72);
}

.agency-table td small,
.agency-table td strong {
    display: block;
}
.agency-table td small {
    color: var(--p3000-muted);
    font-size: 12px;
    margin-top: 4px;
}

.agency-contact-small {
    display: block;
    color: var(--p3000-blue);
    font-size: 12px;
    font-weight: 700;
    margin-top: 0;
    text-decoration: none;
    overflow-wrap: anywhere;
}
.agency-contact-small:hover {
    text-decoration: underline;
}
.agency-table .agency-status {
    min-width: 92px;
    border-radius: 9px;
    padding: 6px 9px;
    border: 1px solid var(--p3000-border);
    background: #ffffff;
    font-size: 11px;
    letter-spacing: 0.03em;
}
.agency-table .badge-active {
    border-color: #bfe8cf;
    color: #11613a;
}
.agency-table .badge-inactive {
    border-color: #f7c8c8;
    color: #9d1f2e;
}
.status-toggle-button {
    min-height: 30px;
    padding: 6px 10px;
    font-size: 11px;
}

.status-toggle-button.success-button {
    background: #16794a;
    color: #ffffff;
}
.status-toggle-button.warning-button {
    background: #c93636;
    color: #ffffff;
}
.agency-head-actions .success-button {
    background: #16794a;
    color: #ffffff;
}
.agency-head-actions .warning-button {
    background: #c93636;
    color: #ffffff;
}

.agency-row-actions,
.agency-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.agency-head-actions {
    justify-content: flex-end;
}
.inline-form {
    display: inline-flex;
    margin: 0;
}
.agency-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 7px 11px;
    font-weight: 900;
    font-size: 12px;
    white-space: nowrap;
}
.badge-active {
    background: #eaf8f0;
    color: #11613a;
}
.badge-inactive {
    background: #fdecec;
    color: #9d1f2e;
}
.small-button {
    min-height: 36px;
    padding: 8px 12px;
    font-size: 13px;
    background: #eef2f7;
    color: var(--p3000-blue);
}
.warning-button {
    background: #fff4e7;
    color: #8a4f0e;
}
.success-button {
    background: #eaf8f0;
    color: #11613a;
}
.primary-button:disabled,
button:disabled {
    opacity: 0.48;
    cursor: not-allowed;
    filter: grayscale(0.2);
}
.save-help {
    color: var(--p3000-muted);
    font-weight: 700;
    margin: 10px 0 0;
    font-size: 13px;
}
.technical-box {
    background: #f8fbff;
}
.agency-detail-head {
    background:
        radial-gradient(circle at top right, rgba(31, 157, 85, 0.14), transparent 30%),
        #ffffff;
}
@media (max-width: 680px) {
    .agency-head-actions {
        justify-content: flex-start;
    }
}

/* Manager 3000 v0.3.8 - affinamenti Gestione Agenzie */
.agency-table {
    min-width: 980px;
    font-size: 13px;
}
.agency-table th,
.agency-table td {
    padding: 10px 8px;
}
.agency-table th:last-child,
.agency-table td:last-child {
    width: 210px;
}
.agency-version-small {
    display: block;
    color: var(--p3000-muted);
    font-size: 12px;
    line-height: 1.35;
    font-weight: 700;
}
.agency-table .agency-status {
    min-width: 0;
    padding: 4px 7px;
    border-radius: 7px;
    font-size: 10px;
    letter-spacing: 0.02em;
    opacity: 0.86;
}
.status-toggle-button {
    min-height: 26px;
    padding: 4px 8px;
    font-size: 10px;
    border-radius: 8px;
    opacity: 0.9;
}
.agency-row-actions {
    gap: 5px;
    flex-wrap: nowrap;
}
.agency-row-actions .small-button:not(.status-toggle-button) {
    min-height: 26px;
    min-width: 28px;
    padding: 4px 7px;
    border-radius: 8px;
    font-size: 11px;
}
.agency-logo-preview {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    max-width: 100%;
    margin: 0 0 16px;
    padding: 12px 14px;
    border: 1px solid var(--p3000-border);
    border-radius: 16px;
    background: #f8fbff;
}
.agency-logo-preview span {
    color: var(--p3000-blue);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.agency-logo-preview img {
    max-width: 180px;
    max-height: 70px;
    object-fit: contain;
    background: #ffffff;
    border: 1px solid var(--p3000-border);
    border-radius: 10px;
    padding: 6px;
}
.agency-logo-preview small {
    color: var(--p3000-muted);
    font-size: 12px;
    line-height: 1.35;
}
@media (max-width: 680px) {
    .agency-logo-preview {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Manager 3000 v0.3.9 - controllo apertura singola pagina */
.single-tab-blocked .app-shell,
.single-tab-blocked .login-card {
    pointer-events: none;
    filter: blur(2px);
    user-select: none;
}

.single-tab-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.68);
    backdrop-filter: blur(4px);
}

.single-tab-modal {
    width: min(440px, 100%);
    background: #ffffff;
    border-radius: 22px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 22px 70px rgba(15, 23, 42, 0.32);
    border: 1px solid rgba(15, 23, 42, 0.10);
}

.single-tab-mark {
    width: 58px;
    height: 58px;
    margin: 0 auto 16px;
    border-radius: 18px;
    background: linear-gradient(135deg, #0d6efd, #0a3d91);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    letter-spacing: -1px;
}

.single-tab-modal h2 {
    margin: 0 0 10px;
    font-size: 23px;
    color: #102033;
}

.single-tab-modal p {
    margin: 0 0 20px;
    color: #55657a;
    line-height: 1.55;
    font-size: 15px;
}

/* Manager 3000 - Crea Utente */
.user-hero {
    background:
        radial-gradient(circle at top right, rgba(33, 86, 165, 0.14), transparent 30%),
        radial-gradient(circle at bottom left, rgba(31, 157, 85, 0.14), transparent 28%),
        #ffffff;
}
.user-form .field-help {
    display: block;
    margin-top: 2px;
    line-height: 1.35;
}
.user-form input[readonly],
.user-form select:disabled {
    background: #eef5ff;
    color: var(--p3000-blue);
    font-weight: 900;
    cursor: not-allowed;
}
.user-summary-grid {
    margin-top: 8px;
}


/* Manager 3000 v0.4.1 - Gestione Utenti */
.user-table {
    min-width: 980px;
    font-size: 13px;
}
.user-table tbody tr.user-row-active td {
    background: #ecf9f1;
}
.user-table tbody tr.user-row-inactive td {
    background: #fff0f0;
}
.user-table tbody tr.user-row-active:hover td {
    background: #dff4e8;
}
.user-table tbody tr.user-row-inactive:hover td {
    background: #ffe3e3;
}
.user-table th:last-child,
.user-table td:last-child {
    width: 72px;
}
.user-row-actions {
    justify-content: center;
}
.user-card-active {
    background: #ecf9f1;
    border-color: #bfe8cf;
}
.user-card-inactive {
    background: #fff0f0;
    border-color: #f7c8c8;
}
.user-card-active .ticket-meta span,
.user-card-inactive .ticket-meta span {
    background: rgba(255, 255, 255, 0.72);
}
.user-detail-head {
    margin-bottom: 18px;
}

/* Manager 3000 v0.4.2 - Filtri utenti e Dashboard */
.user-filters {
    display: grid;
    grid-template-columns: minmax(220px, 1.2fr) minmax(180px, 0.8fr) auto;
    align-items: end;
    gap: 14px;
}

.dashboard-hero {
    margin-bottom: 22px;
}

.dashboard-panel .panel-header {
    margin-bottom: 14px;
}

.dashboard-stats-grid {
    grid-template-columns: repeat(6, minmax(130px, 1fr));
}

.dashboard-stats-grid .stat-card {
    min-height: 116px;
}

.dashboard-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
}

@media (max-width: 1180px) {
    .dashboard-stats-grid {
        grid-template-columns: repeat(3, minmax(150px, 1fr));
    }
}

@media (max-width: 760px) {
    .user-filters,
    .dashboard-stats-grid {
        grid-template-columns: 1fr;
    }
    .dashboard-actions {
        justify-content: flex-start;
    }
}

/* Manager 3000 v0.5.1 - correzione controllo singola scheda */
.agency-filters,
.manager-filters {
    display: grid;
    grid-template-columns: minmax(260px, 1.2fr) minmax(170px, 0.6fr) auto;
    align-items: end;
    gap: 14px;
}
.manager-filters {
    grid-template-columns: minmax(260px, 1fr) auto;
}
.compact-primary {
    width: auto;
    margin-top: 0;
    min-height: 36px;
    padding: 8px 14px;
    font-size: 13px;
}
.dashboard-compact-table,
.technical-log-table,
.manager-account-table {
    min-width: 760px;
    font-size: 13px;
}
.dashboard-compact-table th,
.dashboard-compact-table td,
.technical-log-table th,
.technical-log-table td {
    padding: 10px 9px;
}
.technical-hero {
    background:
        radial-gradient(circle at top right, rgba(23, 59, 122, 0.14), transparent 30%),
        radial-gradient(circle at bottom left, rgba(244, 162, 97, 0.14), transparent 28%),
        #ffffff;
}
.technical-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}
.technical-card {
    border: 1px solid var(--p3000-border);
    border-radius: 18px;
    padding: 16px;
    background: #f8fbff;
    display: grid;
    gap: 7px;
}
.technical-card strong {
    color: var(--p3000-blue);
    font-size: 16px;
}
.technical-card span {
    font-weight: 900;
}
.technical-card small {
    color: var(--p3000-muted);
    overflow-wrap: anywhere;
}
.technical-ok {
    border-color: #bfe8cf;
    background: #ecf9f1;
}
.technical-ok span {
    color: #11613a;
}
.technical-ko {
    border-color: #f7c8c8;
    background: #fff0f0;
}
.technical-ko span {
    color: #9d1f2e;
}
@media (max-width: 900px) {
    .agency-filters,
    .manager-filters,
    .technical-grid {
        grid-template-columns: 1fr;
    }
}
.user-filters {
    grid-template-columns: minmax(220px, 1.2fr) minmax(180px, 0.8fr) minmax(170px, 0.7fr) auto;
}
@media (max-width: 900px) {
    .user-filters {
        grid-template-columns: 1fr;
    }
}

/* ==============================
   Manager 3000 v0.5.2 - restyling Posta 3000
   ============================== */
body {
    background: var(--ui-light);
    color: var(--ui-text-dark);
}

.login-body {
    background:
        linear-gradient(180deg, var(--ui-secondary) 0%, var(--ui-light) 100%);
}

.login-card {
    border: 1px solid var(--ui-border);
    border-radius: 22px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.14);
}

.login-logo,
.brand-mark {
    background: var(--ui-primary);
    color: var(--ui-text-light);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.16);
    overflow: hidden;
}

.brand-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.login-card h1,
.topbar h1,
.ticket-hero h2,
.ticket-head h2,
.panel-header h2,
.empty-state h2 {
    color: var(--ui-text-dark);
}

.login-subtitle,
.login-help,
.empty-state p,
.ticket-hero p,
.user-chip small,
.brand-subtitle,
.field-help,
.stat-card span,
.detail-grid dt {
    color: #555555;
}

.page-kicker {
    color: rgba(255, 255, 255, 0.9);
}

.primary-button {
    background: linear-gradient(180deg, var(--ui-primary) 0%, var(--ui-primary-dark) 100%);
    color: var(--ui-text-light);
}

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

.app-shell {
    background: var(--ui-light);
}

.sidebar {
    background: linear-gradient(180deg, var(--ui-primary) 0%, var(--ui-primary-dark) 100%);
    box-shadow: inset -1px 0 0 rgba(255,255,255,0.08);
}

.brand-box {
    border-bottom-color: rgba(255, 255, 255, 0.16);
}

.brand-title {
    color: var(--ui-text-light);
}

.menu-link {
    color: rgba(255,255,255,0.92);
}

.menu-link:hover,
.menu-link.active {
    background: rgba(255,255,255,0.14);
    color: var(--ui-text-light);
}

.menu-link.active {
    box-shadow: inset 4px 0 0 var(--ui-secondary);
}

.main-area {
    padding: 22px;
}

.topbar {
    background: linear-gradient(180deg, var(--ui-primary) 0%, var(--ui-primary-dark) 100%);
    color: var(--ui-text-light);
    padding: 18px 22px;
    border-radius: 22px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.topbar h1 {
    color: var(--ui-text-light);
    font-size: 28px;
}

.user-chip {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.18);
    color: var(--ui-text-light);
    box-shadow: none;
}

.user-avatar {
    background: var(--ui-light);
    color: var(--ui-primary);
}

.content-card,
.panel-box,
.ticket-hero,
.ticket-head,
.stat-card {
    border-color: var(--ui-border);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.06);
}

.content-card {
    background: #ffffff;
    min-height: calc(100vh - 170px);
}

.login-form input,
.form-row input,
.form-row select,
.form-row textarea,
.filter-panel input,
.filter-panel select {
    border-color: var(--ui-border);
    color: var(--ui-text-dark);
}

.login-form input:focus,
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus,
.filter-panel input:focus,
.filter-panel select:focus {
    border-color: var(--ui-primary);
    box-shadow: 0 0 0 4px rgba(140, 0, 0, 0.12);
    outline: none;
}

.alert-success {
    background: #edf8ef;
    border-color: #d0e8d5;
    color: #17653d;
}

.alert-info {
    background: #f7f7f7;
    border-color: var(--ui-border);
    color: var(--ui-text-dark);
}

.alert-error {
    background: #fff2f2;
    border-color: #e8caca;
    color: var(--ui-primary);
}

.ticket-eyebrow,
.password-policy strong,
.notice-box strong {
    color: var(--ui-primary);
}

.secondary-button,
.light-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border-radius: 12px;
    padding: 0 16px;
    text-decoration: none;
    font-weight: 800;
    border: 1px solid var(--ui-border);
    cursor: pointer;
}

.secondary-button {
    background: #ffffff;
    color: var(--ui-primary);
}

.light-button {
    background: var(--ui-light);
    color: var(--ui-text-dark);
}

.inline-button { width: auto; padding: 0 20px; }
.compact-primary { min-height: 42px; }

.form-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 22px;
}

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

.color-grid {
    align-items: end;
}

.color-input-wrap {
    display: flex;
    gap: 10px;
    align-items: center;
}

.color-input-wrap input[type="color"] {
    width: 58px;
    min-width: 58px;
    height: 46px;
    padding: 4px;
    border: 1px solid var(--ui-border);
    border-radius: 10px;
    background: #fff;
}

.color-input-wrap input[type="text"] {
    flex: 1;
    text-transform: uppercase;
}

.ui-preview-card {
    margin-top: 18px;
    background: #ffffff;
    border: 1px solid var(--ui-border);
    border-radius: 18px;
    overflow: hidden;
}

.ui-preview-top {
    background: var(--preview-primary);
    color: var(--preview-white);
    padding: 12px 16px;
    font-weight: 900;
}

.ui-preview-body {
    display: grid;
    grid-template-columns: 180px 1fr;
    min-height: 180px;
    background: var(--preview-light);
}

.ui-preview-sidebar {
    background: linear-gradient(180deg, var(--preview-primary) 0%, #5F0000 100%);
}

.ui-preview-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    padding: 18px;
}

.ui-preview-cardbox {
    background: #ffffff;
    border: 1px solid var(--preview-secondary);
    border-radius: 14px;
    min-height: 92px;
}

.brand-mark .brand-logo-img,
.login-logo .brand-logo-img {
    padding: 10px;
}

.login-logo span,
.brand-mark span {
    display: inline-block;
}

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

@media (max-width: 900px) {
    .topbar {
        padding: 16px 18px;
    }

    .content-card {
        min-height: 360px;
    }

    .ui-preview-body {
        grid-template-columns: 1fr;
    }

    .ui-preview-sidebar {
        min-height: 56px;
    }
}

@media (max-width: 560px) {
    .main-area {
        padding: 14px;
    }

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

    .user-chip {
        max-width: none;
    }

    .color-input-wrap {
        flex-direction: column;
        align-items: stretch;
    }
}


/* Manager 3000 v0.5.4 - correzioni leggibilità topbar/sidebar */
.sidebar .brand-subtitle {
    color: #FFFFFF !important;
}

.topbar .user-chip small {
    color: #FFFFFF !important;
}

/* Manager 3000 v0.6.2 - Informazioni utili e novità software */
.content-hero {
    background:
        radial-gradient(circle at top right, rgba(140, 0, 0, 0.14), transparent 30%),
        radial-gradient(circle at bottom left, rgba(204, 204, 204, 0.28), transparent 28%),
        #ffffff;
}

.content-filters {
    display: grid;
    grid-template-columns: minmax(240px, 1.5fr) minmax(180px, 0.8fr) minmax(150px, 0.6fr) auto;
    align-items: end;
    gap: 14px;
}

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

.content-form-grid .content-span-two {
    grid-column: span 2;
}

.content-form-grid .content-span-all {
    grid-column: 1 / -1;
}

.content-active-check {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--ui-border);
    border-radius: 14px;
    background: var(--ui-light);
    color: var(--ui-text-dark);
    cursor: pointer;
}

.content-active-check input {
    width: 20px;
    height: 20px;
    accent-color: var(--ui-primary);
}

.content-active-check span,
.content-active-check strong,
.content-active-check small,
.content-table td strong,
.content-table td small {
    display: block;
}

.content-active-check small,
.content-table td small {
    margin-top: 5px;
    color: var(--p3000-muted);
    font-size: 12px;
    line-height: 1.45;
}

.content-table {
    width: 100%;
    min-width: 980px;
    table-layout: fixed;
}

.content-table .content-col-type { width: 14%; }
.content-table .content-col-main { width: 39%; }
.content-table .content-col-date { width: 13%; }
.content-table .content-col-visibility { width: 13%; }
.content-table .content-col-order { width: 8%; }
.content-table .content-col-actions { width: 13%; }

.content-table th,
.content-table td {
    padding: 14px 10px;
    overflow-wrap: anywhere;
}

.content-table td:nth-child(2) > strong {
    font-size: 16px;
    line-height: 1.3;
}

.content-table td:nth-child(2) > small {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.content-table td:nth-child(4) .agency-status {
    max-width: 100%;
    padding: 7px 9px;
    font-size: 11px;
}

.content-table td:nth-child(5) {
    white-space: nowrap;
}

.content-table tbody tr.content-row-active td {
    background: #f4fbf7;
}

.content-table tbody tr.content-row-inactive td {
    background: #fff5f5;
}

.content-table tbody tr.content-row-active:hover td {
    background: #eaf7ef;
}

.content-table tbody tr.content-row-inactive:hover td {
    background: #ffebeb;
}

.content-type-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 7px 10px;
    font-size: 11px;
    font-weight: 900;
    max-width: 100%;
    justify-content: center;
    text-align: center;
    white-space: normal;
}

.content-type-info {
    background: #eef5ff;
    color: var(--ui-primary);
}

.content-type-update {
    background: #fff4e7;
    color: #8a4f0e;
}

.content-link-small {
    display: inline-block;
    margin-top: 7px;
    color: var(--ui-primary);
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
}

.content-link-small:hover {
    text-decoration: underline;
}

.content-badge-scheduled {
    background: #fff9db;
    color: #806000;
}

.content-badge-expired {
    background: #edf2f7;
    color: #4a5568;
}

.content-card-active {
    background: #ecf9f1;
    border-color: #bfe8cf;
}

.content-card-inactive {
    background: #fff0f0;
    border-color: #f7c8c8;
}

.content-row-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 38px;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.content-row-actions .inline-form,
.content-row-actions .status-toggle-button {
    width: 100%;
}

.content-row-actions .status-toggle-button {
    min-height: 34px;
    padding: 7px 6px;
    font-size: 10px;
}

.content-row-actions .content-edit-button {
    min-width: 38px;
    min-height: 34px;
    padding: 7px 6px;
}

@media (max-width: 1280px) {
    .content-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1180px) {
    .content-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

@media (max-width: 680px) {
    .content-form-grid,
    .content-filters {
        grid-template-columns: 1fr;
    }

    .content-form-grid .content-span-two,
    .content-form-grid .content-span-all {
        grid-column: auto;
    }

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

    .content-list-panel {
        padding: 18px 14px;
    }
}

/* Manager 3000 v0.7.0 - Catalogo prodotti e gestione CAP */
.catalog-subnav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    padding: 8px;
    border: 1px solid var(--ui-border);
    border-radius: 16px;
    background: var(--ui-light);
}

.catalog-subnav-link {
    flex: 1 1 180px;
    min-width: 0;
    padding: 11px 16px;
    border-radius: 11px;
    color: var(--ui-text-dark);
    font-weight: 900;
    text-align: center;
    text-decoration: none;
}

.catalog-subnav-link:hover,
.catalog-subnav-link.active {
    background: #ffffff;
    color: var(--ui-primary);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.07);
}

.catalog-hero {
    background:
        radial-gradient(circle at top right, rgba(140, 0, 0, 0.13), transparent 30%),
        radial-gradient(circle at bottom left, rgba(204, 204, 204, 0.30), transparent 30%),
        #ffffff;
}

.request-hero {
    background:
        radial-gradient(circle at top right, rgba(244, 162, 97, 0.20), transparent 30%),
        #ffffff;
}

.rules-hero {
    background:
        radial-gradient(circle at top right, rgba(33, 86, 165, 0.12), transparent 30%),
        #ffffff;
}

.catalog-filters {
    display: grid;
    grid-template-columns: minmax(220px, 1.4fr) minmax(170px, 0.8fr) minmax(170px, 0.8fr) auto;
    align-items: end;
    gap: 14px;
}

.catalog-filters-compact {
    grid-template-columns: minmax(260px, 1.4fr) minmax(180px, 0.7fr) auto;
}

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

.catalog-filter-actions-full {
    grid-column: 1 / -1;
}

.catalog-form,
.catalog-form-grid,
.catalog-two-panels,
.catalog-card-grid,
.catalog-request-grid,
.catalog-card,
.catalog-request-card {
    min-width: 0;
}

.catalog-form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: start;
    gap: 16px;
}

.catalog-form-grid > * {
    min-width: 0;
}

.catalog-span-two { grid-column: span 2; }
.catalog-span-three { grid-column: span 3; }
.catalog-span-all { grid-column: 1 / -1; }

.catalog-code-input {
    text-transform: uppercase;
    font-weight: 900;
    letter-spacing: 0.10em;
}

.catalog-check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 10px;
}

.catalog-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid var(--ui-border);
    border-radius: 13px;
    background: #ffffff;
    color: var(--ui-text-dark);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.35;
    cursor: pointer;
}

.catalog-check:hover {
    border-color: var(--ui-primary);
    background: var(--ui-light);
}

.catalog-check input {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--ui-primary);
}

.catalog-check span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.catalog-check strong,
.catalog-check small {
    display: block;
}

.catalog-check small {
    margin-top: 4px;
    color: var(--ui-muted);
    font-weight: 600;
}

.catalog-check-prominent {
    min-height: 76px;
    align-items: center;
    background: var(--ui-light);
}

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

.catalog-two-panels .panel-box {
    min-width: 0;
}

.catalog-card-grid,
.catalog-request-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr));
    gap: 18px;
}

.catalog-request-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
}

.catalog-card,
.catalog-request-card {
    display: flex;
    flex-direction: column;
    padding: 20px;
    border: 1px solid var(--ui-border);
    border-radius: 19px;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.catalog-card-active {
    border-top: 5px solid #16794a;
}

.catalog-card-inactive {
    border-top: 5px solid #c93636;
    background: #fffafa;
}

.catalog-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
}

.catalog-code,
.catalog-request-id {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    min-height: 38px;
    padding: 7px 10px;
    border-radius: 11px;
    background: var(--ui-primary);
    color: var(--ui-text-light);
    font-weight: 900;
    letter-spacing: 0.05em;
}

.catalog-request-id {
    background: var(--ui-light);
    color: var(--ui-primary);
}

.catalog-card h3,
.catalog-request-card h3 {
    margin: 16px 0 5px;
    color: var(--ui-primary);
    font-size: 19px;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.catalog-card-subtitle,
.catalog-card-note {
    margin: 0 0 16px;
    color: var(--ui-muted);
    font-size: 13px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.catalog-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 14px 0;
}

.catalog-meta-grid div {
    min-width: 0;
    padding: 10px;
    border-radius: 11px;
    background: var(--ui-light);
}

.catalog-meta-grid span,
.catalog-meta-grid strong {
    display: block;
    overflow-wrap: anywhere;
}

.catalog-meta-grid span {
    margin-bottom: 4px;
    color: var(--ui-muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.catalog-meta-grid strong {
    color: var(--ui-text-dark);
    font-size: 13px;
}

.catalog-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 2px 0 16px;
}

.catalog-tag-list span {
    max-width: 100%;
    padding: 5px 8px;
    border-radius: 999px;
    background: #eef5ff;
    color: var(--ui-primary);
    font-size: 10px;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.catalog-card-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--ui-border);
}

.catalog-card-actions .inline-form {
    max-width: 100%;
}

.catalog-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    text-align: center;
    overflow-wrap: anywhere;
}

.catalog-status-wait {
    background: #fff9db;
    color: #806000;
}

.catalog-status-approved {
    background: #eaf8f0;
    color: #11613a;
}

.catalog-status-rejected {
    background: #fdecec;
    color: #9d1f2e;
}

.catalog-status-cancelled {
    background: #edf2f7;
    color: #4a5568;
}

.alert-warning {
    border: 1px solid #efd48a;
    background: #fff9e8;
    color: #6f5200;
}

.catalog-inline-notice {
    margin: 0 0 14px;
    padding: 11px 13px;
    border-left: 4px solid var(--ui-primary);
    border-radius: 9px;
    background: var(--ui-light);
    color: var(--ui-muted);
    font-size: 13px;
    line-height: 1.5;
}

.catalog-final-outcome {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    min-width: 0;
}

.catalog-final-outcome p {
    min-width: 0;
    margin: 3px 0 0;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.catalog-detail-head h2 {
    overflow-wrap: anywhere;
}

.catalog-detail-grid > div {
    min-width: 0;
}

.catalog-detail-grid dd {
    overflow-wrap: anywhere;
}

.catalog-notes-box {
    margin-top: 16px;
    padding: 16px;
    border: 1px solid var(--ui-border);
    border-radius: 14px;
    background: var(--ui-light);
}

.catalog-notes-box strong,
.catalog-notes-box p {
    display: block;
    margin: 0;
}

.catalog-notes-box p {
    margin-top: 8px;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.catalog-request-form textarea {
    min-height: 120px;
}

.catalog-management-note {
    margin: 16px 0 0;
    color: var(--ui-muted);
    font-size: 13px;
}

.catalog-rule-requirement {
    display: inline-flex;
    align-self: flex-start;
    margin: 8px 0 14px;
    padding: 6px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
}

.catalog-rule-requirement.required {
    background: #eef5ff;
    color: var(--ui-primary);
}

.catalog-rule-requirement.optional {
    background: #edf2f7;
    color: #4a5568;
}

.catalog-rule-data {
    display: grid;
    gap: 6px;
    min-width: 0;
    margin-bottom: 14px;
}

.catalog-rule-data span {
    color: var(--ui-muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.catalog-rule-data code,
.catalog-rule-data strong {
    display: block;
    max-width: 100%;
    padding: 8px 10px;
    border-radius: 9px;
    background: var(--ui-light);
    color: var(--ui-text-dark);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

@media (max-width: 1280px) {
    .catalog-filters,
    .catalog-filters-compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .catalog-request-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

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

    .catalog-span-three {
        grid-column: span 1;
    }
}

@media (max-width: 760px) {
    .catalog-subnav,
    .catalog-filters,
    .catalog-filters-compact,
    .catalog-request-filters,
    .catalog-form-grid,
    .catalog-two-panels,
    .catalog-stats {
        grid-template-columns: 1fr;
    }

    .catalog-subnav {
        display: grid;
    }

    .catalog-subnav-link,
    .catalog-span-two,
    .catalog-span-three,
    .catalog-span-all {
        grid-column: auto;
    }

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

    .catalog-card,
    .catalog-request-card {
        padding: 16px;
    }

    .catalog-final-outcome {
        flex-direction: column;
    }
}

/* Manager 3000 v0.8.0 - Cataloghi centrali */
.central-catalog-nav .catalog-subnav-link {
    flex-basis: 145px;
}

.cap-subnav {
    margin-top: -10px;
    background: #ffffff;
}

.cap-subnav .catalog-subnav-link {
    flex-basis: 220px;
    border: 1px solid transparent;
}

.cap-subnav .catalog-subnav-link.active {
    border-color: var(--ui-border);
    background: var(--ui-light);
}

.central-overview-hero,
.carriers-hero {
    background:
        radial-gradient(circle at top right, rgba(42, 122, 84, 0.15), transparent 32%),
        radial-gradient(circle at bottom left, rgba(140, 0, 0, 0.10), transparent 31%),
        #ffffff;
}

.outcomes-hero {
    background:
        radial-gradient(circle at top right, rgba(33, 86, 165, 0.15), transparent 32%),
        #ffffff;
}

.cap-archive-hero {
    background:
        radial-gradient(circle at top right, rgba(244, 162, 97, 0.20), transparent 32%),
        #ffffff;
}

.migration-panel {
    border-left: 5px solid #c78900;
    background: #fffaf0;
}

.migration-panel > p {
    margin: 0 0 14px;
    color: #695519;
    line-height: 1.55;
}

.migration-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    gap: 10px;
}

.migration-item {
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid #efd48a;
    border-radius: 12px;
    background: #ffffff;
}

.migration-item strong,
.migration-item span {
    display: block;
    overflow-wrap: anywhere;
}

.migration-item span {
    margin-top: 5px;
    color: #6f5200;
    font-size: 12px;
}

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

.central-overview-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 22px;
    border: 1px solid var(--ui-border);
    border-top: 5px solid var(--ui-primary);
    border-radius: 19px;
    background: #ffffff;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.06);
}

.central-overview-card.is-unavailable {
    border-top-color: #c93636;
    background: #fffafa;
}

.central-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    min-width: 0;
}

.central-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    min-height: 42px;
    padding: 8px 10px;
    border-radius: 12px;
    background: var(--ui-primary);
    color: var(--ui-text-light);
    font-weight: 900;
    letter-spacing: 0.06em;
}

.central-overview-card h3 {
    margin: 18px 0 8px;
    color: var(--ui-primary);
    font-size: 21px;
}

.central-overview-card p {
    margin: 12px 0 18px;
    color: var(--ui-muted);
    line-height: 1.55;
}

.central-overview-card > .secondary-button {
    align-self: flex-start;
    margin-top: auto;
}

.central-metric-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 9px;
}

.central-metric-row > div {
    min-width: 0;
    padding: 11px;
    border-radius: 12px;
    background: var(--ui-light);
}

.central-metric-row span,
.central-metric-row strong {
    display: block;
}

.central-metric-row span {
    color: var(--ui-muted);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.central-metric-row strong {
    margin-top: 3px;
    color: var(--ui-primary);
    font-size: 23px;
}

.central-permission-note {
    margin-top: 20px;
}

.category-summary,
.catalog-capability-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    min-width: 0;
}

.category-summary {
    margin: 0 0 18px;
}

.category-badge,
.boolean-badge,
.outcome-ui-badge,
.protected-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    padding: 6px 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 900;
    text-align: center;
    overflow-wrap: anywhere;
}

.category-poste { background: #fff0dd; color: #8b4b00; }
.category-corriere { background: #eaf2ff; color: #174a91; }
.category-agenzia { background: #eaf8f0; color: #11613a; }
.category-circuito { background: #f2eafd; color: #663399; }

.catalog-capability-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0 0 14px;
}

.catalog-capability-grid span {
    min-width: 0;
    padding: 7px 5px;
    border: 1px solid var(--ui-border);
    border-radius: 9px;
    background: #f5f5f5;
    color: #8a8a8a;
    font-size: 10px;
    font-weight: 800;
    text-align: center;
    overflow-wrap: anywhere;
}

.catalog-capability-grid span.is-enabled {
    border-color: #b8dfc9;
    background: #eaf8f0;
    color: #11613a;
}

.strengthened-confirmation {
    border-left: 5px solid #c78900;
    background: #fffaf0;
}

.strengthened-confirmation p {
    margin: 0 0 14px;
    color: #695519;
    line-height: 1.55;
}

.strengthened-confirmation .form-row {
    max-width: 360px;
}

.catalog-check.is-locked {
    cursor: not-allowed;
    opacity: 0.72;
    background: #f4f4f4;
}

.filter-checkbox {
    align-self: end;
    min-height: 46px;
    align-items: center;
}

.cap-archive-filters,
.carrier-filters {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cap-archive-filters .filter-actions,
.carrier-filters .filter-actions {
    grid-column: 1 / -1;
}

.responsive-table-shell {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    border: 1px solid var(--ui-border);
    border-radius: 16px;
    background: #ffffff;
}

.responsive-data-table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.responsive-data-table th,
.responsive-data-table td {
    min-width: 0;
    padding: 11px 10px;
    border-bottom: 1px solid var(--ui-border);
    vertical-align: middle;
    text-align: left;
    line-height: 1.4;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.responsive-data-table th {
    background: var(--ui-light);
    color: var(--ui-primary);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.responsive-data-table td {
    color: var(--ui-text-dark);
    font-size: 12px;
}

.responsive-data-table tbody tr:last-child td {
    border-bottom: 0;
}

.responsive-data-table td > strong,
.responsive-data-table td > small,
.responsive-data-table td > span {
    display: block;
    max-width: 100%;
}

.responsive-data-table td > small {
    margin-top: 4px;
    color: var(--ui-muted);
    font-size: 10px;
}

.responsive-data-table .small-button {
    max-width: 100%;
    white-space: normal;
}

.cap-data-table th:nth-child(1) { width: 9%; }
.cap-data-table th:nth-child(2) { width: 12%; }
.cap-data-table th:nth-child(3) { width: 35%; }
.cap-data-table th:nth-child(4) { width: 12%; }
.cap-data-table th:nth-child(5) { width: 18%; }
.cap-data-table th:nth-child(6) { width: 14%; }

.outcome-ui-neutral { background: #edf2f7; color: #4a5568; }
.outcome-ui-success { background: #eaf8f0; color: #11613a; }
.outcome-ui-warning { background: #fff9db; color: #806000; }
.outcome-ui-danger { background: #fdecec; color: #9d1f2e; }
.outcome-ui-info { background: #eaf2ff; color: #174a91; }

.boolean-badge.yes { background: #eaf8f0; color: #11613a; }
.boolean-badge.no { background: #edf2f7; color: #4a5568; }
.protected-badge { align-self: flex-start; background: #fff0dd; color: #8b4b00; }

.tracking-test-control {
    min-width: 0;
}

.tracking-test-control > label {
    display: block;
    margin-bottom: 7px;
    color: var(--ui-text-dark);
    font-size: 13px;
    font-weight: 800;
}

.tracking-test-control > div {
    display: flex;
    align-items: stretch;
    gap: 7px;
    min-width: 0;
}

.tracking-test-control input {
    min-width: 0;
    width: 100%;
}

.tracking-test-control .small-button {
    flex: 0 0 auto;
    margin: 0;
}

.carrier-rules-panel {
    margin-top: 22px;
}

.carrier-rule-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 350px), 1fr));
    gap: 15px;
}

.carrier-rule-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--ui-border);
    border-top: 4px solid #16794a;
    border-radius: 16px;
    background: #ffffff;
}

.carrier-rule-card.is-inactive {
    border-top-color: #c93636;
    background: #fffafa;
}

.carrier-rule-card h3 {
    margin: 13px 0 10px;
    color: var(--ui-primary);
    overflow-wrap: anywhere;
}

.compact-rule-form {
    display: grid;
    gap: 11px;
    min-width: 0;
    margin-top: 14px;
}

.compact-rule-form textarea {
    min-height: 92px;
    font-family: inherit;
    overflow-wrap: anywhere;
}

.compact-rule-form > .small-button {
    justify-self: start;
}

.new-rule-form {
    min-width: 0;
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--ui-border);
}

.new-rule-form h3 {
    margin: 0 0 14px;
    color: var(--ui-primary);
}

.break-url,
.table-url {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.table-url {
    color: var(--ui-primary);
    font-weight: 800;
}

.carrier-readonly-panel .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 1500px) {
    .outcomes-data-table,
    .carriers-data-table,
    .outcomes-data-table tbody,
    .carriers-data-table tbody {
        display: block;
        width: 100%;
    }

    .outcomes-data-table thead,
    .carriers-data-table thead {
        display: none;
    }

    .outcomes-data-table tr,
    .carriers-data-table tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0;
        padding: 12px;
        border-bottom: 1px solid var(--ui-border);
    }

    .outcomes-data-table tbody tr:last-child,
    .carriers-data-table tbody tr:last-child {
        border-bottom: 0;
    }

    .outcomes-data-table td,
    .carriers-data-table td {
        display: grid;
        grid-template-columns: minmax(110px, 0.65fr) minmax(0, 1.35fr);
        align-items: start;
        gap: 10px;
        min-width: 0;
        border-bottom: 1px dashed var(--ui-border);
    }

    .outcomes-data-table td::before,
    .carriers-data-table td::before {
        content: attr(data-label);
        color: var(--ui-muted);
        font-size: 10px;
        font-weight: 900;
        text-transform: uppercase;
    }
}

@media (max-width: 1280px) {
    .cap-archive-filters,
    .carrier-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 920px) {
    .central-overview-grid {
        grid-template-columns: 1fr;
    }

    .cap-data-table,
    .cap-data-table tbody {
        display: block;
        width: 100%;
    }

    .cap-data-table thead {
        display: none;
    }

    .cap-data-table tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 12px;
        border-bottom: 1px solid var(--ui-border);
    }

    .cap-data-table td {
        display: grid;
        grid-template-columns: minmax(90px, 0.6fr) minmax(0, 1.4fr);
        gap: 9px;
        border-bottom: 1px dashed var(--ui-border);
    }

    .cap-data-table td::before {
        content: attr(data-label);
        color: var(--ui-muted);
        font-size: 10px;
        font-weight: 900;
        text-transform: uppercase;
    }
}

@media (max-width: 700px) {
    .cap-archive-filters,
    .carrier-filters,
    .outcomes-data-table tr,
    .carriers-data-table tr,
    .cap-data-table tr,
    .carrier-readonly-panel .detail-grid {
        grid-template-columns: 1fr;
    }

    .outcomes-data-table td,
    .carriers-data-table td,
    .cap-data-table td {
        grid-template-columns: 1fr;
        gap: 4px;
    }

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

    .tracking-test-control > div {
        flex-direction: column;
    }
}

/* Manager 3000 v0.9.0 - supervisione centralizzata */
.technical-grid-four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.technical-warning {
    border-color: #efd597;
    background: #fff8e5;
}

.technical-warning span {
    color: #806000;
}

.technical-note {
    margin: 16px 0 0;
    color: var(--p3000-muted);
    font-size: 13px;
    line-height: 1.55;
}

.technical-note code {
    color: var(--p3000-blue);
    font-weight: 800;
    overflow-wrap: anywhere;
}

.technical-filter-form {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto;
    align-items: end;
    gap: 14px;
}

.technical-request-form {
    grid-template-columns: minmax(320px, 1fr) auto;
}

.technical-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 20px 0 16px;
}

.technical-summary span {
    padding: 12px 14px;
    border: 1px solid var(--p3000-border);
    border-radius: 13px;
    background: #f8fbff;
    color: var(--p3000-muted);
    font-size: 12px;
    font-weight: 800;
}

.technical-summary strong {
    display: block;
    margin-top: 4px;
    color: var(--p3000-blue);
    font-size: 22px;
}

.technical-agency-table {
    min-width: 980px;
    font-size: 13px;
}

.technical-agency-table td > small,
.technical-agency-table td .technical-status + small {
    display: block;
    margin-top: 5px;
    color: var(--p3000-muted);
    font-size: 11px;
    line-height: 1.35;
}

.technical-status {
    display: inline-flex;
    padding: 5px 9px;
    border: 1px solid var(--p3000-border);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
}

.technical-status.technical-ok {
    color: #11613a;
}

.technical-status.technical-warning {
    color: #806000;
}

.technical-status.technical-ko {
    color: #9d1f2e;
}

.technical-log-preview {
    max-height: 340px;
    margin: 18px 0 0;
    padding: 16px;
    overflow: auto;
    border: 1px solid var(--p3000-border);
    border-radius: 14px;
    background: #10233f;
    color: #eef5ff;
    font: 12px/1.55 Consolas, Monaco, monospace;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.technical-export-form {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 16px;
    padding: 16px;
    border: 1px solid var(--p3000-border);
    border-radius: 14px;
    background: #f8fbff;
}

.technical-export-form .check-row {
    display: flex;
    align-items: center;
    gap: 9px;
}

@media (max-width: 1100px) {
    .technical-grid-four,
    .technical-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .technical-grid-four,
    .technical-summary,
    .technical-filter-form {
        grid-template-columns: 1fr;
    }

    .technical-export-form {
        align-items: stretch;
        flex-direction: column;
    }
}
