*,*::before,*::after{box-sizing:border-box}
html,body{
  margin:0;height:100%;
  font-family:'Montserrat',Arial,Helvetica,sans-serif;
  background:#f6f8fb;
  color:#1f2937;
}
.dash,.dash-page{
  width:100%;
  max-width:none;
  margin:0;
  padding:16px;
}
.dash-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:16px 16px 0;
  margin-bottom:12px;
  flex-wrap:nowrap;
  gap:12px;
  white-space:nowrap;
}
.dash-header-logo{
  height:36px;
  width:auto;
  display:block;
}
.btn{
  display:inline-flex;align-items:center;justify-content:center;
  padding:10px 22px;
  border:none;border-radius:14px;
  font-family:inherit;font-size:14px;font-weight:700;
  cursor:pointer;transition:transform .15s,opacity .15s;
}
.btn:hover{opacity:.85;transform:translateY(-1px)}
.btn-violet{background:#7B2C8E;color:#fff}
.btn-red{background:#dc2626;color:#fff}
.btn-outline{background:#fff;border:1.5px solid #d1d5db;color:#374151}
.btn-sm{padding:7px 16px;font-size:13px;border-radius:10px}

.conf-list{display:flex;flex-direction:column;gap:12px}

.conf-card{
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:20px;
  padding:20px 24px;
  box-shadow:0 4px 16px rgba(15,23,42,.05);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  transition:box-shadow .15s,background .15s,transform .15s;
  cursor:pointer;
  text-decoration:none;
  color:inherit;
}
.conf-card:hover{box-shadow:0 6px 24px rgba(123,44,142,.12);background:#faf7ff;transform:translateY(-1px)}
.conf-info{flex:1;min-width:0}
.conf-info h2{
  margin:0 0 4px;
  font-size:16px;font-weight:700;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  color:#111827;
}
.conf-info p{margin:0;font-size:13px;color:#6b7280}
.conf-actions{display:flex;gap:8px;flex-shrink:0}

.empty-state{
  text-align:center;
  padding:60px 20px;
  color:#9ca3af;
  font-size:15px;
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:20px;
}

.modal-overlay{
  display:none;
  position:fixed;top:0;left:0;right:0;bottom:0;
  background:rgba(15,23,42,.45);
  z-index:1000;
  align-items:center;justify-content:center;
  padding:20px;
}
.modal-overlay.open{display:flex}
.modal-box{
  background:#fff;border-radius:24px;
  padding:24px;width:min(820px,calc(100vw - 32px));max-width:none;
  box-shadow:0 20px 60px rgba(15,23,42,.2);
}
.modal-box h3{margin:0 0 16px;font-size:18px;font-weight:700;color:#111827}
.modal-tabs{display:flex;gap:4px;margin-bottom:20px;background:#f3f4f6;border-radius:12px;padding:4px}
.modal-tab{flex:1;padding:8px 12px;border:none;border-radius:9px;font-family:inherit;font-size:13px;font-weight:600;cursor:pointer;background:transparent;color:#6b7280;transition:background .15s,color .15s}
.modal-tab.active{background:#fff;color:#7B2C8E;box-shadow:0 1px 4px rgba(15,23,42,.1)}
.form-group{margin-bottom:16px}
.form-group label{display:block;font-size:13px;font-weight:700;margin-bottom:6px;color:#374151}
.form-group input:not([type="checkbox"]):not([type="radio"]){
  width:100%;padding:11px 14px;
  border:1.5px solid #d1d5db;border-radius:12px;
  font-family:inherit;font-size:14px;
  outline:none;transition:border-color .15s,box-shadow .15s;
  color:#111827;
}
.form-group input:not([type="checkbox"]):not([type="radio"]):focus{border-color:#7B2C8E;box-shadow:0 0 0 4px rgba(123,44,142,.1)}
.form-group input[type="file"]{padding:8px 10px;cursor:pointer;}
.form-note{font-size:12px;color:#6b7280;margin-top:5px;line-height:1.4}
.modal-actions{display:flex;gap:10px;justify-content:flex-end;margin-top:22px}

.confirm-text{font-size:15px;line-height:1.5;margin-bottom:20px;color:#374151}
.confirm-name{font-weight:700;color:#dc2626}

/* ── Auth / Login ─────────────────────────────────────────────────────────── */
.page-loading{display:flex;align-items:center;justify-content:center;min-height:100vh;font-size:16px;color:#6b7280}
.login-page{min-height:100vh;display:flex;align-items:center;justify-content:center;background:#f6f8fb}
.login-card{background:#fff;border:1px solid #e5e7eb;border-radius:24px;box-shadow:0 8px 30px rgba(15,23,42,.09);padding:40px;width:100%;max-width:380px}
.login-logo{height:32px;display:block;margin:0 auto 28px}
.login-title{font-size:22px;font-weight:800;color:#111827;text-align:center;margin:0 0 24px}
.login-group{margin-bottom:16px}
.login-label{display:block;font-size:13px;font-weight:700;color:#374151;margin-bottom:8px}
.login-input{width:100%;border:1px solid #d1d5db;border-radius:14px;padding:12px 14px;font-size:14px;font-family:inherit;box-sizing:border-box;outline:none;transition:border-color .2s,box-shadow .2s;background:#fff;color:#1f2937}
.login-input:focus{border-color:#7B2C8E;box-shadow:0 0 0 4px rgba(123,44,142,.10)}
.login-error{margin:12px 0 0;padding:10px 14px;background:#fee2e2;border-radius:10px;color:#991b1b;font-size:13px;font-weight:600}
.login-submit{margin-top:20px;width:100%}
.btn-primary{background:#7B2C8E;color:#fff}
.btn-secondary{background:#fff;border:1.5px solid #d1d5db;color:#374151}
.btn-ghost{background:transparent;color:#6b7280;border:1.5px solid #e5e7eb}
.btn-danger{background:#dc2626;color:#fff}

/* ── Dashboard header user area ───────────────────────────────────────────── */
.dash-header-right{display:flex;align-items:center;gap:10px;flex-shrink:0}
.dash-username{font-size:13px;font-weight:600;color:#374151;padding:0 4px}

/* ── Admin page ───────────────────────────────────────────────────────────── */
.admin-page{width:100%;max-width:none;margin:0;padding:16px}
.admin-header{display:flex;align-items:center;gap:16px;margin-bottom:28px}
.admin-title{margin:0;font-size:24px;font-weight:800}
.admin-table{width:100%;min-width:100%;table-layout:fixed;border-collapse:collapse;background:#fff;border:1px solid #e5e7eb;border-radius:16px;overflow:hidden;margin-bottom:24px}
.admin-table th{background:#f8fafc;padding:12px 16px;text-align:left;font-size:13px;font-weight:800;color:#374151;border-bottom:1px solid #e5e7eb;vertical-align:middle}
.admin-table td{padding:12px 16px;font-size:14px;border-top:1px solid #f3f4f6;vertical-align:middle}
.admin-table th:nth-child(1),.admin-table td:nth-child(1){width:14%}
.admin-table th:nth-child(2),.admin-table td:nth-child(2){width:18%}
.admin-table th:nth-child(3),.admin-table td:nth-child(3){width:13%}
.admin-table th:nth-child(4),.admin-table td:nth-child(4){width:16%}
.admin-table th:nth-child(5),.admin-table td:nth-child(5){width:10%}
.admin-table th:nth-child(6),.admin-table td:nth-child(6){width:12%}
.admin-table th:nth-child(7),.admin-table td:nth-child(7){width:17%}
.admin-create-card{background:#fff;border:1px solid #e5e7eb;border-radius:20px;padding:16px 20px;overflow-x:hidden}
.admin-create-card form{width:100%}
.admin-create-title{font-size:16px;font-weight:800;margin:0 0 16px}
.admin-form-row{display:grid;grid-template-columns:1fr 1fr 1fr auto;gap:12px;align-items:end}
.admin-form-grid{display:grid;grid-template-columns:1fr 1fr 1fr 1fr 1fr auto;gap:12px;align-items:end}
.admin-form-inline{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));align-items:center;gap:12px;width:100%;min-width:0}
.admin-form-inline > *{min-width:0}
.admin-form-inline .login-input{height:42px;min-height:42px;padding-top:0;padding-bottom:0;line-height:42px;width:100%}
.admin-inline-fio{width:100%}
.admin-inline-login{width:100%}
.admin-inline-password{width:100%}
.admin-inline-role{width:100%}
.admin-inline-direction{width:100%}
.admin-inline-checkbox{display:flex;align-items:center;justify-content:center;align-self:center;gap:8px;font-size:13px;font-weight:500;color:#374151;white-space:nowrap;cursor:pointer;padding:0 6px;height:42px;min-height:42px}
.admin-inline-checkbox input[type="checkbox"]{width:15px;height:15px;margin:0;flex-shrink:0;cursor:pointer}
.admin-inline-btn{height:42px;min-height:42px;white-space:nowrap;padding:0 22px;display:inline-flex;align-items:center;justify-content:center;align-self:center;line-height:1}
.admin-row-actions{display:flex;align-items:center;justify-content:flex-end;gap:6px;white-space:nowrap;width:100%}
.admin-table .btn-sm{padding:6px 10px;font-size:11px;border-radius:9px;min-height:30px}
.admin-delete-btn{height:42px;min-height:42px;padding:0 22px;font-size:13px;border-radius:12px;display:inline-flex;align-items:center;justify-content:center;line-height:1;white-space:nowrap}
@media(max-width:1400px){
  .admin-form-inline{grid-template-columns:repeat(auto-fit,minmax(160px,1fr))}
}
.admin-directions-list{display:flex;flex-direction:column;gap:8px;min-width:0}
.admin-direction-option{display:flex;align-items:center;gap:10px;font-size:14px;font-weight:500;color:#374151;line-height:1.3;white-space:normal;word-break:normal}
.admin-direction-option input[type="checkbox"]{flex:0 0 auto;width:16px;height:16px;margin:0}
@media(max-width:800px){.admin-form-grid{grid-template-columns:1fr 1fr}}
@media(max-width:600px){.admin-form-row{grid-template-columns:1fr}.admin-form-grid{grid-template-columns:1fr}}

/* ── Permission templates & editor ───────────────────────────────────────── */
.admin-perms-block{margin-top:16px;border-top:1px solid #e5e7eb;padding-top:14px}
.admin-perms-header{display:flex;align-items:center;gap:12px;margin-bottom:12px;flex-wrap:wrap}
.admin-perms-title{font-size:13px;font-weight:700;color:#374151;white-space:nowrap}
.tpl-bar{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.tpl-select{height:36px!important;min-height:36px!important;font-size:13px;padding:0 10px;width:auto;min-width:180px}
.tpl-save-row{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.tpl-name-input{height:36px!important;min-height:36px!important;font-size:13px;padding:0 10px;width:200px}
.tpl-error{font-size:12px;color:#ef4444}
.perm-editor{display:flex;flex-wrap:wrap;gap:16px;padding:0 4px}
.perm-item{flex:1 1 220px;min-width:220px;background:#fff;border:1px solid #e5e7eb;border-radius:18px;padding:16px;display:flex;flex-direction:column;gap:10px;transition:border-color .2s,box-shadow .2s;}
.perm-item-header{display:flex;align-items:flex-start;gap:12px}
.perm-item-icon{width:34px;height:34px;border-radius:12px;background:#f8fafc;display:flex;align-items:center;justify-content:center;font-size:16px}
.perm-item-text{min-width:0}
.perm-item-title{font-size:14px;font-weight:700;color:#111827}
.perm-item-desc{font-size:12px;color:#6b7280;line-height:1.4;margin-top:2px}
.perm-item-row{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:12px}
.perm-toggle{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:600;color:#374151;cursor:pointer}
.perm-toggle input[type="checkbox"]{width:16px;height:16px;margin:0;flex-shrink:0;cursor:pointer}
.perm-item-options{display:flex;flex-wrap:wrap;gap:10px;margin-top:10px}
.perm-check{display:flex;align-items:center;gap:6px;font-size:13px;font-weight:500;color:#374151;cursor:pointer;white-space:nowrap}
.perm-check input[type="checkbox"],.perm-check input[type="radio"]{width:14px;height:14px;margin:0;flex-shrink:0;cursor:pointer}
.perm-sub{color:#6b7280;font-weight:400;margin-left:4px}
.perm-select{height:34px!important;min-height:34px!important;font-size:13px!important;padding:0 10px!important;border-radius:10px!important}
.perm-item-active{border-color:#7B2C8E;box-shadow:0 12px 32px rgba(123,44,142,.08)}

/* ── Shared page layout (Projects, Managers, Registries) ──────────────────── */
.dash-header-left{display:flex;align-items:center;gap:10px;overflow:hidden}
.dash-logo{font-size:20px;font-weight:800;color:#111827;flex-shrink:0}
.dash-header-sep{color:#d1d5db;font-size:14px;flex-shrink:0}
.dash-nav-link{font-size:14px;font-weight:600;color:#6b7280;text-decoration:none;transition:color .15s;white-space:nowrap}
.dash-nav-link:hover{color:#7B2C8E}
.dash-nav-active{color:#7B2C8E}
.dash-section-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:20px}
.dash-title{margin:0;font-size:22px;font-weight:800;color:#111827}
.dash-main{display:flex;flex-direction:column;gap:16px}
.dash-empty{text-align:center;padding:60px 20px;color:#9ca3af;font-size:15px;background:#fff;border:1px solid #e5e7eb;border-radius:20px;display:flex;flex-direction:column;align-items:center;gap:16px}

/* ── Shared modal ─────────────────────────────────────────────────────────── */
.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(15,23,42,.45);z-index:1000;display:flex;align-items:center;justify-content:center;padding:20px}
.modal-card{background:#fff;border-radius:20px;box-shadow:0 20px 60px rgba(15,23,42,.18);width:min(980px,calc(100vw - 32px));max-width:none;max-height:90vh;display:flex;flex-direction:column;overflow:hidden}
.modal-confirm{max-width:420px}
.modal-header{display:flex;align-items:center;justify-content:space-between;padding:20px 24px 0;flex-shrink:0}
.modal-header h2{margin:0;font-size:18px;font-weight:800;color:#111827}
.modal-close{background:none;border:none;font-size:22px;cursor:pointer;color:#9ca3af;line-height:1;padding:0 4px}
.modal-close:hover{color:#374151}
.modal-body{padding:20px 24px;overflow-y:auto;flex:1}
.modal-body p{margin:0;font-size:15px;line-height:1.5;color:#374151}
.modal-footer{display:flex;gap:10px;justify-content:flex-end;padding:16px 24px;border-top:1px solid #f3f4f6;flex-shrink:0}

/* ── Shared form elements ─────────────────────────────────────────────────── */
.form-label{display:flex;flex-direction:column;gap:6px;font-size:13px;font-weight:700;color:#374151}
.form-row{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.form-radio-group{display:flex;gap:16px;margin-top:2px}
.form-radio{display:flex;align-items:center;gap:6px;font-weight:400;font-size:14px;cursor:pointer}
.form-checkbox-group{display:flex;flex-wrap:wrap;gap:8px 16px;margin-top:6px}
.form-checkbox{display:flex;align-items:center;gap:6px;font-weight:400;font-size:14px;cursor:pointer}
.form-section-title{font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.06em;color:#9ca3af;margin:16px 0 4px}
.form-deadlines-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.project-form{display:flex;flex-direction:column;gap:12px}
.form-checkbox-sync{margin-top:4px}

/* ── Projects list ────────────────────────────────────────────────────────── */
.projects-list{display:flex;flex-direction:column;gap:12px}
.project-card{background:#fff;border:1px solid #e5e7eb;border-radius:18px;padding:18px 22px;display:flex;align-items:flex-start;justify-content:space-between;gap:16px;box-shadow:0 2px 10px rgba(15,23,42,.04);transition:box-shadow .15s,background .15s,transform .15s;cursor:pointer;text-decoration:none;color:inherit}
.project-card:hover{box-shadow:0 6px 24px rgba(123,44,142,.12);background:#faf7ff;transform:translateY(-1px)}
.projects-list-dragging .project-card-dnd{cursor:grabbing}
.project-card-dnd{cursor:grab}
.project-card-drag-source{opacity:.55;transform:scale(.99)}
.project-card-drag-overlay{box-shadow:0 16px 34px rgba(15,23,42,.18);transform:rotate(-0.4deg)}
.project-drop-placeholder{
  height:74px;
  border:2px dashed #7B2C8E;
  border-radius:14px;
  background:linear-gradient(90deg, rgba(123,44,142,.08), rgba(123,44,142,.03));
  box-shadow:inset 0 0 0 1px rgba(123,44,142,.08);
  animation:project-drop-pulse .9s ease-in-out infinite alternate;
}
@keyframes project-drop-pulse{
  from{opacity:.65}
  to{opacity:1}
}
.project-card-main{flex:1;min-width:0}
.project-card-name{font-size:15px;font-weight:700;color:#111827;margin-bottom:4px;display:flex;align-items:center;gap:8px}
.project-card-drag-handle{
  font-size:13px;line-height:1;color:#9ca3af;user-select:none;letter-spacing:-1px;
  padding:0 2px;cursor:grab;flex:0 0 auto;border:none;background:transparent;touch-action:none;
}
.project-card-meta{font-size:13px;color:#6b7280;display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-bottom:8px}
.project-meta-sep{color:#d1d5db}
.project-badge-sync{background:#ede9fe;color:#7B2C8E;font-size:11px;font-weight:700;border-radius:6px;padding:2px 7px}
.project-card-deadlines{display:flex;flex-wrap:wrap;gap:6px}
.project-deadline-pill{font-size:12px;background:#f3f4f6;border-radius:8px;padding:2px 9px;color:#374151}
.project-card-actions{display:flex;gap:8px;flex-shrink:0;align-items:flex-start}
.project-modal{width:min(980px,calc(100vw - 32px))}

/* Shared btn sizing for new pages */
.btn-primary,.btn-secondary,.btn-ghost,.btn-danger{
  display:inline-flex;align-items:center;justify-content:center;
  padding:9px 20px;border:none;border-radius:12px;
  font-family:inherit;font-size:13px;font-weight:700;
  cursor:pointer;transition:opacity .15s,transform .15s;text-decoration:none;
}
.btn-primary:hover,.btn-secondary:hover,.btn-ghost:hover,.btn-danger:hover{opacity:.85}

/* ── Managers ─────────────────────────────────────────────────────────────── */
.mgr-table-wrap{background:#fff;border:1px solid #e5e7eb;border-radius:16px;overflow:hidden}
.mgr-type-badge{display:inline-block;font-size:11px;font-weight:700;padding:2px 9px;border-radius:8px;background:#ede9fe;color:#7B2C8E}

/* ── Registries ───────────────────────────────────────────────────────────── */
.reg-list{display:flex;flex-direction:column;gap:10px}
.reg-card{background:#fff;border:1px solid #e5e7eb;border-radius:16px;padding:16px 20px;display:flex;align-items:center;justify-content:space-between;gap:16px;box-shadow:0 2px 8px rgba(15,23,42,.04);transition:box-shadow .15s,background .15s,transform .15s;cursor:pointer;text-decoration:none;color:inherit}
.reg-card:hover{box-shadow:0 6px 24px rgba(123,44,142,.12);background:#faf7ff;transform:translateY(-1px)}
.reg-card-main{flex:1;min-width:0}
.reg-card-name{margin-bottom:4px}
.reg-card-link{font-size:15px;font-weight:700;color:#111827;text-decoration:none}
.reg-card-link:hover{color:#7B2C8E;text-decoration:underline}
.reg-card-meta{display:flex;align-items:center;gap:8px;font-size:13px;color:#6b7280;flex-wrap:wrap}
.reg-meta-mgr{font-weight:600;color:#374151}
.reg-card-actions{display:flex;gap:8px;flex-shrink:0;align-items:center}

/* ── Registry page ─────────────────────────────────────────────────────────── */
.reg-back-link{font-size:13px;color:#9ca3af;text-decoration:none}
.reg-back-link:hover{color:#7B2C8E}
.reg-page-title-row{display:flex;align-items:flex-start;justify-content:space-between;margin-bottom:18px}

/* Вкладки листов */
.sheet-tabs-row{margin-bottom:0;border-bottom:2px solid #e5e7eb}
.sheet-tabs{display:flex;align-items:flex-end;gap:2px;flex-wrap:wrap}
.sheet-tab{background:none;border:none;border-radius:8px 8px 0 0;padding:8px 18px;font-size:13px;font-weight:600;color:#6b7280;cursor:pointer;transition:background .15s,color .15s;display:flex;align-items:center;gap:6px;white-space:nowrap}
.sheet-tab:hover{background:#f3f4f6;color:#374151}
.sheet-tab-active{background:#fff;color:#7B2C8E;border:2px solid #e5e7eb;border-bottom:2px solid #fff;margin-bottom:-2px}
.sheet-tab-label{display:inline-flex;align-items:center}
.sheet-tab-dragging{opacity:.55}
.sheet-tab-drop-target{color:#7B2C8E;text-decoration:underline;text-underline-offset:3px}
.sheet-tab-add{color:#7B2C8E;border:1.5px dashed #c4b5fd;background:none}
.sheet-tab-add:hover{background:#ede9fe}
.sheet-tab-archive-toggle{border:1px solid #cbd5e1;border-bottom:none;background:#f8fafc;color:#475569}
.sheet-tab-archive-toggle:hover{background:#f1f5f9;color:#334155}
.sheet-tab-archive-open{background:#e2e8f0;color:#1e293b}
.sheet-tab-archive{font-size:11px;color:#64748b;line-height:1;padding:1px 4px;border-radius:4px;cursor:pointer;border:1px solid transparent}
.sheet-tab-archive:hover{color:#0f172a;background:#e2e8f0;border-color:#cbd5e1}
.sheet-tab-del{font-size:15px;color:#9ca3af;line-height:1;padding:0 2px;border-radius:4px;cursor:pointer}
.sheet-tab-del:hover{color:#ef4444;background:#fee2e2}
.sheet-add-inline{display:flex;align-items:center;gap:8px;padding:6px 8px}
.sheet-add-inline .login-input{font-size:13px;padding:6px 10px;min-width:220px}
.sheet-archive-panel{border:1px solid #e2e8f0;border-top:none;border-radius:0 0 10px 10px;background:#f8fafc;padding:8px 10px;margin-bottom:10px}
.sheet-archive-item{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 0;border-bottom:1px dashed #dbe2ea}
.sheet-archive-item:last-child{border-bottom:none}
.sheet-archive-name{border:none;background:none;padding:0;color:#334155;font-size:13px;font-weight:600;cursor:pointer}
.sheet-archive-name:hover{color:#7B2C8E}
.sheet-archive-actions{display:flex;gap:8px}

/* Расчётный блок */
.calc-block{display:flex;gap:0;background:#fff;border:1px solid #e5e7eb;border-top:none;border-radius:0 0 14px 14px;margin-bottom:18px;padding:14px 20px;flex-wrap:wrap;gap:24px}
.calc-item{display:flex;flex-direction:column;gap:2px}
.calc-label{font-size:11px;font-weight:700;text-transform:uppercase;color:#9ca3af;letter-spacing:.04em}
.calc-label-active{color:#16a34a}
.calc-value{font-size:17px;font-weight:700;color:#111827}
.calc-value-main{font-size:20px;color:#7B2C8E}
.calc-payout{color:#059669}
.calc-payout-unmet{color:#dc2626;font-weight:700}
.calc-payout-met{color:#16a34a;font-weight:700}
.calc-pos{color:#059669}
.calc-neg{color:#dc2626}
.calc-empty{font-size:13px;font-weight:400;color:#9ca3af}
.calc-plan-edit{display:flex}
.calc-plan-input{width:130px;font-size:16px;font-weight:700;border:1.5px solid #7B2C8E;border-radius:6px;padding:2px 8px;outline:none}
.calc-plan-val{cursor:pointer;border-bottom:1.5px dashed #d1d5db}
.calc-plan-val:hover{border-color:#7B2C8E;color:#7B2C8E}
.calc-attendance{margin-left:auto;display:flex;gap:24px;padding-left:24px;border-left:2px solid #e5e7eb;align-self:stretch;align-items:center}
.calc-attendance-free{margin-left:auto;display:flex;gap:24px;padding-left:24px;border-left:2px solid #e5e7eb;align-self:stretch;align-items:center}
.calc-attendance-free + .calc-attendance{margin-left:0}
.calc-unit{font-size:13px;font-weight:400;color:#6b7280}

/* Таблица участников */
.rp-table-wrap{overflow-x:auto;overflow-y:auto;max-height:72vh;border-radius:12px;border:1px solid #e5e7eb;background:#fff}
.rp-table{border-collapse:collapse;width:100%;font-size:12px;table-layout:fixed}
.rp-table th{background:#f9fafb;font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.03em;color:#6b7280;padding:6px 4px;white-space:nowrap;border-bottom:1.5px solid #e5e7eb;text-align:left;position:sticky;top:0;overflow:visible}
.rp-table td{padding:3px 4px;border-bottom:1px solid #e5e7eb;vertical-align:top;word-break:break-word;overflow-wrap:anywhere;white-space:normal}
.rp-table td,.rp-table td textarea,.rp-table td input,.rp-table td select,.rp-cell-select-display{scroll-margin-top:56px;scroll-margin-bottom:140px}
.rp-table th:not(:last-child),.rp-table td:not(:last-child){border-right:1px solid #f0f0f0}
.rp-table tr:last-child td{border-bottom:none}

/* Base readability for neutral rows (do not override status row fills). */
.rp-table tbody tr.rp-row:not(.rp-row-paid):not(.rp-row-partial-paid):not(.rp-row-invoiced):not(.rp-row-event-info):not(.rp-row-event-program):not(.rp-row-event-reserve):not(.rp-row-event-declined):not(.rp-row-free-sent):not(.rp-row-free-waiting):not(.rp-row-free-confirmed):not(.rp-row-free-link):nth-child(even) td{background:#fafafa}
.rp-table tbody tr.rp-row:not(.rp-row-paid):not(.rp-row-partial-paid):not(.rp-row-invoiced):not(.rp-row-event-info):not(.rp-row-event-program):not(.rp-row-event-reserve):not(.rp-row-event-declined):not(.rp-row-free-sent):not(.rp-row-free-waiting):not(.rp-row-free-confirmed):not(.rp-row-free-link):nth-child(odd) td{background:#fff}

/* Hover highlight for full row; status colors stay visually intact via light overlay. */
.rp-table tbody tr.rp-row td{transition:background-color .12s ease,background-image .12s ease}
.rp-table tbody tr.rp-row:hover td{background-image:linear-gradient(rgba(241,245,249,.55),rgba(241,245,249,.55))}

.rp-row-paid td{background:#bbf7d0}
.rp-row-partial-paid td{background:#dcfce7}
.rp-row-invoiced td{background:#fef9c3}
.rp-td-overdue{background:#fecaca !important;color:#7f1d1d}
.rp-td-contract-missing-signature{background:#fecaca !important;color:#7f1d1d}
.rp-td-contract-signed{background:#86efac !important;color:#14532d}
.rp-td-contract-missing-signature .rp-cell-text,
.rp-td-contract-missing-signature .rp-cell-input,
.rp-td-contract-missing-signature .rp-cell-select,
.rp-td-contract-missing-signature .rp-cell-select-display,
.rp-td-contract-missing-signature input,
.rp-td-contract-missing-signature select,
.rp-td-contract-missing-signature textarea,
.rp-td-contract-signed .rp-cell-text,
.rp-td-contract-signed .rp-cell-input,
.rp-td-contract-signed .rp-cell-select,
.rp-td-contract-signed .rp-cell-select-display,
.rp-td-contract-signed input,
.rp-td-contract-signed select,
.rp-td-contract-signed textarea{background:transparent;color:inherit}
.rp-row-free-sent td{background:#fef9c3}
.rp-row-free-waiting td{background:#fce7f3}
.rp-row-free-confirmed td{background:#bbf7d0}
.rp-row-free-link td{background:#bfdbfe}
.rp-row-event-info td{background:#fef3c7}
.rp-row-event-program td{background:#dcfce7}
.rp-row-event-reserve td{background:#fce7f3}
.rp-row-event-declined td{background:#e5e7eb}
.rp-td-event-partner-role{background:#fed7aa !important}
.rp-td-event-moderator-role{background:#15803d !important}
.rp-td-event-moderator-role .rp-cell-select,.rp-td-event-moderator-role .rp-cell-text{color:#f8fafc}
.rp-td-event-moderator-role .rp-cell-select:hover,.rp-td-event-moderator-role .rp-cell-select:focus,.rp-td-event-moderator-role .rp-cell-text:hover{background:rgba(255,255,255,.12)}
.rp-row-sponsor td.rp-td-sponsor{background:#dbeafe !important}
.rp-row-sponsor td.rp-td-sponsor .rp-cell-select,
.rp-row-sponsor td.rp-td-sponsor .rp-cell-text{background:transparent}
.rp-row-divider td{background:#f8fafc;border-top:2px solid #e5e7eb;border-bottom:2px solid #e5e7eb}
.rp-td-selected{outline:2px solid #7B2C8E;outline-offset:-2px;background:#f3e8ff}
.rp-divider-cell{padding:0 8px !important}
.rp-divider-inner{display:flex;align-items:center;justify-content:center;gap:12px;padding:6px 0}
.rp-divider-inner .rp-cell-text{font-weight:800;letter-spacing:.04em;text-transform:uppercase;color:#334155;background:transparent;flex:1;text-align:center}
.rp-divider-actions{display:flex;align-items:center;gap:6px}
.rp-divider-title-input{font-weight:800;letter-spacing:.04em;text-transform:uppercase;color:#334155;background:transparent;border:none;outline:none;flex:1;text-align:center;font-size:12px;font-family:inherit;width:100%;padding:0}

.rp-th-drag{width:1.8%}
.rp-td-drag-handle{cursor:grab;color:#9ca3af;font-size:14px;text-align:center;user-select:none;padding:3px 2px}
.rp-td-drag-handle:hover{color:#374151}
.rp-td-drag-handle.rp-td-drag-handle-sub{cursor:default;color:#e5e7eb;font-size:10px}
.rp-row-dragging td{opacity:.35}
.rp-row-drop-before td{border-top:2px solid #7B2C8E !important}
.rp-row-drop-after td{border-bottom:2px solid #7B2C8E !important}
/* Колонки — пропорциональные ширины, без min-width */
.rp-th-memo{width:6%}
.rp-th-company{width:8.5%}
.rp-th-name{width:8%}
.rp-th-pos{width:7%}
.rp-th-email{width:9%}
.rp-th-phone{width:7%}
.rp-th-pkg{width:7%}
.rp-th-free-status{width:8%}
.rp-th-edo{width:3.3%}
.rp-th-contract{width:6.2%}
.rp-th-due{width:5.5%}
.rp-th-amt{width:4.8%;text-align:left}
.rp-th-status{width:6.2%}
.rp-th-comment{width:7%}
.rp-th-del{width:2%}
.rp-novat{text-align:left;font-weight:600;color:#374151;padding-right:4px}
.rp-th-event-small{width:5%}
.rp-th-event-phone{width:7%}
.rp-th-event-contact{width:8%}
.rp-th-event-comment{width:8%}
.rp-th-event-order{width:4%}
.rp-table-event .rp-th-status{width:7.5%}
.rp-table-event .rp-th-name{width:9.5%}
.rp-table-event .rp-th-pos{width:8.5%}
.rp-table-event .rp-th-company{width:8.5%}

/* В двухдневном листе слегка ужимаем все колонки, чтобы колонка "День" всегда была видимой. */
.rp-table.rp-table-2day .rp-th-memo{width:5.5%}
.rp-table.rp-table-2day .rp-th-company{width:8%}
.rp-table.rp-table-2day .rp-th-name{width:7.5%}
.rp-table.rp-table-2day .rp-th-pos{width:6.5%}
.rp-table.rp-table-2day .rp-th-email{width:8.5%}
.rp-table.rp-table-2day .rp-th-phone{width:6.2%}
.rp-table.rp-table-2day .rp-th-day{width:5.5%}
.rp-table.rp-table-2day .rp-th-pkg{width:6.5%}
.rp-table.rp-table-2day .rp-th-edo{width:3.2%}
.rp-table.rp-table-2day .rp-th-contract{width:5.8%}
.rp-table.rp-table-2day .rp-th-due{width:5%}
.rp-table.rp-table-2day .rp-th-amt{width:4.5%}
.rp-table.rp-table-2day .rp-th-status{width:5.8%}
.rp-table.rp-table-2day .rp-th-comment{width:6.5%}
.rp-table.rp-table-2day .rp-th-del{width:1.8%}

/* Цветовая индикация */
.rp-td-memo-sent{background:#fde68a !important}
.rp-td-memo-sent .rp-cell-select{background:transparent}
.rp-td-memo-confirmed{background:#86efac !important}
.rp-td-memo-confirmed .rp-cell-select{background:transparent}

/* Inline-ячейки */
.rp-cell-text{min-height:22px;padding:2px 4px;border-radius:3px;cursor:text;white-space:normal;overflow-wrap:break-word;word-break:break-word;max-width:none;line-height:1.3}
.rp-cell-text:hover{background:#f3f4f6}
.rp-cell-select-display{cursor:pointer}
.rp-cell-select-display-package{display:block;white-space:normal;word-break:break-word;overflow-wrap:anywhere;line-height:1.3;min-height:22px}
.rp-cell-num{text-align:left}
.rp-cell-empty{color:#d1d5db}
.rp-cell-input{width:100%;border:1.5px solid #7B2C8E;border-radius:4px;padding:2px 4px;font-size:12px;font-family:inherit;outline:none;background:#fff}
.rp-cell-input-num{text-align:left;width:80px}
.rp-cell-select{border:none;background:transparent;font-size:12px;font-family:inherit;color:#1f2937;cursor:pointer;padding:2px 2px;border-radius:4px;width:100%}
.rp-cell-select:hover,.rp-cell-select:focus{background:#f3f4f6;outline:none}
.rp-th-multiline{white-space:normal;line-height:1.2;padding-top:8px;padding-bottom:8px}
.rp-order-btn{background:none;border:none;color:#9ca3af;font-size:14px;cursor:pointer;padding:1px 4px;border-radius:4px;line-height:1}
.rp-order-btn:hover{color:#374151;background:#f1f5f9}
.rp-del-btn{background:none;border:none;color:#9ca3af;font-size:14px;cursor:pointer;padding:1px 4px;border-radius:4px;line-height:1}
.rp-del-btn:hover{color:#ef4444;background:#fee2e2}
.rp-confirm-overlay{position:fixed;inset:0;background:rgba(0,0,0,.4);z-index:1000;display:flex;align-items:center;justify-content:center}
.rp-confirm-dialog{background:#fff;border-radius:10px;padding:24px 28px;min-width:260px;box-shadow:0 8px 32px rgba(0,0,0,.18);display:flex;flex-direction:column;gap:16px}
.rp-confirm-text{margin:0;font-size:15px;font-weight:500;color:#111827}
.rp-confirm-actions{display:flex;gap:10px;justify-content:flex-end}
.rp-confirm-btn{padding:7px 16px;border-radius:7px;border:1px solid #d1d5db;background:#f9fafb;font-size:13px;cursor:pointer;font-weight:500;color:#374151}
.rp-confirm-btn:hover{background:#e5e7eb}
.rp-confirm-btn-danger{background:#ef4444;color:#fff;border-color:#ef4444}
.rp-confirm-btn-danger:hover{background:#dc2626;border-color:#dc2626}
.rp-row-drag-handle{display:inline-flex;align-items:center;justify-content:center;width:22px;height:28px;background:#f3f4f6;border:1px solid #d1d5db;color:#4b5563;font-size:12px;line-height:1;border-radius:6px;cursor:grab;touch-action:none}
.rp-row-drag-handle:hover{background:#e5e7eb}
.rp-row-drag-handle:active{cursor:grabbing}
.rp-row-drag-handle-blocked{background:#fef2f2;border-color:#fca5a5;color:#b91c1c}
.rp-table-wrap-sort-mode .rp-row td:first-child{background-image:linear-gradient(to right, rgba(243,244,246,.6), rgba(243,244,246,0));}
.rp-row-drag-source{opacity:.55}
.rp-row-drop-blocked td{background:#fef2f2 !important;box-shadow:inset 0 0 0 1px #fca5a5}
.rp-table-wrap-drop-blocked{box-shadow:0 0 0 2px rgba(239,68,68,.18);border-radius:12px}
.rp-context-menu{position:fixed;z-index:1300;min-width:170px;background:#fff;border:1px solid #e5e7eb;border-radius:10px;box-shadow:0 10px 24px rgba(15,23,42,.18);padding:6px}
.rp-context-menu-item{display:block;width:100%;text-align:left;background:transparent;border:none;border-radius:7px;padding:8px 10px;font-size:13px;color:#1f2937;cursor:pointer}
.rp-context-menu-item:hover{background:#f3f4f6}
.rp-context-menu-item:disabled{color:#9ca3af;cursor:not-allowed}
.rp-sheet-footer{margin-top:12px;display:flex;gap:10px;align-items:center;flex-wrap:wrap;padding:10px 12px;border:1px solid #e5e7eb;border-radius:12px;background:#fff;box-shadow:0 10px 24px rgba(15,23,42,.08)}

/* ── Partner registry column widths (table-layout:fixed, % of table width) ─ */
.rp-table-partner .rp-pth-copy{width:1.8%}
.rp-table-partner .rp-pth-legal{width:8.5%}
.rp-table-partner .rp-pth-bname{width:8.5%}
.rp-table-partner .rp-pth-contact{width:7%}
.rp-table-partner .rp-pth-email{width:7%}
.rp-table-partner .rp-pth-phone{width:7%}
.rp-table-partner .rp-pth-pkg{width:7.5%}
.rp-table-partner .rp-pth-participants{width:3%}
.rp-table-partner .rp-pth-rate{width:3%;text-align:center}
.rp-table-partner .rp-pth-day{width:4.2%}
.rp-table-partner .rp-pth-stand{width:4.5%}
.rp-table-partner .rp-pth-stand-no{width:3.4%}
.rp-table-partner .rp-pth-edo{width:3.5%}
.rp-table-partner .rp-pth-contract{width:6%}
.rp-table-partner .rp-pth-vika{width:3.5%}
.rp-table-partner .rp-pth-due{width:4.8%}
.rp-table-partner .rp-pth-amt{width:5%}
.rp-table-partner .rp-pth-comment{width:12.6%}
.rp-table-partner .rp-pth-del{width:2%}

.rp-table-partner td textarea,
.rp-table-partner td input,
.rp-table-partner td select{
  width:100%;
  max-width:100%;
  min-width:0;
  font-size:12px;
}

.rp-table-partner td textarea{
  display:block;
  line-height:1.35;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
}

.rp-cell-select-display,
.rp-cell-wrap-input{
  white-space:normal;
  overflow-wrap:anywhere;
  word-break:break-word;
  line-height:1.3;
}

.rp-cell-disabled{color:#6b7280;background:#f9fafb}

/* ── Registry page visual improvements ───────────────────────────────────── */
.rp-page{max-width:none}
.rp-page .reg-page-title-row{margin-bottom:10px}
.rp-page .calc-block{padding:10px 16px;margin-bottom:12px;gap:18px}
.rp-page .calc-value{font-size:15px}
.rp-page .calc-value-main{font-size:17px}
.rp-page .calc-label{font-size:10px}
.rp-page .sheet-tabs-row{display:flex;align-items:flex-end;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-bottom:0}
.rp-page .sheet-tabs-saving{display:inline-flex;align-items:center;gap:8px;font-size:12px;font-weight:600;color:#0f766e;padding:6px 10px;border:1px solid #99f6e4;background:#f0fdfa;border-radius:999px;white-space:nowrap}
.rp-page .sheet-tabs-saving-dot{width:8px;height:8px;border-radius:50%;background:#14b8a6;animation:rp-saving-pulse 1s ease-in-out infinite}
.rp-page .sheet-tab-pending-blocked{opacity:.55;cursor:wait}

@keyframes rp-saving-pulse{
  0%{transform:scale(1);opacity:1}
  50%{transform:scale(0.72);opacity:.55}
  100%{transform:scale(1);opacity:1}
}

@media(max-width:900px){
  .dash,.dash-page,.admin-page{padding:12px}
  .modal-box,.modal-card,.project-modal{width:calc(100vw - 24px)}
}

@media(max-width:640px){
  .dash,.dash-page,.admin-page{padding:8px}
  .dash-header{margin-bottom:14px}
  .dash-section-header{margin-bottom:12px}
  .conf-card,.project-card,.reg-card{padding:12px}
  .modal-box{padding:14px}
  .modal-header{padding:14px 14px 0}
  .modal-body{padding:14px}
  .modal-footer{padding:12px 14px}
}

