:root {
    --color-bg: #f4f6f8;
    --color-surface: #ffffff;
    --color-surface-soft: #f8fafc;
    --color-border: #e5e7eb;
    --color-border-strong: #d1d5db;

    --color-text: #111827;
    --color-muted: #6b7280;
    --color-soft: #9ca3af;

    --color-primary: #7a1f3d;
    --color-primary-hover: #681933;
    --color-primary-soft: #fce7f3;

    --color-blue: #2563eb;
    --color-blue-hover: #1d4ed8;

    --color-green-bg: #dcfce7;
    --color-green-text: #166534;

    --color-yellow-bg: #fef3c7;
    --color-yellow-text: #92400e;

    --color-red-bg: #fee2e2;
    --color-red-text: #991b1b;

    --color-gray-bg: #f3f4f6;
    --color-gray-text: #374151;

    --header-bg: #111827;
    --header-border: #1f2937;
    --header-text: #f9fafb;
    --header-text-soft: #cbd5e1;
    --header-hover: #2a1b22;
    --header-dropdown-bg: #0f172a;
    --header-dropdown-border: #334155;

    --danger-bg: #7f1d1d;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 22px rgba(15, 23, 42, 0.08);
}

/* ======================================================
   RESET
====================================================== */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 14px;
    line-height: 1.45;
}

a {
    color: inherit;
}

img {
    max-width: 100%;
}

/* ======================================================
   HEADER
====================================================== */

.main-header {
    position: sticky;
    top: 0;
    z-index: 2000;
    background: var(--header-bg);
    border-bottom: 1px solid var(--header-border);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}

.header-shell {
    max-width: 1450px;
    margin: 0 auto;
    padding: 8px 18px;
}

.header-row {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 56px;
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--header-text);
    flex-shrink: 0;
}

.brand-logo {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary);
    color: #ffffff;
    font-size: 18px;
    box-shadow: 0 6px 18px rgba(122, 31, 61, 0.28);
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.brand-title {
    font-size: 16px;
    font-weight: 800;
    line-height: 1.1;
    color: var(--header-text);
}

.brand-subtitle {
    font-size: 11px;
    color: var(--header-text-soft);
    line-height: 1.1;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    flex-wrap: wrap;
}

.nav-link,
.nav-dropdown-toggle,
.dropdown-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 8px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--header-text-soft);
    background: transparent;
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s ease;
    font-family: inherit;
}

.nav-link:hover,
.nav-dropdown-toggle:hover,
.dropdown-link:hover {
    background: var(--header-hover);
    color: var(--header-text);
}

.nav-link.is-active,
.nav-dropdown.is-active > .nav-dropdown-toggle,
.dropdown-link.is-active {
    background: var(--color-primary);
    color: #ffffff;
}

.nav-icon {
    width: 18px;
    text-align: center;
    line-height: 1;
    font-size: 15px;
    flex-shrink: 0;
}

.nav-dropdown {
    position: relative;
}

.dropdown-arrow {
    font-size: 11px;
    margin-left: 2px;
    transition: transform 0.2s ease;
}

.nav-dropdown.is-open .dropdown-arrow {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 280px;
    background: var(--header-dropdown-bg);
    border: 1px solid var(--header-dropdown-border);
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
    padding: 8px;
    z-index: 3000;
}

.nav-dropdown.is-open .nav-dropdown-menu {
    display: block;
}

.dropdown-link {
    width: 100%;
    justify-content: flex-start;
}

.nav-link-logout {
    color: #fecaca;
}

.nav-link-logout:hover {
    background: var(--danger-bg);
    color: #ffffff;
}

.nav-user {
    display: inline-flex;
    flex-direction: column;
    gap: 1px;
    padding: 5px 10px;
    border-left: 1px solid #374151;
    color: var(--header-text-soft);
    line-height: 1.1;
}

.nav-user-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--header-text);
}

.nav-user-role {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--header-text-soft);
}

.nav-toggle {
    display: none;
    margin-left: auto;
    border: 1px solid #374151;
    background: transparent;
    color: var(--header-text);
    border-radius: 10px;
    padding: 7px 11px;
    font-size: 20px;
    cursor: pointer;
}

/* ======================================================
   LAYOUT
====================================================== */

.page-content {
    max-width: 1450px;
    margin: 0 auto;
    padding: 20px;
}

.page-header,
.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.page-title {
    margin: 0;
    font-size: 26px;
    font-weight: 800;
    color: var(--color-text);
}

.page-subtitle {
    margin: 4px 0 0;
    color: var(--color-muted);
}

.main-footer {
    margin-top: 30px;
    padding: 20px;
    color: var(--color-muted);
    font-size: 13px;
}

.footer-shell {
    max-width: 1450px;
    margin: 0 auto;
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
}

/* ======================================================
   CARD / BOX
====================================================== */

.box,
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 18px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.card-title {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
}

.card-subtitle {
    margin: 4px 0 0;
    color: var(--color-muted);
    font-size: 13px;
}

.grid {
    display: grid;
    gap: 16px;
}

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

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

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

/* ======================================================
   TABLE
====================================================== */

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-surface);
}

.table th,
.table td {
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    text-align: left;
    vertical-align: top;
}

.table th {
    background: var(--color-surface-soft);
    font-weight: 700;
    white-space: nowrap;
}

.table tbody tr:hover {
    background: #fafafa;
}

.table-compact th,
.table-compact td {
    padding: 7px 9px;
    font-size: 13px;
}

/* ======================================================
   FORM
====================================================== */

.form-grid {
    display: grid;
    gap: 14px;
}

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

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

.form-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: end;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

label {
    font-weight: 700;
    color: var(--color-text);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="number"],
input[type="datetime-local"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    background: #ffffff;
    color: var(--color-text);
}

textarea {
    resize: vertical;
    min-height: 90px;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(122, 31, 61, 0.12);
}

.help-text {
    color: var(--color-muted);
    font-size: 12px;
}

/* ======================================================
   BUTTON
====================================================== */

.action-buttons,
.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    padding: 8px 13px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: 0.18s ease;
    line-height: 1.2;
}

.btn-primary {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
}

.btn-blue {
    background: var(--color-blue);
    border-color: var(--color-blue);
    color: #ffffff;
}

.btn-blue:hover {
    background: var(--color-blue-hover);
    border-color: var(--color-blue-hover);
}

.btn-light,
.btn-secondary {
    background: #e5e7eb;
    color: var(--color-text);
    border-color: #e5e7eb;
}

.btn-light:hover,
.btn-secondary:hover {
    background: #d1d5db;
    border-color: #d1d5db;
}

.btn-outline {
    background: #ffffff;
    color: var(--color-text);
    border-color: var(--color-border-strong);
}

.btn-outline:hover {
    background: var(--color-surface-soft);
}

.btn-danger {
    background: #dc2626;
    border-color: #dc2626;
    color: #ffffff;
}

.btn-danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
}

.btn-success {
    background: #16a34a;
    border-color: #16a34a;
    color: #ffffff;
}

.btn-success:hover {
    background: #15803d;
    border-color: #15803d;
}

.btn-sm {
    min-height: 30px;
    padding: 5px 9px;
    font-size: 12px;
}

/* ======================================================
   BADGE / STATUS
====================================================== */

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.badge-success,
.badge-green {
    background: var(--color-green-bg);
    color: var(--color-green-text);
}

.badge-warning,
.badge-yellow {
    background: var(--color-yellow-bg);
    color: var(--color-yellow-text);
}

.badge-danger,
.badge-red {
    background: var(--color-red-bg);
    color: var(--color-red-text);
}

.badge-neutral,
.badge-gray {
    background: var(--color-gray-bg);
    color: var(--color-gray-text);
}

.badge-primary {
    background: var(--color-primary-soft);
    color: var(--color-primary);
}

.badge-aperta,
.badge-open {
    background: var(--color-red-bg);
    color: var(--color-red-text);
}

.badge-in_lavorazione,
.badge-working {
    background: var(--color-yellow-bg);
    color: var(--color-yellow-text);
}

.badge-chiusa,
.badge-closed {
    background: var(--color-green-bg);
    color: var(--color-green-text);
}

/* ======================================================
   ALERT / FLASH
====================================================== */

.flash-stack {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.flash,
.alert {
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    font-weight: 700;
}

.flash-success,
.alert-success {
    background: var(--color-green-bg);
    color: var(--color-green-text);
    border-color: #bbf7d0;
}

.flash-error,
.alert-error,
.alert-danger {
    background: var(--color-red-bg);
    color: var(--color-red-text);
    border-color: #fecaca;
}

.flash-warning,
.alert-warning {
    background: var(--color-yellow-bg);
    color: var(--color-yellow-text);
    border-color: #fde68a;
}

.flash-info,
.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border-color: #bfdbfe;
}

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

.login-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(circle at top left, rgba(122, 31, 61, 0.06), transparent 32%),
        radial-gradient(circle at bottom right, rgba(17, 24, 39, 0.06), transparent 30%),
        var(--color-bg);
}

.login-header {
    background: var(--header-bg);
    border-bottom: 1px solid var(--header-border);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}

.login-header-shell {
    max-width: 1450px;
    margin: 0 auto;
    padding: 8px 18px;
}

.login-header-row {
    min-height: 56px;
    display: flex;
    align-items: center;
}

.login-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--header-text);
    text-decoration: none;
}

.login-brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--color-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: #ffffff;
    font-size: 20px;
    box-shadow: 0 6px 18px rgba(122, 31, 61, 0.28);
}

.login-brand-logo img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.login-brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.login-brand-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--header-text);
    line-height: 1.1;
}

.login-brand-subtitle {
    font-size: 11px;
    color: var(--header-text-soft);
    line-height: 1.1;
}

.login-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 34px 18px;
}

.login-shell {
    width: 100%;
    max-width: 1180px;
}

.login-card {
    display: grid;
    grid-template-columns: 1fr 0.95fr;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 18px 45px rgba(17, 24, 39, 0.14);
}

.login-panel {
    min-height: 610px;
}

.login-panel-info {
    padding: 42px;
    border-right: 1px solid var(--color-border);
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-info-box {
    width: 100%;
    max-width: 440px;
    min-height: 430px;
    background: #fbfcfe;
    border: 2px solid #d8dee8;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    padding: 32px;
}

.login-info-icon {
    width: 86px;
    height: 86px;
    border-radius: 22px;
    margin: 0 auto 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary-soft);
    color: var(--color-primary);
    font-size: 42px;
}

.login-info-box h1 {
    margin: 0 0 12px;
    font-size: 28px;
    line-height: 1.15;
    color: var(--color-text);
}

.login-info-box p {
    margin: 0;
    color: var(--color-muted);
    font-size: 15px;
}

.login-feature-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 26px;
}

.login-feature {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    font-size: 13px;
}

.login-feature span {
    font-size: 24px;
}

.login-panel-form {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 42px;
}

.login-form-wrap {
    width: 100%;
    max-width: 390px;
}

.login-form-head {
    margin-bottom: 22px;
}

.login-form-head h2 {
    margin: 0 0 6px;
    font-size: 26px;
    color: var(--color-text);
}

.login-form-head p {
    margin: 0;
    color: var(--color-muted);
}

.login-form {
    display: grid;
    gap: 16px;
    margin-top: 18px;
}

.login-submit {
    width: 100%;
    margin-top: 4px;
}

.login-links {
    margin-top: 18px;
    text-align: center;
}

.login-links a {
    color: var(--color-primary);
    font-weight: 700;
    text-decoration: none;
}

.login-links a:hover {
    text-decoration: underline;
}

.login-footer {
    padding: 18px;
    color: var(--color-muted);
    font-size: 13px;
    display: flex;
    justify-content: center;
    gap: 8px;
}

/* ======================================================
   DASHBOARD
====================================================== */

.dashboard-page {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.days-filter-box {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 220px;
}

.days-filter-box label {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-text);
}

.days-filter-row {
    display: flex;
    gap: 8px;
}

.days-filter-row input {
    width: 100%;
}

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

.summary-card {
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 18px;
    text-decoration: none;
    color: var(--color-text);
    box-shadow: var(--shadow-sm);
    transition: 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.summary-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.summary-label {
    font-size: 13px;
    color: var(--color-muted);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.summary-number {
    font-size: 32px;
    font-weight: 900;
    line-height: 1;
}

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

.chart-card {
    min-height: 390px;
}

.chart-card canvas {
    width: 100% !important;
    height: 285px !important;
}

.lists-grid {
    display: grid;
    gap: 18px;
}

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

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

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

.mini-list,
.calls-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mini-list-item,
.call-list-item {
    display: flex;
    gap: 12px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 12px;
    text-decoration: none;
    color: var(--color-text);
    transition: 0.2s ease;
}

.mini-list-item {
    justify-content: space-between;
    align-items: flex-start;
    background: #fafafa;
}

.call-list-item {
    flex-direction: column;
}

.mini-list-item:hover,
.call-list-item:hover {
    background: #f8fafc;
    border-color: var(--color-border-strong);
}

.call-item-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.call-item-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.call-item-meta {
    font-size: 12px;
    color: var(--color-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.call-item-desc {
    font-size: 13px;
    color: var(--color-gray-text);
    line-height: 1.4;
}

.row-recente {
    background: #fff8db;
}

.row-vecchia {
    background: #fdeaea;
}

.mini-list-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.mini-list-side {
    flex-shrink: 0;
}

.small-muted {
    color: var(--color-muted);
    font-size: 12px;
}

.empty-state {
    padding: 18px;
    border: 1px dashed var(--color-border-strong);
    border-radius: 12px;
    background: #fafafa;
    color: var(--color-muted);
}

.mini-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    padding: 6px 10px;
    white-space: nowrap;
}

.mini-badge.success {
    background: var(--color-green-bg);
    color: var(--color-green-text);
}

.mini-badge.warning {
    background: var(--color-yellow-bg);
    color: var(--color-yellow-text);
}

.mini-badge.danger {
    background: var(--color-red-bg);
    color: var(--color-red-text);
}

.mini-badge.neutral {
    background: var(--color-gray-bg);
    color: var(--color-gray-text);
}

.mini-badge.primary {
    background: var(--color-primary-soft);
    color: var(--color-primary);
}

/* ======================================================
   UTILITY
====================================================== */

.text-muted {
    color: var(--color-muted);
}

.text-small {
    font-size: 12px;
}

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

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

.mt-0 {
    margin-top: 0;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-1 {
    margin-bottom: 8px;
}

.mb-2 {
    margin-bottom: 14px;
}

.mb-3 {
    margin-bottom: 20px;
}

.row-disabled {
    opacity: 0.6;
}

.cliente-bloccato {
    background-color: #fef2f2 !important;
}

.nowrap {
    white-space: nowrap;
}

.hidden {
    display: none !important;
}

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

@media (max-width: 1400px) {
    .lists-grid-3,
    .lists-grid-2 {
        grid-template-columns: 1fr;
    }
}

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

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

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

@media (max-width: 1100px) {
    .header-shell {
        padding: 8px 14px;
    }

    .header-row {
        min-height: auto;
        flex-wrap: wrap;
    }

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

    .main-nav {
        display: none;
        width: 100%;
        margin-left: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        padding-top: 10px;
    }

    .main-nav.is-open {
        display: flex;
    }

    .nav-link,
    .nav-dropdown-toggle,
    .dropdown-link {
        width: 100%;
        justify-content: flex-start;
    }

    .nav-dropdown {
        width: 100%;
    }

    .nav-dropdown-menu {
        position: static;
        min-width: 0;
        margin-top: 6px;
        box-shadow: none;
    }

    .nav-user {
        border-left: none;
        border-top: 1px solid #374151;
        padding-top: 10px;
    }
}

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

    .grid-2,
    .grid-3,
    .grid-4,
    .form-grid-2,
    .form-grid-3 {
        grid-template-columns: 1fr;
    }

    .page-title {
        font-size: 22px;
    }

    .login-card {
        grid-template-columns: 1fr;
    }

    .login-panel {
        min-height: auto;
    }

    .login-panel-info {
        border-right: none;
        border-bottom: 1px solid var(--color-border);
        padding: 26px;
    }

    .login-info-box {
        max-width: none;
        min-height: auto;
    }

    .login-panel-form {
        padding: 26px;
    }

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

    .days-filter-row {
        flex-direction: column;
    }

    .call-item-top {
        flex-direction: column;
        align-items: stretch;
    }

    .call-item-badges {
        justify-content: flex-start;
    }
}

@media (max-width: 560px) {
    .brand-title {
        font-size: 15px;
    }

    .brand-subtitle {
        font-size: 10px;
    }

    .brand-logo {
        width: 34px;
        height: 34px;
        font-size: 17px;
    }

    .header-shell {
        padding: 8px 10px;
    }

    .page-content {
        padding: 12px;
    }

    .box,
    .card {
        padding: 14px;
        border-radius: 12px;
    }

    .btn {
        width: 100%;
    }

    .action-buttons,
    .actions {
        width: 100%;
    }

    .login-feature-list {
        grid-template-columns: 1fr;
    }

    .login-info-box {
        padding: 24px;
    }

    .login-info-box h1 {
        font-size: 22px;
    }

    .login-brand-subtitle {
        display: none;
    }
}

/* ======================================================
   IMPOSTAZIONI / TEST CONFIG
====================================================== */

.config-code {
    margin: 12px 0 0;
    padding: 12px;
    background: #111827;
    color: #e5e7eb;
    border-radius: 10px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.5;
}

.checkbox-line {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.checkbox-line input[type="checkbox"] {
    width: auto;
}

.section-title-small {
    margin: 6px 0 2px;
    font-size: 16px;
    font-weight: 800;
    color: var(--color-text);
}

hr {
    width: 100%;
    border: 0;
    border-top: 1px solid var(--color-border);
    margin: 12px 0;
}

/* ======================================================
   ANAGRAFICA CLIENTI / PRODOTTI
====================================================== */

.anagrafica-filter-row {
    align-items: end;
}

.filter-grow {
    flex: 1 1 280px;
}

.table-hover tbody tr:hover {
    background: #f8fafc;
}

.pagination {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.pagination a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid var(--color-border-strong);
    background: #ffffff;
    color: var(--color-text);
    text-decoration: none;
    font-weight: 700;
}

.pagination a:hover {
    background: var(--color-surface-soft);
}

.pagination a.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #ffffff;
}

.detail-list {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.detail-list > div {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--color-border);
}

.detail-list > div:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.detail-list span {
    color: var(--color-muted);
}

.detail-list strong {
    text-align: right;
}

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

.summary-mini {
    padding: 12px;
    border-radius: 12px;
    background: var(--color-surface-soft);
    border: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.summary-mini span {
    color: var(--color-muted);
    font-size: 12px;
    font-weight: 700;
}

.summary-mini strong {
    font-size: 18px;
}

.pre-line {
    white-space: pre-line;
}

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

@media (max-width: 900px) {
    .detail-list > div {
        flex-direction: column;
        gap: 4px;
    }

    .detail-list strong {
        text-align: left;
    }

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