:root{
  --cnkd-radius-sm:6px;
  --cnkd-radius-md:8px;
  --cnkd-radius-lg:8px;
  --cnkd-radius-xl:8px;
  --cnkd-space-1:4px;
  --cnkd-space-2:8px;
  --cnkd-space-3:12px;
  --cnkd-space-4:16px;
  --cnkd-space-5:20px;
  --cnkd-space-6:24px;
  --cnkd-font-xs:12px;
  --cnkd-font-sm:13px;
  --cnkd-font-md:14px;
  --cnkd-font-lg:16px;
  --cnkd-font-xl:18px;
  --cnkd-control-sm:30px;
  --cnkd-control-md:36px;
  --cnkd-control-lg:42px;
  --cnkd-shadow-focus:0 0 0 3px rgba(59,130,246,.14);
  --cnkd-surface:var(--card);
  --cnkd-surface-soft:var(--border-weak);
  --cnkd-line:var(--border);
  --cnkd-line-soft:var(--border-weak);
}

html[data-theme="dark"]{
  --cnkd-shadow-focus:0 0 0 3px rgba(96,165,250,.18);
}

:where(
  .cn-page-head,
  .cn-page-head *,
  .cn-toolbar,
  .cn-toolbar *,
  .cn-filter,
  .cn-filter *,
  .cn-action-bar,
  .cn-action-bar *,
  .cn-data-shell,
  .cn-data-shell *,
  .cn-action-list,
  .cn-action-list *,
  .cn-empty,
  .cn-empty *,
  .cn-segmented,
  .cn-segmented *,
  .cn-page-kpis,
  .cn-page-kpis *,
  .cn-mini-stat,
  .cn-mini-stat *,
  .cn-workflow-strip,
  .cn-workflow-strip *,
  .cn-form-grid-12,
  .cn-form-grid-12 *,
  .cn-table-empty,
  .cn-table-empty *
){
  box-sizing:border-box;
}

.cn-page-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:var(--cnkd-space-4);
  padding:var(--cnkd-space-4);
  border:1px solid var(--cnkd-line);
  border-radius:var(--cnkd-radius-lg);
  background:var(--cnkd-surface);
  width:100%;
  max-width:100%;
  min-width:0;
}
.cn-page-head__main{
  min-width:0;
  display:grid;
  gap:var(--cnkd-space-2);
}
.cn-page-head__title{
  margin:0;
  color:var(--text);
  font-size:var(--cnkd-font-xl);
  font-weight:950;
  line-height:1.25;
}
.cn-page-head__desc{
  color:var(--muted);
  font-size:var(--cnkd-font-sm);
  line-height:1.55;
  overflow-wrap:anywhere;
}
.cn-page-head__meta,
.cn-page-head__actions{
  display:flex;
  align-items:center;
  gap:var(--cnkd-space-2);
  flex-wrap:wrap;
}
.cn-page-head__actions{
  justify-content:flex-end;
  flex:0 0 auto;
  min-width:0;
}
.cn-page-head__actions :where(.btn,.pill,button,a),
.cn-filter__actions :where(.btn,.pill,button,a),
.cn-toolbar__actions :where(.btn,.pill,button,a),
.cn-action-bar__actions :where(.btn,.pill,button,a),
.cn-empty__actions :where(.btn,.pill,button,a){
  max-width:100%;
  min-width:0;
  white-space:normal;
  text-align:center;
}
.cn-page-head--flat{
  border-radius:0;
  border-left:0;
  border-right:0;
  border-top:0;
}
.module > .cn-page-head:first-child,
.module > form.cn-filter:first-child{
  border-left:0;
  border-right:0;
  border-top:0;
  border-radius:0;
}
.module > .cn-page-head:first-child{
  margin:0;
}

.cn-toolbar,
.cn-filter,
.cn-action-bar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:var(--cnkd-space-3);
  flex-wrap:wrap;
  padding:var(--cnkd-space-3);
  border:1px solid var(--cnkd-line);
  border-radius:var(--cnkd-radius-lg);
  background:var(--cnkd-surface);
  width:100%;
  max-width:100%;
  min-width:0;
}
.cn-filter{
  align-items:flex-end;
}
.cn-filter__grid{
  flex:1 1 520px;
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:var(--cnkd-space-2);
  min-width:0;
}
.cn-filter__grid > *,
.cn-filter .field,
.cn-action-bar > *,
.cn-data-shell__head > *{
  min-width:0;
}
.cn-filter__actions,
.cn-toolbar__actions,
.cn-action-bar__actions{
  display:flex;
  align-items:center;
  gap:var(--cnkd-space-2);
  flex-wrap:wrap;
  min-width:0;
}
.cn-action-bar__actions{
  flex:1 1 360px;
  justify-content:flex-end;
}
.cn-action-bar__actions :where(.input,.select,select,input[type="text"],input[type="search"]){
  min-width:0;
  max-width:100%;
}
.cn-segmented{
  display:inline-flex;
  align-items:center;
  gap:4px;
  flex-wrap:nowrap;
  padding:3px;
  border:1px solid var(--cnkd-line);
  border-radius:var(--cnkd-radius-sm);
  background:var(--cnkd-surface-soft);
  max-width:100%;
  overflow-x:auto;
}
.cn-page-head__actions.cn-segmented{
  flex-wrap:nowrap;
}
.cn-segmented__item{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  min-height:28px;
  padding:4px 10px;
  border-radius:var(--cnkd-radius-sm);
  color:var(--muted);
  text-decoration:none;
  font-size:var(--cnkd-font-xs);
  font-weight:850;
  white-space:nowrap;
  border:1px solid transparent;
}
.cn-segmented__item:hover{
  color:var(--text);
  background:rgba(59,130,246,.08);
  border-color:rgba(59,130,246,.16);
}
.cn-segmented__item.is-active,
.cn-segmented__item.active{
  color:var(--primary);
  background:rgba(59,130,246,.12);
  border-color:rgba(59,130,246,.22);
}
.cn-page-kpis{
  display:flex;
  align-items:center;
  gap:var(--cnkd-space-2);
  flex-wrap:wrap;
}
.cn-mini-stat{
  min-width:96px;
  padding:8px 10px;
  border:1px solid var(--cnkd-line);
  border-radius:var(--cnkd-radius-sm);
  background:var(--cnkd-surface-soft);
}
.cn-mini-stat__label{
  color:var(--muted);
  font-size:var(--cnkd-font-xs);
  font-weight:800;
}
.cn-mini-stat__value{
  margin-top:2px;
  color:var(--text);
  font-size:var(--cnkd-font-lg);
  font-weight:950;
  line-height:1.15;
}

.cn-state{
  display:inline-flex;
  align-items:center;
  gap:6px;
  min-height:24px;
  padding:2px 8px;
  border-radius:var(--cnkd-radius-sm);
  border:1px solid var(--cnkd-line);
  background:var(--cnkd-surface-soft);
  color:var(--muted);
  font-size:var(--cnkd-font-xs);
  font-weight:850;
  white-space:nowrap;
}
.cn-state.is-success{color:var(--success);background:rgba(16,185,129,.10);border-color:rgba(16,185,129,.20);}
.cn-state.is-warning{color:var(--warning);background:rgba(245,158,11,.10);border-color:rgba(245,158,11,.22);}
.cn-state.is-danger{color:var(--danger);background:rgba(239,68,68,.10);border-color:rgba(239,68,68,.20);}
.cn-state.is-primary{color:var(--primary);background:rgba(59,130,246,.10);border-color:rgba(59,130,246,.20);}

.cn-empty{
  display:grid;
  gap:var(--cnkd-space-2);
  justify-items:start;
  padding:var(--cnkd-space-5);
  border:1px dashed var(--cnkd-line);
  border-radius:var(--cnkd-radius-lg);
  background:var(--cnkd-surface-soft);
  color:var(--muted);
}
.cn-empty__title{
  color:var(--text);
  font-weight:900;
}
.cn-empty__desc{
  font-size:var(--cnkd-font-sm);
  line-height:1.55;
}
.cn-empty__actions{
  display:flex;
  align-items:center;
  gap:var(--cnkd-space-2);
  flex-wrap:wrap;
  margin-top:var(--cnkd-space-1);
}

.cn-action-list{
  display:grid;
  gap:0;
  border:1px solid var(--cnkd-line);
  border-radius:var(--cnkd-radius-lg);
  overflow:hidden;
  background:var(--cnkd-surface);
}
.cn-action-list__item{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:var(--cnkd-space-3);
  align-items:center;
  padding:var(--cnkd-space-3);
  border-bottom:1px solid var(--cnkd-line-soft);
  color:inherit;
  text-decoration:none;
}
.cn-action-list__item:last-child{
  border-bottom:0;
}
.cn-action-list__item:hover{
  background:var(--cnkd-surface-soft);
}
.cn-action-list__main{
  min-width:0;
}
.cn-action-list__title{
  color:var(--text);
  font-weight:900;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.cn-action-list__desc{
  margin-top:2px;
  color:var(--muted);
  font-size:var(--cnkd-font-xs);
  line-height:1.45;
  overflow-wrap:anywhere;
}
.cn-action-list__ops{
  display:flex;
  align-items:center;
  gap:var(--cnkd-space-2);
  flex-wrap:wrap;
  justify-content:flex-end;
}

.cn-data-shell{
  border:1px solid var(--cnkd-line);
  border-radius:var(--cnkd-radius-lg);
  background:var(--cnkd-surface);
  overflow:hidden;
  width:100%;
  max-width:100%;
  min-width:0;
}
.cn-data-shell__head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:var(--cnkd-space-3);
  padding:var(--cnkd-space-3);
  border-bottom:1px solid var(--cnkd-line-soft);
}
.cn-data-shell__title{
  color:var(--text);
  font-size:var(--cnkd-font-md);
  font-weight:950;
}
.cn-data-shell__sub{
  margin-top:2px;
  color:var(--muted);
  font-size:var(--cnkd-font-xs);
}
.cn-data-shell__body{
  overflow:auto;
  max-width:100%;
  -webkit-overflow-scrolling:touch;
}
.cn-data-shell__body > table,
.cn-data-shell__body .table{
  margin:0;
}
.cn-data-shell__body > table:first-child,
.cn-data-shell__body .table:first-child{
  min-width:max(760px, 100%);
}

.cn-workflow-strip{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
  gap:var(--cnkd-space-2);
  margin-top:var(--cnkd-space-3);
}
.cn-workflow-strip__item{
  min-width:0;
  padding:10px 12px;
  border:1px solid var(--cnkd-line);
  border-radius:var(--cnkd-radius-sm);
  background:var(--cnkd-surface-soft);
}
.cn-workflow-strip__label{
  color:var(--muted);
  font-size:var(--cnkd-font-xs);
  font-weight:850;
}
.cn-workflow-strip__value{
  margin-top:4px;
  color:var(--text);
  font-size:var(--cnkd-font-sm);
  font-weight:950;
  line-height:1.35;
  overflow-wrap:anywhere;
}
.cn-table-empty{
  display:grid;
  gap:var(--cnkd-space-1);
  padding:var(--cnkd-space-4);
  border:1px dashed var(--cnkd-line);
  border-radius:var(--cnkd-radius-sm);
  background:var(--cnkd-surface-soft);
  color:var(--muted);
}
.cn-table-empty__title{
  color:var(--text);
  font-weight:900;
}
.cn-table-empty__desc{
  font-size:var(--cnkd-font-xs);
  line-height:1.5;
}
.cn-form-grid-12{
  display:grid;
  grid-template-columns:repeat(12,minmax(0,1fr));
  gap:10px;
  align-items:end;
}

.cn-field-stack{
  display:grid;
  gap:var(--cnkd-space-2);
}
.cn-field-help{
  color:var(--muted);
  font-size:var(--cnkd-font-xs);
  line-height:1.45;
}
.cn-divider{
  height:1px;
  background:var(--cnkd-line-soft);
  margin:var(--cnkd-space-4) 0;
}

:where(.cn-page-head,.cn-toolbar,.cn-filter,.cn-action-bar,.cn-data-shell,.cn-empty) :where(.input,.select,.btn,.pill):focus-visible{
  box-shadow:var(--cnkd-shadow-focus);
}

@media(max-width:900px){
  .cn-page-head{
    flex-direction:column;
  }
  .cn-page-head__actions{
    justify-content:flex-start;
    width:100%;
  }
  .cn-filter__grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}
@media(max-width:560px){
  .cn-page-head,
  .cn-toolbar,
  .cn-filter,
  .cn-action-bar{
    padding:var(--cnkd-space-3);
  }
  .cn-filter__grid{
    grid-template-columns:1fr;
  }
  .cn-page-head__actions,
  .cn-filter__actions,
  .cn-toolbar__actions,
  .cn-action-bar__actions{
    width:100%;
    display:grid;
    grid-template-columns:1fr;
    min-width:0;
  }
  .cn-page-head__actions > *,
  .cn-filter__actions > *,
  .cn-toolbar__actions > *,
  .cn-action-bar__actions > *{
    min-width:0;
    width:100%;
    justify-content:center;
  }
  .cn-action-bar__actions :where(.input,.select,select,input[type="text"],input[type="search"]){
    width:100% !important;
  }
  .cn-page-head__actions.cn-segmented{
    display:flex;
    grid-template-columns:none;
  }
  .cn-page-head__actions.cn-segmented > *{
    width:auto;
  }
  .cn-data-shell__head{
    align-items:flex-start;
    flex-direction:column;
  }
  .cn-data-shell__head .cn-action-bar__actions{
    width:100%;
  }
  .cn-data-shell__body{
    max-width:100%;
    overflow-x:auto;
  }
  .cn-action-list__item{
    grid-template-columns:1fr;
  }
  .cn-action-list__ops{
    justify-content:flex-start;
  }
  .cn-form-grid-12{
    grid-template-columns:1fr !important;
  }
  .cn-form-grid-12 > *{
    grid-column:1 / -1 !important;
  }
  .cn-segmented{
    width:100%;
  }
  .cn-segmented__item{
    flex:1 0 auto;
  }
  .cn-page-kpis{
    width:100%;
    display:grid;
    grid-template-columns:1fr 1fr;
  }
  .cn-mini-stat{
    min-width:0;
  }
  .cn-empty__actions{
    width:100%;
    display:grid;
    grid-template-columns:1fr;
  }
  .cn-empty__actions > *{
    width:100%;
    justify-content:center;
  }
}
