html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: 'Outfit', sans-serif;
    background: #f9fafb;
    color: #1d2939;
}

.main-content {
    flex: 1 1 auto;
    min-height: 0;
    padding: 0.75rem;
}

.main-content.py-5 {
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
}

.main-content.py-3 {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

.container {
    max-width: 1536px;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.menu-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    border-radius: 0.75rem;
    padding: 0.5rem 0.625rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.menu-item-inactive {
    color: #344054;
}

.menu-item-inactive:hover {
    background: #f2f4f7;
    color: #1d2939;
}

.menu-item-active {
    background: #ecf3ff;
    color: #465fff;
}

.menu-item-svg {
    display: inline-flex;
    height: 22px;
    width: 22px;
    align-items: center;
    justify-content: center;
}

.menu-item-icon-inactive {
    color: #667085;
}

.menu-item-icon-active {
    color: #465fff;
}

.app-sidebar {
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.08);
}

.app-sidebar.is-open {
    transform: translateX(0);
}

.app-sidebar.sidebar--open {
    transform: translateX(0);
}

@media (min-width: 993px) {
    .app-sidebar.sidebar--collapsed {
        width: 0 !important;
        min-width: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        border-right: 0 !important;
        overflow: hidden !important;
    }

    .app-sidebar.sidebar--collapsed > * {
        opacity: 0;
        pointer-events: none;
    }
}

.app-mobile-overlay {
    display: none;
}

.app-mobile-overlay.is-open {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(16, 24, 40, 0.45);
}

.app-mobile-overlay.overlay--open {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(16, 24, 40, 0.45);
}

.command-search-result {
    transition: background-color 0.2s ease, color 0.2s ease;
}

.command-search-result:hover {
    background: #f9fafb;
}

.app-topbar-summary {
    min-width: 0;
}

.app-topbar-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-topbar-actions {
    flex-shrink: 0;
}

.mb-4 {
    margin-bottom: 0.75rem !important;
}

.dashboard-card {
    border-radius: 1rem;
    border: 1px solid #e4e7ec;
    background: #ffffff;
    padding: 1rem;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.dashboard-card-tight {
    padding: 0.875rem;
}

.dashboard-chart-shell {
    position: relative;
    min-height: 290px;
}

.dashboard-chart-svg {
    display: block;
    width: 100%;
    height: auto;
}

.dashboard-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.dashboard-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8125rem;
    color: #667085;
}

.dashboard-legend-dot {
    width: 0.625rem;
    height: 0.625rem;
    border-radius: 999px;
}

.dashboard-bars {
    display: grid;
    gap: 0.75rem;
}

.dashboard-bar-track {
    height: 0.625rem;
    border-radius: 999px;
    background: #eef2f6;
    overflow: hidden;
}

.dashboard-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #465fff 0%, #6d7dff 100%);
}

.dashboard-metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.dashboard-mini-metric {
    border-radius: 0.9rem;
    background: #f8fafc;
    padding: 0.75rem;
}

.privacy-footer {
    display: none;
}

.card,
.table-responsive,
.modal-content,
.list-group-item {
    border-radius: 1rem;
}

.card,
.table-responsive,
.modal-content {
    border: 1px solid #e4e7ec;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}

.card-header,
.card-footer {
    border-color: #f2f4f7;
    background: transparent;
}

.hero-card {
    border-radius: 1rem;
    border: 1px solid #e4e7ec;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
    color: #1d2939;
}

.app-auth-shell {
    min-height: 100vh;
    background: #ffffff;
}

.app-auth-aside {
    background: #f9fafb;
}

.app-auth-panel {
    min-height: 100vh;
}

.app-auth-brand {
    display: inline-flex;
    align-items: center;
}

.app-auth-brand img {
    height: 32px;
}

.app-auth-title {
    margin-bottom: 0.5rem;
    font-size: 1.875rem;
    line-height: 2.375rem;
    font-weight: 600;
    color: #1d2939;
}

.app-auth-subtitle {
    font-size: 0.875rem;
    color: #667085;
}

.app-auth-field label,
.form-label {
    margin-bottom: 0.375rem;
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #344054;
}

.form-control,
.form-select,
.input-group-text {
    min-height: 44px;
    border-color: #d0d5dd;
    border-radius: 0.625rem;
    font-size: 0.875rem;
    color: #1d2939;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}

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

.form-control:focus,
.form-select:focus {
    border-color: #9cb9ff;
    box-shadow: 0 0 0 4px rgba(70, 95, 255, 0.12);
}

.btn {
    border-radius: 0.625rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.btn-primary {
    border-color: #465fff;
    background: #465fff;
}

.btn-primary:hover,
.btn-primary:focus {
    border-color: #3641f5;
    background: #3641f5;
}

.btn-outline-secondary,
.btn-outline-primary,
.btn-outline-success {
    border-color: #d0d5dd;
    color: #344054;
    background: #ffffff;
}

.btn-outline-secondary:hover,
.btn-outline-primary:hover,
.btn-outline-success:hover {
    background: #f9fafb;
    color: #1d2939;
    border-color: #d0d5dd;
}

.btn-light {
    background: #ffffff;
    border-color: #d0d5dd;
}

.badge {
    border-radius: 9999px;
    font-weight: 500;
}

.badge-priorita,
.bg-primary-subtle.text-primary.badge-priorita {
    background: #ecf3ff !important;
    color: #465fff !important;
}

.ticket-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 9999px;
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.ticket-badge.aperto {
    background: #fef3f2;
    color: #d92d20;
}

.ticket-badge.in_lavorazione {
    background: #fffaeb;
    color: #dc6803;
}

.ticket-badge.chiuso {
    background: #ecfdf3;
    color: #039855;
}

.ticket-badge.in_attesa {
    background: #ecf3ff;
    color: #465fff;
}

.app-stat-card,
.metric-card {
    border-radius: 1rem;
    border: 1px solid #e4e7ec;
    background: #ffffff;
    padding: 1.25rem;
}

.app-stat-card__meta {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.app-stat-card__label {
    font-size: 0.875rem;
    color: #667085;
}

.app-stat-card__value,
.metric-value {
    margin-top: 0.5rem;
    font-size: 1.875rem;
    line-height: 2.375rem;
    font-weight: 700;
    color: #1d2939;
}

.app-stat-card__icon {
    display: inline-flex;
    height: 3rem;
    width: 3rem;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    background: #f2f4f7;
    color: #1d2939;
}

.app-panel {
    overflow: hidden;
    border-radius: 1rem;
    border: 1px solid #e4e7ec;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}

.app-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1rem 0;
}

.app-panel__title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1d2939;
}

.app-panel__description {
    margin: 0.25rem 0 0;
    font-size: 0.875rem;
    color: #667085;
}

.app-panel__body {
    padding: 1rem;
}

.app-action-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.app-action-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border: 1px solid #e4e7ec;
    border-radius: 0.75rem;
    padding: 0.875rem 1rem;
    color: #344054;
    text-decoration: none;
    background: #ffffff;
}

.app-action-list a:hover {
    background: #f9fafb;
}

.app-action-list__icon {
    display: inline-flex;
    height: 2.5rem;
    width: 2.5rem;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    background: #f2f4f7;
    color: #465fff;
}

.table {
    margin-bottom: 0;
    --bs-table-bg: transparent;
    --bs-table-hover-bg: #f9fafb;
    --bs-table-striped-bg: #f9fafb;
}

.table > :not(caption) > * > * {
    padding: 0.875rem 1rem;
    border-bottom-color: #f2f4f7;
    color: #475467;
    vertical-align: middle;
}

.table thead th,
.table-light th {
    font-size: 0.75rem;
    font-weight: 500;
    color: #667085;
    text-transform: none;
    background: transparent;
}

.table a {
    color: #1d2939;
    text-decoration: none;
    font-weight: 500;
}

.table a:hover {
    color: #465fff;
}

.list-group-item {
    border-color: #e4e7ec;
}

.alert {
    border-radius: 0.75rem;
    border-width: 1px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}

.alert-danger {
    background: #fef3f2;
    border-color: #fecdca;
    color: #b42318;
}

.alert-success {
    background: #ecfdf3;
    border-color: #a6f4c5;
    color: #027a48;
}

.alert-info,
.alert-secondary {
    background: #ecf3ff;
    border-color: #c2d6ff;
    color: #3641f5;
}

.ticket-timer {
    display: inline-flex;
    min-width: 92px;
    justify-content: center;
    border-radius: 9999px;
    background: #ecf3ff;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #3641f5;
}

.ticket-timer--urgent {
    background: #fffaeb;
    color: #dc6803;
}

.ticket-timer--expired {
    background: #fef3f2;
    color: #d92d20;
}

.ticket-row--expired {
    background: rgba(240, 68, 56, 0.03);
}

.login-body,
.privacy-page {
    background: #ffffff;
}

.login-card {
    border: 0;
    box-shadow: none;
}

.hero-card .text-white-50 {
    color: #667085 !important;
}

.hero-card .badge.text-bg-light {
    background: #ecf3ff !important;
    color: #465fff !important;
}

.signature-pad canvas {
    width: 100%;
    min-height: 220px;
    border: 1px solid #d0d5dd;
    border-radius: 0.75rem;
    background: #ffffff;
}

@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
    }

    .app-sidebar.is-open {
        transform: translateX(0);
    }

    .app-topbar-row {
        gap: 0.75rem;
    }

    .app-topbar-title {
        font-size: 1rem;
        line-height: 1.4;
    }
}

@media (max-width: 767.98px) {
    .app-topbar-eyebrow {
        display: none;
    }

    .app-topbar-row {
        padding-top: 0.85rem !important;
        padding-bottom: 0.85rem !important;
    }

    .app-topbar-title {
        font-size: 0.95rem;
    }

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