:root{font-family:system-ui,-apple-system,Segoe UI,Arial,sans-serif;color:#192438;background:#f4f6fa}*{box-sizing:border-box}body{margin:0}header{background:#152d50;color:white}.wrap{max-width:1180px;margin:auto;padding:20px}.top{display:flex;align-items:center;justify-content:space-between}.brand{font-size:20px;font-weight:800;color:white;text-decoration:none}h1{font-size:29px;margin:12px 0}h2{font-size:19px;margin:0 0 14px}.muted,small{color:#69778b}p{line-height:1.5}.panel{background:white;padding:22px;border-radius:14px;margin:18px 0;border:1px solid #e1e7f0;box-shadow:0 2px 8px #20304709}.narrow{max-width:450px;margin:60px auto}.cols{display:grid;grid-template-columns:1fr 1fr;gap:18px}.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}.stat{background:white;border:1px solid #e1e7f0;border-radius:12px;padding:18px}.stat b{display:block;font-size:29px}.stat span{color:#69778b;font-size:13px}label{display:block;font-size:13px;font-weight:600;margin:12px 0 5px}input,textarea,select{width:100%;font:inherit;padding:11px;border:1px solid #cbd4e2;border-radius:8px;background:white}button{background:#2265b8;color:white;border:0;padding:11px 16px;border-radius:8px;font-weight:700;cursor:pointer;margin-top:10px}button:disabled{opacity:.45;cursor:not-allowed}.secondary{background:#e8eef7;color:#1c477b}.danger{background:#b23b44}.ghost{background:transparent;border:1px solid #8095b0}a{color:#1761af}.scroll{overflow-x:auto}table{border-collapse:collapse;width:100%;font-size:14px}td,th{padding:12px;text-align:left;border-bottom:1px solid #e7ebf1;vertical-align:top}th{color:#5c6878}small{display:block;margin-top:4px}.tag{background:#e8eef7;border-radius:30px;padding:5px 10px;font-size:12px}.error{color:#b42335}.success{color:#14804b}footer{color:#7b8797;font-size:12px}hr{border:0;border-top:1px solid #e7ebf1;margin:24px 0}@media(max-width:720px){.cols{grid-template-columns:1fr}.stats{grid-template-columns:repeat(2,1fr)}.wrap{padding:14px}.panel{padding:16px}}

/* crm-modern-2026: safe visual refresh */
:root { color-scheme: light; --crm-accent:#2563eb; --crm-ink:#17243b; --crm-soft:#f3f6fb; }
body { background:var(--crm-soft); color:var(--crm-ink); font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif; line-height:1.5; }
header { background:#fff; border-bottom:1px solid #e4eaf3; box-shadow:0 2px 12px rgba(30,50,90,.035); }
.brand { font-weight:800; letter-spacing:-.025em; }
.panel { background:#fff; border:1px solid #e4eaf3; border-radius:18px; box-shadow:0 5px 25px rgba(35,53,86,.045); padding:22px; }
.stat { border-radius:16px; border:1px solid #e4eaf3; background:#fff; box-shadow:0 3px 14px rgba(35,53,86,.035); }
button { border-radius:10px; font-weight:650; cursor:pointer; transition:filter .15s ease,transform .15s ease; }
button:hover { filter:brightness(.96); }
input,select,textarea { border-radius:10px; border:1px solid #d7dfeb; background:#fff; }
input:focus,select:focus,textarea:focus { outline:2px solid #bfdbfe; outline-offset:1px; border-color:#60a5fa; }
.section-head { display:flex; justify-content:space-between; align-items:center; gap:16px; flex-wrap:wrap; margin-bottom:16px; }
.section-head h2 { margin:0; }
.section-head p { margin:4px 0 0; }
.company-search { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.company-search input { min-width:210px; }
.crm-table { border-collapse:separate; border-spacing:0; min-width:1000px; width:100%; }
.crm-table th { background:#f7f9fc; color:#59677e; font-size:12px; letter-spacing:.04em; text-transform:uppercase; position:sticky; top:0; }
.crm-table th,.crm-table td { padding:14px 12px; border-bottom:1px solid #edf1f6; vertical-align:top; text-align:left; }
.crm-table tbody tr:hover { background:#fafcff; }
.crm-table .company-name { min-width:170px; }
.crm-table .company-name strong { display:block; }
.crm-table .company-name small { display:block; margin-top:6px; }
.company-editor { min-width:255px; display:grid; gap:8px; }
.company-editor label { display:block; font-size:12px; color:#65738a; font-weight:600; }
.company-editor input[type=email],.company-editor input[name=brands] { display:block; width:100%; box-sizing:border-box; padding:8px 10px; margin-top:3px; font-size:13px; }
.editor-bottom { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.company-editor .contact-check { display:flex; align-items:center; gap:7px; font-size:13px; color:#1f3d66; white-space:nowrap; }
.contact-check input { width:17px; height:17px; accent-color:#2563eb; }
.editor-bottom button { padding:7px 12px; font-size:12px; }
.crm-companies .scroll { overflow-x:auto; }
@media(max-width:700px) { .panel { padding:15px; border-radius:14px; } .section-head { align-items:stretch; } .company-search input { min-width:0; flex:1; } }


/* skladparts-premium-ui-v2 */
:root {--ink:#18243b;--muted:#687991;--line:#e4eaf3;--primary:#375dfb;--bg:#f4f7fc;--radius:18px;color-scheme:light}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;background:radial-gradient(ellipse 90% 28% at 75% 0%,#e7edff 0%,transparent 75%),var(--bg);color:var(--ink);font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;font-size:14px;line-height:1.55}
.wrap{width:min(1480px,calc(100% - 48px));max-width:1480px;margin-inline:auto}
header{background:rgba(255,255,255,.92);border-bottom:1px solid var(--line);box-shadow:0 2px 16px #182d5108;position:relative;z-index:2}
.top{min-height:74px;display:flex;align-items:center;justify-content:space-between;gap:20px}
.brand{color:#203154!important;font-size:20px!important;font-weight:850;text-decoration:none;letter-spacing:-.045em}
main.wrap{padding-top:32px;padding-bottom:44px}
h1{font-size:clamp(27px,3vw,37px);letter-spacing:-.045em;line-height:1.15;margin:0 0 12px;font-weight:820}
h2{font-size:18px;letter-spacing:-.025em;font-weight:780;margin-top:0}
.muted,small{color:var(--muted)}
a{color:#315cda;text-underline-offset:3px}
.stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin:25px 0}
.stat{display:flex;flex-direction:column;gap:5px;padding:22px 24px;background:#fff;border:1px solid var(--line);border-radius:18px;box-shadow:0 8px 28px #213a6509;min-width:0}
.stat b{font-size:32px;line-height:1.2;letter-spacing:-.05em;color:#20325c;font-weight:830}
.stat span{font-size:13px;color:var(--muted);font-weight:600}
.cols{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;align-items:start}
.panel{background:#fff;border:1px solid var(--line);border-radius:20px;padding:24px;box-shadow:0 10px 35px #213a650a;margin-bottom:20px;min-width:0}
.panel h2{margin:0 0 14px}
label{font-weight:600;color:#465670;font-size:13px}
input:not([type=checkbox]):not([type=hidden]):not([type=file]),select,textarea{background:#fff;border:1px solid #dbe3f0;border-radius:11px;box-shadow:0 1px 2px #172b4b05;color:#1e304e;min-height:42px;padding:10px 12px;font:inherit;max-width:100%}
input::placeholder,textarea::placeholder{color:#9aa7b8;opacity:1}
input:focus,textarea:focus,select:focus{outline:3px solid #dce6ff;border-color:#6c89fa}
button{background:var(--primary);color:white;border:1px solid transparent;border-radius:11px;padding:10px 16px;min-height:40px;font:inherit;font-weight:720;box-shadow:0 3px 9px #2d56c81b;cursor:pointer;transition:background .15s,transform .15s}
button:hover{background:#294bdf;filter:none;transform:translateY(-1px)}
button.secondary{background:#ecf1ff;color:#294fb0;border-color:#e1e9ff;box-shadow:none}
button.secondary:hover{background:#dde7ff}
button.ghost{background:#f2f5fa;color:#4e5d75;border:1px solid #e3e9f1;box-shadow:none}
button.danger{background:#d8485c;color:#fff}
.section-head{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:22px;flex-wrap:wrap}
.section-head h2{font-size:21px;margin:0}
.section-head .muted{margin:4px 0 0;font-size:13px}
.company-search{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:0}
.company-search input{min-width:250px;flex:1}
.crm-companies{padding:26px 24px}
.crm-companies .scroll{width:100%;overflow-x:auto;border:1px solid var(--line);border-radius:15px;background:white}
.crm-table{width:100%;min-width:960px;border-collapse:collapse;border-spacing:0;table-layout:auto}
.crm-table thead th{position:static;background:#f6f8fd;color:#71809a;font-size:11px;text-transform:uppercase;letter-spacing:.075em;font-weight:800;padding:15px 13px;border-bottom:1px solid var(--line);text-align:left;white-space:nowrap}
.crm-table td{vertical-align:middle;padding:15px 13px;border-bottom:1px solid #edf1f7;color:#40516e;font-size:13px;line-height:1.45}
.crm-table tbody tr:last-child td{border-bottom:none}
.crm-table tbody tr:nth-child(even){background:#fcfdff}
.crm-table tbody tr:hover{background:#f6f9ff}
.crm-table .company-name{min-width:175px;max-width:250px}
.crm-table .company-name strong{font-size:13px;color:#172a4d;font-weight:800;line-height:1.4;display:block}
.crm-table .company-name small{font-size:11px;display:block;margin-top:7px}
.crm-table .tag{display:inline-flex;align-items:center;justify-content:center;white-space:nowrap;background:#eaf0ff;color:#2b50b0;border:1px solid #dce6ff;border-radius:100px;padding:5px 10px;font-size:12px;font-weight:750}
.crm-table td:last-child{width:315px;min-width:295px}
.company-editor{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);column-gap:9px;row-gap:10px;min-width:0;width:100%;align-items:end}
.company-editor>label{display:block;min-width:0;font-size:11px;color:#687891;font-weight:700;line-height:1.3}
.company-editor input[type=email],.company-editor input[name=brands]{width:100%;min-width:0;min-height:36px!important;height:36px;padding:7px 9px!important;margin:5px 0 0!important;font-size:12px!important;border-radius:9px!important}
.company-editor .editor-bottom{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;gap:12px;padding-top:2px}
.company-editor .contact-check{display:inline-flex;align-items:center;gap:8px;white-space:nowrap;font-size:12px;color:#435b79;font-weight:750}
.company-editor .contact-check input{width:17px;height:17px;accent-color:#365cf6;margin:0}
.company-editor .editor-bottom button{min-height:34px;padding:6px 14px;font-size:12px;border-radius:9px}
.crm-companies>.muted{font-size:12px;line-height:1.55;margin-top:15px}
footer.wrap{color:#8490a3;font-size:12px;padding:15px 0 25px}
@media(max-width:1000px){.stats{grid-template-columns:repeat(2,minmax(0,1fr))}.cols{grid-template-columns:1fr}.crm-table{min-width:930px}}
@media(max-width:650px){.wrap{width:calc(100% - 24px)}main.wrap{padding-top:22px}.top{min-height:62px}.brand{font-size:17px!important}.stats{gap:10px}.stat{padding:16px}.stat b{font-size:26px}.panel{padding:16px;border-radius:16px}.crm-companies{padding:16px}.section-head{display:block}.company-search{margin-top:14px}.company-search input{min-width:0;width:100%}.company-search button{width:100%}}


/* crm-search-notes-delete-v1 */
.crm-companies .section-head{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}
.crm-companies .company-search{display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:flex-end;gap:9px;flex-wrap:nowrap!important;margin:0;min-width:min(100%,360px)}
.crm-companies .company-search input[name=q]{width:280px!important;min-width:0!important;flex:1 1 250px!important;margin:0!important;min-height:42px}
.crm-companies .company-search button{flex:0 0 auto!important;width:auto!important;margin:0!important;white-space:nowrap;min-height:42px}
.company-note{margin:8px 0 4px;white-space:pre-wrap;overflow-wrap:anywhere;color:#586b84;font-size:12px;line-height:1.5;background:#f4f7fc;border-left:3px solid #93aafa;border-radius:5px;padding:7px 9px}
.company-note-edit,.company-delete{margin-top:9px;font-size:12px;max-width:270px}
.company-note-edit summary,.company-delete summary{cursor:pointer;font-weight:700;color:#3559b5;list-style:revert}
.company-delete summary{color:#a34b56}
.company-note-edit form,.company-delete form{display:flex;flex-direction:column;align-items:stretch;gap:7px;margin-top:8px}
.company-note-edit textarea,.company-delete input{width:100%;min-width:0;font-size:12px}
.company-note-edit button,.company-delete button{font-size:12px;padding:7px 10px;min-height:34px}
.company-delete p{margin:6px 0;color:#7c5660}
.company-delete strong{font-size:12px;overflow-wrap:anywhere}
@media(max-width:650px){.crm-companies .company-search{width:100%;min-width:0}.crm-companies .company-search input[name=q]{width:auto!important;flex:1 1 auto!important}.crm-companies .company-search button{width:auto!important}}

/* Отступ между надписью и полем пароля */
.narrow form label input[type="password"] {
    display: block;
    margin-top: 10px;
}

/* Горизонтальная прокрутка таблицы компаний */
.crm-companies {
    min-width: 0;
    max-width: 100%;
}

.crm-companies .scroll {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto !important;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.crm-companies .crm-table {
    min-width: 1050px;
    width: 100%;
}

/* skladparts-company-editor-grid-fix-v1 */
.crm-companies .company-editor {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 10px;
  align-items: start;
}
.crm-companies .company-editor > label {
  display: block;
  min-width: 0;
  margin: 0;
}
.crm-companies .company-editor > label input:not([type="checkbox"]) {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  margin-top: 5px;
}
.crm-companies .company-editor > label:nth-of-type(3) {
  grid-column: 1 / -1;
}
.crm-companies .company-editor .editor-bottom {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 2px;
}
.crm-companies .company-editor .contact-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
@media (max-width: 650px) {
  .crm-companies .company-editor {
    grid-template-columns: minmax(0, 1fr);
  }
  .crm-companies .company-editor > label:nth-of-type(3) {
    grid-column: auto;
  }
}
