* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #eef1f6;
    color: #1f2937;
}

/* TOPBAR */
.topbar {
    background: #1f3c88;
    color: #fff;
    padding: 22px 32px 16px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
    position: relative;
    z-index: 1000;
}

.topbar-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.topbar-brand {
    min-width: 0;
}

.topbar h1 {
    margin: 0;
    font-size: 30px;
}

.topbar .subtitle {
    margin-top: 6px;
    color: #dbe4ff;
    font-size: 15px;
}

.topbar .menu-toggle {
    display: none;
    appearance: none;
    -webkit-appearance: none;
    border: none;
    outline: none;
    background: rgba(255,255,255,0.14);
    color: #fff;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 22px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    box-shadow: none;
}

.topbar .menu-toggle:hover {
    background: rgba(255,255,255,0.22);
}

.topbar .menu-toggle span {
    display: block;
    transform: translateY(-1px);
}

/* MENU */
.topbar .menu {
    margin-top: 16px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.topbar .menu > a,
.topbar .dropdown-toggle {
    appearance: none;
    -webkit-appearance: none;
    text-decoration: none;
    color: #fff;
    background: rgba(255,255,255,0.14);
    padding: 10px 16px;
    border-radius: 12px;
    font-weight: bold;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s ease;
    cursor: pointer;
    border: none;
    font-family: inherit;
    line-height: 1.2;
    box-shadow: none;
}

.topbar .menu > a:hover,
.topbar .dropdown-toggle:hover {
    background: rgba(255,255,255,0.22);
}

.topbar .menu > a.active {
    background: #0b1736;
}

/* DROPDOWN */
.topbar .dropdown {
    position: relative;
}

.topbar .dropdown.active .dropdown-toggle,
.topbar .dropdown.open .dropdown-toggle {
    background: #0b1736;
}

.topbar .caret {
    font-size: 12px;
    line-height: 1;
}

.topbar .dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    min-width: 220px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.14);
    overflow: hidden;
    z-index: 1200;
    border: 1px solid #dbe4ff;
    padding: 6px 0;
}

.topbar .dropdown.open .dropdown-menu {
    display: block;
}

.topbar .dropdown-menu a {
    display: block;
    width: 100%;
    background: #fff;
    color: #1f2937;
    padding: 12px 16px;
    border-radius: 0;
    margin: 0;
    font-weight: bold;
    font-size: 14px;
    text-decoration: none;
}

.topbar .dropdown-menu a:hover {
    background: #eef4ff;
    color: #1f3c88;
}

.topbar .dropdown-menu a.active {
    background: #dbe4ff;
    color: #0b1736;
}

/* MOBILE */
@media (max-width: 900px) {
    .topbar {
        padding: 18px 16px 14px;
    }

    .topbar h1 {
        font-size: 24px;
    }

    .topbar .subtitle {
        font-size: 14px;
    }

    .topbar .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .topbar .menu {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        margin-top: 18px;
    }

    .topbar .menu.open {
        display: flex;
    }

    .topbar .menu > a,
    .topbar .dropdown-toggle {
        width: 100%;
        justify-content: space-between;
    }

    .topbar .dropdown {
        width: 100%;
    }

    .topbar .dropdown-menu {
        position: static;
        display: none;
        width: 100%;
        min-width: 0;
        margin-top: 8px;
        border-radius: 12px;
        box-shadow: none;
        border: 1px solid rgba(255,255,255,0.18);
        background: rgba(255,255,255,0.10);
        padding: 6px;
    }

    .topbar .dropdown.open .dropdown-menu {
        display: block;
    }

    .topbar .dropdown-menu a {
        background: rgba(255,255,255,0.14);
        color: #fff;
        border-radius: 10px;
        margin-bottom: 6px;
    }

    .topbar .dropdown-menu a:last-child {
        margin-bottom: 0;
    }

    .topbar .dropdown-menu a:hover,
    .topbar .dropdown-menu a.active {
        background: #0b1736;
        color: #fff;
    }
}

/* LAYOUT */
.wrap {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

.card {
    background: #fff;
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.06);
    margin-bottom: 20px;
}

/* BUTTON */
.btn {
    display: inline-block;
    text-decoration: none;
    border: none;
    cursor: pointer;
    color: #fff;
    padding: 14px 22px;
    border-radius: 16px;
    margin-right: 10px;
    margin-top: 10px;
    font-weight: bold;
    font-family: inherit;
    font-size: 14px;
}

.btn-primary {
    background: #0b1736;
}

.btn-success {
    background: #198754;
}

.btn-danger {
    background: #dc3545;
}

/* ALERT */
.ok {
    background: #eaf7ee;
    color: #1f6b3b;
    border: 1px solid #cde9d4;
    padding: 14px 16px;
    border-radius: 16px;
    margin-bottom: 16px;
}

.error {
    background: #fde8e8;
    color: #a61b1b;
    border: 1px solid #f5c2c7;
    padding: 14px 16px;
    border-radius: 16px;
    margin-bottom: 16px;
}

/* FLASH */
.flash {
    padding: 14px 16px;
    border-radius: 16px;
    margin-bottom: 16px;
    font-weight: bold;
}

.flash-success {
    background: #eaf7ee;
    color: #1f6b3b;
    border: 1px solid #cde9d4;
}

.flash-error {
    background: #fde8e8;
    color: #a61b1b;
    border: 1px solid #f5c2c7;
}

.flash-warning {
    background: #fff7e6;
    color: #9a6700;
    border: 1px solid #f3d38a;
}

/* TABLE */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 18px;
}

th, td {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
}

th {
    color: #374151;
    background: #f8fafc;
}

/* FORM */
input[type="text"],
input[type="email"],
input[type="date"],
input[type="time"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 14px;
    font-size: 14px;
    background: #fff;
    color: #1f2937;
    font-family: inherit;
}

textarea {
    resize: vertical;
    min-height: 90px;
}

label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
}

.field {
    margin-bottom: 18px;
}

/* BADGE */
.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: bold;
    background: #dbe4ff;
    color: #0b1736;
}

/* UTILITIES */
.muted {
    color: #6b7280;
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .menu {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        margin-top: 18px;
    }

    .menu.open {
        display: flex;
    }

    .menu a,
    .dropdown-toggle {
        width: 100%;
        justify-content: space-between;
    }

    .dropdown {
        width: 100%;
    }

    .dropdown-menu {
        position: static;
        display: none;
        width: 100%;
        margin-top: 8px;
        border-radius: 12px;
        box-shadow: none;
        border: 1px solid rgba(255,255,255,0.18);
        background: rgba(255,255,255,0.10);
        padding: 6px;
    }

    .dropdown.open .dropdown-menu {
        display: block;
    }

    .dropdown-menu a {
        background: rgba(255,255,255,0.14);
        color: #fff;
        border-radius: 10px;
        margin-bottom: 6px;
    }

    .dropdown-menu a:last-child {
        margin-bottom: 0;
    }

    .dropdown-menu a:hover,
    .dropdown-menu a.active {
        background: #0b1736;
        color: #fff;
    }
}

@media (max-width: 768px) {
    .topbar {
        padding: 18px 16px 14px;
    }

    .topbar h1 {
        font-size: 24px;
    }

    .topbar .subtitle {
        font-size: 14px;
    }

    .wrap {
        padding: 0 14px;
        margin: 20px auto;
    }

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

    th, td {
        padding: 10px;
        font-size: 14px;
    }
}
/* ===== MENU GESTIONE CARTELLINO ISOLATO ===== */
.gc-topbar {
    background: #1f3c88;
    color: #fff;
    padding: 22px 32px 16px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
    position: relative;
    z-index: 2000;
}

.gc-topbar-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.gc-topbar-brand h1 {
    margin: 0;
    font-size: 30px;
    color: #fff;
}

.gc-topbar-subtitle {
    margin-top: 6px;
    color: #dbe4ff;
    font-size: 15px;
}

.gc-menu-toggle {
    display: none;
    appearance: none;
    -webkit-appearance: none;
    border: none;
    outline: none;
    background: rgba(255,255,255,0.14);
    color: #fff;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 22px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    box-shadow: none;
}

.gc-menu-toggle:hover {
    background: rgba(255,255,255,0.22);
}

.gc-menu {
    margin-top: 16px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.gc-menu > a,
.gc-dropdown-toggle {
    appearance: none;
    -webkit-appearance: none;
    text-decoration: none;
    color: #fff;
    background: rgba(255,255,255,0.14);
    padding: 10px 16px;
    border-radius: 12px;
    font-weight: bold;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s ease;
    cursor: pointer;
    border: none;
    font-family: inherit;
    line-height: 1.2;
    box-shadow: none;
}

.gc-menu > a:hover,
.gc-dropdown-toggle:hover {
    background: rgba(255,255,255,0.22);
}

.gc-menu > a.active {
    background: #0b1736;
}

.gc-dropdown {
    position: relative;
}

.gc-dropdown.active .gc-dropdown-toggle,
.gc-dropdown.open .gc-dropdown-toggle {
    background: #0b1736;
}

.gc-caret {
    font-size: 12px;
    line-height: 1;
}

.gc-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    min-width: 220px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.14);
    overflow: hidden;
    z-index: 2200;
    border: 1px solid #dbe4ff;
    padding: 6px 0;
}

.gc-dropdown.open .gc-dropdown-menu {
    display: block;
}

.gc-dropdown-menu a {
    display: block;
    width: 100%;
    background: #fff;
    color: #1f2937;
    padding: 12px 16px;
    border-radius: 0;
    margin: 0;
    font-weight: bold;
    font-size: 14px;
    text-decoration: none;
}

.gc-dropdown-menu a:hover {
    background: #eef4ff;
    color: #1f3c88;
}

.gc-dropdown-menu a.active {
    background: #dbe4ff;
    color: #0b1736;
}

@media (max-width: 900px) {
    .gc-topbar {
        padding: 18px 16px 14px;
    }

    .gc-topbar-brand h1 {
        font-size: 24px;
    }

    .gc-topbar-subtitle {
        font-size: 14px;
    }

    .gc-menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .gc-menu {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        margin-top: 18px;
    }

    .gc-menu.open {
        display: flex;
    }

    .gc-menu > a,
    .gc-dropdown-toggle {
        width: 100%;
        justify-content: space-between;
    }

    .gc-dropdown {
        width: 100%;
    }

    .gc-dropdown-menu {
        position: static;
        display: none;
        width: 100%;
        min-width: 0;
        margin-top: 8px;
        border-radius: 12px;
        box-shadow: none;
        border: 1px solid rgba(255,255,255,0.18);
        background: rgba(255,255,255,0.10);
        padding: 6px;
    }

    .gc-dropdown.open .gc-dropdown-menu {
        display: block;
    }

    .gc-dropdown-menu a {
        background: rgba(255,255,255,0.14);
        color: #fff;
        border-radius: 10px;
        margin-bottom: 6px;
    }

    .gc-dropdown-menu a:last-child {
        margin-bottom: 0;
    }

    .gc-dropdown-menu a:hover,
    .gc-dropdown-menu a.active {
        background: #0b1736;
        color: #fff;
    }
}