/* App custom — palette azzurra coerente, override Bootstrap minimi. */

:root {
    /* Palette: azzurro Bootstrap "info" come primary, grigio neutro,
       success per "ok/positivo", danger riservato alle azioni distruttive. */
    --bs-primary: #0aa2c0;
    --bs-primary-rgb: 10, 162, 192;
    --bs-link-color: #0aa2c0;
    --bs-link-color-rgb: 10, 162, 192;
    --bs-link-hover-color: #087a91;
    --bs-link-hover-color-rgb: 8, 122, 145;
}

/* Force Bootstrap utility classes to follow the new primary. */
.bg-primary { background-color: #0aa2c0 !important; }
.text-bg-primary { background-color: #0aa2c0 !important; color: #fff !important; }
.btn-primary {
    --bs-btn-bg: #0aa2c0;
    --bs-btn-border-color: #0aa2c0;
    --bs-btn-hover-bg: #0891ac;
    --bs-btn-hover-border-color: #087f97;
    --bs-btn-active-bg: #087a91;
    --bs-btn-active-border-color: #087589;
    --bs-btn-disabled-bg: #0aa2c0;
    --bs-btn-disabled-border-color: #0aa2c0;
}
.btn-outline-primary {
    --bs-btn-color: #0aa2c0;
    --bs-btn-border-color: #0aa2c0;
    --bs-btn-hover-bg: #0aa2c0;
    --bs-btn-hover-border-color: #0aa2c0;
    --bs-btn-active-bg: #087a91;
    --bs-btn-active-border-color: #087589;
}
.text-primary { color: #0aa2c0 !important; }
.border-primary { border-color: #0aa2c0 !important; }
.bg-primary-subtle { background-color: #cdeff5 !important; }
.border-primary-subtle { border-color: #aedfe8 !important; }
.text-primary-emphasis { color: #056679 !important; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #f5f7fa;
    color: #1f2937;
}

/* Navbar: link bianco pieno. */
.navbar-dark {
    --bs-navbar-color: #fff;
    --bs-navbar-hover-color: rgba(255, 255, 255, 0.85);
    --bs-navbar-active-color: #fff;
    --bs-navbar-disabled-color: rgba(255, 255, 255, 0.5);
}

/* Cards: ombre soft uniformi. */
.card {
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.card-header {
    background-color: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
}

/* Calendario. */
.calendar-grid {
    display: grid;
    grid-template-columns: 64px repeat(7, 1fr);
    gap: 1px;
    background: #dee2e6;
    border: 1px solid #dee2e6;
    border-radius: .375rem;
    overflow: hidden;
}

.calendar-grid .cell {
    background: #fff;
    min-height: 36px;
    padding: 2px 4px;
    font-size: .8rem;
}

.calendar-grid .cell.head {
    background: #f8f9fa;
    font-weight: 600;
    text-align: center;
    padding: 6px 4px;
}

.calendar-grid .cell.hour {
    background: #f8f9fa;
    color: #6c757d;
    text-align: right;
    font-size: .75rem;
    padding-right: 6px;
    line-height: 36px;
}

.calendar-grid .cell.today {
    background: #fffbeb;
}

.calendar-event {
    background: #cdeff5;
    border-left: 3px solid #0aa2c0;
    border-radius: 3px;
    padding: 2px 6px;
    margin-bottom: 2px;
    font-size: .75rem;
    line-height: 1.2;
    text-decoration: none;
    color: #056679;
    display: block;
}

.calendar-event.online {
    background: #d1e7dd;
    border-left-color: #198754;
    color: #0a3622;
}

.calendar-event.svolta { opacity: .55; }

@media (max-width: 767.98px) {
    .calendar-grid { grid-template-columns: 48px 1fr; }
    .calendar-grid .day-col { display: none; }
    .calendar-grid .day-col.active { display: block; }
}

/* Stat card sulla dashboard (legacy, ora le card non hanno più il bordo). */
.card-stat {
    border-left: 4px solid #0aa2c0;
}

/* Card cliccabile (es. lezioni nella dashboard). */
.lesson-card,
.hover-lift {
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.lesson-card:hover,
.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(10, 162, 192, 0.12);
    border-color: #aedfe8;
}

/* Avatar con iniziali (lista studenti/genitori). */
.avatar-initials {
    width: 44px;
    height: 44px;
    background: #cdeff5;
    color: #056679;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.95rem;
    flex-shrink: 0;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.avatar-initials.avatar-muted {
    background: #f3f4f6;
    color: #6b7280;
}
.avatar-initials.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 0.78rem;
}
.avatar-initials.avatar-lg {
    width: 64px;
    height: 64px;
    font-size: 1.35rem;
}

/* Stat tiles: numero grande + label piccola, sfondo chiaro. */
.stat-tile {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: .5rem;
    padding: 1rem;
    height: 100%;
    transition: border-color .12s ease;
}
.stat-tile:hover { border-color: #aedfe8; }
.stat-tile .stat-icon {
    width: 36px;
    height: 36px;
    border-radius: .5rem;
    background: #cdeff5;
    color: #056679;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}
.stat-tile.stat-warning .stat-icon { background: #fff3cd; color: #856404; }
.stat-tile .stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.1;
    color: #1f2937;
}
.stat-tile .stat-label {
    color: #6b7280;
    font-size: .8rem;
}

/* Info row con icona allineata (per profile/contact cards). */
.info-row {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    padding: .5rem 0;
}
.info-row + .info-row { border-top: 1px solid #f3f4f6; }
.info-row .info-icon {
    color: #0aa2c0;
    width: 1.25rem;
    text-align: center;
    flex-shrink: 0;
    padding-top: .15rem;
}
.info-row .info-label {
    color: #6b7280;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.info-row .info-value {
    color: #1f2937;
    font-weight: 500;
}

/* Profile grid: 2 colonne responsive, definition-list compatta con icona. */
.profile-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem 1.25rem;
}
@media (min-width: 576px) {
    .profile-grid { grid-template-columns: 1fr 1fr; }
}
.profile-grid .profile-item.span-2 { grid-column: 1 / -1; }
.profile-grid .profile-item {
    display: flex;
    gap: .65rem;
    min-width: 0;
}
.profile-grid .profile-item .info-icon {
    color: #0aa2c0;
    width: 1.5rem;
    height: 1.5rem;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #cdeff5;
    border-radius: .375rem;
    font-size: .85rem;
}
.profile-grid .profile-item .info-label {
    color: #6b7280;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: .1rem;
}
.profile-grid .profile-item .info-value {
    color: #1f2937;
    font-weight: 500;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}
.profile-grid .profile-item .info-value.text-muted-empty,
.text-muted-empty {
    color: #adb5bd;
    font-weight: 400;
    font-style: italic;
}

/* Chip soft (materie, studenti collegati, ecc.). */
.chip {
    display: inline-block;
    background: #f3f4f6;
    color: #374151;
    border-radius: 9999px;
    padding: 0.2rem 0.7rem;
    font-size: 0.78rem;
    line-height: 1.5;
    margin: 0 0.3rem 0.3rem 0;
    text-decoration: none;
}
/* Wrapper per chip con gap uniforme. */
.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0;
}
.chip-list .chip { margin: 0; }
.chip:hover { background: #e5e7eb; color: #111827; }
.chip-primary {
    background: #cdeff5;
    color: #056679;
}
.chip-primary:hover { background: #aedfe8; color: #034a59; }

/* Utility: serve a far funzionare text-truncate dentro flex-grow. */
.min-width-0 { min-width: 0; }

/* Stato empty stilizzato. */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
}
/* Only the hero icon (direct child), not icons inside buttons. */
.empty-state > .bi { font-size: 2.5rem; opacity: 0.4; }


/* Importi sensibili: nascosti di default, toggle con .revenue-toggle. */
.revenue {
    filter: blur(8px);
    transition: filter .15s ease;
    user-select: none;
    cursor: pointer;
}
.revenue.show { filter: none; user-select: auto; cursor: default; }
.revenue-toggle {
    background: none;
    border: 0;
    padding: 0 .25rem;
    color: #6c757d;
    font-size: .9em;
    cursor: pointer;
}
.revenue-toggle:hover { color: #0aa2c0; }

/* ---------- Public homepage ---------- */
/* On the public home page, lock the viewport: no scroll, footer always
   visible. body gets .home-page class via the home.html template. */
body.home-page {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}
body.home-page main {
    min-height: 0;
    overflow: hidden;
    padding-top: 0;
    padding-bottom: 0;
}
.home-hero {
    position: relative;
    overflow: hidden;
    min-height: 0;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1rem, 4vw, 3rem) 1rem;
}

.home-watermark {
    position: absolute;
    left: 50%;
    top: 60%;
    transform: translate(-50%, -50%);
    font-size: clamp(20rem, 55vw, 44rem);
    line-height: 1;
    color: #0aa2c0;
    opacity: 0.06;
    pointer-events: none;
    user-select: none;
    z-index: 0;
}

.home-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 640px;
    width: 100%;
}

.home-brand {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    color: #0aa2c0;
    font-weight: 600;
    font-size: clamp(.9rem, 1.4vw, 1rem);
    letter-spacing: -0.01em;
    margin-bottom: clamp(1rem, 3vw, 1.75rem);
}
.home-brand .bi { font-size: 1.25em; }

.home-headline {
    font-size: clamp(1.9rem, 5vw, 3.2rem);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.022em;
    color: #0f172a;
    margin-bottom: clamp(.75rem, 2vw, 1.25rem);
}

.home-sub {
    font-size: clamp(1rem, 1.6vw, 1.2rem);
    color: #475569;
    line-height: 1.55;
    margin: 0 auto clamp(1.5rem, 3.5vw, 2.5rem);
    max-width: 36rem;
}

.home-cta {
    padding: clamp(.7rem, 1.5vw, .9rem) clamp(1.5rem, 3vw, 2.25rem);
    font-size: clamp(.95rem, 1.3vw, 1.1rem);
    font-weight: 500;
}

.home-tagline {
    margin-top: 1rem;
    color: #94a3b8;
    font-size: .85rem;
}
