.companies-workspace { width:100%; }
.companies-page-heading { display:flex; align-items:center; justify-content:space-between; gap:18px; margin-bottom:22px; }
.companies-page-heading h1 { margin:0; font-size:28px; }
.companies-heading-actions { display:flex; align-items:center; gap:9px; }
.companies-heading-actions button,.companies-export-menu summary { display:inline-flex; align-items:center; justify-content:center; gap:7px; }
.companies-heading-actions svg { width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.companies-export-menu { position:relative; }
.companies-export-menu > summary { list-style:none; cursor:pointer; }
.companies-export-menu > summary::-webkit-details-marker { display:none; }
.companies-export-menu > div { position:absolute; z-index:20; right:0; top:calc(100% + 7px); width:180px; overflow:hidden; padding:5px; border:1px solid var(--line); border-radius:9px; background:#fff; box-shadow:var(--shadow-medium); }
.companies-export-menu > div button { width:100%; justify-content:flex-start; padding:9px 10px; border:0; border-radius:6px; background:none; color:var(--label); font-size:12px; cursor:pointer; }
.companies-export-menu > div button:hover { background:var(--fill); }
.companies-stats { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:1px; margin-bottom:18px; overflow:hidden; border:1px solid var(--line); border-radius:9px; background:var(--line); }
.company-stat { min-width:0; padding:14px 16px; background:rgba(255,255,255,.78); }
.company-stat strong { display:block; font-size:20px; line-height:1.1; }
.company-stat span { display:block; margin-top:4px; color:var(--secondary-label); font-size:11px; }
.companies-toolbar { display:flex; align-items:center; gap:10px; margin-bottom:12px; }
.companies-search { flex:1; position:relative; }
.companies-search svg { position:absolute; left:12px; top:50%; width:16px; height:16px; transform:translateY(-50%); fill:none; stroke:var(--secondary-label); stroke-width:1.8; }
.companies-workspace input:not([type=checkbox]),.companies-workspace select,.company-dialog input:not([type=checkbox]),.company-dialog select,.company-dialog textarea,.company-import-dialog select { width:100%; min-height:40px; padding:9px 11px; border:1px solid var(--line); border-radius:7px; background:#fff; color:var(--label); font:inherit; font-size:13px; }
.companies-search input { padding-left:37px !important; }
#companies-status { width:190px; }
.companies-icon-button { display:grid; place-items:center; flex:0 0 38px; width:38px; height:38px; padding:0; border:1px solid var(--line); border-radius:7px; background:#fff; color:var(--label); font-size:20px; cursor:pointer; }
.companies-icon-button:hover { background:var(--fill); }
.companies-table-shell { position:relative; min-height:280px; overflow:auto; border:1px solid var(--line); border-radius:9px; background:#fff; }
.companies-table { width:100%; border-collapse:collapse; table-layout:fixed; }
.companies-table th { position:sticky; top:0; z-index:2; padding:11px 13px; border-bottom:1px solid var(--line); background:#f7f7f9; color:var(--secondary-label); font-size:10px; font-weight:650; text-align:left; text-transform:uppercase; }
.companies-table th:nth-child(1){width:29%}.companies-table th:nth-child(2){width:15%}.companies-table th:nth-child(3){width:15%}.companies-table th:nth-child(4){width:10%}.companies-table th:nth-child(5){width:16%}.companies-table th:nth-child(6){width:10%}.companies-table th:last-child{width:42px}
.companies-table td { height:62px; padding:10px 13px; border-bottom:1px solid #ededf0; color:#3a3a3c; font-size:12px; vertical-align:middle; overflow:hidden; text-overflow:ellipsis; }
.companies-table td:last-child { padding:8px 6px; overflow:visible; text-overflow:clip; }
.companies-table tbody tr { cursor:pointer; transition:background 120ms; }
.companies-table tbody tr:hover { background:#f6f9fd; }
.companies-table tbody tr:last-child td { border-bottom:0; }
.company-name-cell { display:grid; min-width:0; gap:3px; }
.company-name-cell strong { overflow:hidden; color:var(--label); font-size:13px; text-overflow:ellipsis; white-space:nowrap; }
.company-name-cell span { overflow:hidden; color:var(--secondary-label); font-size:10px; text-overflow:ellipsis; white-space:nowrap; }
.company-status { display:inline-flex; align-items:center; gap:6px; padding:5px 8px; border-radius:5px; background:#eaf7ed; color:#207837; font-size:10px; font-weight:650; }
.company-status::before { content:''; width:6px; height:6px; border-radius:50%; background:currentColor; }
.company-status.inactive { background:#ededf2; color:#6e6e73; }
.company-row-open { width:30px; height:30px; border:0; border-radius:50%; background:none; color:var(--secondary-label); font-size:18px; cursor:pointer; }
.company-row-open:hover { background:var(--fill); color:var(--blue); }
.companies-empty { min-height:280px; display:grid; place-items:center; align-content:center; gap:5px; padding:40px; text-align:center; }
.companies-empty > span { color:#9a9aa1; font-size:34px; }
.companies-empty strong { font-size:14px; }
.companies-empty p { margin:0; color:var(--secondary-label); font-size:11px; }
.companies-pagination { display:flex; align-items:center; justify-content:space-between; gap:16px; padding-top:13px; color:var(--secondary-label); font-size:11px; }
.companies-pagination > div { display:flex; align-items:center; gap:10px; }
.companies-pagination .companies-icon-button { width:32px; height:32px; flex-basis:32px; }
.companies-loading { padding:80px 20px; color:var(--secondary-label); text-align:center; }
.company-toast { position:fixed; z-index:140; right:22px; bottom:22px; padding:11px 15px; border:1px solid #b8d7f4; border-radius:8px; background:#fff; color:var(--label); box-shadow:var(--shadow-medium); font-size:12px; animation:sheet-in 180ms var(--ease); }

.company-dialog,.company-import-dialog,.company-woztell-dialog,.company-delete-dialog { width:min(920px,calc(100vw - 28px)); max-height:calc(100dvh - 32px); padding:0; overflow:hidden; border:1px solid var(--line); border-radius:12px; background:#fff; color:var(--label); box-shadow:var(--shadow-large); }
.company-import-dialog { width:min(860px,calc(100vw - 28px)); }
.company-woztell-dialog { width:min(650px,calc(100vw - 28px)); }
.company-delete-dialog { width:min(520px,calc(100vw - 28px)); }
.company-dialog::backdrop,.company-import-dialog::backdrop,.company-woztell-dialog::backdrop,.company-delete-dialog::backdrop { background:rgba(20,20,25,.38); backdrop-filter:blur(3px); }
.company-dialog form,.company-import-dialog form,.company-woztell-sheet,.company-confirm-sheet { display:flex; flex-direction:column; max-height:calc(100dvh - 34px); }
.company-dialog header,.company-import-dialog header,.company-woztell-dialog header,.company-delete-dialog header { display:flex; align-items:center; justify-content:space-between; gap:16px; min-height:72px; padding:14px 20px; border-bottom:1px solid var(--line); }
.company-dialog header span,.company-import-dialog header span,.company-woztell-dialog header span,.company-delete-dialog header span { display:block; margin-bottom:3px; color:var(--secondary-label); font-size:10px; font-weight:650; text-transform:uppercase; }
.company-dialog h2,.company-import-dialog h2,.company-woztell-dialog h2,.company-delete-dialog h2 { margin:0; font-size:21px; }
.company-dialog-body,.company-import-body { flex:1; overflow:auto; overscroll-behavior:contain; padding:0 22px 24px; }
.company-dialog footer,.company-import-dialog footer,.company-woztell-dialog footer,.company-delete-dialog footer { min-height:66px; display:flex; align-items:center; justify-content:space-between; gap:14px; padding:12px 20px; border-top:1px solid var(--line); background:#fafafa; }
.company-dialog footer > div { display:flex; gap:9px; margin-left:auto; }
.company-footer-meta { align-items:center; margin-left:0 !important; }
.company-footer-meta span { color:var(--secondary-label); font-size:10px; }
.company-delete-button { padding:8px 10px; border:1px solid transparent; border-radius:7px; background:transparent; color:var(--danger); font:inherit; font-size:11px; font-weight:600; cursor:pointer; }
.company-delete-button:hover { border-color:#efc5c9; background:var(--danger-soft); }
.company-form-section { padding:21px 0; border-bottom:1px solid var(--line); }
.company-form-section:last-child { border-bottom:0; }
.company-section-title { display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:13px; }
.company-section-title > div { min-width:0; }
.company-section-title h3 { margin:0; font-size:14px; }
.company-section-title span { display:block; margin-top:3px; color:var(--secondary-label); font-size:10px; }
.company-form-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:13px; }
.company-form-grid label,.company-contact-card label,.company-custom-row label { display:grid; gap:6px; color:#44444a; font-size:10px; font-weight:600; }
.company-form-grid .span-2 { grid-column:span 2; }
.company-dialog[data-person-type="individual"] .company-juridical-only { display:none; }
.company-active-field { grid-column:span 2; display:flex !important; align-items:center; gap:10px; min-height:42px; padding:7px 10px; border:1px solid var(--line); border-radius:7px; background:#fafafa; }
.company-active-field input,.company-preserve-fields input { width:17px; height:17px; accent-color:var(--blue); }
.company-active-field span { display:grid; gap:2px; }
.company-active-field small { color:var(--secondary-label); font-weight:400; }
.company-contact-list { display:grid; gap:10px; }
.company-contact-empty { padding:18px; border:1px dashed var(--line-strong); border-radius:8px; color:var(--secondary-label); font-size:11px; text-align:center; }
.company-contact-card { position:relative; padding:15px; border:1px solid var(--line); border-radius:8px; background:#fafafa; }
.company-contact-card.primary { border-color:#9bc8f2; background:#f6faff; }
.company-contact-top { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:12px; }
.company-contact-top strong { font-size:12px; }
.company-contact-top > div { display:flex; align-items:center; gap:7px; }
.company-contact-remove { border:0; background:none; color:var(--danger); cursor:pointer; font-size:11px; }
.company-contact-grid { display:grid; grid-template-columns:1.5fr 1.5fr 1.2fr; gap:10px; }
.company-contact-title { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.company-contact-shared { padding:3px 7px; border-radius:999px; background:#e9f5ff; color:#0878d1; font-size:9px; font-weight:650; }
.company-contact-actions { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:12px; }
.company-contact-heading-actions { display:flex; align-items:center; justify-content:flex-end; gap:8px; }
.company-select-woztell { display:inline-flex; align-items:center; gap:7px; min-height:38px; padding:8px 12px; border:1px solid #5246bd; border-radius:7px; background:#5b50c7; color:#fff; font:inherit; font-size:11px; font-weight:650; cursor:pointer; }
.company-select-woztell:hover { background:#4e43b5; }
.company-select-woztell span { display:grid; width:18px; height:18px; place-items:center; margin:0; border-radius:5px; background:rgba(255,255,255,.18); color:#fff; font-size:9px; }
.company-contact-primary { display:flex; align-items:center; gap:7px; color:#44444a; font-size:11px; }
.company-contact-primary input { width:16px; height:16px; accent-color:var(--blue); }
.company-ecosystem-section { border-bottom:0; }
.company-ecosystem-badge { flex:0 0 auto; margin:0 !important; padding:5px 8px; border-radius:999px; background:#eaf7ed; color:#248a3d !important; font-size:9px !important; font-weight:700; text-transform:none !important; }
.company-ecosystem-warning { margin:0; padding:12px 14px; border:1px solid #ead6a5; border-radius:8px; background:#fff8e7; color:#765814; font-size:11px; line-height:1.45; }
.company-ecosystem-access-list { display:grid; gap:8px; margin-bottom:13px; }
.company-ecosystem-access { display:flex; align-items:center; gap:11px; min-width:0; padding:11px 12px; border:1px solid var(--line); border-radius:8px; background:#fafafa; }
.company-ecosystem-avatar { display:grid; flex:0 0 32px; width:32px; height:32px; place-items:center; border-radius:50%; background:#e8f3ff; color:var(--blue); font-size:10px; font-weight:750; }
.company-ecosystem-access-copy { display:grid; min-width:0; gap:2px; }
.company-ecosystem-access-copy strong,.company-ecosystem-access-copy span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.company-ecosystem-access-copy strong { font-size:11px; }
.company-ecosystem-access-copy span { color:var(--secondary-label); font-size:10px; }
.company-ecosystem-access-status { margin-left:auto; color:#248a3d; font-size:9px; font-weight:700; white-space:nowrap; }
.company-ecosystem-access-status.inactive { color:var(--danger); }
.company-ecosystem-create { display:grid; grid-template-columns:minmax(0,1.15fr) minmax(0,1fr); gap:12px; padding:15px; border:1px solid #b8d7f4; border-radius:8px; background:#f7fbff; }
.company-ecosystem-create label { display:grid; gap:6px; color:#44444a; font-size:10px; font-weight:600; }
.company-ecosystem-identity { grid-column:2; min-height:38px; padding:8px 10px; border:1px solid var(--line); border-radius:7px; background:#fff; color:var(--secondary-label); font-size:10px; line-height:1.4; }
.company-ecosystem-create .form-error { grid-column:1/-1; margin:0; }
.company-ecosystem-create .primary-button { grid-column:2; justify-self:end; align-self:end; }
.company-woztell-button.linked { border-color:#87cfa0; background:#eef9f1; color:#207837; }
.company-woztell-panel { margin-top:11px; padding:11px; border:1px solid #b8d7f4; border-radius:8px; background:#fff; }
.company-woztell-panel input { margin-bottom:8px; }
.company-woztell-results { display:grid; gap:4px; max-height:170px; overflow:auto; }
.company-woztell-result { display:flex; align-items:center; justify-content:space-between; gap:10px; width:100%; padding:9px; border:0; border-radius:6px; background:#f6f7f9; text-align:left; cursor:pointer; }
.company-woztell-result:hover { background:var(--blue-soft); }
.company-woztell-result span { display:grid; gap:2px; min-width:0; }
.company-woztell-result strong { overflow:hidden; font-size:11px; text-overflow:ellipsis; white-space:nowrap; }
.company-woztell-result small { color:var(--secondary-label); font-size:9px; }
.company-woztell-body { min-height:390px; padding:18px 20px 22px; overflow:auto; }
.company-woztell-search { position:relative; display:block; }
.company-woztell-search svg { position:absolute; z-index:1; top:50%; left:11px; width:16px; height:16px; transform:translateY(-50%); fill:none; stroke:var(--secondary-label); stroke-width:1.8; }
.company-woztell-search input { width:100%; min-height:42px; padding:9px 12px 9px 36px; border:1px solid var(--line); border-radius:8px; font:inherit; }
#company-woztell-status { min-height:18px; margin:10px 0 5px; color:var(--secondary-label); font-size:10px; }
#company-woztell-results { max-height:300px; }
#company-woztell-results .company-woztell-result { padding:11px 12px; border:1px solid transparent; background:#f7f7f9; }
#company-woztell-results .company-woztell-result:hover { border-color:#b7b0ed; background:#f1efff; }
#company-woztell-results .company-woztell-result:disabled { opacity:.58; cursor:default; }
#company-woztell-results .company-woztell-result b { color:#5145b9; font-size:10px; }
.company-confirm-body { padding:22px 20px 26px; }
.company-confirm-body strong { display:block; margin-bottom:8px; font-size:14px; }
.company-confirm-body > p:not(.form-error) { margin:0; color:var(--secondary-label); font-size:12px; line-height:1.55; }
.company-confirm-body .form-error { margin-top:14px; }
.company-delete-dialog footer { justify-content:flex-end; }
.company-custom-details summary { cursor:pointer; font-size:12px; font-weight:650; }
.company-custom-details > p { margin:8px 0 12px; color:var(--secondary-label); font-size:10px; }
.company-custom-fields { display:grid; gap:8px; }
.company-custom-row { display:grid; grid-template-columns:1fr 1.6fr 34px; gap:8px; align-items:end; }
.company-custom-row button { width:34px; height:40px; border:1px solid var(--line); border-radius:7px; background:#fff; color:var(--danger); cursor:pointer; }

.company-import-body { min-height:360px; padding-top:22px; }
.company-import-drop { width:100%; min-height:260px; display:grid; place-items:center; align-content:center; gap:8px; border:1px dashed #9ebddd; border-radius:10px; background:#f7fbff; color:var(--label); cursor:pointer; }
.company-import-drop:hover,.company-import-drop.dragging { border-color:var(--blue); background:#edf6ff; }
.company-import-drop svg { width:34px; height:34px; margin-bottom:5px; fill:none; stroke:var(--blue); stroke-width:1.5; stroke-linecap:round; stroke-linejoin:round; }
.company-import-drop strong { font-size:15px; }
.company-import-drop span { color:var(--secondary-label); font-size:11px; }
.company-import-summary { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:12px 14px; border:1px solid var(--line); border-radius:8px; background:#f8f8fa; }
.company-import-summary > div { display:grid; gap:3px; }
.company-import-summary strong { font-size:12px; }
.company-import-summary span { color:var(--secondary-label); font-size:10px; }
.company-mapping-heading { display:flex; align-items:end; justify-content:space-between; gap:18px; margin:20px 0 10px; }
.company-mapping-heading h3 { margin:0; font-size:15px; }
.company-mapping-heading p { margin:4px 0 0; color:var(--secondary-label); font-size:10px; }
.company-mapping-heading > span { color:var(--blue); font-size:10px; font-weight:650; }
.company-mapping-list { overflow:hidden; border:1px solid var(--line); border-radius:8px; }
.company-mapping-row { display:grid; grid-template-columns:minmax(150px,1fr) minmax(160px,1.4fr) minmax(180px,1fr); align-items:center; gap:12px; min-height:58px; padding:9px 12px; border-bottom:1px solid #ededf0; }
.company-mapping-row:last-child { border-bottom:0; }
.company-mapping-source { display:grid; min-width:0; gap:3px; }
.company-mapping-source strong { overflow:hidden; font-size:11px; text-overflow:ellipsis; white-space:nowrap; }
.company-mapping-source span { overflow:hidden; color:var(--secondary-label); font-size:9px; text-overflow:ellipsis; white-space:nowrap; }
.company-mapping-arrow { display:none; }
.company-preserve-fields { display:flex; align-items:center; gap:9px; margin-top:13px; color:var(--label); font-size:11px; }
.company-preserve-fields span { display:grid; gap:2px; }
.company-preserve-fields small { color:var(--secondary-label); }
.company-import-result { min-height:300px; display:grid; place-items:center; align-content:center; gap:14px; text-align:center; }
.company-import-result-icon { width:52px; height:52px; display:grid; place-items:center; border-radius:50%; background:var(--success-soft); color:var(--success); font-size:27px; }
.company-import-result h3 { margin:0; font-size:19px; }
.company-import-result p { max-width:500px; margin:0; color:var(--secondary-label); font-size:11px; line-height:1.5; }
.company-import-numbers { display:flex; flex-wrap:wrap; justify-content:center; gap:8px; }
.company-import-numbers span { padding:7px 10px; border-radius:6px; background:var(--fill); font-size:10px; }
.company-import-errors { width:min(600px,100%); max-height:120px; overflow:auto; padding:10px; border:1px solid #efc5c9; border-radius:7px; background:var(--danger-soft); color:#8f1d2c; font-size:10px; text-align:left; }

@media (max-width:850px) {
  .companies-page-heading { align-items:flex-start; }
  .companies-heading-actions { flex-wrap:wrap; justify-content:flex-end; }
  .companies-stats { grid-template-columns:repeat(2,1fr); }
  .companies-table { min-width:760px; }
  .company-form-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .company-contact-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:620px) {
  .companies-page-heading { display:grid; }
  .companies-heading-actions { justify-content:flex-start; }
  .companies-toolbar { align-items:stretch; flex-wrap:wrap; }
  .companies-search { flex-basis:100%; }
  #companies-status { flex:1; width:auto; }
  .company-dialog,.company-import-dialog,.company-woztell-dialog { width:100vw; max-width:none; height:100dvh; max-height:none; border:0; border-radius:0; }
  .company-dialog form,.company-import-dialog form,.company-woztell-sheet { max-height:100dvh; }
  .company-form-grid,.company-contact-grid { grid-template-columns:1fr; }
  .company-ecosystem-create { grid-template-columns:1fr; }
  .company-ecosystem-identity,.company-ecosystem-create .primary-button { grid-column:1; }
  .company-ecosystem-create .primary-button { width:100%; justify-self:stretch; }
  .company-form-grid .span-2,.company-active-field { grid-column:auto; }
  .company-contact-actions { align-items:flex-start; flex-direction:column; }
  .company-section-title { align-items:flex-start; flex-direction:column; }
  .company-contact-heading-actions { width:100%; justify-content:flex-start; flex-wrap:wrap; }
  .company-dialog footer { align-items:flex-end; }
  .company-footer-meta { align-items:flex-start !important; flex-direction:column; }
  .company-mapping-row { grid-template-columns:1fr; gap:7px; padding:12px; }
  .company-custom-row { grid-template-columns:1fr 34px; }
  .company-custom-row label:first-child { grid-column:span 2; }
}
