/* ElixeMarket Work Hub Next - ERP Density & UX Standard
   Scope: visual density only. No business logic, no save logic, no database changes. */

.emwh-app{
  font-size:13px!important;
  --emwh-density-input-h:34px;
  --emwh-density-button-h:34px;
  --emwh-density-radius:10px;
}

.emwh-sidebar{width:250px!important;padding:18px 14px!important;}
.emwh-brand{margin-bottom:22px!important;gap:10px!important;}
.emwh-logo{width:42px!important;height:42px!important;border-radius:12px!important;font-size:20px!important;}
.emwh-brand strong{font-size:16px!important;}
.emwh-brand small{font-size:11px!important;}
.emwh-brand em{font-size:9px!important;letter-spacing:.12em!important;}
.emwh-sidebar nav{gap:5px!important;}
.emwh-side-item{padding:9px 11px!important;border-radius:10px!important;gap:10px!important;}
.emwh-side-item b{font-size:13px!important;}
.emwh-side-item small{font-size:10px!important;line-height:1.25!important;}
.emwh-status{padding:10px!important;border-radius:12px!important;}

.emwh-topbar{height:56px!important;padding:0 18px!important;gap:14px!important;}
.emwh-menu-btn{width:34px!important;height:34px!important;font-size:18px!important;}
.emwh-search{height:36px!important;border-radius:10px!important;}
.emwh-search span{font-size:17px!important;padding-left:12px!important;}
.emwh-search input{font-size:13px!important;padding:0 10px!important;}
.emwh-topbar .emwh-search button{padding:4px 7px!important;font-size:10px!important;}
.emwh-user{gap:10px!important;font-size:13px!important;}
.emwh-version{padding:6px 10px!important;font-size:12px!important;}
.emwh-help-toggle{min-height:34px!important;height:34px!important;padding:0 10px!important;min-width:126px!important;border-radius:10px!important;}
.emwh-help-toggle b{font-size:10px!important;}

.emwh-content{padding:18px 20px 42px!important;}
.emwh-hero{padding:16px 20px!important;margin-bottom:12px!important;border-radius:14px!important;}
.emwh-hero small,.emwh-tag{font-size:10px!important;letter-spacing:.13em!important;}
.emwh-hero h1{font-size:34px!important;line-height:1.05!important;margin:3px 0 5px!important;}
.emwh-hero p{font-size:13px!important;line-height:1.35!important;}

.emwh-toolbar{padding:9px!important;margin-bottom:12px!important;border-radius:14px!important;gap:8px!important;}
.emwh-toolbar input,.emwh-toolbar select,
.emwh-action,.emwh-light,.emwh-primary,
.emwh-toolbar .emwh-light,.emwh-toolbar .emwh-action{
  min-height:var(--emwh-density-button-h)!important;
  height:var(--emwh-density-button-h)!important;
  border-radius:var(--emwh-density-radius)!important;
  padding:0 12px!important;
  font-size:12px!important;
  line-height:1!important;
}
.emwh-primary{display:inline-flex!important;align-items:center!important;justify-content:center!important;text-decoration:none!important;}
.emwh-toolbar input,.emwh-toolbar select{font-size:13px!important;}
.emwh-readonly-chip{padding:7px 10px!important;font-size:11px!important;}

.emwh-card,.emwh-module,.emwh-metric,.emwh-form,.emwh-table-wrap{border-radius:14px!important;}
.emwh-card,.emwh-module,.emwh-metric{padding:14px!important;}
.emwh-card h2{font-size:21px!important;margin:8px 0!important;}
.emwh-module h3{font-size:18px!important;margin-bottom:6px!important;}
.emwh-card p,.emwh-module p{font-size:13px!important;line-height:1.35!important;}
.emwh-grid{gap:10px!important;}
.emwh-grid.metrics{gap:10px!important;margin-bottom:12px!important;}
.emwh-metric{border-top-width:3px!important;}
.emwh-metric small{font-size:10px!important;}
.emwh-metric strong{font-size:21px!important;margin:6px 0 4px!important;}

.emwh-table-wrap{margin-top:12px!important;}
.emwh-count{padding:11px 14px!important;font-size:13px!important;}
.emwh-table th{padding:10px 11px!important;font-size:10px!important;letter-spacing:.12em!important;}
.emwh-table td{padding:9px 11px!important;font-size:13px!important;line-height:1.25!important;vertical-align:middle!important;}
.emwh-table td small{font-size:11px!important;line-height:1.25!important;}
.emwh-open{font-size:13px!important;}
.emwh-badge,.emwh-status-badge{padding:5px 9px!important;font-size:11px!important;}

.emwh-tabs{gap:6px!important;margin-bottom:12px!important;}
.emwh-tabs span,.emwh-tabs a{padding:7px 10px!important;font-size:12px!important;}
.emwh-detail-grid{gap:9px!important;}
.emwh-detail-grid div{padding:9px 10px!important;border-radius:10px!important;}
.emwh-detail-grid small{font-size:10px!important;margin-bottom:4px!important;}
.emwh-detail-grid b{font-size:13px!important;line-height:1.25!important;}

.emwh-form{padding:14px!important;gap:10px!important;}
.emwh-form label small,.emwh-edit-form label small{font-size:10px!important;letter-spacing:.08em!important;margin-bottom:5px!important;}
.emwh-form input,.emwh-form select,.emwh-form textarea,
.emwh-edit-form input,.emwh-edit-form select,.emwh-edit-form textarea,
.emwh-kyc-action-form select,.emwh-kyc-action-form textarea{
  min-height:var(--emwh-density-input-h)!important;
  border-radius:9px!important;
  padding:7px 9px!important;
  font-size:13px!important;
}
.emwh-form textarea,.emwh-edit-form textarea{min-height:64px!important;line-height:1.35!important;}

.emwh-company-clean .emwh-detail-grid b{font-size:12px!important;}
.emwh-quick{padding:10px!important;border-radius:10px!important;}
.emwh-quick b{font-size:13px!important;}
.emwh-quick small{font-size:11px!important;}

.emwh-notice{padding:10px 13px!important;margin-bottom:11px!important;border-radius:12px!important;font-size:12px!important;}

/* Desktop ERP default: show more records on Full HD without losing readability. */
@media(min-width:1600px){
  .emwh-content{padding-left:18px!important;padding-right:18px!important;}
  .emwh-hero h1{font-size:32px!important;}
}

/* Keep smaller laptops usable. */
@media(max-width:1400px){
  .emwh-sidebar{width:230px!important;}
  .emwh-hero h1{font-size:28px!important;}
  .emwh-toolbar{grid-template-columns:1fr 1fr 1fr!important;}
}


/* V4.0.3.5.9.4.1 - Compact Buttons & Metric Cards Fix
   Scope: visual density only. Reduces oversized action buttons and company metric cards. */
.emwh-app{
  --emwh-density-button-h:30px;
  --emwh-density-input-h:32px;
}

.emwh-primary,
.emwh-action,
.emwh-light,
.emwh-action-link,
.emwh-toolbar .emwh-light,
.emwh-toolbar .emwh-action,
.emwh-toolbar input,
.emwh-toolbar select{
  min-height:30px!important;
  height:30px!important;
  padding:0 10px!important;
  border-radius:8px!important;
  font-size:11px!important;
  line-height:1!important;
}

.emwh-hero .emwh-primary,
.emwh-hero .emwh-action,
.emwh-hero .emwh-light,
.emwh-hero a.emwh-primary,
.emwh-hero a.emwh-action{
  min-height:34px!important;
  height:34px!important;
  padding:0 14px!important;
  border-radius:9px!important;
  font-size:11px!important;
  box-shadow:0 4px 12px rgba(0,85,210,.16)!important;
}

.emwh-help-toggle,
.emwh-version,
.emwh-readonly-chip{
  min-height:28px!important;
  height:28px!important;
  padding:0 9px!important;
  border-radius:8px!important;
  font-size:10px!important;
}
.emwh-help-toggle b,
.emwh-version b,
.emwh-readonly-chip b{font-size:10px!important;}

.emwh-topbar{height:48px!important;padding:0 14px!important;gap:10px!important;}
.emwh-menu-btn{width:30px!important;height:30px!important;font-size:16px!important;}
.emwh-search{height:30px!important;max-width:520px!important;border-radius:9px!important;}
.emwh-search input{font-size:12px!important;}
.emwh-search span{font-size:15px!important;padding-left:10px!important;}
.emwh-topbar .emwh-search button{height:24px!important;min-height:24px!important;padding:0 6px!important;font-size:10px!important;border-radius:7px!important;}

.emwh-hero{padding:13px 18px!important;margin-bottom:10px!important;min-height:auto!important;}
.emwh-hero h1{font-size:29px!important;margin:2px 0 4px!important;}
.emwh-hero p{font-size:12px!important;}

.emwh-grid.metrics{grid-template-columns:repeat(auto-fit,minmax(142px,1fr))!important;gap:8px!important;margin-bottom:10px!important;}
.emwh-metric{
  min-height:112px!important;
  padding:12px 13px!important;
  border-radius:12px!important;
  border-top-width:3px!important;
}
.emwh-metric small{font-size:9px!important;letter-spacing:.06em!important;}
.emwh-metric strong{font-size:19px!important;line-height:1.16!important;margin:7px 0 5px!important;}
.emwh-metric span{font-size:11px!important;line-height:1.25!important;}

.emwh-company-clean .emwh-metric strong,
.emwh-company-clean .emwh-detail-grid b{font-size:17px!important;line-height:1.15!important;}
.emwh-company-clean .emwh-metric span{font-size:11px!important;}

.emwh-module,.emwh-card{padding:12px!important;border-radius:12px!important;}
.emwh-quick{min-height:72px!important;padding:10px 12px!important;border-radius:10px!important;}
.emwh-quick b{font-size:12px!important;}
.emwh-quick small{font-size:10px!important;line-height:1.25!important;}
.emwh-quick em{font-size:11px!important;}

@media(min-width:1600px){
  .emwh-content{padding-top:12px!important;}
  .emwh-grid.metrics{grid-template-columns:repeat(7,minmax(138px,1fr))!important;}
  .emwh-hero h1{font-size:28px!important;}
}

/* V4.0.3.5.9.4.2 - Company Master Final UX */
.emwh-company-final{padding:16px!important}
.emwh-company-final>h2{font-size:22px!important;margin:0 0 12px!important;line-height:1.15!important}
.emwh-company-final .emwh-guidance-legend{margin:0 0 10px!important;padding:8px 10px!important}
.emwh-company-final .emwh-edit-actions-read{margin:0 0 10px!important}
.emwh-company-final .emwh-edit-actions-read .emwh-primary{height:30px!important;min-height:30px!important;padding:0 12px!important;font-size:11px!important;border-radius:7px!important;display:inline-flex!important;align-items:center!important}
.emwh-company-final .emwh-edit-actions-active{margin:10px 0 0!important}
.emwh-company-read-grid.emwh-detail-grid{gap:8px!important;grid-template-columns:repeat(4,minmax(0,1fr))!important}
.emwh-company-read-grid .emwh-detail-item{background:#fff!important;border:0!important;border-bottom:1px solid #dbe6f2!important;border-radius:0!important;padding:8px 4px 9px!important;box-shadow:none!important;min-height:0!important}
.emwh-company-read-grid .emwh-detail-item small{font-size:10px!important;letter-spacing:.12em!important;text-transform:uppercase!important;color:#456885!important;font-weight:800!important;margin-bottom:4px!important}
.emwh-company-read-grid .emwh-detail-item b{font-size:15px!important;line-height:1.2!important;color:#071d34!important;font-weight:800!important}
.emwh-company-read-grid .emwh-detail-wide{grid-column:span 2!important}
.emwh-company-read-grid .emwh-detail-notes{grid-column:1/-1!important;background:#f8fbff!important;border:1px solid #dbe6f2!important;border-radius:10px!important;padding:10px 12px!important;margin-top:2px!important}
.emwh-company-read-grid .emwh-detail-notes b{font-size:14px!important;min-height:22px!important}
.emwh-company-meta-footer{display:flex!important;gap:18px!important;align-items:center!important;border-top:1px solid #e3edf7!important;margin-top:12px!important;padding-top:10px!important;color:#6a829a!important}
.emwh-company-meta-footer .emwh-detail-item{background:transparent!important;border:0!important;padding:0!important;display:flex!important;gap:8px!important;align-items:baseline!important}
.emwh-company-meta-footer small{font-size:10px!important;text-transform:uppercase!important;letter-spacing:.1em!important;color:#7b91a8!important;font-weight:800!important;margin:0!important}
.emwh-company-meta-footer b{font-size:12px!important;color:#49647f!important;font-weight:700!important}
.emwh-card.emwh-company-actions{padding:14px!important}
.emwh-card.emwh-company-actions h2{font-size:20px!important;margin:4px 0 10px!important}
.emwh-action-grid{gap:8px!important}
.emwh-quick{padding:10px 12px!important;min-height:50px!important;border-radius:10px!important}
.emwh-quick b{font-size:13px!important}
.emwh-quick small{font-size:11px!important;line-height:1.25!important}
.emwh-quick em{font-size:11px!important;margin-top:5px!important}
@media (max-width:1400px){.emwh-company-read-grid.emwh-detail-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}.emwh-company-read-grid .emwh-detail-wide{grid-column:1/-1!important}}


/* V4.0.3.5.9.5.1 - Company & Contact Final Visual Polish
   Scope: final visual tightening only. No database, save handlers or business logic. */

/* Quick Actions: compact work-mode shortcuts, not large cards. */
body .emwh-app .emwh-company-actions,
body .emwh-app .emwh-company-actions-stable{
  margin:6px 0 8px!important;
  padding:10px 12px!important;
  border-radius:12px!important;
}
body .emwh-app .emwh-company-actions .emwh-tag,
body .emwh-app .emwh-company-actions-stable .emwh-tag{
  margin-bottom:6px!important;
  font-size:9.5px!important;
  letter-spacing:.10em!important;
}
body .emwh-app .emwh-company-actions h2,
body .emwh-app .emwh-company-actions-stable h2{
  margin:0 0 8px!important;
  font-size:16px!important;
  line-height:1.15!important;
}
body .emwh-app .emwh-company-actions .emwh-action-grid,
body .emwh-app .emwh-company-actions-stable .emwh-action-grid{
  display:grid!important;
  grid-template-columns:repeat(6,minmax(118px,1fr))!important;
  gap:6px!important;
}
body .emwh-app .emwh-company-actions .emwh-quick,
body .emwh-app .emwh-company-actions-stable .emwh-quick{
  min-height:38px!important;
  height:38px!important;
  padding:5px 8px!important;
  display:flex!important;
  flex-direction:row!important;
  align-items:center!important;
  gap:7px!important;
  border-radius:9px!important;
  border:1px solid #d8e3ef!important;
  background:#f9fbfe!important;
  box-shadow:none!important;
}
body .emwh-app .emwh-company-actions .emwh-quick:hover,
body .emwh-app .emwh-company-actions-stable .emwh-quick:hover{
  background:#fff!important;
  border-color:#a9ccef!important;
  box-shadow:0 4px 12px rgba(6,24,43,.05)!important;
}
body .emwh-app .emwh-company-actions .emwh-quick-icon,
body .emwh-app .emwh-company-actions-stable .emwh-quick-icon{
  width:22px!important;
  height:22px!important;
  flex:0 0 22px!important;
  border-radius:7px!important;
  font-size:12px!important;
  background:#eef5ff!important;
}
body .emwh-app .emwh-company-actions .emwh-quick-copy,
body .emwh-app .emwh-company-actions-stable .emwh-quick-copy{
  min-width:0!important;
  flex:1 1 auto!important;
}
body .emwh-app .emwh-company-actions .emwh-quick b,
body .emwh-app .emwh-company-actions-stable .emwh-quick b{
  font-size:11.5px!important;
  line-height:1!important;
  font-weight:700!important;
  color:#102a43!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
body .emwh-app .emwh-company-actions .emwh-quick small,
body .emwh-app .emwh-company-actions-stable .emwh-quick small{
  display:none!important;
}
body .emwh-app .emwh-company-actions .emwh-quick em,
body .emwh-app .emwh-company-actions-stable .emwh-quick em{
  margin-left:auto!important;
  font-size:0!important;
  font-style:normal!important;
  line-height:1!important;
  color:#0b65d8!important;
}
body .emwh-app .emwh-company-actions .emwh-quick em:after,
body .emwh-app .emwh-company-actions-stable .emwh-quick em:after{
  content:'→'!important;
  font-size:14px!important;
  font-weight:900!important;
}

/* KPI / metric cards: keep the 360 view, reduce height and visual weight. */
body .emwh-app .emwh-grid.metrics,
body .emwh-app .company-snapshot.emwh-grid{
  gap:8px!important;
  margin-bottom:8px!important;
}
body .emwh-app .emwh-grid.metrics .emwh-metric,
body .emwh-app .company-snapshot.emwh-grid .emwh-metric{
  min-height:70px!important;
  padding:9px 10px!important;
  border-radius:11px!important;
  border-top-width:3px!important;
}
body .emwh-app .emwh-grid.metrics .emwh-metric small,
body .emwh-app .company-snapshot.emwh-grid .emwh-metric small{
  font-size:9px!important;
  letter-spacing:.075em!important;
  line-height:1.05!important;
}
body .emwh-app .emwh-grid.metrics .emwh-metric strong,
body .emwh-app .company-snapshot.emwh-grid .emwh-metric strong{
  font-size:16px!important;
  line-height:1.15!important;
  margin:5px 0 3px!important;
  font-weight:600!important;
}
body .emwh-app .emwh-grid.metrics .emwh-metric span,
body .emwh-app .company-snapshot.emwh-grid .emwh-metric span{
  font-size:10.5px!important;
  line-height:1.15!important;
}

/* Reduce vertical distance between Quick Actions, tabs and the General Information block. */
body .emwh-app .emwh-tabs{
  margin:6px 0 8px!important;
  gap:6px!important;
}
body .emwh-app .emwh-tabs a,
body .emwh-app .emwh-tabs span{
  padding:6px 9px!important;
  font-size:10.8px!important;
  line-height:1!important;
  border-radius:999px!important;
}
body .emwh-app .emwh-card.emwh-company-clean,
body .emwh-app .emwh-card.emwh-contact-clean,
body .emwh-app .emwh-card:has(.emwh-company-field-grid){
  padding:12px!important;
  border-radius:13px!important;
}
body .emwh-app .emwh-card h2,
body .emwh-app .emwh-company-clean h2,
body .emwh-app .emwh-contact-clean h2{
  font-size:18px!important;
  line-height:1.15!important;
  margin:4px 0 10px!important;
}
body .emwh-app .emwh-line{
  width:38px!important;
  height:1px!important;
  margin:0 0 10px!important;
}

/* Fields: thinner visual cue, less padding, calmer value weight. */
body .emwh-app .emwh-guided-field,
body .emwh-app .em-field-manual,
body .emwh-app .em-field-auto,
body .emwh-app .em-field-readonly,
body .emwh-app .em-field-valid,
body .emwh-app .em-field-error{
  border-left-width:3px!important;
  padding:6px 7px!important;
  border-radius:8px!important;
}
body .emwh-app .emwh-form,
body .emwh-app .emwh-company-field-grid,
body .emwh-app .emwh-detail-grid{
  gap:8px!important;
}
body .emwh-app .emwh-form input,
body .emwh-app .emwh-form textarea,
body .emwh-app .emwh-form select,
body .emwh-app .emwh-guided-field input,
body .emwh-app .emwh-guided-field textarea,
body .emwh-app .emwh-guided-field select{
  min-height:32px!important;
  padding:7px 9px!important;
  font-size:12px!important;
  font-weight:500!important;
  border-radius:7px!important;
}
body .emwh-app .emwh-form textarea,
body .emwh-app .emwh-guided-field textarea{
  min-height:58px!important;
}
body .emwh-app .emwh-detail-grid b,
body .emwh-app .emwh-company-clean .emwh-detail-grid b,
body .emwh-app .emwh-contact-clean .emwh-detail-grid b{
  font-size:13px!important;
  line-height:1.18!important;
  font-weight:500!important;
}
body .emwh-app .emwh-detail-grid small,
body .emwh-app .emwh-company-clean .emwh-detail-grid small,
body .emwh-app .emwh-contact-clean .emwh-detail-grid small,
body .emwh-app .emwh-guided-field label,
body .emwh-app .emwh-guided-field small:first-child{
  font-size:9px!important;
  letter-spacing:.075em!important;
  line-height:1.05!important;
}
body .emwh-app .em-field-badge,
body .emwh-app .emwh-guided-field .em-field-source,
body .emwh-app .em-guidance-badge{
  font-size:8.5px!important;
  line-height:1!important;
  padding:1px 6px!important;
  border-radius:999px!important;
}

/* Help stays off unless explicitly enabled. Errors remain visible. */
body.emwh-help-off .emwh-app .em-field-help,
.emwh-app.emwh-help-off .em-field-help,
html.emwh-help-off body .emwh-app .em-field-help{
  display:none!important;
  visibility:hidden!important;
  opacity:0!important;
  pointer-events:none!important;
}
body.emwh-help-on .emwh-app .em-field-help,
.emwh-app.emwh-help-on .em-field-help{
  display:block!important;
  font-size:10px!important;
  line-height:1.2!important;
  text-transform:none!important;
  letter-spacing:0!important;
  color:#667891!important;
}

/* Responsive behavior: preserve work density without squeezing content. */
@media(max-width:1500px){
  body .emwh-app .emwh-company-actions .emwh-action-grid,
  body .emwh-app .emwh-company-actions-stable .emwh-action-grid{grid-template-columns:repeat(3,1fr)!important;}
  body .emwh-app .emwh-grid.metrics,
  body .emwh-app .company-snapshot.emwh-grid{grid-template-columns:repeat(4,1fr)!important;}
}
@media(max-width:1100px){
  body .emwh-app .emwh-company-actions .emwh-action-grid,
  body .emwh-app .emwh-company-actions-stable .emwh-action-grid{grid-template-columns:repeat(2,1fr)!important;}
  body .emwh-app .emwh-detail-grid,
  body .emwh-app .emwh-form,
  body .emwh-app .emwh-company-field-grid{grid-template-columns:repeat(2,1fr)!important;}
}
@media(max-width:720px){
  body .emwh-app .emwh-company-actions .emwh-action-grid,
  body .emwh-app .emwh-company-actions-stable .emwh-action-grid,
  body .emwh-app .emwh-detail-grid,
  body .emwh-app .emwh-form,
  body .emwh-app .emwh-company-field-grid,
  body .emwh-app .emwh-grid.metrics,
  body .emwh-app .company-snapshot.emwh-grid{grid-template-columns:1fr!important;}
}
