/* =========================================================
   GIGZAKAZ 2.9.1 FINAL — COMPANY COMPACT UX
   GZ_COMPANY_COMPACT_2_9_1_FINAL
   ========================================================= */

/* --- Сотрудники: минимум высоты, вся операция видна сразу --- */
.company-team-card {
  padding: 13px 16px !important;
}
.company-team-head {
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 4px !important;
}
.company-team-title { min-width: 0; }
.company-team-note {
  margin: 2px 0 0 !important;
  font-size: 11px;
  line-height: 1.3;
}
.company-team-list .deal-empty {
  padding: 2px 0 3px !important;
  font-size: 12px;
  line-height: 1.3;
}
.company-team-form {
  display: grid !important;
  grid-template-columns: minmax(140px, .9fr) minmax(190px, 1.15fr) minmax(125px, .68fr) auto;
  gap: 7px !important;
  align-items: center;
  margin-top: 7px !important;
}
.company-team-form > * {
  min-width: 0;
  width: 100%;
}
.company-team-form .field-dark,
.company-team-form #emp-add {
  min-height: 38px !important;
  height: 38px !important;
}
.company-team-form #emp-add {
  width: auto;
  padding: 7px 13px;
  white-space: nowrap;
}

.company-team-list .emp-row {
  padding: 7px 0 !important;
}
.company-team-list .emp-head {
  display: grid !important;
  grid-template-columns: minmax(120px, 1.05fr) minmax(150px, 1.2fr) auto auto 30px;
  gap: 6px !important;
  align-items: center;
}
.company-team-list .emp-name,
.company-team-list .emp-email {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.company-team-list .emp-name {
  font-size: 13px !important;
  font-weight: 700;
}
.company-team-list .emp-email {
  color: var(--ink-dim);
  font-size: 11px;
}
.company-team-list .emp-role-label,
.company-team-list .emp-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 7px;
  border: 1px solid var(--card-brd);
  border-radius: 999px;
  color: var(--ink-dim);
  background: var(--surface-2);
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
}
.company-team-list .emp-del {
  width: 28px !important;
  height: 28px !important;
  padding: 0 !important;
  display: inline-grid;
  place-items: center;
}
.company-team-list .emp-perms {
  gap: 4px !important;
  margin-top: 4px !important;
}
.company-team-list .perm-chip {
  padding: 2px 6px !important;
  font-size: 10px !important;
}

/* --- Журнал: только последние 5, без длинной простыни --- */
.company-audit-card {
  padding: 12px 16px !important;
}
.company-audit-head {
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 3px !important;
}
.company-audit-note {
  margin: 2px 0 0 !important;
  font-size: 11px;
  line-height: 1.3;
}
.company-audit-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}
.company-audit-tools .cab-badge {
  min-height: 26px;
  padding: 4px 8px;
  font-size: 10px;
}
.company-audit-toggle {
  min-height: 28px !important;
  padding: 4px 9px !important;
  font-size: 11px !important;
}
.company-audit-list {
  min-height: 0;
}
.company-audit-list .audit-row {
  padding: 6px 0 !important;
  gap: 6px !important;
}
.company-audit-list .audit-row > i {
  font-size: 13px !important;
  margin-top: 2px !important;
}
.company-audit-list .audit-action {
  font-size: 12px !important;
  line-height: 1.3;
}
.company-audit-list .audit-meta {
  margin-top: 0 !important;
  font-size: 10px !important;
  line-height: 1.25;
}
.company-audit-card:not(.is-expanded) .company-audit-list .audit-row:nth-child(n+6) {
  display: none;
}
.company-audit-card.is-expanded .company-audit-list {
  max-height: 310px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

/* --- Планшет --- */
@media (min-width: 761px) and (max-width: 1100px) {
  .company-team-form {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .company-team-form #emp-add { width: 100%; }
  .company-team-list .emp-head {
    grid-template-columns: minmax(120px, 1fr) minmax(150px, 1.15fr) auto 30px;
  }
  .company-team-list .emp-status {
    grid-column: 1;
    justify-self: start;
  }
  .company-audit-card.is-expanded .company-audit-list {
    max-height: 280px;
  }
}

/* --- Смартфон --- */
@media (max-width: 760px) {
  .company-team-card,
  .company-audit-card {
    padding: 11px 12px !important;
  }
  .company-team-head,
  .company-audit-head {
    gap: 6px;
  }
  .company-team-form {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px !important;
  }
  .company-team-form .field-dark,
  .company-team-form #emp-add {
    min-height: 42px !important;
    height: 42px !important;
  }
  .company-team-form #emp-add { width: 100%; }

  .company-team-list .emp-head {
    grid-template-columns: minmax(0, 1fr) auto 28px;
    gap: 5px !important;
  }
  .company-team-list .emp-email {
    grid-column: 1 / -1;
    grid-row: 2;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .company-team-list .emp-role-label {
    grid-column: 2;
    grid-row: 1;
  }
  .company-team-list .emp-status {
    grid-column: 1;
    grid-row: 3;
    justify-self: start;
  }
  .company-team-list .emp-del {
    grid-column: 3;
    grid-row: 1;
  }

  .company-audit-head {
    flex-wrap: wrap;
  }
  .company-audit-tools {
    width: 100%;
    justify-content: space-between;
  }
  .company-audit-card:not(.is-expanded) .company-audit-list .audit-row:nth-child(n+5) {
    display: none;
  }
  .company-audit-card.is-expanded .company-audit-list {
    max-height: 240px;
  }
}

/* --- Узкие смартфоны --- */
@media (max-width: 390px) {
  .company-team-card,
  .company-audit-card {
    padding: 10px !important;
  }
  .company-team-note,
  .company-audit-note {
    font-size: 10px;
  }
  .company-audit-tools {
    gap: 4px;
  }
}

/* =========================================================
   GIGZAKAZ 2.20.4 — COMPANY CLEAN FOOTER / AUDIT ON DEMAND
   ========================================================= */
.company-page-grid{
  grid-template-columns:minmax(0,1fr)!important;
}
.company-page-grid>.cab-col-main{min-width:0;max-width:none!important;}
.company-compact-links{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  gap:8px;
  margin-top:10px;
}
.company-compact-link{
  width:100%;min-width:0;min-height:58px;padding:9px 12px;
  display:grid;grid-template-columns:34px minmax(0,1fr) auto;gap:9px;align-items:center;
  border:1px solid var(--card-brd);border-radius:14px;background:var(--surface-1);color:var(--ink);text-align:left;cursor:pointer;
}
.company-compact-link:hover{border-color:var(--accent);background:var(--surface-2);}
.company-compact-link-icon{width:34px;height:34px;border-radius:10px;display:grid;place-items:center;background:var(--accent-soft);font-size:18px;}
.company-compact-link-copy{min-width:0;display:flex;flex-direction:column;gap:2px;}
.company-compact-link-copy strong{font-size:13px;line-height:1.25;}
.company-compact-link-copy strong b{font-weight:600;color:var(--ink-dim);margin-left:4px;}
.company-compact-link-copy small{font-size:11px;line-height:1.3;color:var(--ink-dim);white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
.company-compact-link-action{display:inline-flex;align-items:center;gap:3px;font-size:11px;font-weight:700;color:var(--ink-dim);white-space:nowrap;}
.company-audit-modal-head p{margin:3px 0 0;color:var(--ink-dim);font-size:12px;}
.company-audit-modal-tools{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:10px 0;}
.company-audit-modal-tools .field-dark{max-width:270px;min-height:38px;}
.company-audit-modal-list{max-height:min(58vh,520px);overflow:auto;border:1px solid var(--card-brd);border-radius:14px;padding:4px 12px;overscroll-behavior:contain;}
.company-audit-modal-row{display:grid;grid-template-columns:12px minmax(0,1fr);gap:8px;padding:9px 0;border-bottom:1px solid var(--card-brd);}
.company-audit-modal-row:last-child{border-bottom:0;}
.company-audit-dot{width:7px;height:7px;border-radius:50%;background:var(--accent);margin-top:5px;}
.company-audit-modal-row strong{display:block;font-size:13px;line-height:1.3;}
.company-audit-modal-row small{display:block;margin-top:2px;color:var(--ink-dim);font-size:11px;line-height:1.3;}
.company-audit-modal-foot{align-items:center;gap:8px;}
.company-audit-modal-foot>span{margin-right:auto;color:var(--ink-dim);font-size:11px;}
@media(max-width:760px){
  .company-compact-links{grid-template-columns:minmax(0,1fr);}
  .company-compact-link{grid-template-columns:32px minmax(0,1fr) auto;min-height:54px;padding:8px 10px;}
  .company-compact-link-copy small{white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
  .company-audit-modal-tools{align-items:stretch;flex-direction:column;}
  .company-audit-modal-tools .field-dark{max-width:none;width:100%;}
  .company-audit-modal-list{max-height:56vh;}
  .company-audit-modal-foot{flex-wrap:wrap;}
  .company-audit-modal-foot>span{width:100%;}
}
