﻿/* TOKENS */
:root {
    --dm-gx: 24px;
    --dm-gy: 12px;
}
/* GRID */
.dm-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--dm-gx);
    row-gap: var(--dm-gy);
    max-width: 1024px; /* Limita la larghezza massima della griglia per rendere i campi più stretti */
}
.dm-col-4 {
    grid-column: span 4;
}
.dm-col-6 {
    grid-column: span 6;
}
.dm-col-12 {
    grid-column: 1 / -1;
}
@media (max-width: 992px) {
    .dm-col-4, .dm-col-6 {
        grid-column: 1 / -1;
    }
}
/* =================================== */
/* NEW FIELD STYLES (BOXED DESIGN)   */
/* =================================== */

.mdf-field {
    font-family: Roboto, system-ui, -apple-system, Segoe UI, Arial, sans-serif;
    margin-bottom: 14px;
}

.mdf-label {
    display: block;
    margin: 0 0 4px;
    font-size: 12px;
    line-height: 16px;
    letter-spacing: .4px;
    color: rgba(255, 255, 255, .38);
    font-weight: 400;
}

.mdf-help {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    line-height: 16px;
    letter-spacing: .4px;
    color: rgba(255, 255, 255, .60);
}

/* WRAPPER (This is now the visible box) */
.mdf-control-wrap {
    position: relative;
    background: #2b2b2b;
    border: 1px solid #4b4b4b;
    border-radius: 6px;
    transition: border-color .2s ease;
}

    .mdf-control-wrap:focus-within {
        border-color: #6d6d6d;
    }

/* CONTROL (The actual <input> or <select>) */
.mdf-control {
    display: block;
    width: 100%;
    height: 44px;
    padding: 8px 12px;
    background: transparent;
    border: 0;
    border-radius: 6px; /* Match wrapper for consistency */
    color: #eeeeee;
    outline: none;
    box-shadow: none;
}

    .mdf-control::placeholder {
        color: #9a9a9a;
        opacity: 1;
    }

/* SELECT specific styles */
select.mdf-control {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23cfcfcf' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px 18px;
    padding-right: 40px;
    transition: background-image 0.2s ease;
}

    /* Change arrow on focus */
    select.mdf-control:focus {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23cfcfcf' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 15 12 9 18 15'/%3E%3C/svg%3E");
    }

    select.mdf-control:required:invalid {
        color: #9a9a9a;
    }

    select.mdf-control option[value=""][disabled] {
        display: none;
    }

    select.mdf-control option {
        background: #3a3a3a;
        color: #eeeeee;
    }

/* DATE input icon style */
/* Add a custom icon as background to the new .mdf-control-date class */
.mdf-control-date {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23cfcfcf' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px 18px;
}

    /* When the input has a value, keep text color */
    .mdf-control-date[type="date"]:valid,
    .mdf-control-date[type="month"]:valid {
        color: #eeeeee;
    }

    /* Hide the native icon but keep the area clickable by making it transparent */
    .mdf-control-date::-webkit-calendar-picker-indicator {
        opacity: 0;
        cursor: pointer;
    }

/* NOTE: The calendar pop-up itself is a native browser UI component.
   It cannot be styled using standard CSS. The design in the reference
   image would require a custom JavaScript library. */


/* ERROR STATE */
.mdf-field.is-invalid .mdf-control-wrap {
    border-color: #C94040;
}

.mdf-field .mdf-help.is-error {
    color: #C94040;
}
/* =================================== */
/* TABLE STYLES (Dark UI, like mockup) */
/* Override: appended on 2025-09-26    */
/* =================================== */

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-family: Roboto, system-ui, -apple-system, Segoe UI, Arial, sans-serif;
    background: transparent; /* lo sfondo resta quello della pagina (#0E0E0E nel mockup) */
}

    /* Header */
    .data-table thead th {
        text-align: left;
        font-weight: 500;
        color: #F5F5F5;
        font-size: 14px;
        line-height: 24px;
        letter-spacing: 0.10px;
        padding: 16px;
        border-bottom: 1px solid #F5F5F5; /* come i separatori nel mockup */
    }

    /* Celle */
    .data-table tbody td {
        padding: 16px;
        font-size: 16px; /* nel mockup il contenuto è 16px */
        line-height: 24px;
        letter-spacing: 0.15px;
        color: rgba(255, 255, 255, 0.87);
        vertical-align: middle;
    }

    /* Separatore tra righe */
    .data-table tbody tr + tr td {
        border-top: 1px solid #F5F5F5; /* nel mockup i separatori sono chiari */
    }

    /* Variante testo attenuato (per celle tipo valori “23/06/2025”, “Me”) */
    .data-table .is-muted {
        color: rgba(255, 255, 255, 0.60);
        font-weight: 400;
        font-size: 14px; /* alcune celle nel mockup sono a 14px */
        letter-spacing: 0.10px;
    }

    /* Variante titolo/etichetta nella cella (se serve a livello contenuto) */
    .data-table .is-label {
        color: #F5F5F5;
        font-weight: 400;
        font-size: 14px;
        letter-spacing: 0.10px;
    }

    /* Hover/Focus riga: leggero sollevamento visivo */
    .data-table tbody tr:hover td {
        background: #121212; /* vicino ai pannelli scuri del mockup */
    }

    /* Colonne ordinabili: caret in stile semplice */
    .data-table th.sortable {
        cursor: pointer;
        position: relative;
        padding-right: 24px;
    }

        .data-table th.sortable::after {
            content: "";
            position: absolute;
            right: 8px;
            top: 50%;
            width: 6px;
            height: 6px;
            border-right: 2px solid currentColor;
            border-bottom: 2px solid currentColor;
            transform: translateY(-30%) rotate(45deg);
            opacity: 0.8;
        }

        .data-table th.sortable.asc::after {
            transform: translateY(-30%) rotate(225deg);
        }

        .data-table th.sortable.desc::after {
            transform: translateY(-30%) rotate(45deg);
        }

        /* Stato attivo: usa il verde del mockup (#2B8456) */
        .data-table th.sortable.active {
            color: #2B8456;
        }

/* Icon button (allineato al verde del mockup) */
.icon-btn {
    background: transparent;
    border: 0;
    color: #2B8456;
    cursor: pointer;
    padding: 10px 8px 10px 10px;
    line-height: 0;
}

    .icon-btn:hover {
        color: #36a66f;
    }

    .icon-btn svg {
        pointer-events: none;
    }
/* =================================== */

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

    .data-table th {
        font-weight: 500;
        color: #eee;
        padding: 12px 0;
        text-align: left;
        font-size: 13px;
    }

    .data-table td {
        padding: 14px 0;
        font-size: 14px;
        color: #eee;
    }

    .data-table tr + tr td {
        border-top: 1px solid #3d3d3d;
    }

    .data-table th.sortable {
        cursor: pointer;
        position: relative;
        padding-right: 18px;
    }

        .data-table th.sortable::after {
            content: "";
            position: absolute;
            right: 4px;
            top: 50%;
            width: 6px;
            height: 6px;
            border-right: 2px solid currentColor;
            border-bottom: 2px solid currentColor;
            transform: translateY(-30%) rotate(45deg);
        }

        .data-table th.sortable.active {
            color: #1dd095;
        }

        .data-table th.sortable.asc::after {
            transform: translateY(-30%) rotate(225deg);
        }

        .data-table th.sortable.desc::after {
            transform: translateY(-30%) rotate(45deg);
        }

.icon-btn {
    background: transparent;
    border: 0;
    color: #1dd095;
    cursor: pointer;
    padding: 10px 8px 10px 10px;
    line-height: 0;
}

    .icon-btn:hover {
        color: #1af7b0;
    }

    .icon-btn svg {
        pointer-events: none;
    }

/* =================================== */
/* ERROR TOAST STYLES                */
/* =================================== */
.error-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 350px;
    max-width: 90%;
    background-color: #333;
    color: #fff;
    border: 1px solid #4b4b4b;
    border-radius: 6px;
    padding: 1rem;
    z-index: 1050;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.toast-title {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #eee;
}

.toast-body {
    font-size: 0.875rem;
    color: rgba(255,255,255,0.7);
    margin: 0;
}

.btn-close {
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    opacity: 0.7;
    padding: 0;
    margin-left: 1rem;
    cursor: pointer;
}

    .btn-close:hover {
        opacity: 1;
    }

/* =================================== */
/* APP SHELL & TOKENS (from mockup)    */
/* =================================== */
:root {
    --dm-bg: #0E0E0E;
    --dm-surface: #1C1C1C;
    --dm-surface-2: #121212;
    --dm-on: rgba(255,255,255,0.87);
    --dm-on-med: rgba(255,255,255,0.60);
    --dm-on-low: rgba(255,255,255,0.38);
    --dm-sep: rgba(255,255,255,0.12);
    --dm-sep-strong: #D9D9D9;
    --dm-green: #2B8456;
    --dm-green-600: #36a66f;
    --dm-radius: 6px;
    --dm-font: Roboto, system-ui, -apple-system, Segoe UI, Arial, sans-serif;
}

/* Page background */
.dm-app {
    background: var(--dm-bg);
    min-height: 100vh;
    color: var(--dm-on);
    font-family: var(--dm-font);
}

/* Typography helpers */
.text-on {
    color: var(--dm-on);
}

.text-med {
    color: var(--dm-on-med);
}

.text-low {
    color: var(--dm-on-low);
}

/* =================================== */
/* BUTTONS                             */
/* =================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-family: Inter, var(--dm-font);
    font-weight: 500;
    font-size: 14px;
    line-height: 24px;
    border-radius: var(--dm-radius);
    border: 0;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary {
    background: var(--dm-green);
    color: #fff;
}

    .btn-primary:hover {
        background: var(--dm-green-600);
    }

.btn-outline {
    background: transparent;
    color: var(--dm-green);
    outline: 1px solid var(--dm-sep);
    outline-offset: -1px;
}

.btn-icon {
    width: 20px;
    height: 20px;
    display: inline-block;
}

/* =================================== */
/* TABS (Upload data / Data list)      */
/* =================================== */
.dm-tabs {
    display: flex;
    gap: 0;
}

.dm-tab {
    position: relative;
    height: 48px;
    width: 150px;
    display: grid;
    place-items: center;
    background: var(--dm-surface);
    text-transform: uppercase;
    letter-spacing: 1.25px;
    font-weight: 500;
    font-size: 14px;
    color: var(--dm-on-med);
}

    .dm-tab.is-active {
        color: var(--dm-green);
    }

        .dm-tab.is-active::after {
            content: "";
            position: absolute;
            left: 0;
            right: 0;
            bottom: 0;
            height: 2px;
            background: var(--dm-green);
        }

/* =================================== */
/* SIDEBAR ITEMS (Stakeholder, etc.)   */
/* =================================== */
.dm-side-item {
    position: relative;
    height: 40px;
    display: flex;
    align-items: center;
    padding: 0 0 0 44px;
    color: #fff;
    font-size: 20px;
    text-transform: capitalize;
}

    .dm-side-item.is-active {
        background: linear-gradient(90deg, #1C1C1C 0%, rgba(14,14,14,0.13) 100%);
        color: var(--dm-green);
    }

        .dm-side-item.is-active::after {
            content: "";
            position: absolute;
            top: 11px;
            right: 0;
            width: 9px;
            height: 17px;
            background: var(--dm-green);
        }

/* =================================== */
/* RADIO / OPTION CHOICE               */
/* =================================== */
.dm-option {
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 12px;
    align-items: center;
    font-family: var(--dm-font);
    font-size: 16px;
    line-height: 24px;
    letter-spacing: 0.15px;
    color: var(--dm-on);
}

.dm-radio {
    width: 20px;
    height: 20px;
    position: relative;
}

    .dm-radio::before {
        content: "";
        position: absolute;
        inset: -2px;
        width: 24px;
        height: 24px;
        background: rgba(255,255,255,0.60);
        border-radius: 4px;
    }

    .dm-radio.is-selected::before {
        background: var(--dm-green);
    }

/* =================================== */
/* DROPDOWN FIELDS (72px block style)  */
/* =================================== */
.dm-field-72 {
    width: 328px;
    height: 72px;
    position: relative;
}

    .dm-field-72 .bar {
        position: absolute;
        left: 0;
        right: 0;
        top: 55px;
        height: 1px;
        background: rgba(255,255,255,0.60);
    }

    .dm-field-72 .hint {
        position: absolute;
        left: 16px;
        top: 59px;
        font-size: 12px;
        line-height: 16px;
        letter-spacing: .4px;
        color: var(--dm-on-med);
    }

    .dm-field-72 .label {
        position: absolute;
        left: 16px;
        top: 8px;
        font-size: 12px;
        line-height: 16px;
        letter-spacing: .4px;
        color: var(--dm-on-low);
    }

    .dm-field-72 .value {
        position: absolute;
        left: 16px;
        top: 22px;
        font-size: 16px;
        line-height: 24px;
        letter-spacing: .15px;
        color: var(--dm-on);
    }

/* caret icon placeholder */
.dm-caret {
    width: 24px;
    height: 24px;
    position: absolute;
}

    .dm-caret::after {
        content: "";
        position: absolute;
        left: 7px;
        top: 10px;
        width: 10px;
        height: 5px;
        background: #AFAFAF;
    }

/* =================================== */
/* UPLOAD AREA                         */
/* =================================== */
.upload-meta {
    display: inline-block;
    background: #000;
    height: 16px;
    padding: 0 6px;
    border-radius: 2px;
    color: #D9D9D9;
    font-size: 12px;
    line-height: 16px;
    letter-spacing: .40px;
}

.upload-dropzone {
    border-radius: 5px;
    outline: 1px solid #D9D9D9;
    outline-offset: -0.5px;
    min-height: 267.5px;
    width: 327px;
    display: grid;
    place-items: center;
    text-align: center;
    gap: 8px;
    padding: 24px;
}

.upload-link {
    color: var(--dm-green);
    font-size: 16px;
    line-height: 24px;
    letter-spacing: .15px;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.upload-help {
    color: var(--dm-on-med);
    font-size: 14px;
    line-height: 20px;
    letter-spacing: .25px;
}

/* Single file row (selected file) */
.file-row {
    position: relative;
    width: 328px;
    height: 48px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
}

    .file-row .name {
        color: var(--dm-on);
        font-size: 16px;
        line-height: 24px;
        letter-spacing: .15px;
        flex: 1;
    }

    .file-row .icon {
        width: 24px;
        height: 24px;
        background: #D9D9D9;
    }

    .file-row .check {
        width: 16px;
        height: 18px;
        background: var(--dm-green);
    }

/* =================================== */
/* TOP ACTIONS                         */
/* =================================== */
.top-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.top-avatar {
    width: 40px;
    height: 40px;
    background: #D9D9D9;
    border-radius: 50%;
}

/* =================================== */
/* UTILITIES                           */
/* =================================== */
.divider-light {
    height: 1px;
    background: rgba(255,255,255,0.12);
}

.panel {
    background: var(--dm-surface-2);
    border-radius: 4px;
}
/* End of additions */
/* ===== USER INFORMATION look ===== */
.um-info {
    padding: .25rem .25rem 0;
}

.um-info-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.um-info-grid {
    display: grid;
    gap: 1.1rem;
    grid-template-columns: repeat(12, 1fr);
}

.um-info-field {
    grid-column: span 6;
}

@media (max-width: 992px) {
    .um-info-field {
        grid-column: 1 / -1;
    }
}

.um-info-label {
    display: block;
    margin: 0 0 .35rem;
    color: rgba(255,255,255,.55);
    font-size: 12px;
    letter-spacing: .4px;
}

.um-info-input, .um-info-static {
    display: block;
    width: 100%;
    padding: .9rem 1rem .8rem;
    color: rgba(255,255,255,.92);
    background: #171717; /* superficie scura */
    border: none;
    outline: none;
    border-bottom: 1px solid rgba(255,255,255,.35);
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}

    .um-info-input::placeholder {
        color: rgba(255,255,255,.55);
    }

/* static read-only (Role) */
.um-info-static {
    user-select: text;
    background: #1a1a1a;
}

/* password + occhio */
.um-info-password {
    position: relative;
}

.um-eye {
    position: absolute;
    right: .55rem;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #cfcfcf;
    cursor: pointer;
}

/* reset link */
.um-info-reset {
    margin-top: .4rem;
    background: none;
    border: none;
    color: #2B8456;
    cursor: pointer;
    font-weight: 500;
    padding: 0;
}

/* footer actions */
.um-info-actions {
    display: flex;
    justify-content: flex-end;
    gap: .75rem;
}
.at-max {
    outline: 1px dashed #2B8456;
}
.dm-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
}

    .dm-modal.d-none {
        display: none;
    }

.dm-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.55);
}

.dm-modal-dialog {
    position: relative;
    z-index: 1;
    background: #101418;
    color: #fff;
    border-radius: 12px;
    padding: 20px;
    min-width: 320px;
    max-width: 480px;
    box-shadow: 0 10px 30px rgba(0,0,0,.6);
}

.dm-modal-close {
    position: absolute;
    top: 6px;
    right: 10px;
    background: transparent;
    border: 0;
    font-size: 22px;
    color: #fff;
    cursor: pointer;
    line-height: 1;
}
