/* ============================================================
   COGE_STYLE.CSS — Layout principale Coordinazione Genitoriale
   ============================================================ */

:root {
    --primary:        #667eea;
    --primary-dark:   #5a6fd9;
    --secondary:      #764ba2;
    --primary-light:  #f0f2ff;
    --border-lighter: #e8eaf6;
    --text-muted:     #718096;
    --text-dark:      #2D3748;
}

/* ---- BASE ---- */
* { box-sizing: border-box; }
body {
    font-family: 'Source Sans Pro', sans-serif;
    color: var(--text-dark);
    background: #f4f5fb;
    margin: 0;
}
h1,h2,h3,h4,h5,h6 { font-family: 'Inter', sans-serif; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    min-height: 100vh;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Icone categoria sidebar */
.sidebar-cat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: rgba(255,255,255,0.6);
    font-size: 1.3rem;
    gap: 3px;
    transition: background 0.15s, color 0.15s;
    user-select: none;
}
.sidebar-cat-icon span {
    font-size: 0.55rem;
    color: rgba(255,255,255,0.6);
    line-height: 1.1;
    text-align: center;
}
.sidebar-cat-icon:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}
.sidebar-cat-icon:hover span {
    color: #fff;
}
.sidebar-cat-icon.sidebar-cat-active {
    background: rgba(255,255,255,0.22);
    color: #fff;
}
.sidebar-cat-icon.sidebar-cat-active span {
    color: #fff;
}
.sidebar-cat-icon.sidebar-cat-open {
    background: rgba(255,255,255,0.22);
    color: #fff;
}
.sidebar-cat-icon.sidebar-cat-open span {
    color: #fff;
}

/* Pannello laterale voci */
.sidebar-panel-item {
    display: block;
    width: 100%;
    padding: 9px 16px;
    color: rgba(255,255,255,0.75) !important;
    font-size: 0.82rem;
    text-decoration: none !important;
    transition: background 0.12s;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-panel-item:hover {
    background: rgba(255,255,255,0.09);
    color: #fff !important;
}
.sidebar-panel-item.sidebar-panel-item-active {
    background: rgba(100,115,255,0.3);
    color: #a5b4ff !important;
    border-left: 3px solid #a5b4ff;
}
.sidebar-panel-item .bi {
    font-size: 0.85rem;
    margin-right: 8px;
    vertical-align: middle;
}

.sidebar-brand-text {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    color: #fff;
    line-height: 1.2;
}

.sidebar-section-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255,255,255,0.45);
    padding: 0.9rem 1.2rem 0.25rem;
}

.nav-link {
    color: rgba(255,255,255,0.82) !important;
    margin: 0.05rem 0.5rem;
    padding: 0.55rem 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    border-radius: 8px;
    font-size: 0.85rem;
    transition: background 0.15s, color 0.15s;
    text-decoration: none;
}
.nav-link:hover {
    background: rgba(255,255,255,0.18) !important;
    color: #fff !important;
}
.nav-link.active {
    background: rgba(255,255,255,0.26) !important;
    color: #fff !important;
    font-weight: 600;
}
.nav-link .bi { font-size: 0.95rem; flex-shrink: 0; }

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar-btn {
    font-size: 0.82rem;
    background: #fff;
    border: 1px solid #dde1f0;
    border-radius: 8px;
    padding: 5px 11px;
    color: #4a5568;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
    line-height: 1.4;
    position: relative;
}
.topbar-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary-dark);
    text-decoration: none;
}
.topbar-btn .bi { font-size: 0.95rem; }

.topbar-upgrade-badge {
    background: linear-gradient(135deg, #e85d7a, #c0392b);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.topbar-notif-badge {
    position: absolute;
    top: -5px; right: -5px;
    min-width: 17px; height: 17px;
    background: #e53e3e;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    border: 2px solid #fff;
}

/* ============================================================
   SECTION CARD
   ============================================================ */
.section-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--border-lighter);
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 4px rgba(102,126,234,0.06);
}
.section-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: #fff;
    padding: 0.75rem 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.section-header h5,
.section-header h6 {
    margin: 0;
    color: #fff;
    font-size: 0.92rem;
    font-weight: 600;
}
.section-body { padding: 1.25rem; }

/* ============================================================
   TABELLE
   ============================================================ */
.table thead th {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.6rem 0.75rem;
    border: none;
}
.table tbody td {
    font-size: 0.85rem;
    vertical-align: middle;
    border-color: #f0f0f8;
}
.table tbody tr:hover { background: #faf9ff; }

/* ============================================================
   FORM CONTROLS
   ============================================================ */
.form-control, .form-select {
    border-radius: 8px !important;
    font-size: 0.88rem;
    border-color: #dde1f0;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 0.2rem rgba(102,126,234,0.18) !important;
}
.form-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 0.3rem;
}

/* ============================================================
   BOTTONI
   ============================================================ */
.btn { border-radius: 8px; font-size: 0.85rem; }
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%) !important;
    border: none !important;
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #6a3d91 100%) !important;
    transform: translateY(-1px);
}
.btn-sm { font-size: 0.78rem; padding: 0.25rem 0.65rem; }

/* ============================================================
   BADGE STATO
   ============================================================ */
.badge-status {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
}
.badge-active    { background:#e8f5ee; color:#1a7a3c; }
.badge-trial     { background:#fdf6e3; color:#856404; }
.badge-suspended { background:#fdedf0; color:#b02020; }
.badge-cancelled { background:#f0f0f0; color:#666; }

/* ============================================================
   SEMAFORO TOGGLE (permessi)
   ============================================================ */
.btn-semaforo {
    width: 26px; height: 26px;
    border-radius: 50%;
    border: 2px solid #dee2e6;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center; justify-content: center;
    padding: 0;
    font-size: 0.75rem;
    font-weight: 900;
    background: transparent;
}
.btn-semaforo.active       { color:#1a7a3c; border-color:#1a7a3c; background:#e8f5ee; }
.btn-semaforo:not(.active) { color:#b02020; border-color:#f0c0c0; background:#fdedf0; }
.btn-semaforo.saving       { color:#856404; border-color:#d4a017; background:#fdf6e3; }
.btn-semaforo:hover        { transform: scale(1.2); }

/* ============================================================
   ALERT
   ============================================================ */
.alert { border-radius: 10px; font-size: 0.88rem; }

/* ============================================================
   UTILITIES
   ============================================================ */
.text-primary-coge    { color: var(--primary) !important; }
.bg-primary-light     { background: var(--primary-light) !important; }
.border-primary-light { border-color: var(--border-lighter) !important; }

/* Scrollbar sottile */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(102,126,234,0.3); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(102,126,234,0.5); }
/* ============================================================
   DASHBOARD — PROSSIMI INCONTRI
   ============================================================ */
.meeting-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.2rem;
    border-bottom: 1px solid #f0f0f8;
    transition: background 0.12s;
}
.meeting-row:last-child { border-bottom: none; }
.meeting-row:hover { background: #faf9ff; }

.date-badge {
    min-width: 42px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(102,126,234,0.25);
}
.date-badge .day {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}
.date-badge .month {
    font-size: 0.65rem;
    font-weight: 600;
    color: rgba(255,255,255,0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.meeting-time {
    min-width: 44px;
    text-align: center;
    flex-shrink: 0;
}
.meeting-time strong {
    display: block;
    font-size: 0.9rem;
    color: var(--primary-dark);
    line-height: 1.2;
}
.meeting-time div {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: capitalize;
}

.meeting-info { min-width: 0; }
.meeting-code {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.meeting-type-badge {
    display: inline-block;
    font-size: 0.7rem;
    background: var(--primary-light);
    color: var(--primary-dark);
    border-radius: 20px;
    padding: 1px 8px;
    font-weight: 600;
    margin-top: 2px;
}

/* ============================================================
   DASHBOARD — TODO / SCADENZE
   ============================================================ */
.todo-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1.2rem;
    border-bottom: 1px solid #f0f0f8;
}
.todo-row:last-child { border-bottom: none; }
.todo-title {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-dark);
}
.todo-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ============================================================
   EMPTY STATE COMPACT
   ============================================================ */
.empty-state.compact {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    gap: 0.4rem;
}
.empty-state.compact .bi {
    font-size: 1.6rem;
    opacity: 0.35;
}
