/* VIHAN CRM V12.6.1 — Stability, responsive and visual consistency */
:root{--v1261-radius:14px;--v1261-gap:16px;--v1261-control:44px;--v1261-border:#dce6f1;--v1261-shadow:0 8px 26px rgba(20,46,78,.07)}
.crm-v7 .card,.crm-v7 .box,.partner-module .box{border-radius:var(--v1261-radius);box-shadow:var(--v1261-shadow)}
.crm-v7 button,.crm-v7 .btn,.crm-v7 .button,.partner-module button,.partner-module .button{min-height:40px;display:inline-flex;align-items:center;justify-content:center;gap:7px;line-height:1.2}
.crm-v7 input,.crm-v7 select,.crm-v7 textarea,.partner-module input,.partner-module select,.partner-module textarea{max-width:100%}
.crm-v7 input:not([type=checkbox]):not([type=radio]):not([type=hidden]),.crm-v7 select,.partner-module input:not([type=checkbox]):not([type=radio]):not([type=hidden]),.partner-module select{min-height:var(--v1261-control)}
.crm-v7 .page-head,.partner-module .heading{gap:16px}
.crm-v7 .page-head>div,.partner-module .heading>div{min-width:0}
.crm-v7 .page-head h1,.partner-module .heading h1{overflow-wrap:anywhere}
.crm-v7 .card-head,.partner-module .section-head,.partner-module .list-title{gap:14px}
.crm-v7 .admin-tabs,.partner-module .tabs{display:flex;align-items:center;gap:8px;overflow-x:auto;scrollbar-width:thin;padding-bottom:5px}
.crm-v7 .admin-tabs a,.partner-module .tabs a{flex:0 0 auto;white-space:nowrap}
.crm-v7 .table-scroll,.partner-module .table{max-width:100%;overflow:auto;-webkit-overflow-scrolling:touch}
.crm-v7 table,.partner-module table{width:100%}
.crm-v7 .form-grid,.partner-module .grid{align-items:end}

/* Health dashboard */
.health-page-head{align-items:center}
.health-page-head .eyebrow{display:block;margin-bottom:6px;color:#1761bb;font-size:11px;font-weight:850;letter-spacing:.13em}
.health-hero{display:flex;align-items:center;justify-content:space-between;gap:24px;margin-bottom:20px;padding:25px 28px;border:1px solid var(--v1261-border);border-left:5px solid #13864f;border-radius:16px;background:linear-gradient(135deg,#f2fbf6,#fff);box-shadow:var(--v1261-shadow)}
.health-hero.has-error{border-left-color:#c83f3f;background:linear-gradient(135deg,#fff5f5,#fff)}
.health-hero small{color:#667b92;font-size:11px;font-weight:850;letter-spacing:.12em}.health-hero h2{margin:4px 0;font-size:27px}.health-hero p{margin:0;color:#66788e}
.health-score{display:grid;place-items:center;flex:0 0 116px;height:116px;border:9px solid #d9f0e3;border-radius:50%;background:#fff}.health-score strong{font-size:27px;color:#087a43}.health-score span{margin-top:-11px;color:#6b7d91;font-size:11px}
.health-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}.health-card{margin:0;padding:0;overflow:hidden}.health-card .card-head{padding:20px 22px;border-bottom:1px solid #e4ebf3}.health-card .card-head h2{margin:0}.health-list{padding:5px 22px 13px}.health-row{display:grid;grid-template-columns:10px minmax(0,1fr) auto;align-items:center;gap:11px;padding:12px 0;border-bottom:1px solid #edf1f5}.health-row:last-child{border-bottom:0}.health-row div{display:flex;min-width:0;flex-direction:column}.health-row small{overflow-wrap:anywhere;color:#718298}.health-row em{font-size:11px;font-style:normal;font-weight:850}.health-dot{width:9px;height:9px;border-radius:50%;background:#13864f;box-shadow:0 0 0 4px #e3f4eb}.health-row.error .health-dot{background:#c83f3f;box-shadow:0 0 0 4px #fde8e8}.health-row.warn .health-dot{background:#c88913;box-shadow:0 0 0 4px #fff2d8}.health-row.ok em{color:#087a43}.health-row.error em{color:#b42318}.health-row.warn em{color:#91640b}
.permission-matrix{margin-top:20px}.permission-matrix th{white-space:nowrap;background:#f3f7fb}.permission-matrix td:first-child{font-weight:750}.health-note{display:flex;align-items:center;gap:12px;margin-top:20px}.health-note span{color:#697c91}.health-note code{padding:5px 8px;border-radius:7px;background:#edf3fa;color:#174f96}

/* Sales & commission alignment */
.partner-module .reconciliation-toolbar{grid-template-columns:minmax(300px,1fr) minmax(480px,auto);align-items:center}
.partner-module .reconciliation-actions{min-width:0}
.partner-module .period-action-form{min-width:0}
.partner-module .commission-filters>*{min-width:0}
.partner-module .commission-filters label{margin:0}
.partner-module .commission-filters button{height:var(--v1261-control);white-space:nowrap}
.partner-module .kpis article{min-width:0}.partner-module .kpis strong{overflow-wrap:anywhere}
.partner-module .review-actions,.partner-module .table-actions,.crm-v7 .actions{align-items:center}

@media(max-width:1180px){
  .health-grid{grid-template-columns:1fr}
  .partner-module .reconciliation-toolbar{grid-template-columns:1fr}
  .partner-module .reconciliation-actions{justify-content:flex-start;width:100%}
}
@media(max-width:900px){
  .crm-v7 .page-head,.partner-module .heading{align-items:flex-start;flex-direction:column}
  .crm-v7 .page-head>.btn,.crm-v7 .page-head>.button,.partner-module .heading>.button{width:100%}
  .crm-v7 .grid2,.crm-v7 .grid3{grid-template-columns:1fr}
  .partner-module .commission-filters{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .partner-module .commission-filters button{width:100%}
}
@media(max-width:680px){
  :root{--v1261-gap:12px;--v1261-control:46px}
  .crm-v7 .app-content{padding-left:13px!important;padding-right:13px!important}
  .crm-v7 .card,.crm-v7 .box,.partner-module .box{border-radius:12px}
  .crm-v7 .page-head h1,.partner-module .heading h1{font-size:24px;line-height:1.2}
  .crm-v7 .page-head p,.partner-module .heading p{font-size:13px}
  .crm-v7 .admin-tabs,.partner-module .tabs{margin-left:-2px;margin-right:-2px;padding:2px 2px 8px}
  .crm-v7 .admin-tabs a,.partner-module .tabs a{min-height:40px;padding:9px 12px}
  .health-hero{align-items:flex-start;flex-direction:column;padding:21px}.health-score{width:94px;height:94px;flex-basis:94px;border-width:7px}.health-score strong{font-size:23px}
  .health-card .card-head,.health-list{padding-left:17px;padding-right:17px}.health-row{grid-template-columns:10px 1fr}.health-row em{grid-column:2}
  .health-note{align-items:flex-start;flex-direction:column}
  .partner-module .reconciliation-actions{display:grid!important;grid-template-columns:1fr!important}
  .partner-module .reconciliation-actions>*{width:100%!important}
  .partner-module .period-action-form,.partner-module .commission-filters{grid-template-columns:1fr!important;width:100%}
  .partner-module .period-action-form button,.partner-module .commission-filters button{width:100%}
  .partner-module .kpis{grid-template-columns:1fr 1fr!important}
  .partner-module .kpis article{padding:14px}
  .partner-module .table{border:1px solid var(--v1261-border);border-radius:10px}
  .crm-v7 .form-grid,.partner-module .grid{grid-template-columns:1fr!important}
  .crm-v7 .card-head,.partner-module .section-head,.partner-module .list-title{align-items:stretch;flex-direction:column}
  .crm-v7 .card-head .btn,.crm-v7 .card-head .button,.partner-module .section-head .button,.partner-module .list-title .button{width:100%}
}
@media(max-width:420px){
  .partner-module .kpis{grid-template-columns:1fr!important}
  .crm-v7 .app-content{padding-left:10px!important;padding-right:10px!important}
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;transition:none!important;animation:none!important}}
