/* ============================================================
   KLOUDARCHIVE - MODERN UI
   Replacement for the old Artisteer style.css / StyleSheet.css
   ============================================================ */


/* ============================================================
   DESIGN TOKENS
   ============================================================ */

:root {
    --color-page-bg: #dceff7;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-soft: #eff6ff;

    --text: #1f2937;
    --text-secondary: #4b5563;
    --text-muted: #6b7280;

    --background: #80CDF5;
    --surface: #ffffff;

    --border: #e5e7eb;
    --border-light: #eef1f5;

    --success: #15803d;
    --warning: #b45309;
    --danger: #b91c1c;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04);
    --shadow-md: 0 4px 14px rgba(15, 23, 42, .06);
    --shadow-lg: 0 10px 30px rgba(15, 23, 42, .10);

    --container-width: 1440px;
}


/* ============================================================
   RESET / BASE
   ============================================================ */

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

html {
    margin: 0;
    padding: 0;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0;
    min-width: 0;

    background: var(--background);
    color: var(--text);

    font-family:
        "Segoe UI",
        Inter,
        Roboto,
        Arial,
        sans-serif;

    font-size: 14px;
    line-height: 1.5;
    text-align: left;
}

form {
    margin: 0;
    padding: 0;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-hover);
}

img {
    max-width: 100%;
    height: auto;
}

table {
    border-collapse: collapse;
}

button,
input,
select,
textarea {
    font: inherit;
}


/* ============================================================
   APPLICATION
   ============================================================ */

.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}


/* ============================================================
   HEADER
   ============================================================ */

.app-header {
    position: sticky;
    top: 0;
    z-index: 1000;

    min-height: 68px;

    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.app-header-inner {
    width: 100%;
    max-width: var(--container-width);
    min-height: 68px;

    margin: 0 auto;
    padding: 0 24px;

    display: flex;
    align-items: center;
    gap: 24px;
}


/* ============================================================
   BRAND
   ============================================================ */

.app-brand {
    flex: 0 0 auto;
}

.app-brand-link {
    display: flex;
    align-items: center;
    gap: 10px;

    color: var(--text);
    font-size: 17px;
    font-weight: 600;
    white-space: nowrap;
}

.app-brand-link:hover {
    color: var(--text);
}

.app-brand-mark {
    width: 36px;
    height: 36px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 9px;

    background: var(--primary);
    color: #fff;

    font-size: 17px;
    font-weight: 700;
}

.app-brand-name {
    letter-spacing: -.2px;
}


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

.app-navigation {
    flex: 1 1 auto;
    min-width: 0;
}

.app-navigation-inner {
    min-width: 0;
    display: flex;
    align-items: center;
}


/*
 * ASP.NET Menu compatibility.
 *
 * WebForms Menu can render either UL/LI structures or tables
 * depending on the version/configuration. Both are handled here.
 */

.app-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;

    display: flex;
    align-items: center;
    gap: 3px;
}

.app-navigation li {
    position: relative;
    margin: 0;
    padding: 0;
}

.app-navigation a {
    display: flex;
    align-items: center;

    min-height: 20px;
    padding: 0px 12px;

    border-radius: var(--radius-sm);

    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;

    white-space: nowrap;

    transition:
        background-color .15s ease,
        color .15s ease;
}

.app-navigation a:hover {
    background: var(--primary-soft);
    color: var(--primary);
}


/* ASP.NET Menu can emit a table */

.app-navigation > div > table {
    border-collapse: separate;
    border-spacing: 3px 0;
}

.app-navigation > div > table td {
    padding: 0;
    border: 0;
}

.app-navigation > div > table a {
    display: inline-flex;
}


/* Submenus */

.app-navigation ul ul {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;

    min-width: 210px;

    display: none;

    padding: 6px;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);

    box-shadow: var(--shadow-lg);
}

.app-navigation li:hover > ul {
    display: block;
}

.app-navigation ul ul li {
    width: 100%;
}

.app-navigation ul ul a {
    width: 100%;
    justify-content: flex-start;
}


/* ============================================================
   LANGUAGE SELECTOR
   ============================================================ */

.app-header-actions {
    flex: 0 0 auto;
    margin-left: auto;
}

.language-select {
    min-width: 94px;
    height: 38px;

    padding: 0 30px 0 10px;

    border: 1px solid var(--border);
    border-radius: var(--radius-sm);

    background: var(--surface);
    color: var(--text-secondary);

    font-size: 13px;
    cursor: pointer;
    outline: none;
}

.language-select:hover {
    border-color: #cbd5e1;
}

.language-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}


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

.app-main {
    flex: 1 0 auto;
    width: 100%;
    padding: 28px 0 40px;
}

.app-container {
    width: 100%;
    max-width: var(--container-width);

    margin: 0 auto;
    padding: 0 24px;
}

.page-content {
    width: 100%;
}

.content-card {
    width: 100%;

    padding: 26px;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);

    box-shadow: var(--shadow-sm);
}


/* ============================================================
   OPTIONAL HEADER CONTENT
   ============================================================ */

#HeaderContentPlaceHolder {
    width: 100%;
}


/* ============================================================
   TYPOGRAPHY
   ============================================================ */

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text);
    font-weight: 600;
    line-height: 1.3;
}

h1 {
    margin: 0 0 20px;
    font-size: 26px;
    letter-spacing: -.4px;
}

h2 {
    margin: 0 0 16px;
    font-size: 21px;
}

h3 {
    margin: 0 0 12px;
    font-size: 18px;
}

p {
    margin: 0 0 12px;
}


/* ============================================================
   FORM CONTROLS
   ============================================================ */

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="search"],
select,
textarea {
    max-width: 100%;
    min-height: 38px;

    padding: 7px 10px;

    border: 1px solid var(--border);
    border-radius: var(--radius-sm);

    background: var(--surface);
    color: var(--text);

    outline: none;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="search"]:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .10);
}

textarea {
    min-height: 90px;
    resize: vertical;
}


/* ============================================================
   BUTTONS
   ============================================================ */

button,
input[type="submit"],
input[type="button"],
input[type="reset"],
.btn {
    min-height: 38px;

    padding: 7px 14px;

    border: 1px solid var(--primary);
    border-radius: var(--radius-sm);

    background: var(--primary);
    color: #fff;

    font-size: 14px;
    font-weight: 500;

    cursor: pointer;

    transition:
        background-color .15s ease,
        border-color .15s ease,
        box-shadow .15s ease;
}

button:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
input[type="reset"]:hover,
.btn:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #fff;
}

button:focus,
input[type="submit"]:focus,
input[type="button"]:focus,
input[type="reset"]:focus,
.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}


/* ============================================================
   TABLES
   ============================================================ */

.table,
.data-table {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
}

.table th,
.table td,
.data-table th,
.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.table th,
.data-table th {
    background: #f8fafc;
    color: var(--text-secondary);

    font-size: 12px;
    font-weight: 600;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.table tbody tr:hover td,
.data-table tbody tr:hover td {
    background: #f8fafc;
}

.table tr:last-child td,
.data-table tr:last-child td {
    border-bottom: 0;
}


/* ============================================================
   ASP.NET GRIDVIEW
   ============================================================ */

.gridview {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
}

.gridview th {
    padding: 10px 12px;

    background: #f8fafc;
    border-bottom: 1px solid var(--border);

    color: var(--text-secondary);

    font-size: 12px;
    font-weight: 600;
    text-align: left;
}

.gridview td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text);
    vertical-align: middle;
}

.gridview tr:hover td {
    background: #f8fafc;
}


/* ============================================================
   LEGACY PROJECT CLASSES
   These preserve useful existing application components while
   removing the old Artisteer visual treatment.
   ============================================================ */

.TabArea {
    width: 100%;
    padding: 16px;

    border: 1px solid var(--border);
    border-radius: var(--radius-md);

    background: var(--surface);
}

.hoverstyle {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
}

.hoverstyle:hover {
    background: var(--primary-soft);
}

.roundMenu {
    display: block;
    width: 100%;
    padding: 12px;

    border-radius: var(--radius-md);
    background: var(--primary-soft);
    color: var(--primary);
}

.MenuClass {
    background: transparent;
}

.MenuClass a,
.MenuClass a:link,
.MenuClass a:visited {
    display: block;
    padding: 9px 12px;

    border-radius: var(--radius-sm);

    color: var(--text-secondary);
    text-decoration: none;
}

.MenuClass a:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

.TableRound {
    width: 100%;
    padding: 12px;

    overflow-x: auto;

    border: 1px solid var(--border);
    border-radius: var(--radius-md);

    background: var(--surface);
}

img.image {
    border-radius: var(--radius-sm);
}


/* ============================================================
   MODAL
   ============================================================ */

.modalBackground {
    position: fixed;
    inset: 0;
    z-index: 2000;

    background: rgba(15, 23, 42, .55);
}

.modalPopup {
    padding: 20px;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);

    box-shadow: var(--shadow-lg);
}


/* ============================================================
   FOOTER
   ============================================================ */

.app-footer {
    flex: 0 0 auto;

    background: var(--surface);
    border-top: 1px solid var(--border);
}

.app-footer-inner {
    width: 100%;
    max-width: var(--container-width);

    margin: 0 auto;
    padding: 18px 24px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.footer-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 18px;

    min-width: 0;
}

.footer-status-item {
    max-width: 100%;
    color: var(--text-muted);
    font-size: 12px;
}

.footer-status-value {
    color: inherit;
}

.footer-company {
    flex: 0 0 auto;

    text-align: right;

    color: var(--text-muted);
    font-size: 12px;
}

.footer-company a {
    font-weight: 600;
}

.footer-copyright {
    margin-top: 2px;
}

.footer-powered {
    padding: 8px 24px;

    border-top: 1px solid var(--border-light);

    color: var(--text-muted);

    font-size: 11px;
    text-align: center;
}


/* ============================================================
   UTILITY CLASSES
   ============================================================ */

.hidden {
    display: none !important;
}

.text-muted {
    color: var(--text-muted);
}

.text-success {
    color: var(--success);
}

.text-warning {
    color: var(--warning);
}

.text-danger {
    color: var(--danger);
}


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1100px) {

    .app-header-inner {
        gap: 14px;
    }

    .app-navigation a {
        padding-left: 9px;
        padding-right: 9px;
    }

}


@media (max-width: 800px) {

    .app-header {
        position: relative;
    }

    .app-header-inner {
        flex-wrap: wrap;
        padding: 10px 16px;
    }

    .app-brand {
        margin-right: auto;
    }

    .app-navigation {
        order: 3;
        flex-basis: 100%;

        overflow-x: auto;
        padding-top: 4px;
    }

    .app-navigation ul {
        width: max-content;
    }

    .app-header-actions {
        margin-left: 12px;
    }

    .app-main {
        padding-top: 20px;
    }

    .app-container {
        padding-left: 16px;
        padding-right: 16px;
    }

    .content-card {
        padding: 18px;
    }

    .app-footer-inner {
        align-items: flex-start;
        flex-direction: column;
    }

    .footer-company {
        text-align: left;
    }
}


@media (max-width: 520px) {

    .app-brand-name {
        display: none;
    }

    .language-select {
        min-width: 78px;
    }

    .content-card {
        padding: 14px;
        border-radius: var(--radius-md);
    }

    .app-footer-inner {
        padding: 14px 16px;
    }

}


/* =========================================================
   ASP.NET Menu - preservazione icone menu superiore
   =========================================================
   DefaultMenu.ascx usa asp:Menu con MenuItem.ImageUrl.
   Le icone originali sono 48x48; ImageButton1 resta 20x20.
*/

/* Icone dei MenuItem del DefaultMenu.ascx
   NOTA: ContentPlaceHolder non genera necessariamente un elemento
   HTML con id="MenuContentPlaceHolder". Per questo usiamo il
   suffisso dell'id generato da ASP.NET. */
table[id$="Menu1"] img,
table[id$="Menu2"] img,
table[id$="Menu3"] img,
table[id$="MenuCredito"] img,
[id$="_Menu1"] img,
[id$="_Menu2"] img,
[id$="_Menu3"] img,
[id$="_MenuCredito"] img {
    display: inline-block;
    width: 48px;
    height: 48px;
    max-width: 48px;
    max-height: 48px;
    object-fit: contain;
    vertical-align: middle;
    margin: 0;
    padding: 0;
    border: 0;
}

/* Celle generate da ASP.NET Menu */
table[id$="Menu1"] td,
table[id$="Menu2"] td,
table[id$="Menu3"] td,
table[id$="MenuCredito"] td,
[id$="_Menu1"] td,
[id$="_Menu2"] td,
[id$="_Menu3"] td,
[id$="_MenuCredito"] td {
    vertical-align: middle;
}

/* Link dei MenuItem */
table[id$="Menu1"] a,
table[id$="Menu2"] a,
table[id$="Menu3"] a,
table[id$="MenuCredito"] a {
    text-decoration: none;
}

/* Hover senza alterare/ridimensionare l'icona */
table[id$="Menu1"] a:hover img,
table[id$="Menu2"] a:hover img,
table[id$="Menu3"] a:hover img,
table[id$="MenuCredito"] a:hover img {
    opacity: .85;
}

/* ImageButton1 del DefaultMenu.ascx: deve rimanere 20x20 */
img[id$="ImageButton1"],
input[id$="ImageButton1"] {
    width: 20px;
    height: 20px;
    max-width: 20px;
    max-height: 20px;
}


/* -------------------------------------------------------------------------
   Header / menu refinements
   ------------------------------------------------------------------------- */

.app-header-inner {
    min-height: 72px;
    align-items: center;
    position: relative;
}

.app-header-actions {
    margin-left: auto;
    align-self: flex-start;
    padding-top: 10px;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
}

.language-select {
    min-width: 115px;
    height: 32px;
    padding: 4px 30px 4px 10px;
    font-size: 13px;
    border-radius: 6px;
}

/* ASP.NET Menu: reduce the vertical space around DefaultMenu. */
.app-navigation {
    min-height: 0;
    padding: 0;
}

.app-navigation-inner {
    min-height: 0;
    padding: 0;
    margin: 0;
}

.app-navigation-inner > table,
.app-navigation-inner > div,
.app-navigation-inner > ul {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Common ASP.NET Menu table output. */
.app-navigation-inner table {
    margin-top: 0;
    margin-bottom: 0;
    border-spacing: 0;
}

.app-navigation-inner td {
    padding-top: 0;
    padding-bottom: 0;
}

/* Keep the original 48px menu icons, but avoid adding extra vertical padding. */
.app-navigation-inner img {
    vertical-align: middle;
}

/* DefaultMenu's 52px Menu1 is reduced visually to a compact menu strip. */
.app-navigation-inner table[id$="Menu1"] {
    height: auto !important;
}

.app-navigation-inner table[id$="Menu1"] td {
    height: auto !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* When the ASP.NET Menu renders UL/LI instead of a table. */
.app-navigation-inner ul {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.app-navigation-inner li {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Do not let the menu create an unnecessarily tall header. */
.app-header .app-navigation {
    line-height: 1;
}

@media (max-width: 800px) {
    .app-header-inner {
        flex-wrap: wrap;
    }

    .app-header-actions {
        padding-top: 0;
    }
}


/* Final header positioning:
   keep the menu slightly below the top of the page, as in the previous version */
.app {
    padding-top: 28px;
}

.app-header {
    margin-top: 0;
}

.app-header-inner {
    min-height: 72px;
    align-items: center;
    position: relative;
}

.app-header-actions {
    margin-left: auto;
    align-self: flex-start;
    padding-top: 10px;
}

/* Compact menu strip without moving it to the very top */
.app-navigation,
.app-navigation-inner {
    min-height: 0;

}

.app-navigation-inner > table,
.app-navigation-inner > div,
.app-navigation-inner > ul {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.app-navigation-inner td {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}


/* Final language selector alignment: center it vertically in the header.
   This rule is deliberately last so it overrides earlier header rules. */
.app-header-actions {
    margin-left: auto;
    align-self: center;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: auto;
}

.app-header-actions .language-select {
    margin: 0;
    align-self: center;
}

/* Gestione note informative. */

blockquote {
    width: 100% !important;
    max-width: 500px;

    margin: 16px 0;
    padding: 14px 16px 14px 48px;
    box-sizing: border-box;

    background-color: #f1f3f5;
    background-image: url('/images/postquote.png');
    background-position: 14px 14px;
    background-repeat: no-repeat;

    border: 1px solid #d9dde1;
    border-radius: 8px;

    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

blockquote p {
    margin: 0;
}

/* Nome utente */
#ctl00_MenuContentPlaceHolder_DefaultMenuContent_LoginView1_LoginView1 {
    display: inline-block;
    vertical-align: center;
}

/* Logout sotto il nome, centrato */
#ctl00_MenuContentPlaceHolder_DefaultMenuContent_LoginStatus1 {
    display: block !important;
    width: fit-content !important;
    margin-left: auto !important;
    margin-right: 0 !important;
    margin-top: 10px !important;
}

.app-logo {
    display: block;
    height: 48px;
    width: auto;
}

