/* 1.0.151: the «Inserisci edizione» look (light page, white rounded cards, filled
   fields, blue pill buttons, underlined tabs) for every page of the portal.
   Only the content area (main) is touched: the left menu, the header and the chat
   keep their own style. ":not(#theme151)" lifts the rules above the older
   page stylesheets without !important. Mail and composer keep their dense layout. */
:root{
  --t151-bg:#f8fafd;--t151-card:#fff;--t151-field:#f0f4f9;--t151-field-hover:#e7edf5;
  --t151-blue:#0b57d0;--t151-blue-dark:#0842a0;--t151-blue-soft:#d3e3fd;
  --t151-ink:#1f1f1f;--t151-label:#444746;--t151-muted:#747775;--t151-line:#e1e3e1;--t151-outline:#c4c7c5;
  --t151-shadow:0 1px 2px rgba(60,64,67,.12),0 1px 3px 1px rgba(60,64,67,.05);
}

/* Page ------------------------------------------------------------------- */
body.portal-shell:not(#theme151)>main,
body.portal-shell:not(#theme151)>main:has(.system-page){background:var(--t151-bg);color:var(--t151-ink)}
body.portal-shell:not(#theme151)>main .system-page{--system-ink:var(--t151-ink)!important;--system-muted:var(--t151-muted)!important;--system-primary:var(--t151-blue)!important;--system-accent:var(--t151-blue)!important;--system-border:transparent!important;color:var(--t151-ink)!important}
body.portal-shell:not(#theme151)>main :is(.page-head,.system-head) h1{font-size:22px!important;font-weight:500!important;color:var(--t151-ink)!important;letter-spacing:0!important}
body.portal-shell:not(#theme151)>main :is(.eyebrow,.system-kicker){color:var(--t151-muted)!important;letter-spacing:.08em!important}
body.portal-shell:not(#theme151)>main :is(.page-head,.system-head) p:not(.eyebrow):not(.system-kicker),
body.portal-shell:not(#theme151)>main :is(.muted,.system-meta){color:var(--t151-muted)!important}

/* Cards: white, 24px corners, soft shadow, no border ---------------------- */
body.portal-shell:not(#theme151)>main :is(.card,.system-card,.wizard-card,.login-card,.perm-card){background:var(--t151-card)!important;border:0!important;border-radius:24px!important;box-shadow:var(--t151-shadow)!important;padding:22px 26px!important}
body.portal-shell:not(#theme151)>main :is(.card,.system-card)>h2:first-child{display:block!important;width:fit-content!important;color:var(--t151-ink)!important;font-size:17px!important;font-weight:500!important;margin:0 0 14px!important;padding:0 0 8px!important;border-bottom:3px solid var(--t151-blue)!important}

/* Labels and helper text --------------------------------------------------- */
body.portal-shell:not(#theme151)>main:not(:has(.mail-shell)) label{color:var(--t151-ink)!important;font-weight:500!important}
body.portal-shell:not(#theme151)>main :is(.catalog-hint,.form-hint,small.muted){color:var(--t151-muted)!important}

/* Filled fields ------------------------------------------------------------ */
body.portal-shell:not(#theme151)>main :is(input:is([type=text],[type=email],[type=url],[type=search],[type=password],[type=number],[type=tel],[type=date],[type=time],[type=datetime-local],:not([type])),select,textarea):not(.mail-shell *):not([class*=composer] *):not([class*=compose] *){
  background:var(--t151-field)!important;border:1px solid transparent!important;border-radius:6px!important;color:var(--t151-ink)!important;min-height:46px!important;padding:10px 14px!important;box-shadow:none!important;font:inherit!important;font-size:14px!important;box-sizing:border-box!important}
body.portal-shell:not(#theme151)>main textarea:not(.mail-shell *):not([class*=composer] *):not([class*=compose] *){min-height:96px!important;line-height:1.5!important}
body.portal-shell:not(#theme151)>main :is(input,select,textarea):not(.mail-shell *):not([class*=composer] *):not([class*=compose] *):hover{background-color:var(--t151-field-hover)!important}
body.portal-shell:not(#theme151)>main :is(input,select,textarea):not(.mail-shell *):not([class*=composer] *):not([class*=compose] *):focus{background-color:#fff!important;border-color:var(--t151-blue)!important;outline:none!important;box-shadow:0 0 0 1px var(--t151-blue)!important}
body.portal-shell:not(#theme151)>main :is(input,select,textarea):disabled{opacity:.6!important}
body.portal-shell:not(#theme151)>main :is(input[type=checkbox],input[type=radio]){accent-color:var(--t151-blue)!important}

/* Buttons: primary blue pill, secondary outlined ------------------------------ */
body.portal-shell:not(#theme151)>main :is(.system-button,.button-link,.secondary-button,.danger-button,.wizard-primary,
  :is(.card,.system-card,.form-actions,.training-form-actions,.wizard-actions) button:not([class]),button[type=submit]:not([class]),
  :is(.card,.system-card) button.primary):not(.icon-only){
  display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:8px!important;min-height:40px!important;padding:0 24px!important;border-radius:8px!important;
  border:1px solid var(--t151-blue)!important;background:var(--t151-blue)!important;color:#fff!important;font-size:14px!important;font-weight:500!important;
  text-decoration:none!important;box-shadow:none!important;cursor:pointer!important;line-height:1.2!important}
body.portal-shell:not(#theme151)>main :is(.system-button,.button-link,.secondary-button,.danger-button,.wizard-primary,
  :is(.card,.system-card,.form-actions,.training-form-actions,.wizard-actions) button:not([class]),button[type=submit]:not([class]),
  :is(.card,.system-card) button.primary):not(.icon-only):not(:disabled):hover{background:var(--t151-blue-dark)!important;border-color:var(--t151-blue-dark)!important;color:#fff!important}
/* Secondary: white with a thin grey outline, like «Scegli dal calendario». */
body.portal-shell:not(#theme151):not(#theme151-b)>main :is(.system-button:not(.primary),.button-link.secondary,.secondary-button,.secondary:is(button,a)){
  background:#fff!important;border:1px solid var(--t151-outline)!important;color:var(--t151-ink)!important;border-radius:8px!important}
body.portal-shell:not(#theme151):not(#theme151-b)>main :is(.system-button:not(.primary),.button-link.secondary,.secondary-button,.secondary:is(button,a)):not(:disabled):hover{background:var(--t151-field)!important;border-color:var(--t151-outline)!important;color:var(--t151-ink)!important}
body.portal-shell:not(#theme151):not(#theme151-b)>main :is(.system-button.danger,.danger-button,button.danger){background:#fff!important;border:1px solid #f2b8b5!important;color:#b3261e!important;border-radius:8px!important}
body.portal-shell:not(#theme151):not(#theme151-b)>main :is(.system-button.danger,.danger-button,button.danger):not(:disabled):hover{background:#fce8e6!important;border-color:#f2b8b5!important;color:#8c1d18!important}
body.portal-shell:not(#theme151):not(#theme151-b)>main .system-button.icon-only{border-radius:50%!important;border-color:transparent!important;background:transparent!important;color:var(--t151-label)!important}
body.portal-shell:not(#theme151):not(#theme151-b)>main .system-button.icon-only:hover{background:var(--t151-field)!important}
body.portal-shell:not(#theme151):not(#theme151-b)>main .system-button.icon-only.danger{color:#b3261e!important}
body.portal-shell:not(#theme151)>main :is(button,a):focus-visible{outline:2px solid var(--t151-blue)!important;outline-offset:2px!important}

/* Tabs: plain text, blue with a 3px underline when selected ----------------- */
body.portal-shell:not(#theme151)>main :is([role=tablist],.history75-tabs){display:flex!important;gap:4px!important;border-bottom:1px solid var(--t151-line)!important;background:transparent!important}
body.portal-shell:not(#theme151)>main :is([role=tab],.history75-tabs>a,.history75-tabs>button){background:transparent!important;border:0!important;border-bottom:3px solid transparent!important;border-radius:0!important;color:var(--t151-label)!important;font-weight:500!important;padding:10px 14px!important;box-shadow:none!important}
body.portal-shell:not(#theme151)>main :is([role=tab][aria-selected=true],.history75-tabs>[aria-current],.history75-tabs>.active,.history75-tabs>.is-active){color:var(--t151-blue)!important;border-bottom-color:var(--t151-blue)!important;background:transparent!important}

/* Tables ------------------------------------------------------------------- */
body.portal-shell:not(#theme151)>main :is(.table-wrap,.training-table-wrap,.ui-table-scroll){border:0!important;border-radius:16px!important;background:var(--t151-card)!important}
body.portal-shell:not(#theme151)>main:not(:has(.mail-shell)) table th{background:transparent!important;color:var(--t151-label)!important;font-size:12px!important;font-weight:500!important;text-transform:none!important;letter-spacing:0!important;border-bottom:1px solid var(--t151-line)!important}
body.portal-shell:not(#theme151)>main:not(:has(.mail-shell)) table td{border-bottom:1px solid var(--t151-line)!important;color:var(--t151-ink)!important}
body.portal-shell:not(#theme151)>main:not(:has(.mail-shell)) table tbody tr:hover td{background:#f6f9fd!important}

/* Messages ----------------------------------------------------------------- */
body.portal-shell:not(#theme151)>main :is(.system-notice,.notice:not(.error)){background:#e8f0fe!important;border:0!important;border-radius:12px!important;color:#0b3a8c!important}
body.portal-shell:not(#theme151)>main :is(.system-error,.system-notice.is-error,.system-notice.error,.notice.error){background:#fce8e6!important;border:0!important;border-radius:12px!important;color:#8c1d18!important}
body.portal-shell:not(#theme151)>main .status-ok{background:#e6f4ea!important;border:0!important;border-radius:12px!important;color:#0d652d!important;padding:12px 16px!important}

/* Checkbox rows: box and text on one line. */
body.portal-shell:not(#theme151)>main :is(label.checkbox,label.training-checkbox,.training-checkbox label){display:flex!important;align-items:center!important;gap:10px!important;width:auto!important}
body.portal-shell:not(#theme151)>main :is(label.checkbox,label.training-checkbox,.training-checkbox label) input{width:18px!important;height:18px!important;min-height:0!important;margin:0!important;flex:0 0 auto!important}
/* Icon buttons (save, delete) made by modern-ui.js: round; save in blue. */
body.portal-shell:not(#theme151):not(#theme151-b)>main .vector-action{border-radius:50%!important;min-width:40px!important;min-height:40px!important;padding:0!important}
body.portal-shell:not(#theme151):not(#theme151-b)>main .vector-action:not(.delete-icon-button):not(.secondary){background:var(--t151-blue)!important;border:1px solid var(--t151-blue)!important;color:#fff!important}
body.portal-shell:not(#theme151):not(#theme151-b)>main .vector-action:not(.delete-icon-button):not(.secondary):not(:disabled):hover{background:var(--t151-blue-dark)!important;border-color:var(--t151-blue-dark)!important}
body.portal-shell:not(#theme151):not(#theme151-b)>main .vector-action.delete-icon-button{background:#fff!important;border:1px solid #f2b8b5!important;color:#b3261e!important}
/* Hidden stays hidden, whatever display the rules above give. */
body.portal-shell:not(#theme151):not(#theme151-b):not(#theme151-c)>main [hidden]{display:none!important}
/* 1.0.183: alternating grey rows in every table (light, then darker); the mail list keeps its own look.
   Selected rows and rows flagged by an import keep their colour. */
body.portal-shell:not(#theme151):not(#theme151-b):not(#theme151-c)>main:not(:has(.mail-shell)) table>tbody>tr:nth-child(odd)>td{background:#f3f5f7!important}
body.portal-shell:not(#theme151):not(#theme151-b):not(#theme151-c)>main:not(:has(.mail-shell)) table>tbody>tr:nth-child(even)>td{background:#e3e8ed!important}
body.portal-shell:not(#theme151):not(#theme151-b):not(#theme151-c)>main:not(:has(.mail-shell)) table>tbody>tr>td{border-bottom-color:#fff!important}
body.portal-shell:not(#theme151):not(#theme151-b):not(#theme151-c)>main:not(:has(.mail-shell)) table>tbody>tr:hover>td{background:#d6e6f3!important}
body.portal-shell:not(#theme151):not(#theme151-b):not(#theme151-c)>main:not(:has(.mail-shell)) table>tbody>tr:is(.is-selected,.history75-selected,:has(>td input[type=checkbox]:checked))>td{background:#cfe3f5!important}
body.portal-shell:not(#theme151):not(#theme151-b):not(#theme151-c)>main:not(:has(.mail-shell)) table>tbody>tr.training-csv-error>td{background:#fdecec!important}
body.portal-shell:not(#theme151):not(#theme151-b):not(#theme151-c)>main:not(:has(.mail-shell)) table>tbody>tr.training-csv-duplicate>td{background:#fdf3df!important}
/* 1.0.185: row headers follow their row; lists that are not tables alternate too. */
body.portal-shell:not(#theme151):not(#theme151-b):not(#theme151-c)>main:not(:has(.mail-shell)) table>tbody>tr:nth-child(odd)>th{background:#f3f5f7!important}
body.portal-shell:not(#theme151):not(#theme151-b):not(#theme151-c)>main:not(:has(.mail-shell)) table>tbody>tr:nth-child(even)>th{background:#e3e8ed!important}
body.portal-shell:not(#theme151):not(#theme151-b):not(#theme151-c)>main:not(:has(.mail-shell)) table>tbody>tr:hover>th{background:#d6e6f3!important}
body.portal-shell:not(#theme151):not(#theme151-b):not(#theme151-c)>main :is(.user-row,.contact-row,.backup-row,.backup-queue-row,.updates-release-row,.template-row){padding-left:14px!important;padding-right:14px!important;border:0!important;border-radius:10px!important;margin-bottom:4px}
body.portal-shell:not(#theme151):not(#theme151-b):not(#theme151-c)>main :is(.user-row,.contact-row,.backup-row,.backup-queue-row,.updates-release-row,.template-row,.perm-row):nth-of-type(odd){background:#f3f5f7!important}
body.portal-shell:not(#theme151):not(#theme151-b):not(#theme151-c)>main :is(.user-row,.contact-row,.backup-row,.backup-queue-row,.updates-release-row,.template-row,.perm-row):nth-of-type(even){background:#e3e8ed!important}
body.portal-shell:not(#theme151):not(#theme151-b):not(#theme151-c)>main .backup-row:has([data-backup-select]:checked){background:#cfe3f5!important}

/* 1.0.195: Dashboard «Prossimi corsi» — client confirmation as a dot before the date. */
body.portal-shell:not(#theme151):not(#theme151-b):not(#theme151-c)>main .portal-upcoming .upcoming-dot{flex:0 0 10px;width:10px;height:10px;border-radius:50%;margin-right:-8px}
body.portal-shell:not(#theme151):not(#theme151-b):not(#theme151-c)>main .portal-upcoming .upcoming-dot--ok{background:#1e8e3e}
body.portal-shell:not(#theme151):not(#theme151-b):not(#theme151-c)>main .portal-upcoming .upcoming-dot--wait{background:#d93025}

/* 1.0.196: Dashboard «Prossimi corsi» — the day's instructors on the right. */
body.portal-shell:not(#theme151):not(#theme151-b):not(#theme151-c)>main .portal-upcoming .upcoming-teachers{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:6px;max-width:45%}
body.portal-shell:not(#theme151):not(#theme151-b):not(#theme151-c)>main .portal-upcoming .upcoming-teacher{padding:3px 10px;border-radius:999px;font-size:13px;line-height:1.5;white-space:nowrap}
body.portal-shell:not(#theme151):not(#theme151-b):not(#theme151-c)>main .portal-upcoming .upcoming-teacher--ok{background:#e6f4ea;color:#137333}
body.portal-shell:not(#theme151):not(#theme151-b):not(#theme151-c)>main .portal-upcoming .upcoming-teacher--wait{background:#fdecea;color:#a12622}
body.portal-shell:not(#theme151):not(#theme151-b):not(#theme151-c)>main .portal-upcoming .upcoming-teacher--none{background:#f1f3f4;color:#5f6368}
