/* Density follows the usable viewport and the user's browser zoom. */
.automation-presets {
  container: automation-presets / inline-size;
}
.automation-presets .crm-template-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(10px, 1.1vw, 18px);
  padding: clamp(12px, 1.2vw, 22px);
}
@container automation-presets (min-width: 550px) {
  .automation-presets .crm-template-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container automation-presets (min-width: 870px) {
  .automation-presets .crm-template-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.automation-presets .automation-card {
  min-inline-size: 0;
  grid-template-rows: auto 1fr auto auto;
  gap: 8px;
  padding: clamp(13px, 1vw, 20px);
  border: 1px solid #e6dce0;
  border-radius: 12px;
  background: #fff;
  overflow-wrap: anywhere;
}
.automation-card h3 { color: #442333; line-height: 1.35; }
.automation-card p { color: #655962; line-height: 1.5; }
.automation-card .automation-days,
.automation-card .automation-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
}
.automation-card .automation-days { grid-row: 3; }
.automation-card .automation-days input {
  box-sizing: border-box;
  width: 4.5rem;
  min-height: 38px;
  padding-inline: 8px;
  border: 1px solid #d5cbd0;
  border-radius: 7px;
  background: #fff;
  color: inherit;
  font: inherit;
}
.automation-card .automation-card-actions {
  grid-row: 4;
  padding-block-start: 8px;
  border-block-start: 1px solid #eee6e9;
}
.automation-card-actions label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  cursor: pointer;
}
.automation-card-actions input[type="checkbox"] {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: #99183c;
}
.automation-card-actions .btn { min-height: 40px; }
@media (pointer: coarse) {
  .automation-card-actions :is(.btn,label), .automation-card .automation-days input { min-height: 44px; }
}
body .app-main,.page .panel,.page .page-head>div,.page .form-grid>*{min-inline-size:0}
body .page{width:100%;max-width:2400px;margin-inline:auto}
body .topbar .topbar-actions>time.triq-clock{display:grid!important;gap:1px;min-inline-size:0;margin-inline:0 4px;text-align:end;line-height:1.25;font-variant-numeric:tabular-nums;color:#65545c}
body .topbar .triq-clock strong{color:#502439}
body .page .page-head{gap:12px;align-items:center}
body .page :is(.page-actions,.form-actions){row-gap:7px}
body .page :is(.panel-head,.panel-body,.table-wrap){min-width:0;max-width:100%}
/* Keep visually hidden column labels within the scrollable table. */
body .page .table-wrap{position:relative;overflow-x:auto}
@media(min-width:761px) and (max-width:1500px){
 body .page{padding:clamp(14px,1.3vw,20px) clamp(14px,1.55vw,24px) 28px}
 body .app-main .topbar{min-height:54px;padding-block:5px}
 body .page .page-head{margin-bottom:14px}
 body .page :is(.panel-head,.panel-body){padding:clamp(11px,1vw,15px)}
 body .page :is(.page-head h1,.record-head h1){font-size:clamp(21px,1.7vw,25px)}
 body .page .table :is(td,th){padding-block:10px}
}
@media(min-width:1501px){
 body .app-shell{font-size:clamp(14px,.83vw,19px)}
 body .page{padding:clamp(22px,1.6vw,40px) clamp(24px,2vw,52px) 42px}
 body .page .page-head h1{font-size:clamp(26px,1.5vw,38px)}
 body .page :is(.panel-head h2,.section-title){font-size:clamp(16px,1vw,23px)}
 body .app-shell :is(.nav-link,.btn,.subnav button,.search-trigger,.table td,.panel-body p,.page-head p,.refdash-card p,.field input,.field select){font-size:clamp(13px,.78vw,18px)}
 body .app-shell :is(.table th,.table small,.field>span,.stat small,.panel small,.topbar .triq-clock){font-size:clamp(11px,.69vw,16px)}
 body .app-shell .topbar .triq-clock strong{font-size:clamp(12px,.76vw,17px)}
 body .page :is(.panel-head,.panel-body){padding:clamp(16px,1.2vw,28px)}
 body .page .table :is(td,th){padding-block:clamp(12px,.85vw,21px)}
 body .topbar-start .topbar-context{max-width:220px}
}
body .modal.attendance-day-modal{width:min(620px,100%);max-width:620px;height:auto;align-self:center;border-radius:16px}
.attendance-day-sheet.workspace-stack{display:grid;gap:12px}
.attendance-day-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
.attendance-day-heading h3,.attendance-day-sheet p{margin:0}
.attendance-day-heading small,.attendance-timeline span{color:#665862}
.day-status .badge{display:inline-flex;align-items:center;gap:7px;padding:6px 12px;border-radius:20px;font-weight:700}
.day-status .badge::before{content:'';width:7px;height:7px;background:currentColor;border-radius:50%}
.day-status .badge.blue{color:#075f43;background:#def5e9}.day-status .badge.amber{color:#784213;background:#fff0d3}
.attendance-day-sheet .people-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:0}
.attendance-day-sheet .people-stats>div{padding:10px;border-radius:9px;min-width:0}
.attendance-timeline .workspace-list-row{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:8px 2px;min-height:0}
.attendance-day-sheet .attendance-correction{border-top:1px solid #e7dce1;padding-top:10px}
.attendance-correction summary{cursor:pointer;color:#852043;font-weight:650}.attendance-correction form{margin-top:10px}
.attendance-day-sheet>button{justify-self:start}
.leave-register>.panel-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.leave-register .workspace-inline{align-items:end}.leave-register .field{margin:0}
.leave-register .tabs{display:flex;gap:4px;align-items:center;background:#f6f1f3;border-radius:10px;padding:3px}
.leave-register .tabs .btn{border-radius:7px;min-height:35px}
.leave-list{display:grid}.leave-row{display:grid;grid-template-columns:minmax(140px,1fr) minmax(160px,1.8fr) minmax(92px,auto) minmax(100px,auto);align-items:center;gap:clamp(10px,1.3vw,24px);padding:14px 4px;border-bottom:1px solid #eee5e9}
.leave-row:last-child{border-bottom:0}.leave-identity,.leave-actions,.leave-state{display:flex;align-items:center;gap:8px}.leave-actions,.leave-state{flex-wrap:wrap}.leave-actions{justify-content:flex-end}
.leave-identity>div,.leave-period{min-width:0;overflow-wrap:anywhere}.leave-identity strong,.leave-identity small{display:block}.leave-identity small,.leave-period p{color:#695961}.leave-period p{margin:2px 0 0;line-height:1.4}
.leave-state[data-status="Approved"] .badge{background:#dff3e9;color:#155f44}.leave-state[data-status="Pending"] .badge{background:#fff1d6;color:#805118}
.salary-workspace .refops-payroll-summary{display:grid;grid-template-columns:minmax(120px,1fr) minmax(160px,1.5fr) minmax(145px,1fr);align-items:center;gap:16px;border:1px solid #e8dade;border-inline-start:4px solid #99183c;background:linear-gradient(115deg,#fff2f5,#fff 65%);border-radius:14px;padding:16px 20px}
.salary-workspace .refops-payroll-summary>div{min-width:0;display:grid;gap:3px}.salary-workspace .refops-payroll-summary strong{font-size:clamp(22px,1.65vw,36px);line-height:1.2;font-variant-numeric:tabular-nums}
.salary-workspace .refops-payroll-summary .field{justify-self:end;margin:0}.salary-workspace .salary-periods{align-items:flex-end}
.salary-workspace .salary-periods .field{margin:0}.salary-workspace .salary-amount{font-variant-numeric:tabular-nums}
.salary-workspace .salary-net strong{color:#801737}.salary-workspace .salary-period small{display:block}
@media(min-width:761px){.salary-workspace .salary-register :is(th:nth-child(n+3),td.salary-amount){text-align:end}.salary-workspace .salary-action{text-align:end}}
body .refutil-chat-message.message-pending{opacity:.72}.message-pending small{font-style:italic}
@media(max-width:900px){.leave-row{grid-template-columns:minmax(0,1fr) auto;gap:7px 12px}.leave-state{grid-column:2;grid-row:1;justify-content:flex-end}.leave-period{grid-column:1/-1}.leave-actions{grid-column:1/-1;justify-content:flex-start}}
@media(max-width:760px){
 body .topbar .topbar-actions>time.triq-clock{margin-inline:0;font-size:9px;flex:none}body .topbar .topbar-actions>time.triq-clock strong{font-size:11px}
 body .modal.attendance-day-modal{max-height:calc(var(--triq-visible-height,100dvh) - 12px);width:calc(100% - 12px);max-width:620px}
 .attendance-day-sheet .people-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
 .salary-workspace .refops-payroll-summary{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;padding:12px}.salary-workspace .refops-payroll-summary .field{grid-column:1/-1;justify-self:stretch}
 .leave-register>.panel-head{align-items:stretch}.leave-register .workspace-inline{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%}
 .leave-row{padding:12px 0}.leave-actions .btn{min-height:40px}
}

.refdash-chart-card>header{flex-wrap:wrap;gap:10px}
.refdash-chart-card .activity-chart-controls{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.activity-chart-controls select{font:inherit;font-size:12px;color:#72223c;background:#fff;border:1px solid #e5d8dc;border-radius:7px;min-height:32px;width:auto;padding:4px 6px}
.refdash-chart-card .refdash-periods .active{color:#8b1239;background:#f8eaf0}
.refdash-chart-card [data-refdash-point]:focus-visible{outline:none;fill:rgba(162,30,72,.09)}
@media(max-width:600px){.refdash-chart-card .activity-chart-controls{gap:4px}.activity-chart-controls select{min-height:34px;font-size:12px}.refdash-chart-card .refdash-periods .refdash-btn{min-height:32px}}

.crm-current-followup{display:grid;gap:4px;padding:12px 16px;background:#fbf2f5;border-inline-start:3px solid #9d1941;border-radius:8px;margin-block:10px}
.holiday-heading,.refops .holiday-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}
.refops .refops-holidays{display:block}.holiday-month{margin-block:20px}.holiday-month h3{margin-bottom:8px}
.holiday-month .refops-holiday{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:14px;margin-block:6px}
.holiday-info{min-width:0;overflow-wrap:anywhere}.holiday-info small{display:block;margin-top:3px}
.holiday-actions{position:relative}.holiday-actions summary{cursor:pointer;list-style:none;padding:10px;color:#82143b}
.holiday-actions[open]>div{position:absolute;z-index:6;inset-inline-end:0;top:100%;min-width:100px;background:white;border:1px solid #dfd8dc;border-radius:8px;padding:4px;box-shadow:0 5px 16px #3011221a}
.holiday-actions .btn{display:block;width:100%}
