/* =============================================================================
   ProjectsTracking: veste grafica AMUS (la stessa di BeManager e Business Sede):
   tema Radzen "standard" / "standard-dark", palette AMUS, testata e menu laterale blu, logo AMUS.
   ============================================================================= */

html, body {
    margin: 0;
    height: 100%;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

input, button, select, textarea {
    font-family: inherit;
}

h1:focus {
    outline: none;
}

/* ---- Palette AMUS ---- */
:root {
    --amus-blu: #3868b0;          /* testata, pulsanti primari */
    --amus-blu-scuro: #305c9c;    /* logo, hover */
    --amus-blu-scurissimo: #2c5590;
    --amus-blu-attivo: #245775;   /* voce di menu attiva */
    --amus-blu-tenue: #cfe0f1;
    --amus-blu-tenue-testo: #20456e;
    --amus-grigio-blu: #eef2f7;
    --amus-gruppo: #d5e3ee;       /* intestazioni di gruppo */
    --amus-gruppo-testo: #2f4a5e;
    --amus-riga-alterna: #e6edf4;
    --amus-bordo: #c9d6e3;
    --amus-giallo: #ffd800;
    --amus-giallo-tenue: #fff6bf;
    --amus-verde: #00a65a;
    --amus-arancio: #f39c12;
    --amus-rosso: #dd4b39;
    --amus-testo-tenue: #6b7a8a;

    --rz-primary: var(--amus-blu);
    --rz-primary-light: #5a83c0;
    --rz-primary-lighter: var(--amus-blu-tenue);
    --rz-primary-dark: var(--amus-blu-scuro);
    --rz-primary-darker: var(--amus-blu-scurissimo);
    --rz-success: var(--amus-verde);
    --rz-success-dark: #008d4c;
    --rz-warning: var(--amus-arancio);
    --rz-warning-dark: #e08e0b;
    --rz-danger: var(--amus-rosso);
    --rz-danger-dark: #d73925;
    --rz-grid-stripe-background-color: var(--amus-riga-alterna);

    /* menu laterale blu, voce attiva blu scuro con l'indicatore giallo */
    --rz-sidebar-background-color: var(--amus-blu);
    --rz-sidebar-border-inline-end: 1px solid var(--amus-blu-scuro);
    --rz-sidebar-toggle-background-color: var(--amus-blu-scuro);
    --rz-sidebar-toggle-color: #fff;
    --rz-sidebar-toggle-hover-background-color: var(--amus-blu-scurissimo);
    --rz-sidebar-toggle-hover-color: #fff;
    --rz-sidebar-toggle-border: 1px solid var(--amus-blu-scuro);
    --rz-panel-menu-item-background-color: var(--amus-blu);
    --rz-panel-menu-item-color: #e1e1ea;
    --rz-panel-menu-icon-color: #e1e1ea;
    --rz-panel-menu-item-border: 1px solid var(--amus-blu-scuro);
    --rz-panel-menu-item-hover-background-color: var(--amus-blu-scuro);
    --rz-panel-menu-item-active-background-color: var(--amus-blu-attivo);
    --rz-panel-menu-item-active-indicator: var(--amus-giallo);
}

/* ---- Layout, testata e menu ---- */
.pt-layout { --pt-sidebar-width: 240px; height: 100vh; grid-template-columns: auto 1fr; }
.pt-header { background: var(--amus-blu); border-bottom: 1px solid var(--amus-blu-scuro); box-shadow: none; color: #fff; }
.pt-header-row { height: 3.25rem; padding: 0 .75rem 0 .25rem; flex-wrap: nowrap; }
.pt-header .rz-sidebar-toggle, .pt-header .rz-sidebar-toggle .rzi { color: #fff; }
.pt-header .rz-sidebar-toggle:hover { background: var(--amus-blu-scuro); }
.pt-brand { display: flex; align-items: center; gap: .4rem; color: #fff; text-decoration: none; font-weight: 600; font-size: 1.05rem; white-space: nowrap; }
.pt-brand small, .pt-login-header small { font-weight: 400; font-style: italic; color: var(--amus-blu-tenue); margin-left: .1rem; font-size: 1em; }
.pt-logo { width: 1.9rem; height: 1.9rem; display: block; background: #fff; border-radius: 6px; padding: 2px; box-sizing: border-box; }
.pt-spacer { flex: 1; }
.pt-theme { display: inline-flex; margin-left: .25rem; }
.pt-theme .rz-button { color: #fff !important; background: transparent !important; box-shadow: none !important; }
.pt-theme .rz-button:hover { background: var(--amus-blu-scuro) !important; }
/* pulsanti della testata (vista cliente) */
.pt-header-form { margin: 0; }
.pt-header-button { display: inline-flex; align-items: center; gap: .35rem; height: 2.25rem; padding: 0 .6rem; border: 0; border-radius: 4px;
                    background: transparent; color: #fff; font-size: .875rem; cursor: pointer; white-space: nowrap; }
.pt-header-button .rzi { color: #fff; }
.pt-header-button:hover { background: var(--amus-blu-scuro); }
.pt-header-button.active { background: var(--amus-giallo); color: #222; }
.pt-header-button.active .rzi { color: #222; }
/* menu dell'utente in alto a destra */
.pt-user-menu { position: relative; margin-left: .25rem; }
.pt-user { display: inline-flex; align-items: center; gap: .35rem; height: 2.25rem; padding: 0 .5rem; border-radius: 4px; font-size: .875rem; color: #fff; white-space: nowrap; cursor: pointer; list-style: none; user-select: none; }
.pt-user::-webkit-details-marker { display: none; }
.pt-user::marker { content: ""; }
.pt-user .rzi { color: #fff; }
.pt-user:hover, .pt-user-menu[open] > .pt-user { background: var(--amus-blu-scuro); }
.pt-user-items { position: absolute; right: 0; top: calc(100% + 4px); min-width: 12rem; padding: .25rem 0; z-index: 1000;
                 background: var(--rz-base-background-color, #fff); border: 1px solid var(--rz-base-300, #dee2e6); border-radius: 4px; box-shadow: 0 4px 12px rgba(0, 0, 0, .18); }
.pt-user-items form { margin: 0; }
.pt-user-info { padding: .4rem .9rem; font-size: .75rem; color: var(--rz-text-secondary-color, #6b7a8a); border-bottom: 1px solid var(--rz-base-300, #dee2e6); }
.pt-user-item { display: flex; align-items: center; gap: .5rem; width: 100%; padding: .5rem .9rem; border: 0; background: transparent; font-size: .875rem; text-align: left;
                color: var(--rz-text-color, #212529); text-decoration: none; cursor: pointer; }
.pt-user-item .rzi { color: var(--rz-text-secondary-color, #6b7a8a); font-size: 1.15rem; }
.pt-user-item:hover { background: var(--rz-base-200, #e9ecef); }
.pt-sidebar { width: var(--pt-sidebar-width); display: flex; flex-direction: column; }
/* versione in basso a sinistra, sotto i menu */
.pt-version { margin-top: auto; padding: .5rem 1rem; font-size: .75rem; color: rgba(255, 255, 255, .75); border-top: 1px solid rgba(255, 255, 255, .2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-menu { font-size: .875rem; }
.pt-menu .rz-navigation-item-link { padding-top: .45rem; padding-bottom: .45rem; }
.pt-body { overflow-y: auto; background: var(--rz-base-background-color, #f8f9fa); background-image: none; padding: 0; }
/* Radzen mette translateZ(0) su .rz-body: i dialoghi fissi si posizionerebbero rispetto al contenuto che scorre */
.rz-layout.pt-layout .pt-body { transform: none; }
.content { padding: .75rem 1rem; }
.rz-data-grid { max-width: 100%; }
@media (max-width: 768px) { .pt-hide-small { display: none; } }

/* striscia gialla della vista "come cliente" */
.pt-customer-view-banner { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: .5rem; padding: .4rem 1rem;
                           background: var(--amus-giallo); color: #222; font-size: .875rem; font-weight: 600; }
.pt-customer-view-banner form { margin: 0 0 0 auto; }
.pt-customer-view-banner button { border: 1px solid #222; border-radius: 4px; background: transparent; color: #222; padding: .15rem .75rem; cursor: pointer; font-weight: 600; }
.pt-customer-view-banner button:hover { background: rgba(0, 0, 0, .08); }

/* ---- Intestazione di pagina e riquadri numerici ---- */
.page-header { display: flex; align-items: center; gap: .6rem; margin-bottom: .75rem; }
.page-header .rzi { color: var(--rz-primary); font-size: 1.8rem; }
.page-header h1 { font-size: 1.25rem; margin: 0; }
.page-header small { display: block; font-size: .8rem; color: var(--rz-text-secondary-color, #6c757d); }
.kpi-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem; }
.kpi { flex: 1 1 11rem; display: flex; align-items: center; gap: .75rem; border: 1px solid var(--amus-bordo); border-radius: 4px; padding: .5rem .75rem; background: var(--amus-grigio-blu); }
.kpi .rzi { color: var(--amus-blu); font-size: 1.8rem; }
.kpi-value { font-size: 1.25rem; font-weight: 700; color: var(--amus-blu); line-height: 1.1; }
.kpi-title { font-size: .75rem; color: var(--amus-testo-tenue); }

/* ---- Pagina Log ---- */
.pt-log-grid td .rz-cell-data { white-space: normal !important; overflow: visible; text-overflow: clip; }
.pt-log-message { font-family: Consolas, 'Courier New', monospace; font-size: .8rem; word-break: break-word; }
.pt-log-detail { margin: 0; padding: .5rem .75rem; font-size: .75rem; white-space: pre-wrap; word-break: break-word; background: var(--amus-grigio-blu); border-left: 3px solid var(--amus-rosso); }
.pt-log-level { font-size: .75rem; font-weight: 700; padding: .05rem .4rem; border-radius: 3px; }
.pt-log-info { color: var(--amus-blu); }
.pt-log-warn { background: var(--amus-arancio); color: #fff; }
.pt-log-error, .pt-log-fatal { background: var(--amus-rosso); color: #fff; }
.pt-log-debug, .pt-log-trace { color: var(--amus-testo-tenue); }

/* ---- Pagine statiche di accesso e primo avvio ---- */
.pt-login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; box-sizing: border-box; background: var(--amus-grigio-blu); }
.pt-login-card { width: 100%; max-width: 28rem; padding: 0 !important; overflow: hidden; border-color: var(--amus-bordo) !important; }
.pt-login-header { display: flex; align-items: center; gap: .5rem; padding: .75rem 1rem; background: var(--amus-blu); color: #fff; font-weight: 600; font-size: 1.05rem; }
.pt-login-body { padding: 1rem 1.25rem 1.25rem; }
.pt-ms-button { display: flex; align-items: center; justify-content: center; gap: .75rem; width: 100%; min-height: 2.75rem; padding: .5rem 1rem;
    background: #fff; color: #1b1b1b; border: 1px solid #5e5e5e; border-radius: 4px; font: inherit; font-size: 1rem; font-weight: 600;
    cursor: pointer; box-shadow: 0 1px 2px rgba(0, 0, 0, .12); transition: background .15s, box-shadow .15s; }
.pt-ms-button:hover { background: #f3f3f3; box-shadow: 0 2px 6px rgba(0, 0, 0, .18); }
.pt-ms-button:focus-visible { outline: 2px solid var(--amus-blu); outline-offset: 2px; }
.pt-ms-button:active { background: #e8e8e8; }
.pt-login-or { display: flex; align-items: center; gap: .75rem; margin: 1rem 0; color: var(--amus-testo-tenue); font-size: .8rem; }
.pt-login-or::before, .pt-login-or::after { content: ""; flex: 1; border-top: 1px solid var(--amus-bordo); }
.pt-login-admin { margin-top: 1rem; font-size: .875rem; }
.pt-login-admin > summary { cursor: pointer; color: var(--amus-testo-tenue); margin-bottom: .75rem; }
.pt-field { width: 100%; box-sizing: border-box; }
.pt-error { color: var(--rz-danger); }

/* ==== Tema scuro (standard-dark): il layout prende la classe theme-dark ==== */
.theme-dark {
    --amus-blu-tenue: #24405f;
    --amus-blu-tenue-testo: #d6e4f4;
    --amus-grigio-blu: #1d2733;
    --amus-gruppo: #253244;
    --amus-gruppo-testo: #c9d6e3;
    --amus-riga-alterna: #1a232e;
    --amus-bordo: #34475c;
    --amus-testo-tenue: #9aa8b8;
    --rz-primary-lighter: #24405f;
    --rz-grid-stripe-background-color: #1a232e;

    /* il foglio di standard-dark, aggiunto dopo app.css quando si cambia tema, ridefinisce anche questi */
    --rz-primary: var(--amus-blu);
    --rz-panel-menu-item-color: #e1e1ea;
    --rz-panel-menu-icon-color: #e1e1ea;
    --rz-panel-menu-item-active-indicator: var(--amus-giallo);
    --rz-sidebar-background-color: #1f3d66;
    --rz-sidebar-border-inline-end: 1px solid #172f50;
    --rz-panel-menu-item-background-color: #1f3d66;
    --rz-panel-menu-item-border: 1px solid #172f50;
    --rz-panel-menu-item-hover-background-color: #264a7a;
    --rz-panel-menu-item-active-background-color: #173350;
}
.theme-dark .pt-header { background: #24426f; border-bottom-color: #1b3356; }
.theme-dark .pt-brand small { color: #cfe0f1; }
.theme-dark .kpi .rzi, .theme-dark .kpi-value { color: #9cc0ea; }

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* ---- Certificato per Entra (pagina Impostazioni) ---- */
.pt-cert { border-collapse: collapse; margin-bottom: .5rem; font-size: .875rem; }
.pt-cert th { text-align: left; font-weight: 600; padding: .15rem 1rem .15rem 0; color: var(--amus-testo-tenue); white-space: nowrap; }
.pt-cert td { padding: .15rem 0; word-break: break-all; }
.pt-guide { font-size: .875rem; }
.pt-guide summary { cursor: pointer; color: var(--rz-primary); }
.pt-guide ol { margin: .5rem 0 0 1.25rem; padding: 0; }
.pt-guide li { margin-bottom: .25rem; }

/* ---- Progetti, rilasci e task ---- */
.pt-breadcrumb { font-size: .8rem; color: var(--amus-testo-tenue); margin: -.5rem 0 .75rem; }
.pt-breadcrumb a { color: var(--rz-primary); text-decoration: none; }
.pt-breadcrumb a:hover { text-decoration: underline; }
.pt-description { white-space: pre-wrap; margin-bottom: .75rem; }
.pt-facts { font-size: .875rem; }
.pt-facts small { display: block; font-size: .7rem; color: var(--amus-testo-tenue); text-transform: uppercase; letter-spacing: .02em; }
.pt-clickable .rz-data-row { cursor: pointer; }
.pt-state, .pt-waiting { display: inline-flex; align-items: center; gap: .25rem; padding: .05rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 600; white-space: nowrap; line-height: 1.5; }
.pt-state { color: #fff; background: var(--pt-state-color, #6b7a8a); }
.pt-state .rzi, .pt-waiting .rzi { font-size: .95rem; color: inherit; }
/* priorita' 1-4 di rilasci e task: rosso critica, arancio alta, blu media, grigio bassa */
.pt-prio { display: inline-block; padding: .05rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 600; white-space: nowrap; line-height: 1.5; border: 1px solid currentColor; }
.pt-prio-1 { color: #b42318; background: #fdecea; }
.pt-prio-2 { color: #b54708; background: #fff3e0; }
.pt-prio-3 { color: #1d4f91; background: #e8f0fb; }
.pt-prio-4 { color: #5b6573; background: #eef1f4; }
.pt-prio-cell { width: 100%; max-width: 10rem; }
.pt-prio-cell .rz-dropdown { box-sizing: border-box; width: 100%; min-width: 0; }
.pt-prio-select.rz-dropdown { font-weight: 600; border-color: currentColor; }
.pt-prio-select .rz-dropdown-label, .pt-prio-select .rz-dropdown-trigger-icon { color: inherit; }
.pt-fact-edit { display: inline-flex; flex-direction: column; }
.theme-dark .pt-prio-1 { color: #ff9b8f; background: #3d1c19; }
.theme-dark .pt-prio-2 { color: #ffb963; background: #3a2a14; }
.theme-dark .pt-prio-3 { color: #9cc0ea; background: #1c2d44; }
.theme-dark .pt-prio-4 { color: #b6c0cc; background: #2a3038; }
.pt-waiting { margin-left: .35rem; background: var(--amus-giallo); color: #222; }
.pt-notify { display: inline-flex; align-items: center; flex-wrap: wrap; gap: .25rem; }
.pt-notify-to { color: var(--amus-testo-tenue); margin-left: .35rem; }
.pt-confirm { border: 1px solid var(--amus-bordo); border-radius: 4px; padding: .5rem .75rem; background: var(--amus-grigio-blu); }
.pt-tree-title { display: inline-flex; align-items: center; gap: .3rem; }
.pt-tree-title .rzi { font-size: 1rem; color: var(--amus-testo-tenue); }
.pt-tree-branch { color: var(--amus-bordo); }
.pt-tree-grid td .rz-cell-data { overflow: visible; }
.pt-timeline { list-style: none; margin: 0; padding: 0; }
.pt-timeline > li { padding: .4rem 0; border-bottom: 1px solid var(--rz-base-200, #e9ecef); }
.pt-comment-head { display: flex; align-items: center; gap: .4rem; font-size: .8rem; }
.pt-comment-head > span { color: var(--amus-testo-tenue); }
.pt-comment-head .rzi { font-size: 1.1rem; color: var(--amus-blu); }
.pt-comment.customer .pt-comment-head .rzi { color: var(--amus-arancio); }
.pt-comment-text { white-space: pre-wrap; margin: .2rem 0 0 1.5rem; font-size: .9rem; }
.pt-comment.internal { background: var(--amus-giallo-tenue); padding-left: .4rem; padding-right: .4rem; }
.pt-internal-tag { display: inline-flex; align-items: center; gap: .15rem; font-size: .7rem; font-weight: 600; color: #8a6d00 !important; }
.pt-internal-tag .rzi { font-size: .9rem !important; color: #8a6d00 !important; }
.pt-event { display: flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--amus-testo-tenue); }
.pt-event .rzi { font-size: 1rem; }
.pt-event small { margin-left: auto; white-space: nowrap; }
.pt-attachments { list-style: none; margin: 0; padding: 0; font-size: .875rem; }
.pt-attachments li { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem; padding: .25rem 0; border-bottom: 1px solid var(--rz-base-200, #e9ecef); }
.pt-attachments li small { flex-basis: 100%; padding-left: 1.6rem; color: var(--amus-testo-tenue); }
/* commento o allegato aperto dal link di una notifica */
.pt-target { outline: 2px solid var(--rz-primary, #3868b0); outline-offset: 2px; border-radius: 4px; transition: outline-color .6s; }
.pt-attachments .rzi { font-size: 1.1rem; color: var(--amus-testo-tenue); }
.pt-upload { display: flex; flex-direction: column; gap: .4rem; font-size: .85rem; }
/* area di caricamento: l'input file la copre tutta, cosi' riceve anche i file trascinati */
.pt-dropzone { position: relative; display: flex; align-items: center; gap: .5rem; padding: .9rem 1rem; border: 2px dashed var(--amus-bordo); border-radius: 6px; color: var(--amus-testo-tenue); cursor: pointer; transition: background .15s, border-color .15s; }
.pt-dropzone:hover, .pt-dropzone:focus-within { border-color: var(--amus-blu); background: rgba(56, 104, 176, .06); color: inherit; }
.pt-dropzone input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.pt-dropzone .rzi { font-size: 1.5rem; }
/* e-mail allegate */
.pt-mail-head { display: grid; grid-template-columns: max-content 1fr; gap: .2rem .9rem; margin: 0 0 .75rem; font-size: .9rem; }
.pt-mail-head dt { color: var(--amus-testo-tenue); }
.pt-mail-head dd { margin: 0; overflow-wrap: anywhere; }
.pt-mail-attachments { margin-bottom: .75rem; }
.pt-mail-body { width: 100%; height: 50vh; border: 1px solid var(--amus-bordo); border-radius: 4px; background: #fff; }
.pt-mail-text { white-space: pre-wrap; font-family: inherit; font-size: .9rem; max-height: 50vh; overflow: auto; border: 1px solid var(--amus-bordo); border-radius: 4px; padding: .5rem .75rem; margin: 0; }
.pt-color { width: 4rem; height: 2.4rem; padding: 2px; border: 1px solid var(--amus-bordo); border-radius: 4px; background: transparent; }
.pt-dash-list { list-style: none; margin: 0; padding: 0; font-size: .875rem; }
.pt-dash-list li { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; padding: .3rem 0; border-bottom: 1px solid var(--rz-base-200, #e9ecef); }
.pt-dash-list a { color: inherit; text-decoration: none; }
.pt-dash-list a:hover { color: var(--rz-primary); text-decoration: underline; }
.pt-dash-list small { flex-basis: 100%; color: var(--amus-testo-tenue); }
.theme-dark .pt-comment.internal { background: rgba(255, 216, 0, .12); }
.theme-dark .pt-confirm { background: rgba(255, 255, 255, .04); }
