﻿/* ================================================================
   MAINTENANCE v2 — popup (mt2-*) + page (mn2-*) + configurator (cfg-mnt-*)
   ================================================================ */

/* ---- CONFIGURATOR DIALOG (cfg-mnt) ---- */

.cfg-mnt-dialog {
    display: flex;
    flex-direction: column;
    gap: .6rem;
    padding: 1rem 1.25rem .25rem
}

.cfg-mnt-section {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden
}

.cfg-mnt-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .55rem .9rem;
    background: #f8f9fb;
    border-bottom: 1px solid #e5e7eb;
    gap: .75rem
}

.cfg-mnt-section-title {
    display: flex;
    align-items: center;
    gap: .45rem;
    font-size: 11px;
    font-weight: 700;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: .07em;
    white-space: nowrap
}

.cfg-mnt-section-icon {
    color: #2563eb;
    font-size: 12px
}

.cfg-mnt-count {
    background: #e0e7ff;
    color: #3730a3;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px
}

.cfg-mnt-header-actions {
    display: flex;
    align-items: center;
    gap: .5rem
}

.cfg-mnt-search {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    padding: 3px 8px;
    transition: border-color .15s
}

    .cfg-mnt-search:focus-within {
        border-color: #2563eb
    }

.cfg-mnt-search-icon {
    color: #9ca3af;
    font-size: 11px;
    flex-shrink: 0
}

.cfg-mnt-search-input {
    border: none;
    outline: none;
    font-size: 12px;
    color: #111827;
    background: transparent;
    width: 140px
}

    .cfg-mnt-search-input::placeholder {
        color: #9ca3af
    }

.cfg-mnt-add-all-btn {
    background: #16a34a;
    border: none;
    border-radius: 5px;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 5px 11px;
    cursor: pointer;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px
}

    .cfg-mnt-add-all-btn:hover {
        background: #15803d
    }

.cfg-mnt-table-wrap {
    max-height: 220px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db #fff
}

.cfg-mnt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    table-layout: fixed
}

.cfg-mnt-col-name {
    width: 34%
}

.cfg-mnt-col-num {
    width: 14%
}

.cfg-mnt-col-str {
    width: 22%
}

.cfg-mnt-col-act {
    width: 48px
}

.cfg-mnt-table thead tr {
    border-bottom: 2px solid #e5e7eb;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1
}

.cfg-mnt-table thead th {
    padding: 6px 10px;
    font-size: 10px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .06em;
    text-align: left
}

.cfg-mnt-table tbody tr {
    border-bottom: 1px solid #f3f4f6;
    transition: background .1s
}

    .cfg-mnt-table tbody tr:hover {
        background: #f9fafb
    }

.cfg-mnt-table td {
    padding: 6px 10px;
    vertical-align: middle;
    color: #374151;
    font-size: 12px
}

.cfg-mnt-num {
    font-variant-numeric: tabular-nums;
    color: #1d4ed8;
    font-weight: 600
}

.cfg-mnt-tag {
    display: inline-block;
    background: #f1f5f9;
    color: #475569;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 3px;
    white-space: nowrap
}

.cfg-mnt-tag--type {
    background: #ede9fe;
    color: #5b21b6
}

.cfg-mnt-empty {
    text-align: center;
    color: #9ca3af;
    font-style: italic;
    padding: 1.5rem !important
}

.cfg-mnt-input {
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    color: #111827;
    font-size: 12px;
    padding: 4px 7px;
    outline: none;
    width: 100%;
    box-sizing: border-box
}

    .cfg-mnt-input:focus {
        border-color: #2563eb
    }

.cfg-mnt-input--num {
    text-align: right;
    font-variant-numeric: tabular-nums
}

.cfg-mnt-td-action {
    width: 48px;
    text-align: center
}

.cfg-mnt-btn-add {
    background: #16a34a;
    border: none;
    border-radius: 5px;
    color: #fff;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .12s
}

    .cfg-mnt-btn-add:hover {
        background: #15803d
    }

.cfg-mnt-btn-remove {
    background: #ef4444;
    border: none;
    border-radius: 5px;
    color: #fff;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .12s
}

    .cfg-mnt-btn-remove:hover {
        background: #dc2626
    }

.cfg-mnt-row-new td {
    background: #f0fdf4
}

/* FOOTER */
.cfg-mnt-footer {
    display: flex;
    gap: .6rem;
    padding: .85rem 1.25rem;
    border-top: 2px solid #e5e7eb;
    background: #f8f9fb;
    margin-top: .25rem
}

.cfg-mnt-footer-cancel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 7px;
    color: #374151;
    font-size: 13px;
    font-weight: 600;
    padding: 10px 16px;
    cursor: pointer;
    transition: background .12s, border-color .12s
}

    .cfg-mnt-footer-cancel:hover {
        background: #f3f4f6;
        border-color: #9ca3af
    }

.cfg-mnt-footer-confirm {
    flex: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    background: #16a34a;
    border: none;
    border-radius: 7px;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 10px 16px;
    cursor: pointer;
    letter-spacing: .04em;
    text-transform: uppercase;
    transition: background .12s
}

    .cfg-mnt-footer-confirm:hover {
        background: #15803d
    }

/* OPEN-MAINTENANCE BUTTON (header, accanto al nome componente) */
.cfg-header-left {
    display: flex;
    align-items: baseline;
    gap: .75rem;
    margin-left: .625rem
}

.cfg-mnt-open-btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: #1e293b;
    border: none;
    border-radius: 7px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 7px 14px;
    cursor: pointer;
    letter-spacing: .03em;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: background .15s, box-shadow .15s
}

    .cfg-mnt-open-btn i {
        color: #38bdf8;
        font-size: 13px
    }

    .cfg-mnt-open-btn:hover {
        background: #0f172a;
        box-shadow: 0 4px 12px rgba(0,0,0,0.2)
    }

/* ---- POPUP (mt2) ---- */

.mt2-popup {
    width: 520px
}

.mt2-alarm-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
    font-size: 16px
}

.mt2-header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end
}

.mt2-pdf-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 7px;
    border: 1px solid #fecaca;
    background: #fff;
    color: #dc2626;
    font-size: 16px;
    text-decoration: none;
    transition: background .15s
}

    .mt2-pdf-btn:hover {
        background: #fee2e2
    }

.mt2-info-bar {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .55rem 1.25rem;
    background: #eff6ff;
    border-bottom: 1px solid #bfdbfe;
    font-size: 12px;
    color: #374151
}

    .mt2-info-bar strong {
        color: #1d4ed8
    }

.mt2-wrench {
    color: #2563eb;
    font-size: 13px;
    flex-shrink: 0
}

.mt2-popup .rd2-body {
    flex: none;
    height: 260px;
    overflow-y: auto
}

.mt2-item {
    padding: .65rem 1.25rem;
    border-bottom: 1px solid #f3f4f6;
    transition: background .12s
}

    .mt2-item:hover {
        background: #f9fafb
    }

.mt2-item--selected {
    background: rgba(37,99,235,0.06) !important
}

.mt2-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px
}

.mt2-item-name {
    font-size: 12px;
    font-weight: 600;
    color: #111827
}

.mt2-item-pct {
    font-size: 11px;
    font-weight: 700;
    color: #2563eb
}

.mt2-progress {
    height: 7px;
    background: #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 5px
}

.mt2-progress-bar {
    height: 100%;
    border-radius: 6px;
    transition: width .3s
}

.mt2-item-sub {
    font-size: 10px;
    color: #6b7280
}

.mt2-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-top: 1px solid #e5e7eb
}

.mt2-btn-reset {
    background: #2563eb;
    border: none;
    border-right: 1px solid #1d4ed8;
    color: #fff;
    padding: 10px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: .04em;
    transition: background .12s
}

    .mt2-btn-reset:hover {
        background: #1d4ed8
    }

.mt2-btn-replace {
    background: #f59e0b;
    border: none;
    color: #fff;
    padding: 10px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: .04em;
    transition: background .12s
}

    .mt2-btn-replace:hover {
        background: #d97706
    }


/* ---- PAGE LAYOUT (mn2) ---- */

.mn2-layout {
    display: flex;
    height: 100%;
    width: 100%;
    background: #f1f5f9;
    overflow: hidden
}

/* SIDEBAR */
.mn2-sidebar {
    width: 180px;
    flex-shrink: 0;
    background: #1e293b;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #334155 #1e293b
}

.mn2-sidebar-header {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: 1rem 1.1rem .8rem;
    border-bottom: 1px solid #334155;
    color: #94a3b8;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase
}

.mn2-sidebar-icon {
    color: #2563eb;
    font-size: 14px
}

.mn2-nav {
    list-style: none;
    margin: 0;
    padding: .4rem 0
}

.mn2-nav-item {
    padding: .65rem 1.1rem;
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: .05em;
    border-left: 3px solid transparent;
    transition: color .12s, background .12s, border-color .12s
}

    .mn2-nav-item:hover {
        color: #e2e8f0;
        background: rgba(255,255,255,0.04)
    }

.mn2-nav-item--active {
    color: #fff;
    border-left-color: #2563eb;
    background: rgba(37,99,235,0.12)
}

/* CONTENT AREA */
.mn2-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9
}

.mn2-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem
}

/* CARD */
.mn2-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-top: 3px solid #d1d5db;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    transition: box-shadow .15s, border-top-color .15s
}

    .mn2-card:hover {
        box-shadow: 0 4px 14px rgba(0,0,0,0.1)
    }

.mn2-card--selected {
    border-top-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37,99,235,0.2)
}

.mn2-card-header {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .8rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    background: #f8f9fb
}

.mn2-card-icon {
    color: #2563eb;
    font-size: 18px;
    flex-shrink: 0
}

.mn2-card-title {
    display: flex;
    flex-direction: column;
    gap: 1px
}

.mn2-card-name {
    font-size: 13px;
    font-weight: 700;
    color: #111827
}

.mn2-card-time {
    font-size: 10px;
    color: #6b7280
}

    .mn2-card-time strong {
        color: #1d4ed8
    }

.mn2-card-body {
    flex: none;
    height: 248px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db #fff
}

/* TIMING ITEM */
.mn2-timing {
    padding: .6rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    transition: background .12s
}

    .mn2-timing:hover {
        background: #f9fafb
    }

.mn2-timing--selected {
    background: rgba(37,99,235,0.06) !important
}

.mn2-timing-header {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: 5px
}

.mn2-timing-reset-btn {
    background: none;
    border: 1px solid #e5e7eb;
    border-radius: 5px;
    color: #6b7280;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    font-size: 12px;
    transition: border-color .12s, color .12s, background .12s
}

    .mn2-timing-reset-btn:hover {
        border-color: #2563eb;
        color: #2563eb;
        background: #eff6ff
    }

.mn2-timing-name {
    font-size: 12px;
    font-weight: 600;
    color: #111827;
    flex: 1
}

.mn2-timing-pct {
    font-size: 11px;
    font-weight: 700;
    color: #2563eb;
    flex-shrink: 0
}

.mn2-progress {
    height: 6px;
    background: #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 4px
}

.mn2-progress-bar {
    height: 100%;
    border-radius: 6px;
    transition: width .3s
}

.mn2-timing-sub {
    font-size: 10px;
    color: #9ca3af
}

/* CARD ACTIONS */
.mn2-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-top: 1px solid #e5e7eb
}

.mn2-btn-reset {
    background: #2563eb;
    border: none;
    border-right: 1px solid #1d4ed8;
    color: #fff;
    padding: 9px 6px;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: .04em;
    transition: background .12s
}

    .mn2-btn-reset:hover {
        background: #1d4ed8
    }

.mn2-btn-replace {
    background: #f59e0b;
    border: none;
    color: #fff;
    padding: 9px 6px;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: .04em;
    transition: background .12s
}

    .mn2-btn-replace:hover {
        background: #d97706
    }
