﻿/* Content/site.css */
:root {
    --bg: #f6f7fb;
    --card: #fff;
    --txt: #1b1f24;
    --muted: #637083;
    --primary: #2563eb;
    --primary-600: #1e4ed8;
    --accent: #60a5fa;
    --border: #e7eaf0;
    --radius: 14px;
    --shadow: 0 6px 20px rgba(0,0,0,.08);
    --container: 1180px;
}

* {
    box-sizing: border-box
}

html, body {
    height: 100%
}

body {
    margin: 0;
    font: 16px/1.45 system-ui, Segoe UI, Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--txt);
    -webkit-text-size-adjust: 100%;
}

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 16px
}

/* Topbar */
.topbar {
    position: sticky;
    top: 0;
    background: #fff;
    box-shadow: var(--shadow);
    z-index: 20;
}

    .topbar .container {
        display: flex;
        align-items: center;
        gap: 18px;
        min-height: 62px;
    }

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    font-weight: 800;
}

.logo-dot {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    background: linear-gradient(135deg,var(--primary),var(--accent));
    box-shadow: 0 4px 10px rgba(37,99,235,.35);
}

.brand-text {
    letter-spacing: .2px
}

.nav {
    display: flex;
    gap: 14px;
    margin-left: 14px
}

    .nav a {
        color: var(--muted);
        text-decoration: none;
        font-weight: 600;
        padding: 8px 10px;
        border-radius: 8px;
    }

        .nav a:hover {
            background: #f1f4fb;
            color: var(--txt)
        }

        .nav a.active {
            font-weight: 600;
            border-bottom: 2px solid var(--primary)
        }

.userbox {
    margin-left: auto;
    display: flex;
    gap: 10px;
    align-items: center
}

.user-label {
    color: var(--muted);
    font-weight: 600
}

/* Titolo pagina */
.page-title {
    padding: 18px 0
}

    .page-title h1 {
        margin: 0;
        font-size: 1.35rem
    }

/* Card & layout */
.card-soft {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    margin-bottom: 16px;
}

.grid-gap {
    display: grid;
    gap: 12px
}

.row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap
}

.col {
    flex: 1 1 220px
}

/* Controlli */
label {
    display: block;
    font-weight: 700;
    margin: 6px 0
}

.input, input[type=text], input[type=date], input[type=time], input[type=number],
.select, select, textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    font: inherit;
    outline: none;
}

textarea {
    min-height: 110px
}

    .input:focus, select:focus, textarea:focus,
    input[type=date]:focus, input[type=time]:focus, input[type=number]:focus {
        border-color: var(--primary);
        box-shadow: 0 0 0 4px rgba(37,99,235,.12);
    }

/* Bottoni */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    min-height: 44px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: var(--primary);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}

    .btn:hover {
        background: var(--primary-600)
    }

    .btn:focus {
        outline: 2px solid var(--primary);
        outline-offset: 2px
    }

/* Ghost: perfetto per topbar (sfondo bianco) */
.btn-ghost {
    background: #fff;
    color: #111;
    border: 1px solid #cbd5e1; /* bordo visibile */
}

    .btn-ghost:hover {
        background: #f8fafc;
        border-color: #94a3b8
    }

    .btn-ghost:focus {
        outline: 2px solid #94a3b8;
        outline-offset: 2px
    }

/* Secondario “outline” (se ti serve in pagina) */
.btn-outline {
    background: #fff;
    color: var(--primary);
    border: 1px solid var(--primary);
}

    .btn-outline:hover {
        background: #eff6ff
    }

/* Varianti */
.btn-soft {
    background: #f3f6fb;
    color: #111
}

.btn-danger {
    background: #ef4444
}

    .btn-danger:hover {
        background: #dc2626
    }

.btn-mini {
    font-size: 12px;
    padding: 6px 10px;
    min-height: auto;
    border-radius: 10px
}

/* Tabelle */
.table-soft {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0
}

    .table-soft th, .table-soft td {
        padding: 10px 12px;
        border-bottom: 1px solid var(--border)
    }

    .table-soft th {
        text-align: left;
        color: var(--muted);
        font-weight: 800;
        background: #fafbff
    }

/* Utilità */
.no-wrap {
    white-space: nowrap
}

.table-wrap {
    overflow-x: auto
}

.muted {
    color: var(--muted)
}

.h3 {
    font-size: 1.1rem;
    margin: 0 0 8px
}

.footer {
    padding: 18px 0;
    color: var(--muted)
}

/* Tree list (Sezioni) */
.tree-list .row-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    border-bottom: 1px solid #e5e7eb;
    transition: background .2s;
}

    .tree-list .row-item:hover {
        background: #f8fafc
    }

.lvl-0 {
    background: #ffffff
}

.lvl-1 {
    background: #f9fafb
}

.lvl-2 {
    background: #f3f4f6
}

.lvl-3 {
    background: #eef0f3
}

.toggle {
    cursor: pointer;
    user-select: none;
    margin-right: 4px;
    font-size: 13px
}

.collapsed > .children {
    max-height: 0;
    overflow: hidden;
    transition: max-height .25s ease-out
}

.children {
    margin-left: 20px;
    transition: max-height .25s ease-in;
    overflow: hidden
}

.perm-left {
    display: flex;
    align-items: center;
    gap: 6px
}

.badge-inh {
    font-size: 11px;
    color: #6b7280
}

.actions {
    display: flex;
    gap: 6px;
    align-items: center
}

/* (opzionale) forza contrasto bottoni nella topbar */
.topbar .userbox .btn {
    color: #111
}

/* === Dropdown Help === */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropbtn {
    cursor: pointer;
    padding: 8px 10px;
    text-decoration: none;
    color: var(--muted);
    border-radius: 8px;
    font-weight: 600;
}

    .dropbtn:hover, .dropbtn.active {
        background: #f1f4fb;
        color: var(--txt);
    }

.dropdown-content {
    display: none;
    position: absolute;
    background: #fff;
    min-width: 280px;
    box-shadow: 0 10px 26px rgba(0,0,0,.12);
    border-radius: 12px;
    padding: 6px 0;
    z-index: 50;
    right: 0;
    left: auto; /* allinea al bordo destro del bottone */
}

    .dropdown-content a {
        display: block;
        padding: 8px 14px;
        color: #111827;
        text-decoration: none;
        font-size: 14px;
        border-radius: 0;
        white-space: nowrap; /* evita a capo */
    }

        .dropdown-content a:hover,
        .dropdown-content a.active {
            background: #f3f4f6;
        }

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown .divider {
    height: 1px;
    background: #e5e7eb;
    margin: 4px 0;
}
