﻿*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #0a0a0b;
    --bg2: #111113;
    --bg3: #1a1a1e;
    --border: rgba(255,255,255,0.07);
    --border2: rgba(255,255,255,0.12);
    --text: #f0ede8;
    --text2: #9a9691;
    --text3: #5a5753;
    --accent: #e8d5b0;
    --accent2: #c4a96d;
    --green: #4caf78;
    --red: #e05c5c;
    --blue: #5c8ee0;
    --pulse: rgba(76,175,120,0.4);
    --card: #212124;
}

html, body {
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: "Figtree", sans-serif;
    font-size: 15px;
    line-height: 1.6;
    overflow-x: hidden;
}

    body::before {
        content: '';
        position: fixed;
        inset: 0;
        background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
        pointer-events: none;
        z-index: 1000;
        opacity: 0.6;
    }

/* ── LAYOUT ──────────────────────────────────────────────────────────────── */
.layout {
    display: flex;
    min-height: 100vh;
}

/* ── SIDEBAR ─────────────────────────────────────────────────────────────── */
.sidebar {
    width: 220px;
    flex-shrink: 0;
    background: var(--bg2);
    border-right: 0.5px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 24px 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 10;
}

.logo {
    font-family: "Figtree", sans-serif;
    font-size: 22px;
    font-weight: 400;
    color: var(--ink);
    text-decoration: none;
    letter-spacing: 0.02em;
    font-weight: bold;
    padding: 0 20px 15px;
    display:block;
}

    .logo span {
        color: var(--accent2);
    }

.logo-icon {
    width: 35px;
    vertical-align: middle;
    padding-right: 5px;
}
.logo-mobile {
    font-family: "Figtree", sans-serif;
    font-size: 22px;
    font-weight: 400;
    color: var(--ink);
    text-decoration: none;
    letter-spacing: 0.02em;
    font-weight: bold;
    display:none;
}
.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 13.5px;
    color: var(--text3);
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

    .nav-item:hover {
        background: var(--bg3);
        color: var(--text2);
    }

    .nav-item.active {
        background: rgba(196,169,109,0.1);
        color: var(--accent2);
    }

    .nav-item svg {
        flex-shrink: 0;
        opacity: 0.7;
    }

    .nav-item.active svg {
        opacity: 1;
    }

.nav-section {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text3);
    padding: 12px 12px 6px;
    opacity: 0.6;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 0.5px solid var(--border);
}

.profile-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
}

    .profile-preview:hover {
        background: var(--bg3);
    }

.pp-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2a2520, #3d3428);
    border: 1px solid var(--border2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: var(--accent);
    flex-shrink: 0;
    overflow: hidden;
}

    .pp-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 50%;
    }

.pp-name {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text);
}

.pp-slug {
    font-size: 11px;
    color: var(--text3);
}

/* ── MAIN ────────────────────────────────────────────────────────────────── */
.main {
    margin-left: 220px;
    flex: 1;
    padding: 32px 40px;
    max-width: calc(100% - 220px);
}

/* Sopra 1440px di viewport, blocca il main a 1440px e centralo (sidebar resta fissa a sinistra). */
@media (min-width: 1440px) {
    .main {
        max-width: 1440px;
        margin-left: 220px;
        margin-right: auto;
    }
}

/* ── PAGE HEADER ─────────────────────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    opacity: 0;
    animation: fadeUp 0.5s ease forwards;
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    display:flex;
}

.page-sub {
    font-size: 13px;
    color: var(--text3);
    margin-top: 2px;
}

/* ── TABS ────────────────────────────────────────────────────────────────── */
.tabs {
    display: flex;
    gap: 2px;
    background: var(--bg2);
    border: 0.5px solid var(--border);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 28px;
    opacity: 0;
    animation: fadeUp 0.5s ease 0.1s forwards;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

    .tabs::-webkit-scrollbar {
        display: none;
    }

.tab {
    padding: 7px 16px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text3);
    cursor: pointer;
    transition: all 0.15s;
    border: none;
    background: none;
    font-family: "Figtree", sans-serif;
    white-space: nowrap;
    flex-shrink: 0;
}

    .tab:hover {
        color: var(--text2);
    }

    .tab.active {
        background: var(--bg3);
        color: var(--text);
        border: 0.5px solid var(--border2);
    }

/* ── TAB PANELS ──────────────────────────────────────────────────────────── */
.tab-panel {
    display: none;
}

    .tab-panel.active {
        display: block;
    }

/* ── SECTION CARD ────────────────────────────────────────────────────────── */
.section-card {
    background: var(--card);
    border: 0.5px solid var(--border);
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 16px;
    opacity: 0;
    animation: fadeUp 0.5s ease 0.15s forwards;
}

.section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text2);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

    .section-title::after {
        content: '';
        flex: 1;
        height: 0.5px;
        background: var(--border);
    }

/* ── AVATAR EDITOR ───────────────────────────────────────────────────────── */
.avatar-editor {
    display: flex;
    align-items: center;
    gap: 20px;
}

.avatar-large {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2a2520, #3d3428);
    border: 1px solid var(--border2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--accent);
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
    cursor: pointer;
}

    .avatar-large img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.avatar-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.avatar-large:hover .avatar-overlay {
    opacity: 1;
}

.avatar-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.avatar-hint {
    font-size: 12px;
    color: var(--text3);
}

/* ── FIELDS ──────────────────────────────────────────────────────────────── */
.field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

    .field-grid.single {
        grid-template-columns: 1fr;
    }

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field-label {
    font-size: 11.5px;
    font-weight: 500;
    color: var(--text3);
}

.field-input {
    background: var(--bg3);
    border: 0.5px solid var(--border2);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text);
    font-family: "Figtree", sans-serif;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
    height: 54px;
}

    .field-input:focus {
        border-color: rgba(196,169,109,0.4);
    }

    .field-input::placeholder {
        color: var(--text3);
    }

textarea.field-input {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

/* ── CHUNKS LIST ─────────────────────────────────────────────────────────── */
.chunks-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chunk-item {
    background: var(--bg3);
    border: 0.5px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transition: border-color 0.2s;
}

    .chunk-item:hover {
        border-color: var(--border2);
    }

.chunk-role {
    padding: 3px 8px;
    border-radius: 100px;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    flex-shrink: 0;
    margin-top: 2px;
}

    .chunk-role.profile {
        background: rgba(196,169,109,0.12);
        color: var(--accent2);
    }

    .chunk-role.skills {
        background: rgba(92,142,224,0.12);
        color: var(--blue);
    }

    .chunk-role.experience {
        background: rgba(76,175,120,0.12);
        color: var(--green);
    }

    .chunk-role.projects {
        background: rgba(224,92,92,0.12);
        color: var(--red);
    }

    .chunk-role.education {
        background: rgba(155,92,224,0.12);
        color: #9b5ce0;
    }

.chunk-body {
    flex: 1;
    min-width: 0;
}

.chunk-text {
    font-size: 13px;
    color: var(--text2);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.chunk-media {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.chunk-media-tag {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: var(--bg2);
    border: 0.5px solid var(--border2);
    border-radius: 6px;
    font-size: 11px;
    color: var(--text3);
}

.chunk-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.icon-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 0.5px solid var(--border);
    background: var(--bg2);
    color: var(--text3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
}

    .icon-btn:hover {
        border-color: var(--border2);
        color: var(--text2);
    }

    .icon-btn.danger:hover {
        border-color: var(--red);
        color: var(--red);
    }

/* ── MODALS ──────────────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

    .modal-overlay.open {
        display: flex;
    }

.modal {
    background: var(--bg2);
    border: 0.5px solid var(--border2);
    border-radius: 16px;
    padding: 24px;
    width: 100%;
    max-width: 480px;
    animation: fadeUp 0.25s ease forwards;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.modal-sub {
    font-size: 12.5px;
    color: var(--text3);
    margin-bottom: 20px;
}

.media-tabs {
    display: flex;
    gap: 2px;
    background: var(--bg3);
    border-radius: 8px;
    padding: 3px;
    margin-bottom: 16px;
}

.media-tab {
    flex: 1;
    padding: 6px;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text3);
    cursor: pointer;
    transition: all 0.15s;
    border: none;
    background: none;
    font-family: "Figtree", sans-serif;
    text-align: center;
}

    .media-tab.active {
        background: var(--bg2);
        color: var(--text);
        border: 0.5px solid var(--border2);
    }

.media-panel {
    display: none;
}

    .media-panel.active {
        display: block;
    }

/* ── UPLOAD ZONES ────────────────────────────────────────────────────────── */
.upload-zone-sm {
    border: 1px dashed var(--border2);
    border-radius: 10px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg3);
    position: relative;
}

    .upload-zone-sm:hover {
        border-color: var(--accent2);
    }

    .upload-zone-sm input {
        position: absolute;
        inset: 0;
        opacity: 0;
        cursor: pointer;
        width: 100%;
        height: 100%;
    }

    .upload-zone-sm .uz-text {
        font-size: 13px;
        color: var(--text3);
    }

        .upload-zone-sm .uz-text strong {
            color: var(--accent2);
        }

.upload-zone-cv {
    border: 1px dashed var(--border2);
    border-radius: 12px;
    padding: 32px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg3);
    position: relative;
    margin-bottom: 16px;
}

    .upload-zone-cv:hover {
        border-color: var(--accent2);
        background: rgba(196,169,109,0.03);
    }

    .upload-zone-cv input {
        position: absolute;
        inset: 0;
        opacity: 0;
        cursor: pointer;
        width: 100%;
        height: 100%;
    }

    .upload-zone-cv.has-file {
        border-color: rgba(76,175,120,0.4);
    }

        .upload-zone-cv.has-file .uz-icon {
            color: var(--green);
        }

        .upload-zone-cv.has-file .uz-title {
            color: var(--green);
        }

.uz-icon {
    color: var(--text3);
    margin-bottom: 10px;
}

.uz-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 4px;
}

.uz-hint {
    font-size: 12px;
    color: var(--text3);
}

/* ── BUTTONS ─────────────────────────────────────────────────────────────── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--accent2);
    color: #1a1410;
    border: none;
    border-radius: 8px;
    font-family: "Figtree", sans-serif;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s;
}

    .btn-primary:hover {
        background: var(--accent);
    }

    .btn-primary:disabled {
        opacity: 0.4;
        cursor: not-allowed;
    }

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg3);
    color: var(--text2);
    border: 0.5px solid var(--border2);
    border-radius: 8px;
    font-family: "Figtree", sans-serif;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s;
}

    .btn-secondary:hover {
        border-color: var(--text3);
        color: var(--text);
    }

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: none;
    color: var(--text3);
    border: none;
    border-radius: 6px;
    font-family: "Figtree", sans-serif;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}

    .btn-ghost:hover {
        color: var(--text2);
        background: var(--bg3);
    }

.btn-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* ── TOAST ───────────────────────────────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg2);
    border: 0.5px solid var(--border2);
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 13.5px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 200;
    transform: translateY(80px);
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    max-width: calc(100vw - 48px);
}

    .toast.show {
        transform: none;
        opacity: 1;
    }

    .toast.success .toast-dot {
        background: var(--green);
    }

    .toast.error .toast-dot {
        background: var(--red);
    }

.toast-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ── PROCESSING ──────────────────────────────────────────────────────────── */
.processing-bar {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(196,169,109,0.06);
    border: 0.5px solid rgba(196,169,109,0.2);
    border-radius: 8px;
    font-size: 13px;
    color: var(--accent2);
    margin-bottom: 16px;
}

    .processing-bar.show {
        display: flex;
    }

.spinner {
    width: 14px;
    height: 14px;
    border: 1.5px solid rgba(196,169,109,0.3);
    border-top-color: var(--accent2);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── LINK PREVIEW ────────────────────────────────────────────────────────── */
.link-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg3);
    border: 0.5px solid var(--border);
    border-radius: 8px;
    margin-top: 8px;
    font-size: 12.5px;
    color: var(--text3);
}

    .link-preview a {
        color: var(--accent2);
        text-decoration: none;
    }

        .link-preview a:hover {
            text-decoration: underline;
        }

/* ── STATS ───────────────────────────────────────────────────────────────── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    background: var(--bg3);
    border: 0.5px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
}

.stat-label {
    font-size: 11px;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

.stat-sub {
    font-size: 11px;
    color: var(--text3);
    margin-top: 2px;
}

/* ── CHAT HISTORY ────────────────────────────────────────────────────────── */
.chat-session {
    background: var(--bg3);
    border: 0.5px solid var(--border);
    border-radius: 10px;
    margin-bottom: 8px;
    overflow: hidden;
    transition: border-color 0.15s;
}

    .chat-session:hover {
        border-color: var(--border2);
    }

.chat-session-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
}

.session-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--border2);
    flex-shrink: 0;
}

    .session-dot.recent {
        background: var(--green);
    }

.session-info {
    flex: 1;
    min-width: 0;
}

.session-id {
    font-size: 11px;
    color: var(--text3);
    font-family: monospace;
}

.session-preview {
    font-size: 13px;
    color: var(--text2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.session-meta {
    font-size: 11px;
    color: var(--text3);
    text-align: right;
    flex-shrink: 0;
}

.chat-session-messages {
    display: none;
    padding: 0 16px 12px;
    border-top: 0.5px solid var(--border);
}

    .chat-session-messages.open {
        display: block;
    }

.history-msg {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    padding: 8px 0;
    border-bottom: 0.5px solid var(--border);
}

    .history-msg:last-child {
        border-bottom: none;
    }

.history-role {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 4px;
    flex-shrink: 0;
    margin-top: 2px;
}

    .history-role.user {
        background: rgba(196,169,109,0.1);
        color: var(--accent2);
    }

    .history-role.assistant {
        background: rgba(76,175,120,0.1);
        color: var(--green);
    }

.history-content {
    font-size: 13px;
    color: var(--text2);
    line-height: 1.5;
}

/* ── BILLING ─────────────────────────────────────────────────────────────── */
.plan-card {
    background: var(--bg3);
    border: 0.5px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    position: relative;
    transition: border-color 0.2s;
}

    .plan-card:hover {
        border-color: var(--border2);
    }

    .plan-card.featured {
        border-color: rgba(196,169,109,0.3);
        background: rgba(196,169,109,0.04);
    }

    .plan-card.current {
        border-color: var(--green);
    }

.plan-badge {
    position: absolute;
    top: -9px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent2);
    color: #1a1410;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 2px 10px;
    border-radius: 100px;
    white-space: nowrap;
}

.plan-name {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text3);
    margin-bottom: 8px;
}

.plan-price {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}

    .plan-price span {
        font-size: 13px;
        font-weight: 400;
        color: var(--text3);
    }

.plan-features {
    list-style: none;
    margin-bottom: 20px;
}

    .plan-features li {
        font-size: 12.5px;
        color: var(--text2);
        padding: 5px 0;
        border-bottom: 0.5px solid var(--border);
        display: flex;
        align-items: center;
        gap: 6px;
    }

        .plan-features li:last-child {
            border-bottom: none;
        }

        .plan-features li::before {
            content: '—';
            color: var(--text3);
            font-size: 10px;
        }

.plan-btn {
    width: 100%;
    padding: 9px;
    border-radius: 7px;
    border: 0.5px solid var(--border2);
    background: none;
    color: var(--text2);
    font-family: "Figtree", sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

    .plan-btn:hover:not(:disabled) {
        border-color: var(--text3);
        color: var(--text);
    }

    .plan-btn:disabled {
        opacity: 0.5;
        cursor: default;
    }

    .plan-btn.primary {
        background: var(--accent2);
        color: #1a1410;
        border-color: var(--accent2);
        font-weight: 600;
    }

        .plan-btn.primary:hover {
            background: var(--accent);
            border-color: var(--accent);
        }

.invoice-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 0.5px solid var(--border);
    font-size: 13px;
}

    .invoice-row:last-child {
        border-bottom: none;
    }

.invoice-date {
    color: var(--text3);
    font-size: 12px;
}

.invoice-amount {
    font-weight: 600;
    color: var(--text);
}

.invoice-download {
    padding: 4px 10px;
    border: 0.5px solid var(--border2);
    border-radius: 6px;
    color: var(--text3);
    font-size: 11.5px;
    cursor: pointer;
    background: none;
    font-family: "Figtree", sans-serif;
    transition: all 0.15s;
}

    .invoice-download:hover {
        border-color: var(--accent2);
        color: var(--accent2);
    }

/* ── ROLE BUTTONS ────────────────────────────────────────────────────────── */
.role-btn {
    padding: 5px 12px;
    border-radius: 100px;
    border: 0.5px solid var(--border2);
    background: var(--bg3);
    color: var(--text3);
    font-family: "Figtree", sans-serif;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

    .role-btn:hover {
        color: var(--text2);
    }

    .role-btn.selected.profile {
        background: rgba(196,169,109,0.12);
        color: var(--accent2);
        border-color: rgba(196,169,109,0.3);
    }

    .role-btn.selected.skills {
        background: rgba(92,142,224,0.12);
        color: var(--blue);
        border-color: rgba(92,142,224,0.3);
    }

    .role-btn.selected.experience {
        background: rgba(76,175,120,0.12);
        color: var(--green);
        border-color: rgba(76,175,120,0.3);
    }

    .role-btn.selected.projects {
        background: rgba(224,92,92,0.12);
        color: var(--red);
        border-color: rgba(224,92,92,0.3);
    }

    .role-btn.selected.education {
        background: rgba(155,92,224,0.12);
        color: #9b5ce0;
        border-color: rgba(155,92,224,0.3);
    }


.link-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(196,169,109,0.06);
    border: 0.5px solid rgba(196,169,109,0.25);
    border-radius: 10px;
    padding: 12px 16px;
}

.link-prefix {
    font-size: 14px;
    color: var(--text3);
    flex-shrink: 0;
}

.link-slug {
    font-size: 15px;
    font-weight: 600;
    color: var(--accent);
    flex: 1;
    margin-top: -3px;
}

.link-actions {
    display: flex;
    gap: 6px;
}

/* BASE comune */
.btn-copy,
.btn-open {
    height: 28px; /* 👈 stessa altezza */
    padding: 0 12px; /* 👈 padding uniforme */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-family: 'Figtree', sans-serif;
    font-size: 12px;
    cursor: pointer;
    flex-shrink: 0;
    box-sizing: border-box; /* 👈 IMPORTANTISSIMO */
}

/* COPY */
.btn-copy {
    background: none;
    border: 1px solid rgba(196,169,109,0.3);
    color: var(--accent2);
}

/* OPEN */
.btn-open {
    background: var(--accent2);
    border: 1px solid transparent; /* 👈 bilancia il bordo */
    color: #1a1410;
    text-decoration: none;
    font-weight: 600;
}
.link-text {
    display: flex;
    align-items: center;
    gap: 2px; /* 👈 distanza ridotta */
    flex: 1;
}
#custom-mobile-layer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.layer-content {
    width: 100%;
    max-width: 480px;
    background: #fff;
    padding: 20px;
    border-radius: 16px 16px 0 0;
    text-align: center;
    position: relative;
    animation: slideUp 0.3s ease;
}

    .layer-content h2 {
        font-size: 18px;
        margin-bottom: 8px;
        color: #000000;
    }

    .layer-content p {
        font-size: 14px;
        margin-bottom: 16px;
        color: #555;
    }

.layer-btn {
    display: block;
    background: #000;
    color: #fff;
    padding: 14px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    cursor:pointer;
}

.layer-close {
    position: absolute;
    top: 10px;
    right: 14px;
    font-size: 20px;
    cursor: pointer;
    color: #000000;
}


/* ── ANIMATIONS ──────────────────────────────────────────────────────────── */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── RESPONSIVE ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    .logo-mobile {
        display: block;
    }
    .main {
        margin-left: 0;
        padding: 20px 16px;
        max-width: 100%;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

        .page-header .btn-primary {
            width: 100%;
            justify-content: center;
        }

    .field-grid {
        grid-template-columns: 1fr;
    }

    .stats-row {
        grid-template-columns: 1fr 1fr;
    }

    .avatar-editor {
        flex-direction: column;
        align-items: flex-start;
    }

    .plan-cards-grid {
        grid-template-columns: 1fr !important;
    }

    .session-meta {
        display: none;
    }

    .chunk-actions {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .stats-row {
        grid-template-columns: 1fr;
    }

    .chunk-item {
        flex-wrap: wrap;
    }

    .modal {
        padding: 16px;
    }

    .toast {
        bottom: 12px;
        right: 12px;
        left: 12px;
        max-width: none;
    }
}
