
.contract-page-head{
  display:flex;align-items:flex-end;justify-content:space-between;gap:20px;margin-bottom:18px
}
.contract-page-head h2{margin:3px 0 5px}
.contract-page-head p{margin:0;color:var(--muted,#6b7890)}
.contract-toolbar{
  display:flex;align-items:center;justify-content:space-between;gap:14px;
  padding:13px 15px;margin-bottom:17px;border:1px solid var(--border,#e1e7f0);
  border-radius:15px;background:#fff;box-shadow:var(--shadow,0 8px 24px rgba(20,39,75,.06))
}
.contract-search{
  display:flex;align-items:center;gap:9px;flex:1;max-width:520px
}
.contract-search>span{font-size:1.2rem;color:#65738b}
.contract-search input{
  width:100%;min-height:42px;padding:9px 12px;border:1px solid #dfe5ef;
  border-radius:11px;background:#f8faff
}
.contract-counter{
  padding:7px 11px;border-radius:999px;background:#eef2ff;color:#485b83;font-size:.85rem
}
.contract-type-grid{
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:15px
}
.contract-type-card{
  display:flex;flex-direction:column;min-height:235px;padding:18px;
  border:1px solid var(--border,#e1e7f0);border-top:4px solid var(--contract-color);
  border-radius:17px;background:#fff;box-shadow:0 10px 26px rgba(30,49,83,.07);
  transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease
}
.contract-type-card:hover{
  transform:translateY(-2px);box-shadow:0 14px 30px rgba(30,49,83,.11)
}
.contract-card-head{display:flex;align-items:flex-start;gap:13px}
.contract-icon{
  flex:0 0 50px;width:50px;height:50px;display:grid;place-items:center;
  border-radius:14px;background:color-mix(in srgb,var(--contract-color) 14%,white);
  font-size:1.45rem
}
.contract-title{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;flex:1;min-width:0}
.contract-title strong{
  color:#102348;font-size:1rem;line-height:1.3;overflow-wrap:anywhere
}
.contract-code{
  flex:0 0 auto;padding:5px 8px;border-radius:8px;
  background:color-mix(in srgb,var(--contract-color) 13%,white);
  color:var(--contract-color);font-size:.72rem;font-weight:900;letter-spacing:.05em
}
.contract-description{
  min-height:46px;margin:16px 0 13px;color:#526078;line-height:1.45
}
.contract-flags{display:flex;flex-wrap:wrap;gap:7px;margin-bottom:15px}
.contract-flags span{
  padding:6px 9px;border-radius:999px;font-size:.73rem;font-weight:750
}
.contract-flags .is-enabled{background:#edf8f2;color:#16704b}
.contract-flags .is-disabled{background:#f3f5f8;color:#8792a4}
.contract-card-actions{
  display:flex;justify-content:flex-end;gap:8px;margin-top:auto;padding-top:13px;
  border-top:1px solid #edf0f5
}
.contract-card-actions form{margin:0}
.contract-action{
  min-height:37px;padding:7px 10px;border-radius:9px;border:1px solid transparent;
  background:transparent;font-weight:800;cursor:pointer
}
.contract-action-edit{color:#3157d8;background:#eef2ff}
.contract-action-edit:hover{background:#e2e8ff}
.contract-action-archive{color:#a8404d;border-color:#f0c9ce}
.contract-action-archive:hover{background:#fff1f3}
.contract-empty,.contract-no-result{
  padding:45px 20px;text-align:center;border:1px dashed #cfd7e5;border-radius:17px;background:#fff
}
.contract-empty>span,.contract-no-result>span{display:block;font-size:2rem;margin-bottom:8px}
.contract-empty h3,.contract-no-result strong{color:#102348}
.contract-empty p,.contract-no-result p{margin:5px 0 0;color:#6c7890}
.contract-modal[hidden]{display:none}
.contract-modal{
  position:fixed;z-index:10000;inset:0;display:grid;place-items:center;padding:20px
}
.contract-modal-backdrop{position:absolute;inset:0;background:rgba(10,24,52,.56);backdrop-filter:blur(3px)}
.contract-modal-dialog{
  position:relative;width:min(780px,100%);max-height:calc(100vh - 40px);overflow:auto;
  border-radius:19px;background:#fff;box-shadow:0 25px 65px rgba(9,23,50,.28)
}
.contract-modal-dialog>header{
  position:sticky;top:0;z-index:2;display:flex;justify-content:space-between;gap:15px;
  padding:19px 22px;border-bottom:1px solid #e5eaf2;background:#fff
}
.contract-modal-dialog h3{margin:3px 0 0;color:#102348}
.contract-modal-close{
  width:38px;height:38px;border:0;border-radius:10px;background:#f2f4f8;
  color:#44516a;font-size:1.55rem;cursor:pointer
}
.contract-modal form{padding:21px 22px}
.contract-form-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:15px}
.contract-form-grid label{display:grid;gap:7px}
.contract-form-grid label>span{font-weight:750;color:#263a5d}
.contract-form-grid em{color:#c9344b;font-style:normal}
.contract-form-grid .wide{grid-column:span 2}
.contract-form-grid input,.contract-form-grid textarea{
  width:100%;padding:10px 11px;border:1px solid #dce3ee;border-radius:10px;background:#fff
}
.contract-options{
  grid-column:1/-1;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;
  padding:13px;border:1px solid #dfe5ef;border-radius:13px
}
.contract-options legend{padding:0 7px;font-weight:850;color:#263a5d}
.contract-options label{
  display:flex;align-items:flex-start;gap:9px;padding:10px;border-radius:10px;background:#f8faff
}
.contract-options input{width:auto;margin-top:3px}
.contract-options strong,.contract-options small{display:block}
.contract-options small{margin-top:2px;color:#6d798d;font-weight:400}
.contract-modal form>footer{
  display:flex;justify-content:flex-end;gap:10px;margin-top:19px;padding-top:16px;border-top:1px solid #e6ebf2
}
.contract-modal-open{overflow:hidden}
@media(max-width:1050px){
  .contract-type-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:720px){
  .contract-page-head{align-items:stretch;flex-direction:column}
  .contract-page-head .button{width:100%}
  .contract-toolbar{align-items:stretch;flex-direction:column}
  .contract-search{max-width:none}
  .contract-counter{align-self:flex-start}
  .contract-form-grid{grid-template-columns:1fr 1fr}
  .contract-options{grid-template-columns:1fr}
}
@media(max-width:560px){
  .contract-type-grid,.contract-form-grid{grid-template-columns:1fr}
  .contract-form-grid .wide{grid-column:auto}
  .contract-type-card{min-height:0}
  .contract-title{align-items:flex-start;flex-direction:column}
  .contract-card-actions{justify-content:stretch}
  .contract-card-actions>*{flex:1}
  .contract-action{width:100%}
  .contract-modal{padding:0}
  .contract-modal-dialog{width:100%;height:100%;max-height:none;border-radius:0}
}
