/* daCLOUD — struttura: barra laterale, barra superiore, menu, contenuto
   I fogli di questa cartella si caricano in ordine (numero iniziale): l'ordine conta, i successivi
   rifiniscono i precedenti. */

/* ---------------------------------------------------------------- shell */

.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 40;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 6px 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-num);
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--ink);
}

.brand-mark {
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 700;
}

.brand em { font-style: normal; font-weight: 500; color: var(--muted); }

.user-avatar {
    display: grid;
    place-items: center;
    flex: none;
    border-radius: 50%;
    color: #fff;
    font-weight: 650;
    letter-spacing: .02em;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex: 1;
    margin: 0 -4px;
    padding: 0 4px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    font-weight: 500;
}

.sidebar-nav a.active {
    font-weight: 600;
}

.sidebar-nav a.active .nav-icon { opacity: 1; }

.nav-icon {
    flex: none;
    display: grid;
    place-items: center;
}

.nav-icon svg { stroke: currentColor; fill: none; stroke-linecap: round; stroke-linejoin: round; }

.nav-section {
    font-weight: 650;
    text-transform: uppercase;
}

.nav-badge {
    margin-left: auto;
    font-weight: 700;
    letter-spacing: .06em;
    border-radius: 999px;
}

 /* 1.89.2: contrasto AA */

.sidebar-scrim { display: none; }

.workspace { display: flex; flex-direction: column; min-width: 0; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
}

.topbar-title { display: grid; min-width: 0; overflow: hidden; }
.topbar-title span { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title strong { letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; position: relative; flex-shrink: 0; }

.icon-btn {
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    color: var(--ink-2);
    cursor: pointer;
}

.icon-btn svg { stroke: currentColor; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-close { display: none; }

.menu-toggle { display: none; }

.notification-button { position: relative; }

.notification-count {
    position: absolute;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-weight: 700;
    display: grid;
    place-items: center;
    border: 2px solid var(--surface);
}

.user-menu-button {
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    border: 1px solid var(--line);
    cursor: pointer;
}

.user-menu-copy { display: grid; text-align: left; line-height: 1.25; max-width: 160px; }
.user-menu-copy strong, .user-menu-copy small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-menu-copy small { font-size: var(--text-xs); color: var(--muted); }

.user-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 190px;
    background: var(--surface);
    border: 1px solid var(--line);
    padding: 6px;
    display: none;
    z-index: 60;
}

.user-popover.open { display: grid; }
.user-popover a { color: var(--ink-2); }

.notification-panel {
    position: absolute;
    top: calc(var(--topbar-h) - 8px);
    right: 22px;
    width: min(380px, calc(100vw - 32px));
    background: var(--surface);
    border: 1px solid var(--line);
    z-index: 55;
    display: none;
    overflow: hidden;
}

.notification-panel.open { display: block; }

.notification-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
}

.notification-list { max-height: 380px; overflow-y: auto; }

.notification-item {
    display: flex;
    gap: 12px;
    width: 100%;
    text-align: left;
    background: none;
    border: 0;
    border-bottom: 1px solid var(--line-soft);
    cursor: pointer;
}

.notification-item:hover { background: var(--surface-2); }
.notification-item p { margin: 0; font-size: var(--text-base); }
.notification-item time { font-size: var(--text-sm); color: var(--muted); }
.notification-item.unread:hover { background: var(--green-100); }

.notification-dot {
    width: 8px;
    height: 8px;
    margin-top: 6px;
    flex: none;
    border-radius: 50%;
    background: var(--green-500);
}

.notification-item.warning .notification-dot { background: var(--amber); }
.notification-item.info .notification-dot { background: var(--info); }

.main-content {
    width: 100%;
    outline: none;
}
