﻿/* Wrapping element */
/* Set some basic padding to keep content from hitting the edges */
.body-content {
    margin-top: 15px;
    padding-left: 15px;
    padding-right: 15px;
}

/* Set widths on the form inputs since otherwise they're 100% wide */
input,
select,
textarea {
    max-width: 280px;
}

/* Responsive: Portrait tablets and up */
@media screen and (min-width: 768px) {
    .body-content {
        padding: 0;
    }
}

.login-body {
    background: #f2f2f2;
    font-family: "Segoe UI", Arial, sans-serif;
}

.login-box {
    width: 360px;
    margin: 120px auto;
    background: white;
    padding: 30px;
    border: 1px solid #d0d0d0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.login-title {
    font-size: 28px;
    font-weight: 600;
    color: #333;
}

.login-subtitle {
    margin-bottom: 25px;
    color: #666;
}

.login-box label {
    display: block;
    margin-top: 12px;
    margin-bottom: 6px;
    font-weight: 600;
}

.login-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #c0c0c0;
    box-sizing: border-box;
}

.login-button {
    width: 100%;
    margin-top: 24px;
    background: #5cb85c;
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
    font-weight: 600;
}

.login-error {
    display: block;
    margin-top: 15px;
    color: #c0392b;
    font-weight: 600;
}

body {
    margin: 0;
    background: #f5f5f5;
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 13px;
    color: #333;
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 215px;
    height: 100%;
    background: #352f2b;
    color: #fff;
}

.sidebar-logo {
    padding: 18px 20px;
    font-size: 26px;
    font-weight: bold;
    background: #2c2825;
}

.sidebar-title {
    padding: 12px 20px;
    color: #cfcfcf;
    font-size: 12px;
    text-transform: uppercase;
    border-bottom: 1px solid #46403b;
}

.sidebar a {
    display: block;
    padding: 13px 20px;
    color: #dedede;
    text-decoration: none;
    border-bottom: 1px solid #46403b;
}

    .sidebar a:hover {
        background: #4a423d;
        color: #fff;
    }

.main-area {
    margin-left: 215px;
}

.topbar {
    height: 45px;
    line-height: 45px;
    background: #3b3835;
    color: white;
    padding: 0 20px;
    font-size: 15px;
    font-weight: 600;
}

.user-label {
    float: right;
    font-weight: normal;
    font-size: 12px;
    color: #ddd;
}

.page {
    padding: 22px;
}

.panel {
    background: #fff;
    border: 1px solid #d7d7d7;
    padding: 18px;
}

h2 {
    font-weight: 400;
    margin-top: 0;
}

.filters {
    margin-bottom: 20px;
}

    .filters label {
        font-weight: 600;
        margin-right: 6px;
    }

.filter-input {
    padding: 6px;
    border: 1px solid #cfcfcf;
    margin-right: 18px;
}

.btn-search {
    background: #5cb85c;
    color: white;
    border: none;
    padding: 7px 18px;
    cursor: pointer;
    font-weight: 600;
}

    .btn-search:hover {
        background: #4cae4c;
    }

.grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

    .grid th {
        background: #f0f0f0;
        border: 1px solid #d0d0d0;
        padding: 8px;
        text-align: left;
    }

    .grid td {
        border: 1px solid #dcdcdc;
        padding: 7px;
        text-align: left;
    }

        .grid td:nth-child(n+10),
        .grid th:nth-child(n+10) {
            text-align: right;
        }

.filters {
    margin-bottom: 20px;
}

    .filters label {
        font-weight: 600;
        margin-right: 6px;
    }

.filter-input {
    padding: 6px;
    border: 1px solid #cfcfcf;
    margin-right: 18px;
}

.btn-search {
    background: #5cb85c;
    color: white;
    border: none;
    padding: 7px 18px;
    cursor: pointer;
    font-weight: 600;
}

    .btn-search:hover {
        background: #4cae4c;
    }

.grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

    .grid th {
        background: #f0f0f0;
        border: 1px solid #d0d0d0;
        padding: 8px;
        text-align: left;
    }

    .grid td {
        border: 1px solid #dcdcdc;
        padding: 7px;
        text-align: left;
    }

    .grid td {
        padding: 6px 8px;
    }

        .grid td.num,
        .grid th.num {
            text-align: right !important;
        }

.warning-link {
    color: #b35c00;
    text-decoration: none;
}

    .warning-link:hover {
        text-decoration: underline;
    }

.disabled-link {
    color: #777;
    text-decoration: none;
    cursor: default;
    margin-left: 25px;
    font-weight: bold;
}

@media screen and (max-width: 768px) {

    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
    }

    .sidebar-logo {
        padding: 12px 15px;
        font-size: 22px;
    }

    .sidebar-title {
        padding: 8px 15px;
    }

    .sidebar a {
        display: block;
        padding: 10px 15px;
    }

    .main-area {
        margin-left: 0;
    }

    .topbar {
        height: auto;
        line-height: normal;
        padding: 12px 15px;
    }

    .user-label {
        float: none;
        display: block;
        margin-top: 6px;
    }

    .page {
        padding: 10px;
    }

    .panel {
        padding: 10px;
        overflow-x: auto;
    }

    .filters label {
        display: block;
        margin-top: 10px;
    }

    .filter-input {
        width: 100%;
        box-sizing: border-box;
        margin-bottom: 8px;
    }

    .grid {
        min-width: 1100px;
        font-size: 11px;
    }

    .chart-box {
        height: 320px;
        overflow-x: auto;
    }

    canvas {
        min-width: 700px;
    }
}

/* ============================================================
   ADR responsive base
   Ottimizzazione globale per monitor piccoli, tablet e cellulari.
   Le regole finali nel Site.Master completano l'override dopo i CSS inline.
   ============================================================ */

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    min-width: 0;
}

img, svg, canvas {
    max-width: 100%;
}

.main-area,
.page,
.panel {
    min-width: 0;
}

.panel,
.table-scroll,
.grid-scroll,
.responsive-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.filters,
.toolbar,
.sdi-toolbar,
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-end;
}

.filter-input,
input[type="text"],
input[type="date"],
input[type="number"],
input[type="password"],
input[type="email"],
select,
textarea {
    max-width: 100%;
}

.num,
.money {
    text-align: right !important;
    white-space: nowrap;
}

.chart-box {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media screen and (max-width: 1180px) {
    .page {
        padding: 14px;
    }

    .panel {
        padding: 12px;
    }

    .summary-row {
        grid-template-columns: 1fr !important;
    }

    .grid {
        font-size: 11px;
    }

        .grid th,
        .grid td {
            padding: 5px;
        }
}

@media screen and (max-width: 768px) {
    .sidebar {
        position: relative !important;
        width: 100% !important;
        height: auto !important;
        display: flex !important;
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .sidebar-logo {
        flex: 0 0 auto;
        padding: 12px 14px !important;
        font-size: 21px !important;
    }

    .sidebar-title,
    .sidebar-section-title {
        display: none !important;
    }

    .sidebar a {
        flex: 0 0 auto;
        display: flex !important;
        align-items: center;
        padding: 12px 13px !important;
        border-bottom: none !important;
        border-left: 1px solid #46403b;
    }

    .main-area {
        margin-left: 0 !important;
        width: 100% !important;
    }

    .topbar {
        height: auto !important;
        line-height: 1.25 !important;
        padding: 10px 12px !important;
    }

    .user-label {
        float: none !important;
        display: block !important;
        margin-top: 4px;
    }

    .page {
        padding: 10px !important;
    }

    .panel {
        margin: 8px 0 !important;
        padding: 10px !important;
    }

    .filters,
    .toolbar,
    .sdi-toolbar,
    .filter-bar {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        align-items: stretch !important;
    }

    .right-tools {
        margin-left: 0 !important;
        justify-content: flex-start;
    }

    .filter-input,
    input[type="text"],
    input[type="date"],
    input[type="number"],
    input[type="password"],
    input[type="email"],
    select,
    textarea {
        width: 100% !important;
        max-width: 100% !important;
        margin-right: 0 !important;
    }

    input[type="file"] {
        width: 100%;
        max-width: 100%;
    }

    .btn,
    .btn-search,
    input[type="submit"],
    button {
        width: 100%;
        min-height: 40px;
        padding: 9px 12px;
    }

    .grid {
        min-width: 760px;
        font-size: 11px !important;
    }

        .grid th,
        .grid td {
            padding: 5px !important;
        }

    .nowrap,
    .num,
    .money {
        white-space: nowrap !important;
    }

    .edit-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 6px !important;
        max-width: 100% !important;
    }

    .summary-row {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .chart-box {
        height: 300px !important;
    }

        .chart-box canvas {
            min-width: 620px;
        }

    .login-box {
        width: calc(100% - 24px) !important;
        margin: 35px auto !important;
        padding: 20px !important;
    }
}

@media screen and (max-width: 420px) {
    body {
        font-size: 11px;
    }

    .topbar {
        font-size: 13px !important;
    }

    .page {
        padding: 8px !important;
    }

    .panel {
        padding: 8px !important;
    }

    .grid {
        min-width: 680px;
        font-size: 10px !important;
    }

    .chart-box {
        height: 280px !important;
    }

        .chart-box canvas {
            min-width: 560px;
        }
}
