:root {
    --bg: #070711;
    --surface: #10101e;
    --surface-2: #17172a;
    --surface-3: #20203a;
    --text: #f6f4ff;
    --muted: #9b9ab2;
    --line: rgba(255,255,255,.1);
    --purple: #9d4eff;
    --pink: #d04dff;
    --cyan: #20cfff;
    --green: #43dd9a;
    --danger: #ff6484;
    --shadow: 0 18px 70px rgba(0,0,0,.28);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at 80% -5%, rgba(104,45,196,.2), transparent 30rem),
        radial-gradient(circle at 5% 45%, rgba(17,78,132,.1), transparent 32rem),
        var(--bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button, a { transition: .2s ease; }
img { max-width: 100%; }
.container { width: min(1160px, calc(100% - 40px)); margin: 0 auto; }
.narrow { width: min(720px, calc(100% - 40px)); }
.muted { color: var(--muted); }
.eyebrow, .card-kicker { display: block; color: #b88cff; font-size: .72rem; font-weight: 800; letter-spacing: .17em; }
.site-header { position: sticky; top: 0; z-index: 10; background: rgba(7,7,17,.8); border-bottom: 1px solid var(--line); backdrop-filter: blur(18px); }
.nav-shell { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand img { width: 43px; height: 43px; object-fit: cover; border-radius: 12px; border: 1px solid rgba(173,93,255,.5); }
.brand strong { display: block; line-height: 1; letter-spacing: .16em; font-size: 1.08rem; }
.brand small { display: block; color: #a69ebf; line-height: 1; margin-top: 5px; font-size: .54rem; letter-spacing: .35em; }
.main-nav { display: flex; align-items: center; gap: 7px; }
.main-nav > a:not(.button), .account-link { color: var(--muted); padding: 10px 12px; border-radius: 9px; font-size: .9rem; }
.main-nav > a:not(.button):hover, .main-nav > a.active { color: white; background: rgba(255,255,255,.07); }
.account-link { display: grid; line-height: 1.15; text-align: right; }
.account-link small { color: #bb89ff; font-size: .65rem; letter-spacing: .08em; margin-top: 4px; }
.nav-toggle { display: none; background: transparent; color: white; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; padding: 0 18px; border: 1px solid transparent; border-radius: 10px; cursor: pointer; font-weight: 750; font-size: .88rem; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: white; background: linear-gradient(110deg, #773cff, #bd46e9); box-shadow: 0 8px 25px rgba(139,57,255,.25); }
.button.outline { color: white; border-color: rgba(185,137,255,.5); background: rgba(139,57,255,.08); }
.button.ghost { color: #d3cde0; border-color: var(--line); background: rgba(255,255,255,.035); }
.button.danger { color: #ff9cb0; border-color: rgba(255,100,132,.3); background: rgba(255,78,111,.08); }
.button.small { min-height: 34px; padding: 0 11px; font-size: .76rem; border-radius: 8px; }
.inline-form { display: inline-flex; margin: 0; }
.flash-stack { padding-top: 18px; }
.flash { padding: 12px 16px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: #e8e3f4; }
.flash.success { border-color: rgba(67,221,154,.35); color: #a8f6d2; }
.flash.error { border-color: rgba(255,100,132,.35); color: #ffadbd; }
.flash.info { border-color: rgba(32,207,255,.3); color: #9eeaff; }
.hero { overflow: hidden; min-height: 555px; display: flex; align-items: center; border-bottom: 1px solid var(--line); background: radial-gradient(circle at 75% 48%, rgba(88,42,193,.18), transparent 29rem); }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 40px; }
.hero-copy h1 { margin: 13px 0 18px; font-size: clamp(3.2rem, 8vw, 6.6rem); line-height: .93; letter-spacing: -.07em; }
.hero-copy h1 span { color: #bd68ff; text-shadow: 0 0 42px rgba(184,72,255,.3); }
.hero-copy p { max-width: 520px; color: var(--muted); font-size: 1.12rem; }
.hero-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.hero-art { position: relative; display: grid; place-items: center; min-height: 450px; }
.hero-art .glow { position: absolute; width: 85%; aspect-ratio: 1; border-radius: 50%; background: conic-gradient(from 120deg, #7528ff, #13d9ff, #d626ff, #7528ff); filter: blur(55px); opacity: .18; }
.hero-art img { width: min(430px, 90%); aspect-ratio: 1; object-fit: cover; border-radius: 30px; border: 1px solid rgba(206,125,255,.5); box-shadow: 0 0 80px rgba(116,41,225,.32), 0 30px 60px #0008; transform: rotate(3deg); }
.section { padding: 86px 0; }
.section-top { padding-top: 0; padding-bottom: 86px; }
.section-heading, .split-heading, .ticket-header { display: flex; justify-content: space-between; align-items: end; gap: 22px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(2.3rem, 5vw, 4.3rem); line-height: 1; letter-spacing: -.055em; margin-bottom: 14px; }
h2 { letter-spacing: -.035em; }
.page-heading { padding-top: 70px; padding-bottom: 52px; }
.page-heading p { color: var(--muted); font-size: 1.05rem; margin-bottom: 0; }
.text-link { color: #d09dff; font-weight: 750; font-size: .86rem; }
.text-link span { margin-left: 6px; transition: margin .2s; }
.text-link:hover span { margin-left: 10px; }
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.resource-card, .resource-row, .panel, .metric-card, .license-card { background: linear-gradient(145deg, rgba(27,27,48,.92), rgba(13,13,27,.95)); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.resource-card { overflow: hidden; }
.resource-card > img, .resource-placeholder { display: block; width: 100%; height: 180px; object-fit: cover; }
.resource-placeholder { display: grid; place-items: center; color: rgba(195,130,255,.6); background: linear-gradient(135deg, #19112e, #162b4a); font-size: 2rem; font-weight: 900; letter-spacing: .15em; }
.card-body { padding: 23px; }
.card-body h3 { margin: 9px 0 8px; font-size: 1.2rem; }
.card-body p { color: var(--muted); min-height: 49px; font-size: .9rem; }
.stats-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; padding-top: 0; }
.stats-strip div { display: flex; align-items: center; gap: 16px; padding: 22px 0; border-top: 1px solid var(--line); }
.stats-strip strong { color: #c578ff; font-size: 2rem; }
.stats-strip span { color: var(--muted); font-size: .9rem; }
.empty-state { padding: 60px 30px; text-align: center; border: 1px dashed rgba(196,151,255,.26); border-radius: 16px; background: rgba(255,255,255,.018); }
.empty-state.compact { padding: 35px; }
.empty-state h2, .empty-state h3 { margin-bottom: 6px; }
.empty-state p { color: var(--muted); }
.auth-section { padding-top: 75px; padding-bottom: 90px; }
.auth-card { max-width: 480px; margin: 0 auto; padding: 35px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.auth-card h1 { font-size: 2.6rem; margin-top: 12px; }
.auth-card > p { margin-bottom: 26px; }
.auth-switch { color: var(--muted); text-align: center; margin: 23px 0 0; font-size: .9rem; }
.auth-switch a { color: #c891ff; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.form-grid label { display: flex; flex-direction: column; gap: 7px; color: #d9d3e7; font-size: .84rem; font-weight: 700; }
.form-grid label.full, .form-grid .full { grid-column: 1 / -1; }
input, textarea, select { width: 100%; color: var(--text); border: 1px solid rgba(255,255,255,.13); border-radius: 9px; outline: none; background: #0b0b18; padding: 12px 13px; }
input:focus, textarea:focus, select:focus { border-color: #a267ff; box-shadow: 0 0 0 3px rgba(148,76,255,.12); }
textarea { resize: vertical; min-height: 110px; }
select { appearance: auto; }
option { background: #131326; }
.form-actions { display: flex; gap: 10px; align-items: center; }
.panel { padding: 27px; }
.current-image { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .78rem; }
.current-image img { width: 58px; height: 45px; border-radius: 7px; object-fit: cover; }
.resource-list, .ticket-list { display: grid; gap: 14px; }
.resource-row { display: grid; grid-template-columns: 130px 1fr auto; gap: 22px; padding: 15px; align-items: center; }
.resource-row > img, .resource-thumb { width: 130px; height: 130px; border-radius: 11px; object-fit: cover; }
.resource-thumb { display: grid; place-items: center; color: #d598ff; font-size: 2rem; font-weight: 900; background: linear-gradient(140deg, #251044, #102f4d); }
.resource-row-main h2 { margin: 7px 0 6px; font-size: 1.25rem; }
.resource-row-main p { color: var(--muted); margin-bottom: 11px; font-size: .9rem; }
.row-meta { display: flex; align-items: center; gap: 18px; color: #716d85; font-size: .78rem; }
.row-actions { display: flex; flex-direction: column; gap: 8px; }
.detail-page { padding-top: 42px; padding-bottom: 100px; }
.back-link { display: inline-block; color: #b98eff; margin-bottom: 32px; font-size: .88rem; }
.detail-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 50px; align-items: center; }
.detail-image { width: 100%; max-height: 520px; object-fit: cover; border-radius: 18px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.detail-copy h1 { margin-top: 13px; }
.lead { color: #c0bbcc; white-space: normal; font-size: 1.05rem; }
.detail-meta { color: #77728c; font-size: .82rem; margin: 24px 0; }
.ticket-row { display: grid; grid-template-columns: 70px 1fr auto 20px; align-items: center; gap: 15px; padding: 21px; border: 1px solid var(--line); border-radius: 13px; background: rgba(18,18,34,.75); }
.ticket-row:hover { border-color: rgba(170,94,255,.55); transform: translateX(3px); }
.ticket-id { color: #ae7aff; font-weight: 800; }
.ticket-main h2 { font-size: 1rem; margin: 0 0 4px; }
.ticket-main p { color: var(--muted); font-size: .78rem; margin: 0; }
.ticket-arrow { color: #a98dcb; }
.status-badge, .role-badge, .license-pill { display: inline-flex; align-items: center; width: fit-content; padding: 5px 9px; border-radius: 999px; font-size: .65rem; font-weight: 800; letter-spacing: .08em; }
.status-badge.open, .status-badge.active { color: #8ef0c5; background: rgba(67,221,154,.1); border: 1px solid rgba(67,221,154,.22); }
.status-badge.closed, .status-badge.disabled { color: #ff9db2; background: rgba(255,100,132,.1); border: 1px solid rgba(255,100,132,.22); }
.role-badge.ceo { color: #e4a5ff; background: rgba(208,77,255,.15); }
.role-badge.staff { color: #8fdfff; background: rgba(32,207,255,.12); }
.role-badge.utente { color: #c8c1db; background: rgba(255,255,255,.09); }
.ticket-header { align-items: start; padding-bottom: 30px; border-bottom: 1px solid var(--line); }
.ticket-header h1 { margin: 12px 0 8px; }
.ticket-header p { color: var(--muted); margin: 0; }
.conversation { display: grid; gap: 14px; padding: 28px 0; }
.message { max-width: 85%; padding: 17px 20px; border: 1px solid var(--line); border-radius: 13px 13px 13px 3px; background: var(--surface); }
.message.own { margin-left: auto; border-radius: 13px 13px 3px 13px; border-color: rgba(155,78,255,.3); background: rgba(92,39,145,.16); }
.message-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 10px; font-size: .82rem; }
.message-head time { color: var(--muted); font-size: .7rem; margin-left: auto; }
.message p { color: #d1ccdb; margin: 0; font-size: .92rem; }
.reply-panel { max-width: 800px; margin: 0 auto; }
.closed-note { color: #ffadc0; text-align: center; padding: 10px; }
.two-column { display: grid; grid-template-columns: .8fr 1.2fr; gap: 20px; padding-bottom: 90px; }
.profile-panel { text-align: center; }
.profile-avatar { display: grid; place-items: center; width: 72px; height: 72px; margin: 0 auto 16px; color: white; border-radius: 20px; background: linear-gradient(135deg, #7335ed, #d343e5); font-size: 1.8rem; font-weight: 900; }
.profile-panel h2 { margin-bottom: 10px; }
.details { display: grid; grid-template-columns: 1fr 1.3fr; gap: 9px 18px; text-align: left; margin: 26px 0 0; padding-top: 20px; border-top: 1px solid var(--line); font-size: .82rem; }
.details dt { color: var(--muted); }
.details dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.details.compact { margin-top: 18px; padding-top: 17px; font-size: .76rem; }
.quick-links { display: grid; gap: 11px; margin-top: 22px; }
.quick-links a { display: flex; justify-content: space-between; padding: 18px; border: 1px solid var(--line); border-radius: 10px; color: #d3ccdf; }
.quick-links a:hover { border-color: #8952e8; background: rgba(133,71,220,.1); }
.quick-links strong { color: #c18dff; font-size: 1.3rem; margin-right: 6px; }
.panel-rule { border: 0; border-top: 1px solid var(--line); margin: 28px 0 23px; }
.panel h3 { margin-bottom: 16px; }
.dashboard-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; padding-bottom: 90px; }
.metric-card { padding: 25px; }
.metric-card span { display: block; color: var(--muted); }
.metric-card strong { display: block; font-size: 2.9rem; margin: 12px 0 15px; }
.metric-card a { color: #bd87ff; font-size: .83rem; }
.dashboard-callout { grid-column: 1 / -1; }
.dashboard-callout p { color: var(--muted); }
.admin-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-bottom: 60px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--line); }
.admin-stats div { display: grid; gap: 3px; padding: 22px; background: var(--surface); }
.admin-stats strong { font-size: 1.8rem; }
.admin-stats span { color: var(--muted); font-size: .78rem; }
.admin-section { padding-bottom: 60px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 13px; }
table { width: 100%; border-collapse: collapse; min-width: 730px; background: rgba(17,17,31,.7); }
th, td { padding: 15px 16px; text-align: left; border-bottom: 1px solid var(--line); font-size: .8rem; vertical-align: middle; }
th { color: #89849a; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; }
td strong { display: block; }
td small { display: block; color: var(--muted); margin-top: 3px; }
tr:last-child td { border-bottom: 0; }
.role-form { display: flex; align-items: center; gap: 6px; }
.role-form select { width: auto; padding: 7px; font-size: .75rem; }
.notice { margin-bottom: 20px; padding: 15px 17px; border: 1px solid rgba(32,207,255,.22); border-radius: 10px; color: #acddea; background: rgba(32,207,255,.06); font-size: .83rem; }
code { color: #cfa3ff; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8em; }
.license-pill { color: #8eecc4; border: 1px solid rgba(67,221,154,.28); background: rgba(67,221,154,.1); }
.license-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 17px; }
.license-card { padding: 21px; }
.license-card-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 18px; }
.license-card h2 { margin: 0 0 7px; font-size: 1.1rem; }
.license-card .button { width: 100%; margin-top: 17px; }
.site-footer { border-top: 1px solid var(--line); color: #77738a; font-size: .75rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 20px; padding: 25px 0; }

@media (max-width: 850px) {
    .nav-toggle { display: block; }
    .main-nav { display: none; position: absolute; top: 76px; left: 0; right: 0; padding: 14px 20px 20px; flex-direction: column; align-items: stretch; background: #0b0b17; border-bottom: 1px solid var(--line); }
    .main-nav.open { display: flex; }
    .main-nav > a:not(.button), .account-link { text-align: left; }
    .inline-form { display: block; }
    .inline-form .button { width: 100%; }
    .hero-grid, .detail-grid, .two-column { grid-template-columns: 1fr; }
    .hero { min-height: auto; padding: 70px 0; }
    .hero-art { min-height: 300px; order: -1; }
    .hero-art img { width: min(300px, 75%); }
    .card-grid, .license-grid { grid-template-columns: repeat(2, 1fr); }
    .resource-row { grid-template-columns: 90px 1fr; }
    .resource-row > img, .resource-thumb { width: 90px; height: 90px; }
    .row-actions { grid-column: 2; flex-direction: row; }
}
@media (max-width: 590px) {
    .container, .narrow { width: min(100% - 28px, 720px); }
    .brand img { width: 38px; height: 38px; }
    .hero-copy h1 { font-size: 3.5rem; }
    .section, .page-heading { padding-top: 52px; padding-bottom: 35px; }
    .section-top { padding-bottom: 52px; }
    .card-grid, .license-grid, .dashboard-grid, .stats-strip { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid label.full, .form-grid .full { grid-column: auto; }
    .auth-card, .panel { padding: 21px; }
    .split-heading, .section-heading, .ticket-header { align-items: start; flex-direction: column; }
    .resource-row { grid-template-columns: 1fr; }
    .resource-row > img, .resource-thumb { width: 100%; height: 155px; }
    .row-actions { grid-column: auto; }
    .ticket-row { grid-template-columns: 50px 1fr auto; }
    .ticket-arrow { display: none; }
    .message { max-width: 95%; }
    .admin-stats { grid-template-columns: repeat(2, 1fr); }
    .footer-inner { flex-direction: column; gap: 5px; }
}