: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;
}

.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;
}

.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;
}

.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;
    }

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

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

    .main-area {
        padding: 18px;
    }

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

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

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

@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;
}
.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;
}

/* REPORT 3000 v0.1.1 - diagnostica database */
.diagnostic-callout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 20px;
    border: 1px solid var(--ui-border);
    border-radius: 16px;
    background: var(--ui-light);
}

.diagnostic-callout strong,
.diagnostic-agency-name {
    color: var(--ui-primary);
}

.diagnostic-callout p {
    margin: 6px 0 0;
    color: var(--ui-muted);
    line-height: 1.55;
}

.diagnostic-form {
    grid-template-columns: minmax(260px, 1fr) auto;
    align-items: end;
}

.diagnostic-actions {
    padding-bottom: 1px;
}

.diagnostic-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.diagnostic-agency-name {
    margin: -6px 0 16px;
    font-weight: 800;
}

.diagnostic-details {
    margin-top: 18px;
    padding: 15px 17px;
    border: 1px solid var(--ui-border);
    border-radius: 14px;
    background: var(--ui-light);
}

.diagnostic-details summary {
    color: var(--ui-primary);
    font-weight: 900;
    cursor: pointer;
}

.diagnostic-details p {
    margin: 12px 0 0;
    color: var(--ui-muted);
    line-height: 1.65;
    overflow-wrap: anywhere;
}

@media (max-width: 760px) {
    .diagnostic-callout,
    .diagnostic-form {
        display: grid;
        grid-template-columns: 1fr;
    }

    .diagnostic-callout .secondary-button,
    .diagnostic-actions > * {
        width: 100%;
    }
}

/* REPORT 3000 v0.2.0 - report operazioni multi-agenzia */
.report-filter-form {
    display: grid;
    gap: 22px;
}

.report-date-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 260px));
    gap: 16px;
}

.report-field {
    display: grid;
    gap: 8px;
    color: var(--ui-text-dark);
    font-weight: 800;
}

.report-field input,
.report-field select {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid var(--ui-border);
    border-radius: 10px;
    background: #fff;
    color: var(--ui-text-dark);
    font: inherit;
    font-weight: 600;
}

.report-field input:focus,
.report-field select:focus {
    border-color: var(--ui-primary);
    box-shadow: 0 0 0 4px rgba(140, 0, 0, 0.12);
    outline: none;
}

.report-agency-fieldset {
    min-width: 0;
    margin: 0;
    padding: 18px;
    border: 1px solid var(--ui-border);
    border-radius: 16px;
}

.report-agency-fieldset legend {
    padding: 0 8px;
    color: var(--ui-primary);
    font-weight: 900;
}

.report-all-agencies,
.report-agency-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.report-all-agencies {
    padding: 14px 16px;
    border: 1px solid var(--ui-border);
    border-radius: 13px;
    background: var(--ui-light);
}

.report-all-agencies input,
.report-agency-option input {
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    accent-color: var(--ui-primary);
    flex: 0 0 auto;
}

.report-all-agencies span {
    display: grid;
    gap: 3px;
}

.report-all-agencies small {
    color: var(--ui-muted);
    font-weight: 600;
}

.report-agency-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px 14px;
    max-height: 290px;
    margin-top: 14px;
    padding: 4px;
    overflow: auto;
}

.report-agency-option {
    min-width: 0;
    padding: 10px 11px;
    border: 1px solid var(--ui-border);
    border-radius: 11px;
    background: #fff;
    color: var(--ui-text-dark);
    font-size: 13px;
    font-weight: 750;
    line-height: 1.35;
}

.report-agency-option:hover {
    border-color: var(--ui-primary);
}

.report-agency-option span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.report-result-heading .panel-header {
    align-items: center;
}

.report-result-heading .panel-header p {
    margin: 4px 0 0;
    color: var(--ui-muted);
    font-weight: 700;
}

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

.report-summary-grid .stat-card strong {
    font-size: clamp(22px, 2.4vw, 32px);
}

.report-export-form {
    flex: 0 0 auto;
}

.report-export-form button {
    font: inherit;
}

.report-warning-panel details,
.report-detail-panel details {
    border: 0;
}

.report-warning-panel summary,
.report-detail-panel summary {
    color: var(--ui-primary);
    font-weight: 900;
    cursor: pointer;
}

.report-warning-panel ul {
    margin: 14px 0 0;
    padding-left: 22px;
    color: var(--ui-muted);
    line-height: 1.65;
}

.report-daily-chart {
    display: flex;
    align-items: stretch;
    gap: 5px;
    min-height: 260px;
    padding: 22px 8px 0;
    overflow-x: auto;
    border-bottom: 1px solid var(--ui-border);
}

.report-chart-column {
    display: grid;
    grid-template-rows: 28px 180px 28px;
    align-items: end;
    justify-items: center;
    min-width: 22px;
    flex: 1 0 22px;
}

.report-chart-value {
    color: var(--ui-muted);
    font-size: 10px;
    font-weight: 800;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

.report-chart-bar {
    width: min(18px, 78%);
    height: var(--bar-height);
    min-height: 0;
    border-radius: 7px 7px 2px 2px;
    background: linear-gradient(180deg, var(--ui-primary) 0%, var(--ui-primary-dark) 100%);
    box-shadow: 0 5px 12px rgba(140, 0, 0, 0.14);
}

.report-chart-label {
    min-width: 34px;
    color: var(--ui-muted);
    font-size: 10px;
    font-weight: 750;
    text-align: center;
}

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

.report-two-column .panel-box {
    min-width: 0;
    margin: 0;
}

.report-table-wrap {
    max-height: 520px;
    overflow: auto;
}

.report-data-table {
    min-width: 620px;
}

.report-data-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--ui-light);
}

.report-data-table th:not(:first-child),
.report-data-table td:not(:first-child) {
    text-align: right;
}

.report-detail-panel summary {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 3px 0 15px;
}

.report-detail-panel summary small {
    color: var(--ui-muted);
}

.report-detail-table {
    min-width: 980px;
}

.report-detail-table th:nth-child(2),
.report-detail-table td:nth-child(2),
.report-detail-table th:last-child,
.report-detail-table td:last-child {
    text-align: left;
}

.report-detail-note {
    margin: 14px 0 0;
    color: var(--ui-muted);
    font-size: 13px;
    line-height: 1.55;
}

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

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

    .report-two-column {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .report-date-grid,
    .report-agency-grid,
    .report-summary-grid {
        grid-template-columns: 1fr;
    }

    .report-result-heading .panel-header,
    .report-detail-panel summary {
        align-items: stretch;
        flex-direction: column;
    }

    .report-export-form,
    .report-export-form button,
    .report-filter-actions > * {
        width: 100%;
    }
}

/* REPORT 3000 v0.7.0 - tracking, recapito e scambio */
.report-tracking-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

/* REPORT 3000 v0.8.0 - esportazioni cumulative */
.report-export-hero {
    background:
        linear-gradient(120deg, var(--ui-primary) 0%, var(--ui-primary-dark) 68%, #1f2937 100%);
}

.export-filter-panel {
    border-top: 4px solid var(--ui-primary);
}

.export-module-fieldset {
    margin: 0;
    padding: 18px;
    border: 1px solid var(--p3000-border);
    border-radius: 14px;
    background: #fff;
}

.export-module-fieldset legend {
    padding: 0 8px;
    font-weight: 800;
    color: var(--p3000-text);
}

.export-module-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.export-module-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-height: 86px;
    padding: 14px;
    border: 1px solid var(--p3000-border);
    border-radius: 12px;
    background: var(--ui-light);
    cursor: pointer;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.export-module-option:hover {
    border-color: var(--ui-primary);
    box-shadow: 0 8px 22px rgba(0, 0, 0, .07);
    transform: translateY(-1px);
}

.export-module-option input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--ui-primary);
}

.export-module-option span {
    display: grid;
    gap: 5px;
}

.export-module-option strong {
    font-size: 14px;
    color: var(--p3000-text);
}

.export-module-option small {
    font-size: 12px;
    line-height: 1.45;
    color: var(--p3000-muted);
}

.export-actions {
    align-items: center;
}

.export-result-heading {
    border-left: 4px solid var(--ui-primary);
}

.export-module-results {
    display: grid;
    gap: 18px;
}

.export-module-result .panel-header p {
    margin: 5px 0 0;
    color: var(--p3000-muted);
    font-size: 13px;
}

.export-metric-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.export-metric-grid .stat-card strong {
    font-size: 22px;
}

.export-agency-overview .report-table-wrap {
    max-height: 680px;
}

.export-number-cell {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

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

@media (max-width: 720px) {
    .export-module-grid {
        grid-template-columns: 1fr;
    }

    .export-actions > * {
        width: 100%;
        justify-content: center;
    }
}

.report-tracking-search-field {
    grid-column: span 2;
}

.report-tracking-summary-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.report-tracking-summary-grid .stat-card strong,
.report-tracking-mini-grid .stat-card strong {
    font-size: clamp(21px, 2.2vw, 30px);
}

.tracking-success-card {
    border-color: color-mix(in srgb, #198754 34%, var(--ui-border));
}

.tracking-success-card strong {
    color: #176c46;
}

.tracking-alert-card {
    border-color: color-mix(in srgb, var(--ui-primary) 36%, var(--ui-border));
}

.tracking-alert-card strong {
    color: var(--ui-primary);
}

.report-tracking-overview {
    margin-bottom: 18px;
}

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

.report-privacy-note {
    margin: 0 0 18px;
    padding: 13px 16px;
    border: 1px solid var(--ui-border);
    border-radius: 12px;
    background: var(--ui-light);
    color: var(--ui-muted);
    font-size: 13px;
    font-weight: 650;
    line-height: 1.55;
}

.tracking-daily-table {
    min-width: 690px;
}

.tracking-agency-table {
    min-width: 760px;
}

.tracking-outcome-table {
    min-width: 610px;
}

.tracking-outcome-table th:nth-child(3),
.tracking-outcome-table td:nth-child(3) {
    text-align: left;
}

.tracking-detail-table {
    min-width: 1560px;
}

.tracking-detail-table th,
.tracking-detail-table td {
    text-align: left !important;
    vertical-align: top;
}

.tracking-detail-table td:first-child,
.tracking-detail-table td:nth-child(4) {
    white-space: nowrap;
}

@media (max-width: 1180px) {
    .report-tracking-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

@media (max-width: 700px) {
    .report-tracking-filter-grid,
    .report-tracking-summary-grid,
    .report-tracking-mini-grid {
        grid-template-columns: 1fr;
    }

    .report-tracking-search-field {
        grid-column: auto;
    }
}

/* REPORT 3000 v0.3.0 - fatturazione e incassi */
.report-billing-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.billing-collected {
    border-color: color-mix(in srgb, #198754 32%, var(--ui-border));
}

.billing-collected strong {
    color: #176c46;
}

.billing-outstanding {
    border-color: color-mix(in srgb, var(--ui-primary) 32%, var(--ui-border));
}

.billing-outstanding strong {
    color: var(--ui-primary);
}

.billing-agency-table,
.billing-client-table {
    min-width: 880px;
}

.billing-client-table th:nth-child(2),
.billing-client-table td:nth-child(2),
.billing-agency-table th:first-child,
.billing-agency-table td:first-child {
    text-align: left;
}

.billing-detail-table {
    min-width: 1480px;
}

.billing-detail-table th:nth-child(2),
.billing-detail-table td:nth-child(2),
.billing-detail-table th:nth-child(4),
.billing-detail-table td:nth-child(4),
.billing-detail-table th:nth-child(5),
.billing-detail-table td:nth-child(5),
.billing-detail-table th:nth-child(6),
.billing-detail-table td:nth-child(6),
.billing-detail-table th:last-child,
.billing-detail-table td:last-child {
    text-align: left;
}

.report-status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 9px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    line-height: 1.2;
    white-space: nowrap;
}

.report-status-badge.is-paid {
    border-color: #a8d9c2;
    background: #e9f7f0;
    color: #176c46;
}

.report-status-badge.is-partial {
    border-color: #ead49b;
    background: #fff8e3;
    color: #775b10;
}

.report-status-badge.is-unpaid {
    border-color: color-mix(in srgb, var(--ui-primary) 30%, var(--ui-border));
    background: color-mix(in srgb, var(--ui-primary) 8%, #fff);
    color: var(--ui-primary);
}

.billing-method-note .empty-state {
    text-align: left;
}

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

@media (max-width: 700px) {
    .report-billing-summary-grid {
        grid-template-columns: 1fr;
    }
}

/* REPORT 3000 v0.4.0 - clienti business */
.report-business-filter-grid {
    display: grid;
    grid-template-columns: minmax(260px, 1.7fr) repeat(3, minmax(170px, 1fr));
    gap: 16px;
}

.report-search-field input {
    min-width: 0;
}

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

.business-active-card {
    border-color: color-mix(in srgb, #198754 32%, var(--ui-border));
}

.business-active-card strong {
    color: #176c46;
}

.business-inactive-card {
    border-color: color-mix(in srgb, #b07800 32%, var(--ui-border));
}

.business-inactive-card strong {
    color: #775b10;
}

.business-agency-table,
.business-price-list-table {
    min-width: 720px;
}

.business-agency-table th:first-child,
.business-agency-table td:first-child,
.business-price-list-table th:first-child,
.business-price-list-table td:first-child {
    text-align: left;
}

.business-client-table-wrap {
    max-height: 680px;
}

.business-client-table {
    min-width: 1560px;
}

.business-client-table th:nth-child(1),
.business-client-table td:nth-child(1),
.business-client-table th:nth-child(2),
.business-client-table td:nth-child(2),
.business-client-table th:nth-child(3),
.business-client-table td:nth-child(3),
.business-client-table th:nth-child(4),
.business-client-table td:nth-child(4),
.business-client-table th:nth-child(5),
.business-client-table td:nth-child(5),
.business-client-table th:nth-child(6),
.business-client-table td:nth-child(6),
.business-client-table th:last-child,
.business-client-table td:last-child {
    text-align: left;
}

.business-client-cell {
    min-width: 260px;
}

.business-client-cell strong,
.business-client-cell small {
    display: block;
}

.business-client-cell strong {
    color: var(--ui-text-dark);
}

.business-client-cell small {
    margin-top: 4px;
    color: var(--ui-muted);
    font-size: 11px;
    line-height: 1.35;
}

.business-badge {
    display: inline-flex;
    align-items: center;
    min-height: 27px;
    padding: 5px 9px;
    border: 1px solid var(--ui-border);
    border-radius: 999px;
    background: var(--ui-light);
    color: var(--ui-text-dark);
    font-size: 11px;
    font-weight: 900;
    line-height: 1.2;
    white-space: nowrap;
}

.business-badge.is-master,
.business-badge.is-full {
    border-color: color-mix(in srgb, var(--ui-primary) 28%, var(--ui-border));
    background: color-mix(in srgb, var(--ui-primary) 8%, #fff);
    color: var(--ui-primary);
}

.business-badge.is-child {
    border-color: #a8d9c2;
    background: #e9f7f0;
    color: #176c46;
}

.business-badge.is-light,
.business-badge.is-standard {
    color: var(--ui-muted);
}

.business-method-note .empty-state {
    text-align: left;
}

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

@media (max-width: 700px) {
    .report-business-filter-grid,
    .report-business-summary-grid {
        grid-template-columns: 1fr;
    }
}

/* REPORT 3000 v0.5.0 - richieste di ritiro e reclami */
.report-flows-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 16px;
}

.report-flows-search-field {
    grid-column: span 2;
}

.report-flows-summary-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.flow-pickup-card {
    border-color: color-mix(in srgb, var(--ui-primary) 32%, var(--ui-border));
}

.flow-pickup-card strong {
    color: var(--ui-primary);
}

.flow-complaint-card {
    border-color: color-mix(in srgb, #6f42c1 32%, var(--ui-border));
}

.flow-complaint-card strong {
    color: #6339a8;
}

.flow-pending-card {
    border-color: color-mix(in srgb, #b07800 34%, var(--ui-border));
}

.flow-pending-card strong {
    color: #775b10;
}

.flow-rejected-card {
    border-color: color-mix(in srgb, #b42318 30%, var(--ui-border));
}

.flow-rejected-card strong {
    color: #a02219;
}

.flow-closed-card {
    border-color: color-mix(in srgb, #198754 32%, var(--ui-border));
}

.flow-closed-card strong {
    color: #176c46;
}

.flows-agency-table,
.flows-status-table,
.flows-client-table {
    min-width: 760px;
}

.flows-agency-table th:first-child,
.flows-agency-table td:first-child,
.flows-status-table th:first-child,
.flows-status-table td:first-child,
.flows-status-table th:nth-child(3),
.flows-status-table td:nth-child(3),
.flows-client-table th:first-child,
.flows-client-table td:first-child,
.flows-client-table th:nth-child(2),
.flows-client-table td:nth-child(2) {
    text-align: left;
}

.flow-type-badge,
.flow-status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 27px;
    padding: 5px 9px;
    border: 1px solid var(--ui-border);
    border-radius: 999px;
    background: var(--ui-light);
    color: var(--ui-text-dark);
    font-size: 11px;
    font-weight: 900;
    line-height: 1.2;
    white-space: nowrap;
}

.flow-type-badge.is-pickup {
    border-color: color-mix(in srgb, var(--ui-primary) 28%, var(--ui-border));
    background: color-mix(in srgb, var(--ui-primary) 8%, #fff);
    color: var(--ui-primary);
}

.flow-type-badge.is-complaint {
    border-color: #d5c2f1;
    background: #f3edfb;
    color: #6339a8;
}

.flow-status-badge.status-0 {
    border-color: #ead69e;
    background: #fff8e5;
    color: #775b10;
}

.flow-status-badge.status-1 {
    border-color: color-mix(in srgb, var(--ui-primary) 28%, var(--ui-border));
    background: color-mix(in srgb, var(--ui-primary) 8%, #fff);
    color: var(--ui-primary);
}

.flow-status-badge.status-2 {
    border-color: #e6b1ad;
    background: #fff0ef;
    color: #a02219;
}

.flow-status-badge.status-3 {
    border-color: #a8d9c2;
    background: #e9f7f0;
    color: #176c46;
}

.flows-detail-table-wrap {
    max-height: 720px;
}

.flows-detail-table {
    min-width: 1640px;
}

.flows-detail-table th:nth-child(1),
.flows-detail-table td:nth-child(1),
.flows-detail-table th:nth-child(2),
.flows-detail-table td:nth-child(2),
.flows-detail-table th:nth-child(3),
.flows-detail-table td:nth-child(3),
.flows-detail-table th:nth-child(5),
.flows-detail-table td:nth-child(5),
.flows-detail-table th:nth-child(6),
.flows-detail-table td:nth-child(6),
.flows-detail-table th:nth-child(7),
.flows-detail-table td:nth-child(7),
.flows-detail-table th:nth-child(8),
.flows-detail-table td:nth-child(8) {
    text-align: left;
}

.flow-subject-cell {
    min-width: 280px;
}

.flow-subject-cell strong,
.flow-subject-cell small {
    display: block;
}

.flow-subject-cell strong {
    color: var(--ui-text-dark);
}

.flow-subject-cell small {
    margin-top: 4px;
    color: var(--ui-muted);
    font-size: 11px;
    line-height: 1.35;
}

.flows-method-note .empty-state {
    text-align: left;
}

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

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

@media (max-width: 700px) {
    .report-flows-filter-grid,
    .report-flows-summary-grid {
        grid-template-columns: 1fr;
    }

    .report-flows-search-field {
        grid-column: auto;
    }
}

/* REPORT 3000 v0.6.0 - cassa e sessioni di lavoro */
.report-cash-filter-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(150px, 1fr));
    gap: 16px;
}

.report-cash-search-field {
    grid-column: span 2;
}

.report-filter-note,
.report-result-note {
    margin: 14px 0 0;
    color: var(--ui-muted);
    font-size: 12px;
    line-height: 1.5;
}

.report-cash-summary-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.cash-entry-card {
    border-color: color-mix(in srgb, #198754 32%, var(--ui-border));
}

.cash-entry-card strong,
.cash-positive {
    color: #176c46;
}

.cash-exit-card {
    border-color: color-mix(in srgb, #b42318 30%, var(--ui-border));
}

.cash-exit-card strong,
.cash-negative {
    color: #a02219;
}

.cash-balance-card {
    border-color: color-mix(in srgb, var(--ui-primary) 34%, var(--ui-border));
}

.cash-balance-card strong {
    color: var(--ui-primary);
}

.cash-daily-table-wrap {
    max-height: 520px;
}

.cash-daily-table,
.cash-agency-table,
.cash-register-table,
.cash-source-table,
.cash-session-status-table {
    min-width: 720px;
}

.cash-daily-table th:first-child,
.cash-daily-table td:first-child,
.cash-agency-table th:first-child,
.cash-agency-table td:first-child,
.cash-register-table th:first-child,
.cash-register-table td:first-child,
.cash-source-table th:first-child,
.cash-source-table td:first-child,
.cash-session-status-table th:first-child,
.cash-session-status-table td:first-child {
    text-align: left;
}

.cash-code-badge,
.cash-type-badge,
.cash-invoice-badge {
    display: inline-flex;
    align-items: center;
    min-height: 27px;
    padding: 5px 9px;
    border: 1px solid var(--ui-border);
    border-radius: 999px;
    background: var(--ui-light);
    color: var(--ui-text-dark);
    font-size: 11px;
    font-weight: 900;
    line-height: 1.2;
    white-space: nowrap;
}

.cash-type-badge.type-1,
.cash-invoice-badge.is-invoiced {
    border-color: #a8d9c2;
    background: #e9f7f0;
    color: #176c46;
}

.cash-type-badge.type-2 {
    border-color: #e6b1ad;
    background: #fff0ef;
    color: #a02219;
}

.cash-invoice-badge.is-not-invoiced {
    border-color: #ead69e;
    background: #fff8e5;
    color: #775b10;
}

.cash-detail-table-wrap {
    max-height: 720px;
}

.cash-movement-detail-table {
    min-width: 1280px;
}

.cash-session-detail-table {
    min-width: 1380px;
}

.cash-movement-detail-table th:nth-child(1),
.cash-movement-detail-table td:nth-child(1),
.cash-movement-detail-table th:nth-child(2),
.cash-movement-detail-table td:nth-child(2),
.cash-movement-detail-table th:nth-child(5),
.cash-movement-detail-table td:nth-child(5),
.cash-movement-detail-table th:nth-child(6),
.cash-movement-detail-table td:nth-child(6),
.cash-movement-detail-table th:nth-child(8),
.cash-movement-detail-table td:nth-child(8),
.cash-session-detail-table th:nth-child(1),
.cash-session-detail-table td:nth-child(1),
.cash-session-detail-table th:nth-child(2),
.cash-session-detail-table td:nth-child(2),
.cash-session-detail-table th:nth-child(4),
.cash-session-detail-table td:nth-child(4),
.cash-session-detail-table th:nth-child(6),
.cash-session-detail-table td:nth-child(6),
.cash-session-detail-table th:nth-child(7),
.cash-session-detail-table td:nth-child(7) {
    text-align: left;
}

.cash-cause-cell {
    min-width: 320px;
    white-space: normal;
    line-height: 1.4;
}

@media (max-width: 1320px) {
    .report-cash-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

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

@media (max-width: 700px) {
    .report-cash-filter-grid,
    .report-cash-summary-grid {
        grid-template-columns: 1fr;
    }

    .report-cash-search-field {
        grid-column: auto;
    }
}

/* REPORT 3000 v0.9.0 - matrice compatibilità report */
.badge-warning {
    background: #fff6dc;
    color: #775b10;
}

.diagnostic-compatibility-panel .panel-header p {
    margin: 5px 0 0;
    color: var(--ui-muted);
    font-size: 13px;
}

.diagnostic-compatibility-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 20px;
}

.diagnostic-ready-card {
    border-color: #a8d9c2;
}

.diagnostic-ready-card strong {
    color: #176c46;
}

.diagnostic-partial-card {
    border-color: #ead69e;
}

.diagnostic-partial-card strong {
    color: #775b10;
}

.diagnostic-missing-card {
    border-color: #e6b1ad;
}

.diagnostic-missing-card strong {
    color: #a02219;
}

.diagnostic-compatibility-table {
    min-width: 980px;
}

.diagnostic-compatibility-table th:first-child,
.diagnostic-compatibility-table td:first-child,
.diagnostic-compatibility-table th:nth-child(2),
.diagnostic-compatibility-table td:nth-child(2) {
    text-align: left;
}

.diagnostic-compatibility-table td:first-child strong {
    display: block;
    color: var(--ui-text-dark);
}

.diagnostic-compatibility-table td:first-child small {
    display: block;
    margin-top: 4px;
    color: var(--ui-muted);
}

.diagnostic-component-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.diagnostic-component {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 180px;
    padding: 8px 10px;
    border: 1px solid var(--ui-border);
    border-radius: 11px;
    background: var(--ui-light);
}

.diagnostic-component > span:first-child {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-weight: 900;
}

.diagnostic-component.is-available > span:first-child {
    background: #e3f5eb;
    color: #176c46;
}

.diagnostic-component.is-missing > span:first-child {
    background: #fdecec;
    color: #a02219;
}

.diagnostic-component strong,
.diagnostic-component small {
    display: block;
}

.diagnostic-component strong {
    font-size: 12px;
    color: var(--ui-text-dark);
}

.diagnostic-component small {
    margin-top: 2px;
    color: var(--ui-muted);
    font-size: 10px;
}

.diagnostic-compatibility-note {
    margin: 16px 0 0;
    color: var(--ui-muted);
    font-size: 12px;
    line-height: 1.55;
}

@media (max-width: 760px) {
    .diagnostic-compatibility-stats {
        grid-template-columns: 1fr;
    }
}

/* REPORT 3000 v0.9.1 - centro report, filtri compatti e responsive */
.dashboard-stats-grid {
    grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.dashboard-environment-value {
    font-size: 22px !important;
}

.dashboard-report-access,
.report-center-help {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.dashboard-report-access-copy,
.report-center-help > div {
    min-width: 0;
}

.dashboard-report-access h2,
.report-center-help strong {
    color: var(--ui-primary);
}

.dashboard-report-access h2 {
    margin: 3px 0 7px;
}

.dashboard-report-access p,
.report-center-help p {
    margin: 0;
    max-width: 760px;
    color: var(--ui-muted);
    line-height: 1.55;
}

.dashboard-report-access .primary-button,
.report-center-help .light-button {
    flex: 0 0 auto;
    margin: 0;
}

.report-center-hero {
    margin-bottom: 22px;
}

.report-center-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 22px;
}

.report-center-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    min-height: 260px;
    margin: 0;
}

.report-center-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: var(--ui-primary-soft);
    color: var(--ui-primary);
    font-size: 20px;
    font-weight: 900;
}

.report-center-copy {
    flex: 1 1 auto;
}

.report-center-status {
    display: block;
    margin: 14px 0 5px;
    color: var(--ui-muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.report-center-card h2 {
    margin: 0;
    color: var(--ui-primary);
    font-size: 21px;
}

.report-center-card p {
    margin: 9px 0 18px;
    color: var(--ui-muted);
    font-size: 13px;
    line-height: 1.5;
}

.report-center-card .secondary-button {
    width: 100%;
}

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

.report-agency-specific-button {
    min-height: 46px;
    white-space: nowrap;
}

.report-agency-specific-panel {
    margin-top: 14px;
}

.report-agency-specific-panel.is-collapsed {
    display: none;
}

.report-agency-toolbar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto auto;
    align-items: end;
    gap: 12px;
    margin-bottom: 12px;
}

.report-agency-search {
    display: grid;
    gap: 6px;
    color: var(--ui-text-dark);
    font-size: 12px;
    font-weight: 800;
}

.report-agency-search input {
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid var(--ui-border);
    border-radius: 10px;
    background: #fff;
    color: var(--ui-text-dark);
    font: inherit;
}

.report-agency-search input:focus {
    border-color: var(--ui-primary);
    box-shadow: 0 0 0 4px rgba(140, 0, 0, 0.1);
    outline: none;
}

.report-agency-bulk-actions {
    display: flex;
    gap: 8px;
}

.report-agency-bulk-actions .light-button {
    min-height: 42px;
    padding: 9px 12px;
    white-space: nowrap;
}

.report-agency-count {
    padding-bottom: 12px;
    color: var(--ui-muted);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.report-table-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 8px;
}

.report-scroll-hint {
    color: var(--ui-muted);
    font-size: 11px;
    font-weight: 700;
}

.report-scroll-hint::before {
    content: '↔ ';
    color: var(--ui-primary);
    font-weight: 900;
}

.report-table-toggle {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 11px;
    white-space: nowrap;
}

.report-data-table th:first-child,
.report-data-table td:first-child {
    position: sticky;
    left: 0;
}

.report-data-table th:first-child {
    z-index: 3;
}

.report-data-table td:first-child {
    z-index: 2;
    background: #fff;
    box-shadow: 7px 0 10px -10px rgba(20, 40, 70, 0.7);
}

@media (max-width: 1450px) {
    .report-two-column {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1320px) {
    .report-center-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 901px) and (max-width: 1180px) {
    .app-shell {
        grid-template-columns: 92px minmax(0, 1fr);
    }

    .sidebar {
        padding: 18px 12px;
    }

    .brand-box {
        justify-content: center;
        padding: 0 0 17px;
    }

    .brand-box > div:last-child,
    .menu-link > span:last-child {
        display: none;
    }

    .menu-link {
        justify-content: center;
        min-height: 54px;
        padding: 12px 8px;
    }

    .menu-icon {
        width: auto;
        font-size: 20px;
    }

    .main-area {
        padding: 20px;
    }

    .content-card {
        padding: 22px;
    }

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

@media (max-width: 1180px) {
    .responsive-compact-table.is-compact-view {
        min-width: 760px !important;
    }

    .responsive-compact-table.is-compact-view [data-compact-hidden="true"] {
        display: none;
    }
}

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

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

    .brand-mark {
        width: 42px;
        height: 42px;
        border-radius: 12px;
    }

    .brand-subtitle {
        display: none;
    }

    .main-menu {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 6px;
    }

    .menu-link {
        justify-content: center;
        gap: 7px;
        min-height: 48px;
        padding: 9px 8px;
        font-size: 12px;
        text-align: center;
    }

    .main-area {
        padding: 14px;
    }

    .topbar {
        flex-direction: row;
        align-items: center;
        margin-bottom: 14px;
    }

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

    .user-chip {
        max-width: 280px;
    }

    .content-card {
        padding: 16px;
        border-radius: 18px;
    }

    .report-center-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .report-center-card {
        min-height: 235px;
        padding: 18px;
    }

    .dashboard-report-access,
    .report-center-help {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-report-access .primary-button,
    .report-center-help .light-button {
        width: 100%;
    }

    .report-agency-mode,
    .report-agency-toolbar {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .report-agency-specific-button,
    .report-agency-bulk-actions,
    .report-agency-bulk-actions .light-button {
        width: 100%;
    }

    .report-agency-count {
        padding: 0;
    }
}

@media (max-width: 650px) {
    .topbar {
        align-items: stretch;
        flex-direction: column;
    }

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

    .main-menu,
    .report-center-grid,
    .dashboard-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .report-center-card {
        min-height: 0;
    }

    .report-agency-bulk-actions,
    .report-table-tools {
        align-items: stretch;
        flex-direction: column;
    }

    .report-table-toggle {
        width: 100%;
    }

    .responsive-compact-table.is-compact-view {
        min-width: 620px !important;
    }
}

@media (max-width: 430px) {
    .main-menu,
    .report-center-grid,
    .dashboard-stats-grid {
        grid-template-columns: 1fr;
    }
}
