/* ═══════════════════════════════════════════════════════════════════
   mu©k WebApp — Foglio stile principale
   Versione completa "fun / modern / aligned fields"
   Include:
   - redesign generale più moderno e divertente
   - menu sinistro schiarito
   - campi input più belli e coerenti
   - righe form allineate
   - input con unità a destra
   - miglioramenti EE / KE / BP
   Compatibile con i nomi classe originali + alcune utility nuove
   ═══════════════════════════════════════════════════════════════════ */

/* ── 1. Reset + Variabili ──────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg:            #f5f7ff;
    --bg-soft:       #eef2ff;
    --surface:       rgba(255, 255, 255, 0.9);
    --surface-2:     #ffffff;
    --surface-dark:  #1f2340;
    --border:        #d9def5;
    --border-strong: #c7cff0;

    --text:          #1d2240;
    --text-soft:     #4f5680;
    --muted:         #7a82aa;

    --primary:       #6d5efc;
    --primary-dark:  #5646f0;
    --primary-soft:  #ece9ff;

    --secondary:     #23c4c8;
    --secondary-soft:#dffbfc;

    --accent:        #ff7aa2;
    --accent-soft:   #ffe1eb;

    --success:       #16a34a;
    --success-soft:  #dcfce7;

    --warning:       #d97706;
    --warning-soft:  #fff4d6;

    --danger:        #dc2626;
    --danger-soft:   #fee2e2;

    --info:          #2563eb;
    --info-soft:     #dbeafe;

    --shadow-sm:     0 4px 14px rgba(69, 82, 160, 0.08);
    --shadow-md:     0 10px 28px rgba(79, 93, 171, 0.12);
    --shadow-lg:     0 18px 44px rgba(79, 93, 171, 0.16);

    --radius-sm:     10px;
    --radius-md:     14px;
    --radius-lg:     20px;
    --radius-xl:     24px;

    --sidebar:       250px;
    --header:        64px;
    --footer:        40px;

    --grad-main:     linear-gradient(135deg, #6d5efc 0%, #8b7cff 55%, #23c4c8 100%);
    --grad-soft:     linear-gradient(135deg, #f3f0ff 0%, #eef9ff 100%);
    --grad-accent:   linear-gradient(135deg, #ff7aa2 0%, #ff9f80 100%);
}

/* ── 2. Base ───────────────────────────────────────────────────────── */
html {
    scroll-behavior: smooth;
}

body {
    font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(109, 94, 252, 0.10), transparent 26%),
        radial-gradient(circle at top right, rgba(35, 196, 200, 0.10), transparent 24%),
        linear-gradient(180deg, #f7f8ff 0%, #f2f5ff 100%);
}

/* ── 3. Layout principale ──────────────────────────────────────────── */
.hdr {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--header);
    background: rgba(255,255,255,0.76);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(217, 222, 245, 0.8);
    display: flex;
    align-items: center;
    padding: 0 22px;
    gap: 16px;
    box-shadow: 0 6px 24px rgba(80, 90, 160, 0.06);
}

.hdr .brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 17px;
    font-weight: 800;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.hdr .brand::before {
    content: "";
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--grad-main);
    box-shadow: 0 0 0 6px rgba(109, 94, 252, 0.10);
    flex-shrink: 0;
}

.hdr .spacer { flex: 1; }

.hdr .user {
    font-size: 13px;
    color: var(--text-soft);
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(109, 94, 252, 0.06);
    padding: 7px 10px;
    border-radius: 999px;
    border: 1px solid rgba(109, 94, 252, 0.10);
}

.hdr .uname {
    font-weight: 700;
    color: var(--text);
}

.hdr .logout {
    font-size: 12px;
    color: var(--primary-dark);
    background: #fff;
    border: 1px solid rgba(109, 94, 252, 0.18);
    border-radius: 999px;
    padding: 6px 12px;
    cursor: pointer;
    transition: all .18s ease;
    box-shadow: var(--shadow-sm);
}

.hdr .logout:hover {
    transform: translateY(-1px);
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* Menu sinistro schiarito */
.side {
    position: fixed;
    top: var(--header);
    left: 0;
    bottom: var(--footer);
    width: var(--sidebar);
    background: linear-gradient(180deg, #343b68 0%, #485287 100%);
    color: #fff;
    border-right: 1px solid rgba(255,255,255,0.10);
    overflow-y: auto;
    padding: 18px 0;
    box-shadow: 8px 0 30px rgba(28, 31, 57, 0.14);
}

.nav-sec {
    padding: 0 14px;
    margin-bottom: 24px;
}

.nav-lbl {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: rgba(255,255,255,0.62);
    padding: 0 10px;
    margin-bottom: 8px;
}

.nav-a {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 12px;
    border-radius: 12px;
    color: rgba(255,255,255,0.88);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: all .16s ease;
    margin-bottom: 4px;
}

.nav-a:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
    transform: translateX(2px);
}

.nav-a.on {
    background: linear-gradient(135deg, rgba(109,94,252,0.95), rgba(35,196,200,0.82));
    color: #fff;
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(35, 196, 200, 0.18);
}

.main {
    margin-left: var(--sidebar);
    margin-top: var(--header);
    padding: 30px 24px;
    min-height: calc(100vh - var(--header));
    padding-bottom: calc(var(--footer) + 20px);
}

.pg-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 26px;
    gap: 20px;
    flex-wrap: wrap;
}

.pg-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.03em;
}

.pg-sub {
    font-size: 13px;
    color: var(--muted);
    margin-top: 4px;
}

/* ── 4. Componenti condivisi ───────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid rgba(255,255,255,0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    box-shadow: var(--shadow-md);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all .16s ease;
    line-height: 1;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary {
    background: var(--grad-main);
    color: #fff;
    box-shadow: 0 10px 20px rgba(109, 94, 252, 0.18);
}

.btn-primary:hover {
    filter: brightness(1.03);
    box-shadow: 0 14px 24px rgba(109, 94, 252, 0.22);
}

.btn-secondary {
    background: #fff;
    color: var(--primary-dark);
    border: 1px solid rgba(109, 94, 252, 0.18);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover { background: var(--primary-soft); }

.btn-danger {
    background: var(--grad-accent);
    color: #fff;
    box-shadow: 0 10px 20px rgba(255, 122, 162, 0.18);
}

.btn-danger:hover { filter: brightness(1.03); }

.btn-sm {
    font-size: 12.5px;
    padding: 8px 14px;
}

.alert {
    border-radius: 16px;
    padding: 12px 16px;
    font-size: 13px;
    margin-bottom: 16px;
    border: 1px solid transparent;
    box-shadow: var(--shadow-sm);
}

.alert-info    { background: var(--info-soft);    border-color: #bfdbfe; color: #1d4ed8; }
.alert-success { background: var(--success-soft); border-color: #86efac; color: #166534; }
.alert-error   { background: var(--danger-soft);  border-color: #fecaca; color: #b91c1c; }
.alert-warning { background: var(--warning-soft); border-color: #fde68a; color: #92400e; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid transparent;
    line-height: 1;
}

.badge-admin      { background: #272b4b; color: #fff; }
.badge-consultant { background: #dffbfc; color: #0f7f84; }
.badge-parent     { background: #ece9ff; color: #5847df; }
.badge-lawyer     { background: #fff2d8; color: #a55b00; }
.badge-lawfirm    { background: #ffe6dc; color: #b24a22; }
.badge-active     { background: #dcfce7; color: #15803d; }
.badge-draft      { background: #fff6c7; color: #a16207; }
.badge-locked     { background: #dbeafe; color: #1d4ed8; }
.badge-archived   { background: #eceff5; color: #667085; }

.lang-sw {
    display: flex;
    gap: 6px;
    margin-right: 8px;
}

.lang-btn {
    font-size: 11px;
    padding: 5px 9px;
    border-radius: 999px;
    text-decoration: none;
    color: var(--muted);
    border: 1px solid transparent;
    background: transparent;
    transition: all .14s ease;
}

.lang-btn:hover {
    color: var(--text);
    background: rgba(109, 94, 252, 0.08);
}

.lang-btn.lang-on {
    color: #fff;
    font-weight: 700;
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 6px 16px rgba(109, 94, 252, 0.18);
}

/* Form base migliorati */
.form-group { margin-bottom: 18px; }

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 7px;
    letter-spacing: -0.01em;
}

.form-input {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 1px solid #d6dcf3;
    border-radius: 14px;
    font-size: 14px;
    outline: none;
    transition: all .16s ease;
    background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
    color: var(--text);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.85),
        0 2px 6px rgba(90, 105, 180, 0.04);
}

.form-input:hover { border-color: #bec8eb; }

.form-input:focus {
    border-color: rgba(109, 94, 252, 0.45);
    box-shadow:
        0 0 0 4px rgba(109, 94, 252, 0.12),
        0 8px 18px rgba(109, 94, 252, 0.08);
    background: #fff;
}

.form-input.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.10);
}

.field-error {
    font-size: 12px;
    color: #dc2626;
    margin-top: 5px;
    font-weight: 600;
}

.hint {
    font-size: 11.5px;
    color: var(--muted);
    margin-top: 5px;
    line-height: 1.45;
}

/* Nuove utility per form allineati */
.form-row,
.form-row-3,
.form-row-tight {
    display: grid;
    gap: 14px;
    align-items: start;
}

.form-row      { grid-template-columns: 1fr 1fr; }
.form-row-3    { grid-template-columns: 1fr 1fr 1fr; }
.form-row-tight{ grid-template-columns: 1.4fr .9fr .7fr; align-items: end; }

.field-inline {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.field-inline label {
    margin-bottom: 0;
}

.input-with-unit {
    display: flex;
    align-items: stretch;
    width: 100%;
    border: 1px solid #d6dcf3;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
    overflow: hidden;
    transition: all .16s ease;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.85),
        0 2px 6px rgba(90, 105, 180, 0.04);
}

.input-with-unit:focus-within {
    border-color: rgba(109, 94, 252, 0.45);
    box-shadow:
        0 0 0 4px rgba(109, 94, 252, 0.12),
        0 8px 18px rgba(109, 94, 252, 0.08);
    background: #fff;
}

.input-with-unit input {
    flex: 1;
    border: none;
    background: transparent;
    height: 44px;
    padding: 0 14px;
    font-size: 14px;
    color: var(--text);
    outline: none;
    min-width: 0;
}

.input-with-unit .unit {
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    background: rgba(109, 94, 252, 0.06);
    border-left: 1px solid #dfe4f7;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--primary-dark);
    white-space: nowrap;
}

/* ── 5. Navigazione sezioni fase (A / EE / KE / BP) ───────────────── */
.sec-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.sec-tab {
    padding: 8px 14px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 12.5px;
    color: var(--text-soft);
    text-decoration: none;
    font-weight: 700;
    transition: all .14s ease;
    box-shadow: var(--shadow-sm);
}

.sec-tab:hover {
    color: var(--primary-dark);
    background: var(--primary-soft);
    border-color: rgba(109, 94, 252, 0.22);
}

.sec-tab.active {
    background: var(--grad-main);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 10px 20px rgba(109, 94, 252, 0.18);
}

/* ── 6. Tabelle standard ───────────────────────────────────────────── */
.tbl-wrap {
    overflow-x: auto;
    border-radius: 18px;
}

.tbl {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.tbl thead tr {
    background: linear-gradient(135deg, #eef2ff 0%, #f7fbff 100%);
}

.tbl th {
    padding: 12px 16px;
    text-align: left;
    font-size: 11.5px;
    font-weight: 800;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .08em;
    border-bottom: 1px solid var(--border);
}

.tbl th:first-child { border-top-left-radius: 14px; }
.tbl th:last-child  { border-top-right-radius: 14px; }

.tbl td {
    padding: 14px 16px;
    font-size: 13.5px;
}

.tbl tbody tr {
    background: rgba(255,255,255,0.82);
    transition: all .12s ease;
}

.tbl tbody tr + tr td {
    border-top: 1px solid rgba(217, 222, 245, 0.6);
}

.tbl tbody tr:hover { background: #f9faff; }

/* ── 7. Layout Auth ────────────────────────────────────────────────── */
body.auth-body {
    font-size: 15px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background:
        radial-gradient(circle at top left, rgba(109, 94, 252, 0.14), transparent 28%),
        radial-gradient(circle at bottom right, rgba(35, 196, 200, 0.14), transparent 28%),
        linear-gradient(180deg, #f7f8ff 0%, #eef3ff 100%);
}

.auth-box {
    background: rgba(255,255,255,0.84);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,0.8);
    padding: 42px 38px 32px;
    width: 100%;
    max-width: 430px;
    box-shadow: var(--shadow-lg);
}

.auth-logo {
    text-align: center;
    margin-bottom: 28px;
}

.auth-logo .brand {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: var(--grad-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-logo .sub {
    font-size: 12px;
    color: var(--muted);
    margin-top: 6px;
}

.auth-box h1 {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 20px;
    color: var(--text);
}

.auth-box .form-input {
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    font-size: 14px;
}

.auth-box .form-input:focus {
    border-color: rgba(109, 94, 252, 0.45);
}

.pwd-wrap { position: relative; }

.pwd-wrap .form-input { padding-right: 42px; }

.pwd-eye {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1;
}

.pwd-eye:hover { color: var(--primary-dark); }

.auth-box .btn {
    width: 100%;
    padding: 12px 16px;
    margin-top: 4px;
    font-size: 14px;
}

.auth-links {
    margin-top: 18px;
    text-align: center;
    font-size: 13px;
    color: var(--text-soft);
}

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

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

.auth-langs {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
    font-size: 12px;
}

.auth-langs a {
    color: var(--muted);
    text-decoration: none;
}

.auth-langs a.active {
    color: var(--primary-dark);
    font-weight: 700;
}

/* ── 8. Sezione EE — Eltern Eingaben ──────────────────────────────── */
.ee-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
}

.ee-parent-hdr {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 16px;
    color: var(--text);
}

.ee-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    background: var(--grad-main);
    box-shadow: 0 8px 18px rgba(109, 94, 252, 0.18);
}

.ee-section-lbl {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: var(--primary-dark);
    margin: 16px 0 8px;
}

.ee-field { margin-bottom: 12px; }

.ee-field label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.ee-input {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border: 1px solid #d6dcf3;
    border-radius: 14px;
    font-size: 13.5px;
    font-weight: 500;
    background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
    color: var(--text);
    transition: all .15s ease;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.85),
        0 2px 6px rgba(90, 105, 180, 0.04);
}

.ee-input:hover { border-color: #bec8eb; }

.ee-input:focus {
    outline: none;
    border-color: rgba(109, 94, 252, 0.45);
    box-shadow:
        0 0 0 4px rgba(109, 94, 252, 0.12),
        0 8px 18px rgba(109, 94, 252, 0.08);
    background: #fff;
}

.ee-input:disabled {
    background: #f3f6fc;
    color: var(--muted);
    box-shadow: none;
}

.ee-input-group {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
}

.ee-input-group .ee-input { min-width: 0; }

.ee-unit,
.ee-unit-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 54px;
    height: 44px;
    padding: 0 12px;
    background: rgba(109, 94, 252, 0.06);
    border: 1px solid #d6dcf3;
    border-radius: 14px;
    color: var(--primary-dark);
    white-space: nowrap;
    font-weight: 700;
}

.ee-unit { font-size: 12.5px; }
.ee-unit-sm { font-size: 11.5px; }

.ee-dual {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ee-dual-item {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ee-dual-item .ee-input { min-width: 0; }

.ee-divider {
    border: none;
    border-top: 1px dashed var(--border-strong);
    margin: 16px 0;
}

.ee-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--grad-soft);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 8px 12px;
    margin: 10px 0 4px;
    font-size: 12.5px;
    color: var(--text-soft);
}

.ee-total-row strong {
    font-size: 13.5px;
    color: var(--text);
}

.ee-summary {
    background: linear-gradient(135deg, #fafbff 0%, #f2f8ff 100%);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 13px 14px;
    margin: 12px 0;
}

.ee-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 5px 0;
    border-bottom: 1px solid rgba(217, 222, 245, 0.7);
}

.ee-summary-row:last-child { border-bottom: none; }

.ee-summary-row.ee-result {
    font-weight: 800;
    font-size: 14px;
    padding-top: 8px;
    margin-top: 4px;
}

.ee-pos { color: #16a34a; }
.ee-neg { color: #dc2626; }

.ee-night-callout {
    background: #fff6d8;
    border: 1px solid #fde68a;
    border-radius: 14px;
    padding: 10px 13px;
    font-size: 12px;
    color: #8a5b00;
    margin-bottom: 10px;
    line-height: 1.5;
}

/* ── 9. Sezione KE — Kinder Eingaben ──────────────────────────────── */
.ke-child-card { margin-bottom: 22px; }

.ke-child-hdr {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.ke-child-num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--grad-main);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    flex-shrink: 0;
    box-shadow: 0 10px 18px rgba(109, 94, 252, 0.20);
}

.ke-child-name {
    font-size: 16px;
    font-weight: 800;
}

.ke-child-age {
    font-size: 13px;
    color: var(--muted);
    margin-left: 4px;
}

.ke-fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.ke-field label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 4px;
}

.ke-field .hint {
    font-size: 11.5px;
    color: var(--muted);
    margin-top: 3px;
    line-height: 1.4;
}

.ke-input-group {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
}

.ke-input {
    flex: 1;
    height: 44px;
    padding: 0 12px;
    border: 1px solid #d6dcf3;
    border-radius: 14px;
    font-size: 13.5px;
    font-weight: 500;
    background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
    color: var(--text);
    transition: all .15s ease;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.85),
        0 2px 6px rgba(90, 105, 180, 0.04);
}

.ke-input:hover { border-color: #bec8eb; }

.ke-input:focus {
    outline: none;
    border-color: rgba(109, 94, 252, 0.45);
    box-shadow:
        0 0 0 4px rgba(109, 94, 252, 0.12),
        0 8px 18px rgba(109, 94, 252, 0.08);
    background: #fff;
}

.ke-input:disabled {
    background: #f3f6fc;
    color: var(--muted);
    box-shadow: none;
}

.ke-unit,
.ke-unit-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 54px;
    height: 44px;
    padding: 0 12px;
    background: rgba(109, 94, 252, 0.06);
    border: 1px solid #d6dcf3;
    border-radius: 14px;
    color: var(--primary-dark);
    white-space: nowrap;
    font-weight: 700;
}

.ke-unit { font-size: 12px; }
.ke-unit-sm { font-size: 11px; }

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

.ke-nights-col {
    flex: 1;
    min-width: 120px;
}

.ke-nights-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 6px;
    color: var(--text-soft);
}

.ke-nights-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.ke-nights-total {
    font-size: 12px;
    color: var(--muted);
    align-self: flex-end;
    padding-bottom: 10px;
    white-space: nowrap;
}

.ke-divider {
    border: none;
    border-top: 1px dashed var(--border-strong);
    margin: 16px 0;
}

.ke-section-lbl {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--primary-dark);
    margin-bottom: 10px;
}

.ke-empty {
    text-align: center;
    padding: 40px;
    color: var(--muted);
    font-size: 14px;
    background: #fff;
    border: 1px dashed var(--border-strong);
    border-radius: 18px;
}

.ke-cost-row {
    display: grid;
    grid-template-columns: 1fr 110px 110px 80px;
    gap: 8px;
    align-items: center;
    padding: 7px 0;
    border-bottom: 1px solid rgba(217, 222, 245, 0.7);
    font-size: 13px;
}

.ke-cost-row:last-child { border-bottom: none; }

.ke-cost-hdr {
    display: grid;
    grid-template-columns: 1fr 110px 110px 80px;
    gap: 8px;
    padding: 0 0 6px;
    font-size: 11px;
    font-weight: 800;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .06em;
}

.ke-cost-p2 {
    font-size: 12.5px;
    color: var(--muted);
    font-style: italic;
    white-space: nowrap;
    text-align: right;
    padding-right: 4px;
}

.ke-cost-input,
.ke-cost-input-free {
    width: 100%;
    height: 40px;
    padding: 0 10px;
    border: 1px solid #d6dcf3;
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
    font-size: 13px;
    color: var(--text);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.85),
        0 2px 6px rgba(90, 105, 180, 0.04);
    transition: all .15s ease;
}

.ke-cost-input {
    text-align: right;
    font-weight: 600;
}

.ke-cost-input-free {
    text-align: left;
}

.ke-cost-input:focus,
.ke-cost-input-free:focus {
    outline: none;
    border-color: rgba(109, 94, 252, 0.45);
    box-shadow:
        0 0 0 4px rgba(109, 94, 252, 0.10),
        0 8px 18px rgba(109, 94, 252, 0.06);
    background: #fff;
}

.ke-cost-input:disabled {
    background: #f3f6fc;
    color: var(--muted);
    box-shadow: none;
}

.ke-total-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    background: var(--grad-soft);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 8px 12px;
    margin-top: 8px;
    font-size: 12.5px;
    color: var(--text-soft);
}

.ke-total-row strong {
    font-size: 13.5px;
    color: var(--text);
}

.ke-eink-row {
    display: grid;
    grid-template-columns: 1fr 120px 120px;
    gap: 8px;
    align-items: center;
    padding: 7px 0;
    border-bottom: 1px solid rgba(217, 222, 245, 0.7);
    font-size: 13px;
}

.ke-eink-row:last-child { border-bottom: none; }

.ke-eink-hdr {
    display: grid;
    grid-template-columns: 1fr 120px 120px;
    gap: 8px;
    padding: 0 0 6px;
    font-size: 11px;
    font-weight: 800;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .06em;
}

/* ── 10. Sezione BP — Betreuungsplan ───────────────────────────────── */
.bp-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.bp-tool-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 2px solid transparent;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: all .16s ease;
    line-height: 1;
    box-shadow: var(--shadow-sm);
    background: #fff;
    color: var(--text-soft);
}

.bp-tool-btn:hover {
    transform: translateY(-1px);
    opacity: 1;
}

.bp-tool-btn.active {
    border-color: rgba(29,34,64,0.18);
    box-shadow: 0 0 0 4px rgba(109, 94, 252, 0.12);
    color: var(--text);
}

.bp-tool-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.bp-sel-label {
    font-size: 12.5px;
    color: var(--muted);
    margin-left: 8px;
}

.bp-child-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

.bp-child-tab {
    padding: 9px 16px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    background: #fff;
    color: var(--muted);
    transition: all .14s ease;
    box-shadow: var(--shadow-sm);
}

.bp-child-tab:hover {
    color: var(--text);
    background: var(--primary-soft);
}

.bp-child-tab.active {
    background: var(--grad-main);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 10px 20px rgba(109, 94, 252, 0.18);
}

.bp-ctx-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.bp-ctx-tab {
    padding: 7px 13px;
    border-radius: 999px;
    border: 1px solid var(--border);
    font-size: 12.5px;
    cursor: pointer;
    background: #fff;
    color: var(--text-soft);
    transition: all .14s ease;
    box-shadow: var(--shadow-sm);
}

.bp-ctx-tab:hover {
    color: var(--text);
    background: var(--primary-soft);
}

.bp-ctx-tab.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    font-weight: 700;
}

.bp-grid-wrap {
    overflow-x: auto;
    padding-bottom: 6px;
}

.bp-grid {
    border-collapse: separate;
    border-spacing: 3px;
    user-select: none;
}

.bp-grid th {
    padding: 4px 6px;
    font-size: 11.5px;
    font-weight: 800;
    color: var(--muted);
    text-align: center;
    white-space: nowrap;
}

.bp-grid th.day-hdr { min-width: 48px; }

.bp-grid .slot-lbl {
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
    padding: 0 10px 0 0;
    text-align: right;
    min-width: 90px;
    font-weight: 700;
}

.bp-cell {
    width: 46px;
    height: 30px;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,.5);
    border-radius: 10px;
    text-align: center;
    font-size: 11px;
    font-weight: 800;
    transition: transform .08s ease, opacity .08s ease, box-shadow .12s ease;
    vertical-align: middle;
    box-shadow: 0 3px 8px rgba(90, 100, 160, 0.08);
}

.bp-cell:hover {
    opacity: .92;
    transform: scale(1.03);
}

.bp-cell.locked-cell {
    cursor: default;
    filter: saturate(0.85);
}

.bp-fill-btn {
    padding: 5px 9px;
    font-size: 11px;
    cursor: pointer;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 999px;
    white-space: nowrap;
    color: var(--text-soft);
    transition: all .12s ease;
    box-shadow: var(--shadow-sm);
    font-weight: 700;
}

.bp-fill-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.bp-fill-btn:disabled {
    opacity: .45;
    cursor: default;
}

.bp-summary {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(243,246,255,0.95) 100%);
    border-radius: 18px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.bp-sum-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-soft);
}

.bp-sum-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    flex-shrink: 0;
}

.bp-sum-val {
    font-weight: 800;
    min-width: 36px;
    color: var(--text);
}

.bp-copy-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--muted);
    flex-wrap: wrap;
}

.bp-copy-row select {
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 13px;
    background: #fff;
    color: var(--text);
}

/* ── 11. Responsive ────────────────────────────────────────────────── */
@media (max-width: 860px) {
    .ee-grid {
        grid-template-columns: 1fr;
    }
}


/* ── Footer ──────────────────────────────────────────────────────────────────── */
.ftr {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
    height: var(--footer); background: var(--surface);
    border-top: 1px solid var(--border);
    display: flex; align-items: center; gap: 16px;
    padding: 0 20px 0 calc(var(--sidebar) + 20px);
    font-size: 12px; color: var(--muted);
}
.ftr .spacer  { flex: 1; }
.ftr-links    { display: flex; align-items: center; gap: 10px; }
.ftr-link     { color: var(--muted); text-decoration: none; font-size: 12px; transition: color .12s; }
.ftr-link:hover { color: var(--text); }
.ftr-sep      { color: var(--border); font-size: 11px; }
.ftr-copy     { font-size: 11.5px; color: var(--muted); white-space: nowrap; }

@media (max-width: 768px) {
    .ftr  { padding-left: 20px; }
    .side { display: none; }

    .main {
        margin-left: 0;
        padding: 18px 16px;
    }

    .hdr {
        padding: 0 14px;
        height: 58px;
    }

    .pg-title { font-size: 21px; }

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

    .form-row,
    .form-row-3,
    .form-row-tight,
    .field-inline,
    .ke-fields-grid {
        grid-template-columns: 1fr;
    }

    .field-inline {
        gap: 6px;
    }
}

@media (max-width: 700px) {
    .ke-fields-grid {
        grid-template-columns: 1fr;
    }
}
/* ── 12. Landing Login Mu@k — pagina accesso brandizzata ─────────── */

body.auth-body {
    background:
        radial-gradient(circle at top left, rgba(36,74,134,0.12), transparent 28%),
        radial-gradient(circle at bottom right, rgba(35,183,197,0.10), transparent 22%),
        linear-gradient(180deg, #f4f8fd 0%, #eef4fb 100%);
}

/* Layout split landing + login */
.muk-login-layout {
    min-height: 100vh;
    width: 100%;
    display: grid;
    grid-template-columns: 1.15fr .85fr;
}

.muk-hero {
    position: relative;
    overflow: hidden;
    color: #fff;
    background:
        linear-gradient(145deg, rgba(20,42,83,0.96) 0%, rgba(36,74,134,0.94) 58%, rgba(35,183,197,0.88) 100%);
}

.muk-hero::before {
    content: "";
    position: absolute;
    right: -90px;
    bottom: -90px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: rgba(255,255,255,0.07);
}

.muk-hero::after {
    content: "";
    position: absolute;
    left: -60px;
    top: 70px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
}

.muk-hero__inner {
    position: relative;
    z-index: 2;
    height: 100%;
    padding: 38px 42px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.muk-brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}

.muk-brand__mark {
    position: relative;
    width: 50px;
    height: 50px;
    border-radius: 10px;
    background: linear-gradient(180deg, #e53935 0%, #c62828 100%);
    box-shadow:
        0 0 0 8px rgba(255,255,255,0.08),
        0 10px 22px rgba(0,0,0,0.16);
    flex-shrink: 0;
}

.muk-brand__mark::before,
.muk-brand__mark::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 3px;
}

.muk-brand__mark::before {
    width: 24px;
    height: 8px;
}

.muk-brand__mark::after {
    width: 8px;
    height: 24px;
}

.muk-brand__overline {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: .12em;
    opacity: .78;
    font-weight: 700;
}

.muk-brand__name {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.muk-hero__badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.15);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    margin-bottom: 18px;
}

.muk-hero__title {
    margin: 0;
    font-size: 36px;
    line-height: 1.1;
    font-weight: 850;
    letter-spacing: -0.05em;
    color: #fff;
}

.muk-hero__subtitle {
    margin: 14px 0 0;
    font-size: 22px;
    line-height: 1.18;
    font-weight: 700;
    max-width: 680px;
    color: #fff;
}

.muk-hero__lead {
    margin: 22px 0 0;
    max-width: 650px;
    font-size: 17px;
    line-height: 1.7;
    color: rgba(255,255,255,0.90);
}

.muk-hero__points {
    margin-top: 30px;
    display: grid;
    gap: 16px;
    max-width: 720px;
}

.muk-point {
    display: grid;
    grid-template-columns: 32px 1fr;
    gap: 14px;
    align-items: start;
}

.muk-point__icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.14);
    font-weight: 800;
}

.muk-point strong {
    display: block;
    font-size: 16px;
    margin-bottom: 4px;
    color: #fff;
}

.muk-point p {
    margin: 0;
    color: rgba(255,255,255,0.84);
    line-height: 1.55;
}

.muk-hero__mini {
    margin-top: 32px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    max-width: 760px;
}

.muk-mini-card {
    padding: 16px;
    border-radius: 18px;
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.14);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.muk-mini-card span {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
    opacity: .74;
    margin-bottom: 7px;
}

.muk-mini-card strong {
    font-size: 15px;
    line-height: 1.3;
    color: #fff;
}

/* Colonna destra login */
.muk-login-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 34px 24px;
}

.muk-login-card {
    width: 100%;
    max-width: 460px;
    background: rgba(255,255,255,0.90);
    border: 1px solid rgba(216,224,239,0.9);
    border-radius: 28px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 20px 48px rgba(25,42,79,0.12);
    padding: 34px 30px 28px;
}

.muk-login-card__top {
    margin-bottom: 22px;
}

.muk-login-card__eyebrow {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: #3c6ec4;
    margin-bottom: 10px;
}

.muk-login-card h3 {
    margin: 0;
    font-size: 30px;
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: #1d2740;
}

.muk-login-card p {
    margin: 12px 0 0;
    color: #66738f;
    line-height: 1.6;
}

.muk-login-form {
    margin-top: 6px;
}

/* Riusa il look dei tuoi input, ma con classe dedicata */
.muk-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d8e0ef;
    border-radius: 14px;
    font-size: 14px;
    outline: none;
    transition: all .16s ease;
    background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
    color: var(--text);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.85), 0 2px 6px rgba(29,39,64,0.03);
}

.muk-input:focus {
    border-color: #7aa0de;
    box-shadow: 0 0 0 4px rgba(60,110,196,0.12), 0 10px 22px rgba(36,74,134,0.06);
    background: #fff;
}

.muk-pwd-wrap {
    position: relative;
}

.muk-pwd-wrap .muk-input {
    padding-right: 40px;
}

.muk-pwd-eye {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: #8090af;
    font-size: 15px;
    line-height: 1;
}

.muk-pwd-eye:hover {
    color: #244a86;
}

.muk-btn-login {
    width: 100%;
    padding: 11px 16px;
    margin-top: 6px;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    background: linear-gradient(135deg, #244a86 0%, #3c6ec4 55%, #23b7c5 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: .01em;
    transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
    box-shadow: 0 16px 28px rgba(36,74,134,0.18);
}

.muk-btn-login:hover {
    transform: translateY(-1px);
    filter: brightness(1.02);
}

.muk-login-alert {
    margin-bottom: 16px;
    border-radius: 14px;
}

.muk-login-links {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    color: #66738f;
    font-size: 13px;
}

.muk-login-links a {
    color: #244a86;
    text-decoration: none;
    font-weight: 600;
}

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

.muk-sep {
    opacity: .65;
}

/* Responsive login landing */
@media (max-width: 980px) {
    .muk-login-layout {
        grid-template-columns: 1fr;
    }

    .muk-hero__inner {
        padding: 28px 22px 34px;
    }

    .muk-hero__title {
        font-size: 42px;
    }

    .muk-hero__subtitle {
        font-size: 24px;
    }

    .muk-hero__mini {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .muk-login-panel {
        padding: 18px 14px 24px;
    }

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

    .muk-hero__inner {
        padding: 22px 18px 28px;
    }

    .muk-hero__title {
        font-size: 36px;
    }

    .muk-hero__subtitle {
        font-size: 21px;
    }

    .muk-hero__lead {
        font-size: 15px;
    }
}
.muk-hero__title { font-size: 32px; }
.muk-hero__subtitle { font-size: 21px; }
.muk-hero__lead { font-size: 15px; }
.muk-point strong { font-size: 14px; }
.muk-point p { font-size: 13px; line-height: 1.45; }
.muk-mini-card strong { font-size: 14px; }
.muk-mini-card p { font-size: 12px; line-height: 1.4; }
.muk-login-card { max-width: 420px; padding: 26px 24px 22px; }
.muk-login-card h3 { font-size: 25px; }
.muk-input { font-size: 13px; padding: 9px 11px; }
.muk-btn-login { font-size: 14px; padding: 10px 14px; }