/* One screen theme for category menus and every module. Printed documents and
   the schedule's semantic cell colours are deliberately managed separately. */
body.cmvd-app{
  --text:#15364c;--muted:#506676;--line:#c9dfe1;--accent:#0b687a;--accent2:#075667;
  --cmvd-surface:#fff;--cmvd-surface-soft:#f0f8f8;--cmvd-border:#bfdadd;
  --cmvd-focus:#086eac;
  color:var(--text);
}
body.cmvd-app main{font-size:1rem;line-height:1.5}
body.cmvd-app main :is(h1,h2,h3){color:#153f59;line-height:1.3}
body.cmvd-app main h1,body.cmvd-app main .hero h1{font-size:clamp(1.35rem,2.3vw,1.75rem);margin:.2em 0 .45em}
body.cmvd-app main h2{font-size:1.12rem}
body.cmvd-app main h3{font-size:1rem}
body.cmvd-app main .hero{padding:12px 0 14px;margin-bottom:16px;border-bottom:1px solid #c9dfe1}
body.cmvd-app main .hero p{font-size:.95rem;line-height:1.5;color:#506676}
body.cmvd-app main :is(.card,.step-card){border-color:var(--cmvd-border);border-radius:13px;box-shadow:0 3px 12px #17385f08}
body.cmvd-app main .card{padding:16px}
body.cmvd-app main :is(.stack,.grid){gap:12px}
body.cmvd-app main .muted{color:#506676}
body.cmvd-app main .kpi{font-size:1.65rem;font-variant-numeric:tabular-nums}
body.cmvd-app main a:not(.button):not(.home-tile):not(.cmvd-home-action):not(.inv-status-card):not(.cmvd-category-link){text-underline-offset:3px}

/* Existing module navigation used 96–106px tall cards. These links are compact
   at every depth, including edit, archive, review and settings pages. */
body.cmvd-app main .nav:not(.ot-tabs),body.cmvd-app main .nav.ot-tabs,
body.cmvd-app.module-index main :is(nav.nav,.inv-actions,.ot-primary-actions,.message-folders){
  display:flex;flex-wrap:wrap;align-items:stretch;gap:8px;padding:0;margin:14px 0;
}
body.cmvd-app main .nav:not(.ot-tabs)>a,body.cmvd-app main .nav.ot-tabs>a,
body.cmvd-app.module-index main :is(nav.nav,.inv-actions,.ot-primary-actions,.message-folders)>a{
  display:inline-flex;flex-direction:row;align-items:center;justify-content:center;
  flex:0 1 auto;min-width:0;min-height:44px;height:auto;padding:9px 12px;gap:7px;
  border:1px solid #a8cfd3;border-radius:10px;background:#fff;color:#14526a;
  font-size:.9rem;font-weight:700;line-height:1.35;text-align:center;
  text-decoration:none;white-space:normal;overflow-wrap:anywhere;box-shadow:none;
}
body.cmvd-app.module-index main .grid .actions{
  display:flex!important;flex-wrap:wrap;align-items:stretch;gap:8px;
}
body.cmvd-app.module-index main .grid .actions>a.button{
  flex-direction:row;min-height:44px;gap:7px;padding:9px 12px;font-size:.9rem;line-height:1.35;
}
body.cmvd-app main .nav>a svg,
body.cmvd-app.module-index main :is(.hero,.grid) .actions>a.button svg{
  width:21px;height:21px;flex:0 0 21px;color:currentColor;
}
body.cmvd-app main .nav>a[aria-current=page],
body.cmvd-app.module-index main :is(nav.nav,.message-folders)>a[aria-current=page]{
  background:#0b687a;border-color:#0b687a;color:#fff;
}
body.cmvd-app main .nav>a:hover,
body.cmvd-app.module-index main :is(nav.nav,.inv-actions,.ot-primary-actions,.message-folders)>a:hover{
  background:#e6f5f3;border-color:#16828b;color:#14526a;
}
body.cmvd-app main .nav>a[aria-current=page]:hover,
body.cmvd-app.module-index main .message-folders>a[aria-current=page]:hover{background:#075667;color:#fff}

/* The shared tile shape follows Acasă. Colour no longer changes with position. */
body.cmvd-app main .module-tiles .home-tile,
body.cmvd-app .cmvd-category-page .home-tile:nth-child(n){
  border-color:#bfdadd;border-top-color:#087f82;color:#15364c;background:#fff;
}
body.cmvd-app main .module-tiles .home-icon,
body.cmvd-app .cmvd-category-page .home-tile:nth-child(n) .home-icon{background:#e2f5f3;color:#087f82}
body.cmvd-app .cmvd-category-link:last-child svg{color:#087f82}
body.cmvd-app .cmvd-category-link[aria-current=page] svg{color:#fff}
body.cmvd-app main .module-tiles .home-tile{min-height:94px;padding:10px 11px;gap:6px;font-size:.94rem}
body.cmvd-app main .module-tiles .home-tile:hover,
body.cmvd-app .cmvd-category-page .home-tile:nth-child(n):hover{background:#f1fbf9;border-color:#16828b}
body.cmvd-app .cmvd-category-page .home-tile.is-disabled{background:#f3f7f7;border-color:#acbfc6;border-top-color:#8a9da6;color:#576a75}
body.cmvd-app .cmvd-category-page .home-tile.is-disabled .home-icon{background:#e6eeee;color:#627581}

/* Primary, secondary and destructive actions keep distinct meanings. */
body.cmvd-app main .button:not(.secondary):not(.cmvd-home-action):not(:where(.danger,.ghost,.activity-results *,.activity-suggestions *)),
body.cmvd-app main button:not(.secondary):not(.cmvd-home-action):not(:where(.danger,.ghost,.activity-results *,.activity-suggestions *)){background:#0b687a;color:#fff;border-color:#0b687a}
body.cmvd-app main .button:not(.secondary):not(.cmvd-home-action):not(:where(.danger,.ghost,.activity-results *,.activity-suggestions *)):hover,
body.cmvd-app main button:not(.secondary):not(.cmvd-home-action):not(:where(.danger,.ghost,.activity-results *,.activity-suggestions *)):hover{background:#075667}
body.cmvd-app main .button.secondary,body.cmvd-app main button.secondary{
  background:#edf7f6;border:1px solid #bfdadd;color:#14526a;
}
body.cmvd-app main .button.secondary:hover,body.cmvd-app main button.secondary:hover{background:#dff0ee;border-color:#16828b}
body.cmvd-app main .button.ghost,body.cmvd-app main button.ghost{background:#fff;border:1px solid #bfdadd;color:#14526a}
body.cmvd-app main .button.danger,body.cmvd-app main button.danger{background:#a93229;border-color:#a93229;color:#fff}
body.cmvd-app main .button.danger:hover,body.cmvd-app main button.danger:hover{background:#8e2720}
body.cmvd-app main .actions{gap:8px}
body.cmvd-app main .actions>:is(.button,button){min-height:44px;padding:9px 12px;border-radius:10px;font-size:.9rem;line-height:1.35}
body.cmvd-app main :is(.button,button):disabled{opacity:.6;cursor:default}
body.cmvd-app main :is(.button,button,a,input,select,textarea,summary):focus-visible{outline:3px solid var(--cmvd-focus);outline-offset:3px}
body.cmvd-app main :is(.activity-results,.activity-suggestions) button{background:#fff;color:#15364c;border-color:#d7e5e7}
body.cmvd-app main :is(.activity-results,.activity-suggestions) button:is(:hover,:focus){background:#e6f5f3;color:#15364c}

/* Older Smart FOL decorative orange/lime buttons used !important inline CSS. */
body.cmvd-app main :is(.sf-btn-source,.sf-btn-export){background:#0b687a!important;border-color:#0b687a!important;color:#fff!important}
body.cmvd-app main .sf-btn-open{background:#edf7f6!important;border-color:#bfdadd!important;color:#14526a!important}
body.cmvd-app main :is(.sf-btn-source,.sf-btn-export):hover{background:#075667!important}
body.cmvd-app main .sf-btn-open:hover{background:#dff0ee!important}

/* Control sizes stay readable, without changing dense schedule inputs or
   signature canvases. Every original form name and submit action is retained. */
body.cmvd-app main :is(input,select,textarea):not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=range]):not([type=color]):not([type=submit]):not([type=button]):not(.schedule-grid *){
  min-height:44px;border:1px solid #aecbd0;border-radius:10px;padding:10px 11px;
  background:#fff;color:#15364c;font:inherit;font-size:1rem;line-height:1.35;max-width:100%;
}
body.cmvd-app main :is(input,select,textarea):not(.schedule-grid *):disabled{background:#f1f5f6;color:#536975}
body.cmvd-app main :is(input,textarea):not(.schedule-grid *)::placeholder{color:#647986;opacity:1}
body.cmvd-app main :is(input[type=checkbox],input[type=radio]){accent-color:#0b687a}
body.cmvd-app main label{font-size:.95rem;line-height:1.4}
body.cmvd-app main .field small{color:#506676;font-size:.83rem;line-height:1.45}
body.cmvd-app main summary{font-size:.93rem;line-height:1.45;font-weight:650;color:#14526a}
body.cmvd-app main details.card>summary{min-height:32px}
body.cmvd-app main .paste-upload-zone{background:#f3faf9;border-color:#8cbfc5;border-radius:13px;padding:18px;color:#15364c}
body.cmvd-app main .paste-upload-zone:focus{background:#e8f6f3;border-color:#0b687a}

/* Data headers share the theme; row warnings, medical/training cells, absence
   colours and emergency banners retain their status-specific styles. */
body.cmvd-app main .table-wrap{border-color:#bfdadd;border-radius:12px;background:#fff}
body.cmvd-app main table:not(.schedule-grid):not(.annex-grid table) th{background:#edf7f6;color:#153f59;font-size:.87rem;font-weight:750}
body.cmvd-app main table:not(.schedule-grid):not(.annex-grid table) :is(th,td){line-height:1.45;border-bottom-color:#d7e5e7}
body.cmvd-app main .badge:not(.ok):not(.warn):not(.danger){background:#e8f3f4;color:#14526a}
body.cmvd-app main .alert:not(.success):not(.warn):not(.danger){background:#edf7f7;color:#224e62;border:1px solid #c9dfe1}

/* Inventory and overtime used separate bright palettes and larger counters. */
body.cmvd-app main .inv-hero{background:#f0f8f8;border:1px solid #bfdadd;border-left:4px solid #087f82;border-radius:13px;padding:16px 18px;color:#15364c}
body.cmvd-app main .inv-hero h1{color:#153f59}
body.cmvd-app main .inv-hero p{color:#506676}
body.cmvd-app main .inv-status-grid{gap:10px}
body.cmvd-app main .inv-status-card{background:#fff;border:1px solid #bfdadd;border-top:3px solid #087f82;border-radius:13px;box-shadow:0 3px 12px #17385f08;padding:13px 15px;gap:4px;color:#15364c!important}
body.cmvd-app main .inv-status-card>span{font-size:1.3rem}
body.cmvd-app main .inv-status-card>strong{font-size:1.6rem}
body.cmvd-app main .inv-status-card>b{font-size:.95rem}
body.cmvd-app main .inv-status-card>small{font-size:.8rem;color:#506676}
body.cmvd-app main .inv-status-card:hover{background:#f1fbf9;border-color:#16828b}
body.cmvd-app main .ot-counter{padding:16px;gap:12px}
body.cmvd-app main .ot-counter .kpi{font-size:1.8rem}
body.cmvd-app main .ot-counter-icon{width:38px;height:38px;flex-basis:38px;background:#e2f5f3;color:#087f82;border-radius:11px}
body.cmvd-app main .ot-counter-icon svg{width:23px;height:23px}
body.cmvd-app main .ot-counters .ot-counter:first-child,
body.cmvd-app main .ot-counters .ot-counter:last-child{border-top-color:#087f82}
body.cmvd-app main .ot-counters .ot-negative{border-top-color:#bc6430!important}

@media(max-width:640px){
  body.cmvd-app main h1,body.cmvd-app main .hero h1{font-size:1.4rem!important}
  body.cmvd-app main .hero{padding:9px 0 12px;margin-bottom:14px}
  body.cmvd-app main .hero p{font-size:.94rem!important}
  body.cmvd-app main .card{padding:14px!important;border-radius:12px}
  body.cmvd-app main .nav:not(.ot-tabs)>a,body.cmvd-app main .nav.ot-tabs>a,
  body.cmvd-app.module-index main :is(nav.nav,.inv-actions,.ot-primary-actions,.message-folders)>a{flex:1 1 135px;font-size:.9rem;padding:9px 10px}
  body.cmvd-app.module-index main .grid .actions>a.button{flex:1 1 135px}
  body.cmvd-app main .actions>:is(.button,button){font-size:.9rem;min-height:44px}
  body.cmvd-app main .actions>:is(form,label){min-width:0}
  body.cmvd-app main .actions>:is(input,select,textarea){width:100%;flex:1 1 180px;min-width:0!important}
  body.cmvd-app main .inv-status-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  body.cmvd-app main .inv-status-card{flex-direction:column;align-items:flex-start;padding:12px;min-width:0}
  body.cmvd-app main .inv-status-card>strong{font-size:1.45rem}
  body.cmvd-app main .inv-status-card>b{flex:0 1 auto;font-size:.9rem}
  body.cmvd-app main .inv-hero{padding:14px}
}
@media(prefers-reduced-motion:reduce){
  body.cmvd-app main .module-tiles .home-tile,body.cmvd-app .cmvd-category-page .home-tile{transition:none;transform:none}
}
