/* 1.0.39 - Dashboard is the visual authority for the whole Medicare workspace. */
:root{
  --dash-navy:#102e50;
  --dash-blue:#005879;
  --dash-cyan:#00a9c5;
  --dash-cyan-2:#00b9d3;
  --dash-muted:#64758b;
  --dash-line:#dce8ee;
  --dash-soft:#f3f9fc;
  --dash-soft-2:#e9f5f9;
  --dash-shadow:0 6px 20px #0058790c;
}

/* Canvas and hierarchy follow the dashboard: white/open, not grey/card-heavy. */
body.portal-shell{background:linear-gradient(180deg,#fff 0,#fff 66%,#f0f8fb 100%)!important;color:var(--dash-navy)}
body.portal-shell>main{background:transparent!important}
.portal-shell>main:has(.system-page){background:linear-gradient(180deg,#fff 0,#fff 72%,#f3f9fc 100%)!important}
.system-page{color:var(--dash-navy)!important}
.portal-shell .system-page h1,.portal-shell .system-page h2,.portal-shell .system-page h3{color:var(--dash-navy)!important}
.portal-shell .system-page>.system-head{margin-bottom:26px!important;align-items:flex-start!important}
.portal-shell .system-page>.system-head h1{font-size:21px!important;font-weight:650!important;letter-spacing:-.25px!important;margin:0 0 6px!important}
.portal-shell .system-page>.system-head p{color:var(--dash-muted)!important;font-size:13px!important;line-height:1.55!important;margin:0!important}

/* Dashboard-like surfaces: calm white areas, light separators, almost no shadow. */
.portal-shell .system-page :is(.system-card,.card,.directory-table-card,.catalog-table-wrap,.certificate-table-wrap){
  background:#fff!important;
  border:1px solid var(--dash-line)!important;
  border-radius:16px!important;
  box-shadow:none!important;
}

/* Global controls inherit dashboard proportions. */
.portal-shell .system-page :is(input:not([type=checkbox]):not([type=radio]):not([type=file]),select,textarea){
  border:1px solid #dbe9ef!important;
  background:#fff!important;
  color:var(--dash-navy)!important;
  border-radius:14px!important;
  box-shadow:none!important;
  transition:border-color .14s ease,box-shadow .14s ease,background .14s ease!important;
}
.portal-shell .system-page :is(input:not([type=checkbox]):not([type=radio]):not([type=file]),select){min-height:46px!important}
.portal-shell .system-page textarea{padding:13px 15px!important}
.portal-shell .system-page :is(input,select,textarea):focus{
  outline:none!important;
  border-color:#7fc6d5!important;
  box-shadow:0 0 0 3px #00a9c516!important;
  background:#fff!important;
}

/* Search fields are the compact section version of the dashboard command bar. */
.portal-shell .system-page input[type=search]{
  min-height:52px!important;
  border-radius:28px!important;
  padding-left:44px!important;
  background-color:#fff!important;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23008fa9' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E")!important;
  background-repeat:no-repeat!important;
  background-position:17px center!important;
  box-shadow:0 3px 12px #0058790b!important;
}
.portal-shell .system-page input[type=search]::placeholder{color:#8294a5!important}

/* Search/filter rows retain function but share the dashboard rhythm. */
.portal-shell .system-page :is(.directory-search,.training-inline-filter,.audit-search-primary){gap:12px!important;align-items:center!important}
.portal-shell .system-page .directory-search{margin-bottom:18px!important}
.portal-shell .system-page .directory-search>input[type=search],
.portal-shell .system-page .directory-search label:has(input[type=search]),
.portal-shell .system-page .training-search-box,
.portal-shell .system-page .training-inline-filter label:has(input[type=search]){flex:1 1 360px!important;max-width:760px!important}
.portal-shell .system-page .training-search-box input[type=search],
.portal-shell .system-page .training-inline-filter input[type=search],
.portal-shell .system-page .certificate-filters label:first-child input{width:100%!important}

/* Buttons use the dashboard cyan/navy language. */
.portal-shell .system-page .system-button,
.portal-shell .system-dialog .system-button{
  min-height:42px!important;
  border-radius:14px!important;
  padding:9px 16px!important;
  border-color:#d6e5eb!important;
  background:#fff!important;
  color:var(--dash-blue)!important;
  font-weight:650!important;
  box-shadow:none!important;
}
.portal-shell .system-page .system-button:hover,.portal-shell .system-dialog .system-button:hover{background:#f2f9fb!important;border-color:#acd4de!important;color:#007d99!important}
.portal-shell .system-page .system-button.primary,.portal-shell .system-dialog .system-button.primary{
  color:#fff!important;
  border-color:transparent!important;
  background:linear-gradient(135deg,var(--dash-cyan-2),#0097b4)!important;
  box-shadow:0 3px 8px #00a0c226!important;
}
.portal-shell .system-page .system-button.primary:hover,.portal-shell .system-dialog .system-button.primary:hover{background:linear-gradient(135deg,#00abc7,#008aa8)!important}
.portal-shell .system-page .system-button.danger,.portal-shell .system-page .system-button.danger-outline{color:#b43d43!important;background:#fff!important;border-color:#efd7da!important}
.portal-shell .system-page .system-button.danger:hover,.portal-shell .system-page .system-button.danger-outline:hover{background:#fff5f6!important;border-color:#e6bfc4!important}

/* Search submit buttons look like the dashboard action, while preserving labels. */
.portal-shell .system-page :is(.directory-search,.training-inline-filter,.training-search-line,.audit-search-primary) button[type=submit].system-button{
  min-height:46px!important;
  border-radius:23px!important;
  padding-inline:18px!important;
  color:#fff!important;
  border-color:transparent!important;
  background:linear-gradient(135deg,var(--dash-cyan-2),#0097b4)!important;
  box-shadow:0 3px 8px #00a0c220!important;
}

/* Tables use dashboard separators and whitespace instead of boxed density. */
.portal-shell .system-page table{background:#fff!important}
.portal-shell .system-page table thead th{
  background:#fff!important;
  color:#60758b!important;
  font-size:11px!important;
  font-weight:650!important;
  padding:14px 14px!important;
  border-bottom:1px solid var(--dash-line)!important;
}
.portal-shell .system-page table tbody td{
  color:#29445b!important;
  padding:15px 14px!important;
  border-bottom:1px solid #e8eff3!important;
  background:#fff!important;
}
.portal-shell .system-page table tbody tr:hover td{background:#f7fbfc!important}
.portal-shell .system-page table tbody tr:last-child td{border-bottom:0!important}

/* Labels, captions and secondary information align with dashboard typography. */
.portal-shell .system-page label{color:#415a70!important;font-weight:600!important}
.portal-shell .system-page :is(.system-meta,.muted,small){color:#8294a5!important}
.portal-shell .system-page .system-meta{font-size:11px!important}

/* Primary page actions sit quietly in the top-right as in the dashboard. */
.portal-shell .system-head-actions,.portal-shell .certificate-actions{display:flex!important;gap:10px!important;align-items:center!important;flex-wrap:wrap!important}

/* Dialogs use the same open, light visual grammar. */
.portal-shell .system-dialog{border-radius:24px!important;border:1px solid var(--dash-line)!important;box-shadow:0 18px 50px #17344f18!important}

/* Checkbox/radio stay crisp and brand-aligned. */
.portal-shell .system-page input[type=checkbox],.portal-shell .system-page input[type=radio]{accent-color:var(--dash-cyan)!important}

@media(max-width:760px){
  .portal-shell .system-page input[type=search]{min-height:48px!important}
  .portal-shell .system-page>.system-head{gap:14px!important}
  .portal-shell .system-page>.system-head>div:first-child{flex-basis:100%!important}
  .portal-shell .system-page :is(.directory-search,.training-inline-filter,.training-search-line,.audit-search-primary){align-items:stretch!important}
}

/* 1.0.40 - Dashboard visual contract: mandatory for every workspace section. */
.portal-shell{
  --ui-bg:#ffffff;
  --ui-bg-soft:#f5fbfd;
  --ui-line:#dce8ee;
  --ui-line-strong:#cbdfe7;
  --ui-text:#102e50;
  --ui-muted:#7f94a6;
  --ui-brand:#00a9c5;
  --ui-brand-dark:#005879;
  --ui-radius:16px;
  --ui-control-radius:14px;
  --ui-pill-radius:999px;
  --ui-shadow:0 5px 18px rgba(0,88,121,.07);
}

/* Universal page language. Page-specific layouts may change structure, never the visual vocabulary. */
.portal-shell>main :is(.card,.panel,.workspace-card,.directory-table-card,.catalog-table-wrap,.certificate-table-wrap){
  border-color:var(--ui-line)!important;
  border-radius:var(--ui-radius)!important;
  box-shadow:none!important;
}
.portal-shell>main :is(input:not([type=checkbox]):not([type=radio]):not([type=file]),select,textarea){
  border-color:var(--ui-line)!important;
  border-radius:var(--ui-control-radius)!important;
  color:var(--ui-text)!important;
  box-shadow:none!important;
}
.portal-shell>main :is(input:not([type=checkbox]):not([type=radio]):not([type=file]),select,textarea):focus{
  border-color:#7fc6d5!important;
  box-shadow:0 0 0 3px rgba(0,169,197,.09)!important;
  outline:none!important;
}
.portal-shell>main :is(.button-link,.primary-button,button[type=submit]):not(.danger-button):not(.chat-send-button):not(.nav-icon){
  border-radius:var(--ui-control-radius)!important;
}
.portal-shell>main :is(.page-head,.system-head) h1,
.portal-shell>main :is(.page-head,.system-head) h2{color:var(--ui-text)!important}
.portal-shell>main :is(.page-head,.system-head) .eyebrow{color:var(--ui-brand)!important;letter-spacing:.18em!important}

/* The Dashboard also governs floating Chat chrome. */
.portal-shell .chat-dock{
  background:#fff!important;
  border:1px solid var(--ui-line)!important;
  border-radius:22px!important;
  box-shadow:0 18px 52px rgba(16,46,80,.16)!important;
  overflow:hidden!important;
}
.portal-shell .chat-dock>.chat-dock-head,
.portal-shell .chat-dock>.window-titlebar{
  min-height:58px!important;
  background:linear-gradient(180deg,#fff 0%,#f8fcfd 100%)!important;
  color:var(--ui-text)!important;
  border:0!important;
  border-bottom:1px solid var(--ui-line)!important;
  padding:0 16px!important;
}
.portal-shell .chat-dock .chat-dock-head strong,
.portal-shell .chat-dock .window-titlebar strong{color:var(--ui-text)!important;font-weight:650!important}
.portal-shell .chat-dock .chat-dock-head a,
.portal-shell .chat-dock .chat-dock-head button{
  color:var(--ui-brand-dark)!important;
  background:#fff!important;
  border:1px solid var(--ui-line)!important;
  border-radius:50%!important;
  width:38px!important;height:38px!important;min-width:38px!important;
}
.portal-shell .chat-dock .chat-dock-head a:hover,
.portal-shell .chat-dock .chat-dock-head button:hover{background:var(--ui-bg-soft)!important;border-color:#abd5df!important;color:#008ca8!important}
.portal-shell .chat-dock .window-controls{gap:7px!important}
.portal-shell .chat-dock .window-controls button{
  width:30px!important;height:30px!important;min-width:30px!important;
  background:#fff!important;color:var(--ui-brand-dark)!important;
  border:1px solid var(--ui-line)!important;border-radius:50%!important;
  font-size:15px!important;line-height:28px!important;
}
.portal-shell .chat-dock .window-controls button:hover{background:var(--ui-bg-soft)!important;border-color:#abd5df!important}
.portal-shell .chat-dock iframe{background:#fff!important}

/* 1.0.44 - Allineamento preciso filtri Attestati: il pulsante Cerca condivide la stessa baseline dei campi. */
.portal-shell .system-page .certificate-filters{
  align-items:end!important;
}
.portal-shell .system-page .certificate-filters label{
  align-self:end!important;
}
.portal-shell .system-page .certificate-filters :is(input,select){
  min-height:46px!important;
  height:46px!important;
}
.portal-shell .system-page .certificate-filters button[type=submit].system-button{
  align-self:end!important;
  height:46px!important;
  min-height:46px!important;
  margin:0!important;
}

/* 1.0.45 - icon-first action language. Primary workflow actions may keep text; compact/repetitive actions use vector icons. */
.portal-shell .system-button.icon-only{width:40px!important;min-width:40px!important;height:40px!important;min-height:40px!important;padding:8px!important;border-radius:12px!important;display:inline-flex!important;align-items:center!important;justify-content:center!important}
.portal-shell .system-button.icon-only svg{width:18px!important;height:18px!important;flex:0 0 18px!important}
.portal-shell .catalog-actions{display:flex!important;align-items:center!important;gap:7px!important;flex-wrap:wrap!important}
.portal-shell .catalog-actions .system-button.icon-only{margin:0!important}
.portal-shell .certificate-row-actions{display:flex;align-items:center;gap:7px;flex-wrap:nowrap}
.portal-shell .certificate-row-actions .system-button.icon-only{width:36px!important;min-width:36px!important;height:36px!important;min-height:36px!important;border-radius:10px!important;padding:7px!important}
.portal-shell .certificate-row-actions .system-button.icon-only svg{width:17px!important;height:17px!important}

/* 1.0.52 - Chat Medicare: controlli compatti, non schiacciati e coerenti con la Dashboard. */
.portal-shell .chat-dock>.chat-dock-head{
  height:42px!important;min-height:42px!important;max-height:42px!important;
  padding:0 12px!important;
}
.portal-shell .chat-dock>.chat-dock-head>strong{
  font-size:15px!important;line-height:1!important;font-weight:650!important;
}
.portal-shell .chat-dock>.chat-dock-head>.chat-dock-controls{
  height:42px!important;gap:6px!important;margin-left:auto!important;flex:0 0 auto!important;
}
.portal-shell .chat-dock>.chat-dock-head>.chat-dock-controls button{
  box-sizing:border-box!important;
  width:30px!important;min-width:30px!important;max-width:30px!important;
  height:30px!important;min-height:30px!important;max-height:30px!important;
  padding:0!important;margin:0!important;flex:0 0 30px!important;
  border-radius:9px!important;border:1px solid #cfe0e7!important;
  background:#fff!important;color:var(--ui-brand-dark)!important;
  font:700 18px/28px Arial,sans-serif!important;
  box-shadow:none!important;
}
.portal-shell .chat-dock>.chat-dock-head>.chat-dock-controls button:hover{
  background:#eef9fc!important;border-color:#9fcfd9!important;color:#008ca8!important;
}
.portal-shell .chat-dock>.chat-dock-head>.chat-dock-controls button:active{
  transform:translateY(1px)!important;
}
@media(max-width:600px){
  .portal-shell .chat-dock>.chat-dock-head>.chat-dock-controls button{
    width:30px!important;min-width:30px!important;max-width:30px!important;
    height:30px!important;min-height:30px!important;max-height:30px!important;
  }
}
