/* ==========================================
   MYDESK - STYLE SYSTEM 2.2
   Design: Anthracite & Champagne Gold
   Responsive: iPhone / iPad Portrait / iPad Landscape
   Developed by ivan_163
========================================== */

:root {
    --background: #111111;
    --surface: #191919;
    --surface-light: #222222;
    --surface-hover: #292929;

    --gold: #e7bd63;
    --gold-light: #ffdf91;
    --gold-dark: #a77a2e;

    --text: #f4f1eb;
    --text-secondary: #aaa8a3;
    --text-muted: #777570;

    --border: rgba(255,255,255,0.09);
    --gold-border: rgba(231,189,99,0.35);

    --radius: 21px;
    --shadow: 0 10px 28px rgba(0,0,0,0.26);

    --sidebar-width: 235px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    min-height: 100%;
    background: var(--background);
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text);
    background:
        radial-gradient(ellipse at 75% 0%, rgba(231,189,99,0.035), transparent 45%),
        var(--background);
    overflow-x: hidden;
}

button {
    font-family: inherit;
    color: inherit;
    cursor: pointer;
    border: none;
    background: none;
    touch-action: manipulation;
}

button:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 4px;
}

.app-container {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
}

/* ==========================================
   SIDEBAR
========================================== */

.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    position: sticky;
    top: 0;
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    padding: 25px 17px 20px;
    background: linear-gradient(180deg, #1c1c1c, #141414);
    border-right: 1px solid var(--border);
    overflow: hidden;
}

.brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 5px 0 22px;
}

.brand-icon {
    width: 108px;
    height: 108px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold-light);
    background: linear-gradient(145deg, #292929, #101010);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 27px;
    box-shadow:
        inset 0 2px 5px rgba(255,255,255,0.12),
        0 10px 22px rgba(0,0,0,0.35);
}

.brand-icon svg {
    width: 68px;
    height: 68px;
    filter: drop-shadow(0 0 8px rgba(231,189,99,0.2));
}

.brand-name {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -1.5px;
}

.brand-name span {
    color: var(--gold);
}

.sidebar-divider {
    height: 1px;
    background: var(--border);
    margin: 17px 0 22px;
}

/* Menu principale scorrevole */

.side-navigation {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 9px;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-width: none;
}

.side-navigation::-webkit-scrollbar {
    display: none;
}

.nav-item {
    width: 100%;
    min-height: 59px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 15px;
    text-align: left;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: 16px;
    transition: background 0.2s, color 0.2s;
}

.nav-item:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.nav-item.active {
    color: white;
    background: linear-gradient(110deg, #343434, #292929);
    border-left: 4px solid var(--gold);
    box-shadow: inset 0 0 15px rgba(255,255,255,0.025);
}

/* ==========================================
   CESTINO - AREA INFERIORE SIDEBAR
========================================== */

.sidebar-trash {
    flex: 0 0 auto;
    margin-top: 12px;
    padding-top: 13px;
    border-top: 1px solid var(--border);
}

.sidebar-trash .nav-item {
    color: var(--text-secondary);
}

.sidebar-trash .nav-icon {
    color: var(--text-muted);
}

.sidebar-trash .nav-item:hover {
    color: var(--text);
    background: var(--surface-hover);
}

.sidebar-trash .nav-item.active {
    color: white;
    background: linear-gradient(110deg, #343434, #292929);
    border-left: 4px solid var(--gold);
}

/* Icone menu */

.nav-icon {
    width: 28px;
    text-align: center;
    font-size: 26px;
    color: var(--gold);
}

/* Firma sviluppatore */

.sidebar-footer {
    margin-top: 0;
    padding-top: 25px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    color: var(--text-muted);
    font-size: 12px;
}

.sidebar-footer strong {
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
}

/* ==========================================
   MAIN CONTENT
========================================== */

.main-content {
    flex: 1;
    min-width: 0;
    max-width: 1600px;
    margin: 0 auto;
    padding: 27px 34px 25px;
    display: flex;
    flex-direction: column;
    gap: 17px;
}

.main-header {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    padding: 0 8px 17px;
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(
        90deg,
        transparent,
        var(--gold-dark),
        var(--gold-light),
        transparent
    ) 1;
}

.welcome-label {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 5px;
}

.main-header h1 {
    font-size: clamp(27px, 3vw, 37px);
    font-weight: 600;
    letter-spacing: -1.2px;
}

.main-header h1 span {
    color: var(--gold);
}

.header-settings {
    color: var(--gold);
    font-size: 32px;
    padding: 8px;
    transition: transform 0.2s;
}

.header-settings:hover {
    transform: rotate(25deg);
}

/* ==========================================
   PANELS
========================================== */

.content-panel {
    padding: 19px 21px;
    background: linear-gradient(145deg, #202020, #181818);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 17px;
}

.section-heading h2 {
    display: flex;
    align-items: center;
    gap: 11px;
    font-size: 20px;
    font-weight: 600;
}

.section-icon {
    color: var(--gold);
    font-size: 24px;
}

.text-action {
    color: var(--gold);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.text-action span {
    margin-left: 5px;
    font-size: 22px;
    vertical-align: -2px;
}

.text-action:hover {
    color: var(--gold-light);
}

/* ==========================================
   FOLDERS
========================================== */

.folder-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 11px;
}

.folder-card {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 9px 5px;
    border-radius: 15px;
    transition: transform 0.2s, background 0.2s;
}

.folder-card:hover {
    transform: translateY(-3px);
    background: rgba(255,255,255,0.035);
}

.folder-visual {
    width: 76px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: white;
    border-radius: 13px;
    box-shadow:
        inset 0 3px 5px rgba(255,255,255,0.2),
        inset 0 -5px 8px rgba(0,0,0,0.15),
        0 6px 11px rgba(0,0,0,0.25);
}

.folder-card strong {
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

.folder-card small {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
}

.folder-card.blue .folder-visual {
    background: linear-gradient(145deg, #50b9ff, #1761bd);
}

.folder-card.green .folder-visual {
    background: linear-gradient(145deg, #73dc7d, #238b42);
}

.folder-card.amber .folder-visual {
    background: linear-gradient(145deg, #ffd25b, #d77813);
}

.folder-card.purple .folder-visual {
    background: linear-gradient(145deg, #cf83ff, #7629ba);
}

.folder-card.turquoise .folder-visual {
    background: linear-gradient(145deg, #54e0e3, #137b8b);
}

.create-folder-action {
    display: block;
    margin: 11px auto 0;
    padding: 8px 16px;
    color: var(--gold);
    font-size: 13px;
    border: 1px solid var(--gold-border);
    border-radius: 20px;
}

.create-folder-action:hover {
    background: rgba(231,189,99,0.08);
}

/* ==========================================
   RECENT NOTES
========================================== */

.recent-list {
    display: flex;
    flex-direction: column;
}

.empty-state {
    padding: 19px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    text-align: center;
}

.empty-state > span {
    font-size: 32px;
}

.empty-state p {
    font-size: 15px;
    font-weight: 600;
}

.empty-state small {
    color: var(--text-muted);
    font-size: 12px;
}

/* ==========================================
   FAVORITES
========================================== */

.favorites-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.favorite-placeholder {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    padding: 8px;
}

.favorite-placeholder span {
    color: var(--gold);
    font-size: 24px;
}

.favorite-placeholder p {
    font-size: 13px;
}

/* ==========================================
   NEW NOTE BUTTON
========================================== */

.new-note-button {
    width: min(100%, 540px);
    min-height: 61px;
    margin: 0 auto;
    padding: 11px 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 13px;
    color: #17130b;
    font-size: 19px;
    font-weight: 700;
    background: linear-gradient(
        110deg,
        #e2b95d,
        #ffe29b,
        #d5a33d
    );
    border: 1px solid #f7d78b;
    border-radius: 50px;
    box-shadow:
        0 7px 19px rgba(0,0,0,0.3),
        inset 0 2px 2px rgba(255,255,255,0.45);
    transition: transform 0.2s, box-shadow 0.2s;
}

.new-note-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(231,189,99,0.17);
}

.new-note-icon {
    font-size: 27px;
    line-height: 1;
}

/* ==========================================
   MOBILE NAVIGATION
========================================== */

.bottom-navigation {
    display: none;
}

.mobile-footer {
    display: none;
}

/* ==========================================
   TABLET GENERIC
========================================== */

@media (min-width: 701px) and (max-width: 1050px) {

    :root {
        --sidebar-width: 185px;
    }

    .sidebar {
        padding: 20px 12px 17px;
    }

    .brand {
        gap: 8px;
        padding-bottom: 17px;
    }

    .brand-icon {
        width: 85px;
        height: 85px;
        border-radius: 23px;
    }

    .brand-icon svg {
        width: 57px;
        height: 57px;
    }

    .brand-name {
        font-size: 28px;
    }

    .sidebar-divider {
        margin: 13px 0 17px;
    }

    .side-navigation {
        gap: 7px;
    }

    .nav-item {
        min-height: 53px;
        gap: 12px;
        padding: 0 11px;
        font-size: 14px;
    }

    .nav-icon {
        width: 25px;
        font-size: 23px;
    }

    .sidebar-footer {
        padding-top: 17px;
    }

    .main-content {
        padding: 22px 20px 20px;
        gap: 13px;
    }

    .main-header {
        min-height: 68px;
        padding-bottom: 13px;
    }

    .main-header h1 {
        font-size: 29px;
    }

    .content-panel {
        padding: 15px 15px;
        border-radius: 18px;
    }

    .section-heading {
        margin-bottom: 12px;
    }

    .section-heading h2 {
        font-size: 18px;
    }

    .folder-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 5px;
    }

    .folder-card {
        padding: 7px 3px;
        gap: 5px;
    }

    .folder-visual {
        width: 62px;
        height: 55px;
        font-size: 28px;
    }

    .folder-card strong {
        font-size: 12px;
    }

    .folder-card small {
        font-size: 11px;
    }

    .create-folder-action {
        margin-top: 8px;
    }

    .empty-state {
        padding: 13px 8px;
    }

    .new-note-button {
        min-height: 55px;
        font-size: 18px;
    }
}

/* ==========================================
   IPAD PORTRAIT
========================================== */

@media (min-width: 701px) and (max-width: 1050px) and (orientation: portrait) {

    .main-content {
        min-height: 100vh;
        min-height: 100dvh;
        padding: 18px 16px 24px;
        gap: 11px;
    }

    .main-header {
        min-height: 63px;
    }

    .main-header h1 {
        font-size: 27px;
    }

    .content-panel {
        padding: 13px 13px;
    }

    .section-heading {
        margin-bottom: 9px;
    }

    .folder-grid {
        gap: 3px;
        max-height: 250px;
        overflow-y: auto;
        overflow-x: hidden;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: rgba(231,189,99,0.35) transparent;
    }

    .folder-grid::-webkit-scrollbar {
        width: 5px;
    }

    .folder-grid::-webkit-scrollbar-thumb {
        background: rgba(231,189,99,0.35);
        border-radius: 10px;
    }

    .folder-visual {
        width: 58px;
        height: 51px;
    }

    .folder-card {
        padding: 5px 2px;
    }

    .recent-list .empty-state {
        padding: 10px 8px;
    }

    .favorites-grid {
        gap: 6px;
    }

    .favorite-placeholder {
        padding: 5px;
    }

    /* Il pulsante occupa la fascia inferiore */
    .new-note-button {
        margin-top: auto;
        flex-shrink: 0;
        min-height: 55px;
        font-size: 17px;
    }
}

/* ==========================================
   IPAD LANDSCAPE
========================================== */

@media (min-width: 701px) and (max-width: 1366px) and (orientation: landscape) {

    :root {
        --sidebar-width: 190px;
    }

    .sidebar {
        padding: 17px 13px 15px;
    }

    .brand {
        padding-bottom: 13px;
    }

    .brand-icon {
        width: 76px;
        height: 76px;
        border-radius: 21px;
    }

    .brand-icon svg {
        width: 51px;
        height: 51px;
    }

    .brand-name {
        font-size: 27px;
    }

    .sidebar-divider {
        margin: 11px 0 14px;
    }

    .side-navigation {
        gap: 6px;
    }

    .nav-item {
        min-height: 49px;
        font-size: 14px;
    }

    .nav-icon {
        font-size: 22px;
    }

    .main-content {
        padding: 16px 27px 16px;
        gap: 11px;
    }

    .main-header {
        min-height: 61px;
        padding-bottom: 11px;
    }

    .main-header h1 {
        font-size: 29px;
    }

    .content-panel {
        padding: 13px 18px;
    }

    .section-heading {
        margin-bottom: 10px;
    }

    .section-heading h2 {
        font-size: 18px;
    }

    .folder-grid {
        gap: 7px;
    }

    .folder-card {
        padding: 5px 3px;
    }

    .folder-visual {
        width: 66px;
        height: 53px;
    }

    .empty-state {
        padding: 10px;
    }

    .new-note-button {
        min-height: 53px;
        font-size: 18px;
    }
}

/* ==========================================
   RESPONSIVE - IPHONE
========================================== */

@media (max-width: 700px) {

    body {
        padding-bottom: calc(76px + env(safe-area-inset-bottom));
    }

    .app-container {
        display: block;
        min-height: 100vh;
        min-height: 100dvh;
    }

    .sidebar {
        display: none;
    }

    .main-content {
        width: 100%;
        padding: 17px 14px 20px;
        gap: 13px;
    }

    .main-header {
        min-height: 65px;
        padding: 0 4px 13px;
    }

    .welcome-label {
        font-size: 9px;
        letter-spacing: 1.4px;
        margin-bottom: 4px;
    }

    .main-header h1 {
        font-size: 26px;
    }

    .header-settings {
        font-size: 28px;
    }

    .content-panel {
        padding: 15px 12px;
        border-radius: 18px;
    }

    .section-heading {
        margin-bottom: 12px;
        gap: 8px;
    }

    .section-heading h2 {
        font-size: 17px;
        gap: 8px;
    }

    .section-icon {
        font-size: 21px;
    }

    .text-action {
        font-size: 12px;
    }

    .folder-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 4px;
    }

    .folder-card {
        padding: 7px 2px;
        gap: 5px;
    }

    .folder-visual {
        width: 61px;
        height: 54px;
        font-size: 27px;
    }

    .folder-card strong {
        font-size: 13px;
    }

    .folder-card small {
        font-size: 11px;
    }

    .create-folder-action {
        margin-top: 9px;
        padding: 8px 14px;
    }

    .empty-state {
        padding: 15px 8px;
    }

    .empty-state > span {
        font-size: 30px;
    }

    .empty-state p {
        font-size: 14px;
    }

    .favorites-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .favorite-placeholder {
        padding: 7px;
    }

    .new-note-button {
        min-height: 57px;
        width: 96%;
        padding: 10px 16px;
        font-size: 17px;
        gap: 10px;
    }

    .new-note-icon {
        font-size: 25px;
    }

    .mobile-footer {
        display: block;
        text-align: center;
        padding: 8px 0;
        color: var(--text-muted);
        font-size: 11px;
    }

    .bottom-navigation {
        position: fixed;
        z-index: 100;
        left: 0;
        right: 0;
        bottom: 0;
        min-height: calc(72px + env(safe-area-inset-bottom));
        padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
        display: flex;
        justify-content: space-around;
        align-items: center;
        background: rgba(28,28,28,0.97);
        border: 1px solid rgba(255,255,255,0.12);
        border-bottom: none;
        border-radius: 24px 24px 0 0;
        box-shadow: 0 -8px 25px rgba(0,0,0,0.3);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
    }

    .bottom-nav-item {
        position: relative;
        flex: 1;
        height: 57px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        color: var(--text-secondary);
    }

    .bottom-nav-item > span {
        font-size: 26px;
        line-height: 1.1;
    }

    .bottom-nav-item small {
        font-size: 10px;
    }

    .bottom-nav-item.active {
        color: var(--gold-light);
    }

    .bottom-nav-item.active::after {
        content: "";
        position: absolute;
        left: 12%;
        right: 12%;
        bottom: -7px;
        height: 3px;
        background: linear-gradient(90deg, var(--gold-dark), var(--gold-light));
        border-radius: 5px;
    }
}

/* ==========================================
   SMALL IPHONES
========================================== */

@media (max-width: 380px) {

    .main-content {
        padding-left: 10px;
        padding-right: 10px;
    }

    .folder-visual {
        width: 53px;
        height: 48px;
        font-size: 24px;
    }

    .folder-card strong {
        font-size: 12px;
    }

    .section-heading h2 {
        font-size: 16px;
    }

    .content-panel {
        padding-left: 10px;
        padding-right: 10px;
    }
}

/* ==========================================
   REDUCED MOTION
========================================== */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

/* ==========================================
   MYDESK - PULSANTI FINESTRE MODALI
========================================== */

#mydesk-folder-dialog .mf-form-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-top: 22px;
}

#mydesk-folder-dialog .mf-button {
    min-width: 112px;
    min-height: 46px;
    padding: 11px 20px;
    border: 1px solid rgba(231,189,99,0.35);
    border-radius: 13px;
    background: #303030;
    color: #f4f1eb;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
}

#mydesk-folder-dialog .mf-button.primary {
    border: 1px solid #f7d78b;
    background: linear-gradient(
        110deg,
        #e2b95d,
        #ffe29b,
        #d5a33d
    );
    color: #211a0d;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

#mydesk-folder-dialog .mf-button:not(.primary):active {
    background: #414141;
}

#mydesk-folder-dialog .mf-button.primary:active {
    transform: scale(0.97);
}

@media (max-width: 380px) {
    #mydesk-folder-dialog .mf-form-row {
        gap: 9px;
    }

    #mydesk-folder-dialog .mf-button {
        min-width: 100px;
        padding: 10px 15px;
    }
}

/* ==========================================
   MYDESK - NUOVO MENU CREA
   Pannello elegante con comandi uniformi
========================================== */

.create-menu-panel {
    width: 100%;
    max-width: 760px;
    margin-top: 8px;
    padding: 12px;
    background: linear-gradient(145deg, #202020, #181818);
    border: 1px solid rgba(231,189,99,0.16);
    border-radius: 22px;
    box-shadow:
        0 12px 30px rgba(0,0,0,0.24),
        inset 0 1px 0 rgba(255,255,255,0.035);
}

.create-menu-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.create-menu-item,
.create-menu-list > #home-scan-document {
    position: relative;
    width: 100%;
    min-height: 76px;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 11px 15px;
    color: var(--text);
    text-align: left;
    background: linear-gradient(
        110deg,
        rgba(255,255,255,0.035),
        rgba(255,255,255,0.012)
    );
    border: 1px solid rgba(255,255,255,0.055);
    border-radius: 16px;
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

.create-menu-item:hover,
.create-menu-list > #home-scan-document:hover {
    background: linear-gradient(
        110deg,
        rgba(231,189,99,0.09),
        rgba(255,255,255,0.025)
    );
    border-color: rgba(231,189,99,0.25);
}

.create-menu-item:active,
.create-menu-list > #home-scan-document:active {
    transform: scale(0.99);
}

.create-menu-icon {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold-light);
    font-size: 24px;
    background: linear-gradient(145deg, #34302a, #24211c);
    border: 1px solid rgba(231,189,99,0.22);
    border-radius: 14px;
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.06);
}

.create-menu-text {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.create-menu-text strong {
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.1px;
}

.create-menu-text small {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
}

.create-menu-arrow {
    flex: 0 0 auto;
    color: var(--gold-dark);
    font-size: 27px;
    font-weight: 300;
    padding-left: 5px;
    transition: color 0.2s, transform 0.2s;
}

.create-menu-item:hover .create-menu-arrow {
    color: var(--gold-light);
    transform: translateX(3px);
}

/* Scanner: stile coordinato con gli altri comandi.
   L'icona viene aggiunta tramite CSS finché
   non uniformiamo il markup in scanner.js. */

.create-menu-list > #home-scan-document {
    justify-content: flex-start;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
}

.create-menu-list > #home-scan-document::before {
    content: "▧";
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold-light);
    font-size: 24px;
    background: linear-gradient(145deg, #34302a, #24211c);
    border: 1px solid rgba(231,189,99,0.22);
    border-radius: 14px;
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.06);
}

.create-menu-list > #home-scan-document::after {
    content: "›";
    margin-left: auto;
    color: var(--gold-dark);
    font-size: 27px;
    font-weight: 300;
}

/* Titoli delle pagine interne */

.settings-header,
.search-page-header {
    padding: 8px 8px 18px;
    border-bottom: 1px solid var(--border);
}

.settings-header h1,
.search-page-header h1 {
    margin-bottom: 7px;
    color: var(--text);
    font-size: clamp(27px, 3vw, 35px);
    font-weight: 600;
    letter-spacing: -1px;
}

.settings-header > p:last-child,
.search-page-header > p:last-child {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
}

/* ==========================================
   MENU CREA - TABLET
========================================== */

@media (min-width: 701px) and (max-width: 1050px) {

    .create-menu-panel {
        max-width: 100%;
        padding: 10px;
    }

    .create-menu-item,
    .create-menu-list > #home-scan-document {
        min-height: 70px;
        padding: 9px 12px;
        gap: 12px;
    }

    .create-menu-icon,
    .create-menu-list > #home-scan-document::before {
        width: 43px;
        height: 43px;
        flex-basis: 43px;
    }

    .create-menu-text strong {
        font-size: 14px;
    }

    .create-menu-text small {
        font-size: 11px;
    }
}

/* ==========================================
   MENU CREA - IPHONE
========================================== */

@media (max-width: 700px) {

    .settings-header,
    .search-page-header {
        padding: 7px 4px 15px;
    }

    .settings-header h1,
    .search-page-header h1 {
        font-size: 27px;
    }

    .create-menu-panel {
        margin-top: 3px;
        padding: 9px;
        border-radius: 19px;
    }

    .create-menu-list {
        gap: 7px;
    }

    .create-menu-item,
    .create-menu-list > #home-scan-document {
        min-height: 73px;
        gap: 12px;
        padding: 9px 11px;
        border-radius: 14px;
    }

    .create-menu-icon,
    .create-menu-list > #home-scan-document::before {
        width: 43px;
        height: 43px;
        flex-basis: 43px;
        border-radius: 12px;
    }

    .create-menu-text strong {
        font-size: 14px;
    }

    .create-menu-text small {
        font-size: 11px;
    }

    .create-menu-arrow,
    .create-menu-list > #home-scan-document::after {
        font-size: 24px;
    }
}

/* ==========================================
   MENU CREA - IPHONE PICCOLI
========================================== */

@media (max-width: 380px) {

    .create-menu-panel {
        padding: 7px;
    }

    .create-menu-item,
    .create-menu-list > #home-scan-document {
        min-height: 68px;
        gap: 9px;
        padding: 8px;
    }

    .create-menu-icon,
    .create-menu-list > #home-scan-document::before {
        width: 39px;
        height: 39px;
        flex-basis: 39px;
    }

    .create-menu-text strong {
        font-size: 13px;
    }

    .create-menu-text small {
        font-size: 10px;
    }
}

/* ==========================================
   MYDESK - CESTINO
   Interfaccia adattiva iPhone / iPad / Mac
========================================== */

#mydesk-trash-content {
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* Intestazione e pulsante svuota */

.trash-header {
    width: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 17px 19px;
    background: linear-gradient(145deg, #242424, #191919);
    border: 1px solid var(--gold-border);
    border-radius: 17px;
}

.trash-header > div {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.trash-header strong {
    color: var(--text);
    font-size: 16px;
    font-weight: 600;
}

.trash-header small {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.5;
}

/* Elenco */

.trash-list {
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Scheda elemento */

.trash-item {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    align-items: center;
    gap: 15px;
    padding: 17px;
    background: linear-gradient(145deg, #222222, #191919);
    border: 1px solid var(--border);
    border-radius: 17px;
    box-shadow: 0 5px 16px rgba(0,0,0,0.18);
}

.trash-item-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 27px;
    background: #303030;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
}

.trash-item-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.trash-item-title {
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.trash-item-type {
    color: var(--gold);
    font-size: 12px;
    font-weight: 600;
}

.trash-item-details,
.trash-item-date {
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

/* Pulsanti */

.trash-item-actions {
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.trash-btn {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 13px;
    color: var(--text);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
    border: 1px solid rgba(255,255,255,0.13);
    border-radius: 11px;
    transition: background 0.2s, border-color 0.2s;
}

.trash-restore {
    color: #b9edc3;
    background: rgba(66,160,91,0.13);
    border-color: rgba(91,190,116,0.4);
}

.trash-restore:hover {
    background: rgba(66,160,91,0.25);
    border-color: #70c987;
}

.trash-delete {
    color: #ffb0a9;
    background: rgba(190,65,65,0.13);
    border-color: rgba(220,91,91,0.4);
}

.trash-delete:hover,
.trash-empty:hover {
    background: rgba(190,65,65,0.27);
    border-color: #e47b72;
}

.trash-empty {
    flex: 0 0 auto;
    min-width: 145px;
    min-height: 45px;
    padding: 10px 17px;
    color: #ffd0cb;
    background: rgba(190,65,65,0.17);
    border: 1px solid rgba(220,91,91,0.48);
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
}

.trash-btn:active {
    transform: scale(0.98);
}

/* Cestino vuoto */

#mydesk-trash-content > .empty-state {
    min-height: 190px;
    justify-content: center;
    padding: 35px 20px;
    background: linear-gradient(145deg, #202020, #181818);
    border: 1px solid var(--border);
    border-radius: 18px;
}

#mydesk-trash-content > .empty-state > span {
    font-size: 42px;
}

#mydesk-trash-content > .empty-state p {
    color: var(--text);
    font-size: 16px;
}

#mydesk-trash-content > .empty-state small {
    max-width: 340px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ==========================================
   CESTINO - IPAD
========================================== */

@media (min-width: 701px) and (max-width: 1050px) {

    .trash-item {
        grid-template-columns: 46px minmax(0, 1fr);
        gap: 12px;
        padding: 15px;
    }

    .trash-item-icon {
        width: 44px;
        height: 44px;
        font-size: 24px;
    }

    .trash-item-actions {
        grid-column: 2;
        justify-content: flex-start;
        width: 100%;
    }

    .trash-btn {
        min-height: 44px;
        padding: 10px 15px;
        font-size: 13px;
    }

    .trash-header {
        padding: 15px;
    }
}

/* ==========================================
   CESTINO - IPHONE
========================================== */

@media (max-width: 700px) {

    #mydesk-trash-content {
        gap: 13px;
    }

    .trash-header {
        flex-direction: column;
        align-items: stretch;
        gap: 13px;
        padding: 15px;
    }

    .trash-header strong {
        font-size: 15px;
    }

    .trash-header small {
        font-size: 12px;
    }

    .trash-empty {
        width: 100%;
        min-height: 48px;
        font-size: 14px;
    }

    .trash-list {
        gap: 11px;
    }

    .trash-item {
        grid-template-columns: 42px minmax(0, 1fr);
        gap: 10px;
        padding: 13px;
        border-radius: 15px;
    }

    .trash-item-icon {
        width: 40px;
        height: 40px;
        font-size: 23px;
        border-radius: 11px;
    }

    .trash-item-info {
        gap: 5px;
    }

    .trash-item-title {
        font-size: 14px;
    }

    .trash-item-type {
        font-size: 12px;
    }

    .trash-item-details,
    .trash-item-date {
        font-size: 11px;
    }

    .trash-item-actions {
        grid-column: 1 / -1;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        margin-top: 5px;
    }

    .trash-btn {
        width: 100%;
        min-height: 47px;
        padding: 11px 13px;
        font-size: 13px;
        border-radius: 12px;
    }

    #mydesk-trash-content > .empty-state {
        min-height: 180px;
        padding: 25px 15px;
    }
}

/* ==========================================
   CESTINO - IPHONE PICCOLI
========================================== */

@media (max-width: 380px) {

    .trash-header {
        padding: 12px;
    }

    .trash-item {
        padding: 11px;
        gap: 8px;
    }

    .trash-item-title {
        font-size: 13px;
    }

    .trash-btn {
        min-height: 48px;
        font-size: 12px;
    }
}

/* ==========================================
   CESTINO - MAC E FINESTRE LARGHE
========================================== */

@media (min-width: 1051px) {

    .trash-item {
        grid-template-columns: 54px minmax(0, 1fr) auto;
        padding: 19px;
    }

    .trash-item-actions {
        flex-wrap: nowrap;
    }

    .trash-btn {
        min-width: 135px;
        min-height: 44px;
    }

    .trash-delete {
        min-width: 190px;
    }
}
