/* ==========================================================================
   PuntoDiVista — Tema unico (Notion-like + brand giallo)
   Fase 1 restyling. Caricato dopo Bootstrap per fare override.
   ========================================================================== */

:root {
    /* Brand */
    --brand-yellow: #FFD400;
    --brand-yellow-soft: #FEF3C7;
    --brand-yellow-text: #854D0E;
    --brand-black: #0A0A0A;

    /* Surface neutrals */
    --bg-page: #FFFFFF;
    --bg-subtle: #FAFAFA;
    --bg-muted: #F4F4F5;
    --bg-hover: #F4F4F5;

    /* Borders */
    --border-default: #E4E4E7;
    --border-strong: #D4D4D8;
    --border-subtle: #F4F4F5;

    /* Text */
    --text-primary: #18181B;
    --text-secondary: #52525B;
    --text-tertiary: #71717A;
    --text-muted: #A1A1AA;
    --text-inverse: #FFFFFF;

    /* Semantic states */
    --success-bg: #DCFCE7;
    --success-text: #166534;
    --warning-bg: #FEF3C7;
    --warning-text: #854D0E;
    --danger-bg: #FEE2E2;
    --danger-text: #991B1B;
    --info-bg: #E0E7FF;
    --info-text: #3730A3;
    --neutral-bg: #F4F4F5;
    --neutral-text: #52525B;

    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

    /* Layout */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-pill: 999px;
    --sidebar-width: 230px;

    /* Focus */
    --focus-ring: 0 0 0 3px rgba(255, 212, 0, 0.35);
}

/* ========== Reset essenziale ========== */
*, *::before, *::after { box-sizing: border-box; }

html { font-size: 14px; }

body {
    font-family: var(--font-sans);
    color: var(--text-primary);
    background: var(--bg-page);
    margin: 0;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--text-primary); text-decoration: none; }
a:hover { color: var(--text-primary); }

h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 500; color: var(--text-primary); }

p { margin: 0 0 0.75rem; }

hr {
    border: 0;
    border-top: 1px solid var(--border-default);
    margin: 16px 0;
    opacity: 1;
}

/* ========== Scrollbar Notion-like ========== */
* { scrollbar-width: thin; scrollbar-color: #D4D4D8 transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: #D4D4D8; border-radius: 4px; }
*::-webkit-scrollbar-thumb:hover { background: #A1A1AA; }

/* ==========================================================================
   App shell
   ========================================================================== */
.app-shell {
    display: flex;
    min-height: 100vh;
    background: var(--bg-page);
}

.app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-page);
    border-right: 1px solid var(--border-default);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.2s ease;
}

.app-main {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-page);
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-page);
    border-bottom: 1px solid var(--border-default);
    padding: 20px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.app-header h1 {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
}

.app-header p {
    margin: 2px 0 0;
    font-size: 12.5px;
    color: var(--text-tertiary);
}

.app-header .header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-content {
    padding: 24px 28px 48px;
    flex: 1;
}

/* ==========================================================================
   Sidebar
   ========================================================================== */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 16px;
    border-bottom: 1px solid var(--border-default);
}

.sidebar-brand .brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    min-width: 0;
}

.sidebar-brand .brand-name {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-primary);
}

.sidebar-brand .brand-sub {
    font-size: 11px;
    color: var(--text-tertiary);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 8px;
}

.nav-section { margin-bottom: 14px; }

.nav-section-label {
    text-transform: uppercase;
    color: var(--text-muted);
    font-size: 11px;
    letter-spacing: 0.04em;
    font-weight: 500;
    padding: 6px 12px;
    margin-bottom: 2px;
}

.sidebar-nav .nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    margin-bottom: 1px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 13.5px;
    font-weight: 400;
    border-left: 3px solid transparent;
    text-decoration: none;
    cursor: pointer;
    line-height: 1.4;
}

.sidebar-nav .nav-item i {
    font-size: 16px;
    width: 16px;
    flex-shrink: 0;
    color: var(--text-tertiary);
}

.sidebar-nav .nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.sidebar-nav .nav-item.active {
    background: var(--bg-subtle);
    color: var(--text-primary);
    font-weight: 500;
    border-left: 3px solid var(--brand-yellow);
}

.sidebar-nav .nav-item.active i { color: var(--text-primary); }

.sidebar-footer {
    border-top: 1px solid var(--border-default);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-footer .user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--brand-black);
    color: var(--text-inverse);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11.5px;
    font-weight: 500;
    flex-shrink: 0;
    text-transform: uppercase;
}

.sidebar-footer .user-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.sidebar-footer .user-name {
    font-size: 12.5px;
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-footer .user-role {
    font-size: 11px;
    color: var(--text-tertiary);
}

.logout-form { margin: 0; }

.logout-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-tertiary);
    width: 28px;
    height: 28px;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    font-size: 14px;
}

.logout-btn:hover {
    background: var(--bg-hover);
    color: var(--danger-text);
    border-color: var(--border-default);
}

/* ==========================================================================
   Logo box placeholder
   ========================================================================== */
.brand-logo {
    width: 32px;
    height: 32px;
    background: var(--brand-yellow);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 15px;
    color: var(--brand-black);
    flex-shrink: 0;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn-primary,
.btn-secondary,
.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
    font-family: var(--font-sans);
}

.btn-primary {
    background: var(--brand-black);
    color: var(--text-inverse);
    border-color: var(--brand-black);
}
.btn-primary:hover {
    background: #1f1f1f;
    color: var(--text-inverse);
    border-color: #1f1f1f;
}
.btn-primary:active { background: #000; }
.btn-primary:disabled { background: var(--text-muted); border-color: var(--text-muted); cursor: not-allowed; }

.btn-secondary {
    background: var(--bg-page);
    color: var(--text-primary);
    border-color: var(--border-default);
}
.btn-secondary:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}
.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--bg-page);
    color: var(--danger-text);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
}
.btn-danger:hover { background: var(--danger-bg); border-color: var(--danger-bg); color: var(--danger-text); }

.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-block { width: 100%; }

/* ==========================================================================
   Panels / Cards
   ========================================================================== */
.panel {
    background: var(--bg-page);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 16px;
}

.panel-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-default);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--bg-page);
}

.panel-header h2,
.panel-header h3 {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
}

.panel-body { padding: 16px; }

.panel-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border-default);
    background: var(--bg-subtle);
}

/* ==========================================================================
   Metric card
   ========================================================================== */
.metric {
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    background: var(--bg-page);
}

.metric-label {
    font-size: 11.5px;
    color: var(--text-tertiary);
    margin-bottom: 4px;
    text-transform: none;
    letter-spacing: 0;
}

.metric-value {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-primary);
    font-feature-settings: 'tnum';
    line-height: 1.2;
}

.metric-sub {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 4px;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

/* ==========================================================================
   Tabelle
   ========================================================================== */
.table-clean {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}

.table-clean thead { background: var(--bg-subtle); }

.table-clean th {
    text-align: left;
    padding: 8px 16px;
    font-weight: 500;
    color: var(--text-tertiary);
    font-size: 11.5px;
    text-transform: none;
    letter-spacing: 0;
    border-bottom: 1px solid var(--border-subtle);
    white-space: nowrap;
}

.table-clean td {
    padding: 9px 16px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
    vertical-align: middle;
}

.table-clean tbody tr:last-child td { border-bottom: 0; }
.table-clean tbody tr:hover { background: var(--bg-subtle); }

.table-clean .num,
.table-clean td.text-end,
.table-clean th.text-end {
    text-align: right;
    font-feature-settings: 'tnum';
}

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

.table-clean.compact th { padding: 6px 12px; }
.table-clean.compact td { padding: 7px 12px; }

/* ==========================================================================
   Form
   ========================================================================== */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="datetime-local"],
input[type="time"],
select,
textarea,
.form-control,
.form-select {
    width: 100%;
    padding: 8px 12px;
    font-size: 13.5px;
    font-family: var(--font-sans);
    color: var(--text-primary);
    background: var(--bg-page);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    line-height: 1.4;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

textarea, textarea.form-control { resize: vertical; min-height: 80px; }

input:focus,
select:focus,
textarea:focus,
.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--brand-yellow);
    box-shadow: var(--focus-ring);
}

input::placeholder,
textarea::placeholder { color: var(--text-muted); }

input[type="checkbox"],
input[type="radio"] {
    width: auto;
    accent-color: var(--brand-yellow);
}

label,
.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-secondary);
}

.field-error,
.field-validation-error,
.text-danger {
    display: block;
    font-size: 12px;
    color: var(--danger-text);
    margin-top: 4px;
}

.form-group { margin-bottom: 16px; }

/* ==========================================================================
   Badge
   ========================================================================== */
.badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
}

.badge-success { background: var(--success-bg); color: var(--success-text); }
.badge-warning { background: var(--warning-bg); color: var(--warning-text); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger-text); }
.badge-info    { background: var(--info-bg);    color: var(--info-text); }
.badge-neutral { background: var(--neutral-bg); color: var(--neutral-text); }
.badge-brand   { background: var(--brand-yellow); color: var(--brand-black); }

/* ==========================================================================
   Alert
   ========================================================================== */
.alert-success,
.alert-danger,
.alert-warning,
.alert-info {
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 13px;
    border-left: 3px solid transparent;
    margin-bottom: 14px;
    background: var(--bg-subtle);
    color: var(--text-primary);
}

.alert-success { background: var(--success-bg); color: var(--success-text); border-left-color: var(--success-text); }
.alert-warning { background: var(--warning-bg); color: var(--warning-text); border-left-color: var(--warning-text); }
.alert-danger  { background: var(--danger-bg);  color: var(--danger-text);  border-left-color: var(--danger-text); }
.alert-info    { background: var(--info-bg);    color: var(--info-text);    border-left-color: var(--info-text); }

/* ==========================================================================
   Helpers
   ========================================================================== */
.text-muted, .text-tertiary { color: var(--text-tertiary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-strong { font-weight: 500; }
.num { font-feature-settings: 'tnum'; }

.page-section { margin-bottom: 24px; }

/* ==========================================================================
   Mobile toggle / responsive
   ========================================================================== */
.sidebar-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--border-default);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    padding: 0;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 999;
    display: none;
}

.sidebar-overlay.show { display: block; }

@media (max-width: 991px) {
    .app-sidebar { transform: translateX(-100%); }
    .app-sidebar.show { transform: translateX(0); box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08); }
    .app-main { margin-left: 0; }
    .sidebar-toggle { display: inline-flex; }
    .app-header { padding: 14px 18px; }
    .app-content { padding: 18px; }
}

/* ==========================================================================
   Login page
   ========================================================================== */
.login-body {
    background: var(--bg-subtle);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    font-family: var(--font-sans);
    color: var(--text-primary);
}

.login-shell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.login-card {
    background: var(--bg-page);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    width: 100%;
    max-width: 380px;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.brand-logo-lg {
    width: 40px;
    height: 40px;
    font-size: 18px;
}

.brand-name-lg {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.2;
}

.login-title {
    font-size: 18px;
    font-weight: 500;
    margin: 0 0 6px;
    color: var(--text-primary);
}

.login-subtitle {
    font-size: 13px;
    color: var(--text-tertiary);
    margin: 0 0 24px;
}

.login-form .form-group { margin-bottom: 16px; }

.form-row-inline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    margin-bottom: 0;
    font-weight: 400;
}

.checkbox-row input[type="checkbox"] {
    accent-color: var(--brand-yellow);
    width: 14px;
    height: 14px;
}

.login-footer {
    font-size: 11.5px;
    color: var(--text-muted);
    text-align: center;
}

/* ==========================================================================
   Layout Bozza (pagina pubblica conferma)
   ========================================================================== */
.bozza-shell {
    background: var(--bg-subtle);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--font-sans);
    color: var(--text-primary);
}

.bozza-header {
    background: var(--bg-page);
    border-bottom: 1px solid var(--border-default);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.bozza-header .brand-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.bozza-main {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 32px 16px;
}

.bozza-card {
    background: var(--bg-page);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    width: 100%;
    max-width: 720px;
}

.bozza-footer {
    padding: 16px 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 11.5px;
    border-top: 1px solid var(--border-default);
    background: var(--bg-page);
}

/* ==========================================================================
   Bootstrap overrides minimi — per non rompere viste esistenti.
   Allineiamo i widget Bootstrap più visibili allo stile Notion.
   ========================================================================== */
.card {
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: none;
    background: var(--bg-page);
}

.card-header {
    background: var(--bg-page);
    border-bottom: 1px solid var(--border-default);
    padding: 12px 16px;
    font-weight: 500;
    font-size: 13.5px;
    color: var(--text-primary);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.card-body { padding: 16px; }

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
    color: var(--text-primary);
    margin-bottom: 0;
}

.table > thead { background: var(--bg-subtle); }

.table > thead th,
.table > thead > tr > th {
    font-weight: 500;
    color: var(--text-tertiary);
    font-size: 11.5px;
    border-bottom: 1px solid var(--border-subtle);
    padding: 8px 16px;
    background: var(--bg-subtle);
}

.table > tbody > tr > td {
    padding: 9px 16px;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
}

.table-hover > tbody > tr:hover > * { background: var(--bg-subtle); }
.table > tbody > tr:last-child > td { border-bottom: 0; }
.table-light, .table-light > th, .table-light > td { background: var(--bg-subtle); color: var(--text-tertiary); }

.btn {
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    padding: 7px 14px;
    line-height: 1.2;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: var(--font-sans);
}

.btn-lg { padding: 9px 18px; font-size: 14px; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

.btn-success {
    background: var(--brand-black);
    color: var(--text-inverse);
    border-color: var(--brand-black);
}
.btn-success:hover { background: #1f1f1f; color: var(--text-inverse); border-color: #1f1f1f; }

.btn-outline-secondary,
.btn-outline-primary,
.btn-outline-info {
    background: var(--bg-page);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
}
.btn-outline-secondary:hover,
.btn-outline-primary:hover,
.btn-outline-info:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

.btn-outline-danger {
    background: var(--bg-page);
    color: var(--danger-text);
    border: 1px solid var(--border-default);
}
.btn-outline-danger:hover { background: var(--danger-bg); color: var(--danger-text); border-color: var(--danger-bg); }

.btn-warning {
    background: var(--brand-yellow);
    color: var(--brand-black);
    border-color: var(--brand-yellow);
}
.btn-warning:hover { background: #E6BE00; color: var(--brand-black); border-color: #E6BE00; }

.btn-info {
    background: var(--bg-page);
    color: var(--info-text);
    border: 1px solid var(--border-default);
}
.btn-info:hover { background: var(--info-bg); color: var(--info-text); }

/* Bootstrap badge backgrounds → mappa allo stile pill */
.badge,
.badge.bg-secondary,
.badge.bg-primary,
.badge.bg-success,
.badge.bg-warning,
.badge.bg-info,
.badge.bg-danger {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    font-weight: 500;
    line-height: 1.4;
}

.badge.bg-secondary { background-color: var(--neutral-bg) !important; color: var(--neutral-text) !important; }
.badge.bg-primary   { background-color: var(--info-bg)    !important; color: var(--info-text)    !important; }
.badge.bg-success   { background-color: var(--success-bg) !important; color: var(--success-text) !important; }
.badge.bg-warning   { background-color: var(--warning-bg) !important; color: var(--warning-text) !important; }
.badge.bg-info      { background-color: var(--info-bg)    !important; color: var(--info-text)    !important; }
.badge.bg-danger    { background-color: var(--danger-bg)  !important; color: var(--danger-text)  !important; }
.badge.bg-light     { background-color: var(--bg-muted)   !important; color: var(--text-primary) !important; }

/* Bootstrap alert overrides */
.alert {
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 13px;
    border: none;
    border-left: 3px solid transparent;
}
.alert.alert-success { background: var(--success-bg); color: var(--success-text); border-left-color: var(--success-text); }
.alert.alert-warning { background: var(--warning-bg); color: var(--warning-text); border-left-color: var(--warning-text); }
.alert.alert-danger  { background: var(--danger-bg);  color: var(--danger-text);  border-left-color: var(--danger-text); }
.alert.alert-info    { background: var(--info-bg);    color: var(--info-text);    border-left-color: var(--info-text); }

/* Form-check (Bootstrap) */
.form-check-input { accent-color: var(--brand-yellow); }
.form-check-input:focus { border-color: var(--brand-yellow); box-shadow: var(--focus-ring); }
.form-check-input:checked { background-color: var(--brand-yellow); border-color: var(--brand-yellow); }

/* Dropdown menu */
.dropdown-menu {
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
    padding: 4px;
}
.dropdown-item {
    border-radius: var(--radius-sm);
    font-size: 13px;
    padding: 6px 10px;
}
.dropdown-item:hover { background: var(--bg-hover); }
.dropdown-divider { border-color: var(--border-subtle); }

/* === Modulo Campagne === */

.campagne-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.campagna-card {
    background: var(--bg-page);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 200px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.12s ease;
}

.campagna-card:hover {
    border-color: var(--border-strong);
    color: inherit;
}

.campagna-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.campagna-card-title {
    font-size: 14.5px;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
}

.campagna-card-sub {
    font-size: 11.5px;
    color: var(--text-tertiary);
    margin-top: 4px;
}

.campagna-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: auto;
}

.campagna-metric {
    text-align: left;
}

.campagna-metric-label {
    font-size: 10.5px;
    color: var(--text-tertiary);
    text-transform: none;
    line-height: 1.3;
}

.campagna-metric-value {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary);
    font-feature-settings: 'tnum';
    line-height: 1.2;
}

.campagna-metric.highlight .campagna-metric-value {
    color: var(--brand-black);
    background: var(--brand-yellow);
    display: inline-block;
    padding: 0 6px;
    border-radius: var(--radius-sm);
}

.campagna-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid var(--border-subtle);
    font-size: 12.5px;
    color: var(--text-secondary);
}

/* Filtri pill stato lead */
.lead-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.lead-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    background: var(--bg-muted);
    color: var(--text-secondary);
    font-size: 12px;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
}

.lead-filter-pill:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.lead-filter-pill.active {
    background: var(--brand-black);
    color: var(--text-inverse);
}

.lead-filter-pill .count {
    font-size: 11px;
    opacity: 0.75;
    font-feature-settings: 'tnum';
}

/* Pill "Storico" inline */
.pill-storico {
    display: inline-block;
    font-size: 10px;
    background: var(--bg-muted);
    color: var(--text-tertiary);
    padding: 1px 6px;
    border-radius: var(--radius-pill);
    margin-left: 6px;
    vertical-align: middle;
    font-weight: 500;
}

/* Lead edit a 2 colonne */
.lead-edit-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 20px;
}

@media (max-width: 991px) {
    .lead-edit-grid { grid-template-columns: 1fr; }
}

.lead-readonly-box {
    background: var(--bg-page);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 16px;
}

.lead-readonly-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 13px;
}

.lead-readonly-row:last-child { border-bottom: none; }

.lead-readonly-row .label {
    color: var(--text-tertiary);
    font-size: 11.5px;
    flex: 0 0 110px;
}

.lead-readonly-row .value {
    color: var(--text-primary);
    text-align: right;
    flex: 1;
    word-break: break-word;
}

.risposte-form-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.risposte-form-list li {
    padding: 6px 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 12.5px;
}

.risposte-form-list li:last-child { border-bottom: none; }

.risposte-form-list .domanda {
    color: var(--text-tertiary);
    font-size: 11px;
    display: block;
    margin-bottom: 2px;
}

.risposte-form-list .risposta {
    color: var(--text-primary);
}

/* Tabella header con FormId monospace */
.mono { font-family: var(--font-mono); font-size: 12.5px; }

/* Breadcrumb */
.breadcrumb-lite {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 8px;
}

.breadcrumb-lite a {
    color: var(--text-tertiary);
    text-decoration: none;
}

.breadcrumb-lite a:hover { color: var(--text-primary); }

.breadcrumb-lite .sep { margin: 0 6px; opacity: 0.5; }

/* List group */
.list-group-item {
    border-color: var(--border-subtle);
    font-size: 13.5px;
    padding: 10px 14px;
}
.list-group-item-action:hover { background: var(--bg-subtle); }
