/* Corporate Cabinet and CRM styles split from styles.css. */

/* Corporate Cabinet */
.mode-cabinet .chat-sidebar .sidebar-section,
.mode-crm .chat-sidebar .sidebar-section{ display:none !important; }
.mode-cabinet .panel,
.mode-crm .panel{
  min-height: calc(100vh - var(--modebar-height));
}
body.mode-crm #viewCrm,
body.mode-cabinet #cabinetLicenses.active,
body.mode-cabinet #cabinetClients.active,
body.mode-cabinet #cabinetContracts.active,
body.mode-cabinet #cabinetCases.active,
body.mode-cabinet #cabinetEvents.active,
body.mode-cabinet #cabinetCalendar.active{
  position:fixed;
  top:calc(var(--modebar-height, 64px) + 64px);
  left:clamp(284px, 15vw, 332px);
  right:24px;
  bottom:24px;
  height:auto;
  overflow:auto;
}
.cabinet-shell{
  display:flex;
  flex-direction:column;
  gap:14px;
  padding:8px;
}
.cabinet-tabs{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  border-bottom:1px solid var(--border);
  padding-bottom:10px;
}
.cabinet-tab{
  border:1px solid var(--border);
  background:var(--badge-bg);
  color:var(--text);
  border-radius:10px;
  padding:9px 12px;
  cursor:pointer;
}
.cabinet-tab.active{
  border-color:rgba(212,175,55,0.65);
  background:linear-gradient(135deg, rgba(212,175,55,0.18), rgba(245,197,66,0.10));
}
.cabinet-section{ display:none; }
.cabinet-section.active{ display:block; }
.cabinet-grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:12px;
}
.cabinet-grid--organization{
  grid-template-columns:minmax(0, 1fr);
  max-width:648px;
}
.cabinet-file-row{
  display:grid;
  grid-template-columns:minmax(0, 1fr) 42px;
  gap:8px;
  align-items:center;
}
.cabinet-file-btn{
  width:42px;
  height:42px;
  min-width:42px;
}
.cabinet-grid--compact{
  grid-template-columns:1fr 1fr 1fr auto;
  align-items:end;
}
.cabinet-section label{
  display:flex;
  flex-direction:column;
  gap:6px;
  color:var(--label);
  font-size:13px;
  margin-bottom:10px;
}
.required-star{
  color:var(--danger);
  font-weight:900;
}
.cabinet-label-text{
  display:inline-flex;
  gap:4px;
  align-items:baseline;
}
.cabinet-grid--custom-fields{
  grid-template-columns:repeat(2, minmax(0, 1fr));
}
.cabinet-license-profile{
  max-width:760px;
  max-height:88vh;
  overflow:auto;
}
.cabinet-grid--license-profile{
  grid-template-columns:minmax(0, 1fr);
}
.linkbtn{
  border:0;
  background:transparent;
  color:var(--text);
  padding:0;
  font:inherit;
  font-weight:700;
  cursor:pointer;
  text-decoration:underline;
  text-underline-offset:3px;
}
.linkbtn:hover{ color:var(--accent); }
.cabinet-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  margin:12px 0;
}
.cabinet-readonly{
  opacity:.72;
  cursor:not-allowed;
}
.cabinet-actions .input{ max-width:260px; }


/* Native select popups must use the Cabinet dark palette in Chromium. */
#viewCabinet select.input,
#viewCrm select.input{
  color-scheme:dark;
  color:var(--text);
  background-color:rgba(0,0,0,0.42);
}
#viewCabinet select.input option,
#viewCabinet select.input optgroup,
#viewCrm select.input option,
#viewCrm select.input optgroup{
  color:var(--text);
  background-color:#17140d;
}
.cabinet-calendar-month{
  min-width:188px;
  text-transform:capitalize;
}
.cabinet-calendar-month.is-selected{
  border-color:rgba(212,175,55,0.65);
  background:linear-gradient(135deg, rgba(212,175,55,0.18), rgba(245,197,66,0.10));
}
.cabinet-table{
  border:1px solid var(--border);
  border-radius:12px;
  overflow:auto;
  background:rgba(0,0,0,0.12);
}
.cabinet-table table{
  width:100%;
  border-collapse:collapse;
  min-width:720px;
}
.cabinet-table th,
.cabinet-table td{
  border-bottom:1px solid var(--border);
  padding:10px;
  text-align:left;
  vertical-align:top;
}
.cabinet-table th{
  color:var(--muted);
  font-size:12px;
  font-weight:700;
}
.cabinet-title{
  margin:0;
  font-size:22px;
}
.crm-shell{
  width:100%;
  max-width:100%;
  margin-left:0;
  margin-right:auto;
}
.crm-shell .cabinet-table{
  width:100%;
  max-width:100%;
  overflow-x:auto;
}
.crm-shell .cabinet-table table{
  min-width:1480px;
}
.crm-mini{
  width:120px;
  min-width:120px;
}
.crm-money{
  width:150px;
  min-width:150px;
}
.crm-date{
  width:140px;
  min-width:140px;
}
.crm-org-select{
  width:180px;
  min-width:180px;
}
body.mode-cabinet #cabinetLicenses.active{
  top:calc(var(--modebar-height, 64px) + 122px);
  width:auto;
  max-width:none;
}
body.mode-cabinet #cabinetCases.active{
  top:calc(var(--modebar-height, 64px) + 122px);
  width:auto;
  max-width:none;
}
body.mode-cabinet #cabinetClients.active{
  top:calc(var(--modebar-height, 64px) + 122px);
  width:auto;
  max-width:none;
}
body.mode-cabinet #cabinetContracts.active{
  top:calc(var(--modebar-height, 64px) + 122px);
  width:auto;
  max-width:none;
}
body.mode-cabinet #cabinetEvents.active{
  top:calc(var(--modebar-height, 64px) + 122px);
  width:auto;
  max-width:none;
}
body.mode-cabinet #cabinetCalendar.active{
  top:calc(var(--modebar-height, 64px) + 122px);
  width:auto;
  max-width:none;
}
.cabinet-table--licenses{
  width:100%;
  max-width:100%;
  overflow-x:auto;
}
.cabinet-table--licenses table{
  min-width:1180px;
}
.cabinet-table--licenses th:nth-child(1),
.cabinet-table--licenses td:nth-child(1){ min-width:96px; }
.cabinet-table--licenses th:nth-child(2),
.cabinet-table--licenses td:nth-child(2){ min-width:170px; }
.cabinet-table--licenses th:nth-child(3),
.cabinet-table--licenses td:nth-child(3){ min-width:240px; }
.cabinet-table--licenses th:nth-child(4),
.cabinet-table--licenses td:nth-child(4){ min-width:140px; }
.cabinet-table--licenses th:nth-child(5),
.cabinet-table--licenses td:nth-child(5){ min-width:120px; }
.cabinet-table--licenses th:nth-child(6),
.cabinet-table--licenses td:nth-child(6){ min-width:120px; }
.cabinet-table--licenses th:nth-child(7),
.cabinet-table--licenses td:nth-child(7),
.cabinet-table--licenses th:nth-child(8),
.cabinet-table--licenses td:nth-child(8){ min-width:120px; }
.cabinet-table--licenses th:nth-child(9),
.cabinet-table--licenses td:nth-child(9){ min-width:120px; }
.cabinet-table--cases{
  width:100%;
  max-width:100%;
  overflow-x:auto;
}
.cabinet-table--cases table{
  min-width:1320px;
}
.cabinet-table--cases th:nth-child(1),
.cabinet-table--cases td:nth-child(1){ min-width:220px; }
.cabinet-table--cases th:nth-child(2),
.cabinet-table--cases td:nth-child(2){ min-width:240px; }
.cabinet-table--cases th:nth-child(3),
.cabinet-table--cases td:nth-child(3){ min-width:160px; }
.cabinet-table--cases th:nth-child(4),
.cabinet-table--cases td:nth-child(4){ min-width:150px; }
.cabinet-table--cases th:nth-child(5),
.cabinet-table--cases td:nth-child(5){ min-width:150px; }
.cabinet-table--cases th:nth-child(6),
.cabinet-table--cases td:nth-child(6){ min-width:190px; }
.cabinet-table--cases th:nth-child(7),
.cabinet-table--cases td:nth-child(7){ min-width:90px; }
.cabinet-client-toolbar{
  display:flex;
  flex-direction:column;
  gap:2px;
  margin-bottom:10px;
}
.crm-admin-toolbar{
  display:flex;
  gap:8px;
  align-items:center;
  margin-bottom:10px;
}
.cabinet-client-profile{
  max-width:760px;
  max-height:88vh;
  overflow:auto;
}
.cabinet-contract-profile,
.cabinet-case-profile,
.cabinet-event-profile{
  max-width:760px;
  max-height:88vh;
  overflow:auto;
}
.cabinet-grid--client-profile,
.cabinet-grid--contract-profile,
.cabinet-grid--case-profile,
.cabinet-grid--event-profile{
  grid-template-columns:minmax(0, 1fr);
}
.cabinet-check{
  display:flex;
  flex-direction:row !important;
  align-items:center;
  gap:8px;
  margin:8px 0 4px;
}
.cabinet-table--clients{
  width:100%;
  max-width:100%;
  overflow-x:auto;
}
.cabinet-table--clients table{
  min-width:820px;
}
.cabinet-table--clients th:nth-child(1),
.cabinet-table--clients td:nth-child(1){ min-width:260px; }
.cabinet-table--clients th:nth-child(2),
.cabinet-table--clients td:nth-child(2){ min-width:260px; }
.cabinet-table--clients th:nth-child(3),
.cabinet-table--clients td:nth-child(3){ min-width:180px; }
.cabinet-table--clients th:nth-child(4),
.cabinet-table--clients td:nth-child(4){ min-width:90px; }
.cabinet-table--contracts{
  width:100%;
  max-width:100%;
  overflow-x:auto;
}
.cabinet-table--contracts table{
  min-width:1320px;
}
.cabinet-table--contracts th:nth-child(1),
.cabinet-table--contracts td:nth-child(1){ min-width:220px; }
.cabinet-table--contracts th:nth-child(2),
.cabinet-table--contracts td:nth-child(2){ min-width:240px; }
.cabinet-table--contracts th:nth-child(3),
.cabinet-table--contracts td:nth-child(3){ min-width:160px; }
.cabinet-table--contracts th:nth-child(4),
.cabinet-table--contracts td:nth-child(4){ min-width:150px; }
.cabinet-table--contracts th:nth-child(5),
.cabinet-table--contracts td:nth-child(5){ min-width:140px; }
.cabinet-table--contracts th:nth-child(6),
.cabinet-table--contracts td:nth-child(6){ min-width:190px; }
.cabinet-table--contracts th:nth-child(7),
.cabinet-table--contracts td:nth-child(7){ min-width:90px; }
.cabinet-filter-select{
  max-width:260px;
}
.cabinet-table--events{
  width:100%;
  max-width:100%;
  overflow-x:auto;
}
.cabinet-table--events table{
  min-width:1180px;
}
.cabinet-table--events th:nth-child(1),
.cabinet-table--events td:nth-child(1){ min-width:130px; }
.cabinet-table--events th:nth-child(2),
.cabinet-table--events td:nth-child(2){ min-width:130px; }
.cabinet-table--events th:nth-child(3),
.cabinet-table--events td:nth-child(3){ min-width:210px; }
.cabinet-table--events th:nth-child(4),
.cabinet-table--events td:nth-child(4){ min-width:250px; }
.cabinet-table--events th:nth-child(5),
.cabinet-table--events td:nth-child(5){ min-width:160px; }
.cabinet-table--events th:nth-child(6),
.cabinet-table--events td:nth-child(6){ min-width:260px; }
.cabinet-table--calendar{
  width:100%;
  max-width:100%;
  overflow-x:auto;
}
.cabinet-table--calendar table{
  min-width:1420px;
}
.cabinet-table--calendar th:nth-child(1),
.cabinet-table--calendar td:nth-child(1){ min-width:120px; }
.cabinet-table--calendar th:nth-child(2),
.cabinet-table--calendar td:nth-child(2),
.cabinet-table--calendar th:nth-child(3),
.cabinet-table--calendar td:nth-child(3){ min-width:92px; }
.cabinet-table--calendar th:nth-child(4),
.cabinet-table--calendar td:nth-child(4){ min-width:180px; }
.cabinet-table--calendar th:nth-child(5),
.cabinet-table--calendar td:nth-child(5){ min-width:190px; }
.cabinet-table--calendar th:nth-child(6),
.cabinet-table--calendar td:nth-child(6){ min-width:240px; }
.cabinet-table--calendar th:nth-child(7),
.cabinet-table--calendar td:nth-child(7){ min-width:150px; }
.cabinet-table--calendar th:nth-child(8),
.cabinet-table--calendar td:nth-child(8){ min-width:220px; }
.cabinet-table--calendar th:nth-child(9),
.cabinet-table--calendar td:nth-child(9){ min-width:180px; }
.cabinet-table--calendar th:nth-child(10),
.cabinet-table--calendar td:nth-child(10){ min-width:96px; text-align:center; }
.cabinet-calendar-widget{
  width:min(520px, 100%);
  margin:0 0 14px;
  border:1px solid rgba(212,175,55,0.36);
  border-radius:12px;
  padding:14px;
  background:linear-gradient(145deg, rgba(212,175,55,0.10), rgba(0,0,0,0.28));
  box-shadow:0 18px 44px rgba(0,0,0,0.24);
}
.cabinet-calendar-widget__head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}
.cabinet-calendar-widget__title{
  border:0;
  background:transparent;
  color:var(--text);
  font-size:18px;
  font-weight:800;
  text-transform:capitalize;
  padding:0;
  cursor:pointer;
}
.cabinet-calendar-widget__title:hover{
  color:var(--accent);
}
.cabinet-calendar-controls,
.cabinet-calendar-filterbar{
  display:flex;
  align-items:center;
  gap:8px;
}
.cabinet-calendar-filterbar{
  margin:0 0 12px;
}
.cabinet-calendar-weekdays,
.cabinet-calendar-days{
  display:grid;
  grid-template-columns:repeat(7, minmax(0, 1fr));
  gap:6px;
}
.cabinet-calendar-weekdays span{
  color:var(--muted);
  font-size:12px;
  font-weight:800;
  text-align:center;
}
.cabinet-calendar-day{
  min-height:42px;
  border:1px solid var(--border);
  border-radius:8px;
  background:rgba(0,0,0,0.20);
  color:var(--text);
  font-weight:700;
}
.cabinet-calendar-day--blank{
  border-color:transparent;
  background:transparent;
}
.cabinet-calendar-day.has-events{
  border-color:rgba(212,175,55,0.70);
  background:rgba(212,175,55,0.16);
}
.cabinet-calendar-day.is-today{
  box-shadow:inset 0 0 0 2px rgba(245,197,66,0.60);
}
.cabinet-calendar-day.is-selected{
  border-color:rgba(245,197,66,0.95);
  background:linear-gradient(135deg, rgba(212,175,55,0.34), rgba(245,197,66,0.18));
  color:#fff6d6;
}
.cabinet-table input[type="checkbox"]{
  width:16px;
  height:16px;
  accent-color:var(--accent);
}
.cabinet-table-gap td{
  height:14px;
  padding:0;
  border-bottom:0;
  background:transparent;
}
.cabinet-row-inactive td,
.cabinet-row-inactive .linkbtn{
  color:var(--muted) !important;
  font-weight:400 !important;
  text-decoration:none !important;
}
.cabinet-event-overdue td,
.cabinet-event-overdue .linkbtn{
  color:var(--danger) !important;
  font-weight:800;
  text-decoration:underline;
}
.cabinet-event-pending td,
.cabinet-event-pending .linkbtn{
  color:#fff !important;
  font-weight:800;
}
html[data-theme="light"] .cabinet-event-pending td,
html[data-theme="light"] .cabinet-event-pending .linkbtn{
  color:rgba(29,29,31,0.92) !important;
}
.cabinet-event-done td,
.cabinet-event-done .linkbtn{
  color:rgba(145,145,145,0.95) !important;
  font-weight:400;
  text-decoration:none;
}
.crm-comment{
  min-width:180px;
}
.crm-tariffs-panel{
  max-width:760px;
}
.crm-summary{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:10px;
  margin-bottom:14px;
}
.crm-buy-row{
  grid-template-columns:minmax(180px, 1fr) auto auto;
}
.crm-quote{
  display:grid;
  gap:8px;
}
@media (max-width: 900px){
  body.mode-crm #viewCrm,
  body.mode-cabinet #cabinetLicenses.active,
  body.mode-cabinet #cabinetClients.active,
  body.mode-cabinet #cabinetContracts.active,
  body.mode-cabinet #cabinetCases.active,
  body.mode-cabinet #cabinetEvents.active,
  body.mode-cabinet #cabinetCalendar.active{
    position:static;
    height:auto;
    overflow:visible;
  }
}
.cabinet-empty{
  padding:14px;
  color:var(--muted);
}
.cabinet-muted{
  color:var(--muted);
  font-size:12px;
  margin-top:4px;
}
.cabinet-access-box{
  border:1px solid var(--border);
  border-radius:12px;
  padding:12px;
  margin:12px 0;
  background:var(--badge-bg);
}
.cabinet-access-title{
  font-weight:800;
  margin-bottom:8px;
}
.cabinet-details{
  margin-top:14px;
  border:1px solid var(--border);
  border-radius:12px;
  padding:14px;
}
.cabinet-detail-head,
.cabinet-row{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:center;
  border-bottom:1px solid var(--border);
  padding:10px 0;
}
.cabinet-detail-head{ padding-top:0; }
.cabinet-row:last-child{ border-bottom:0; }
.cabinet-columns{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:16px;
}
.cabinet-stats{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:12px;
}
.cabinet-stat{
  border:1px solid var(--border);
  border-radius:12px;
  padding:14px;
  background:var(--badge-bg);
  display:flex;
  flex-direction:column;
  gap:8px;
}
.cabinet-stat span{ color:var(--muted); font-size:12px; }
.cabinet-stat b{ color:var(--text); overflow-wrap:anywhere; }

@media (max-width: 980px){
  .cabinet-grid,
  .cabinet-grid--compact,
  .cabinet-columns,
  .cabinet-stats{ grid-template-columns:1fr; }
  .cabinet-actions .input{ max-width:none; width:100%; }
}

.cabinet-calendar-muted td,
.cabinet-calendar-muted .linkbtn {
  color: var(--muted);
  font-weight: 400;
}

.cabinet-event-muted td,
.cabinet-event-muted .linkbtn {
  color: var(--muted);
  font-weight: 400;
}

#cabLicenseProfileModal .modal__panel,
#cabClientProfileModal .modal__panel,
#cabContractProfileModal .modal__panel,
#cabCaseProfileModal .modal__panel,
#cabEventProfileModal .modal__panel{
  border:1px solid rgba(212,175,55,0.34);
  border-radius:12px;
  background:linear-gradient(145deg, rgba(18,17,11,0.98), rgba(0,0,0,0.98));
  box-shadow:0 28px 80px rgba(0,0,0,0.58);
}
#cabLicenseProfileModal .modal__head,
#cabClientProfileModal .modal__head,
#cabContractProfileModal .modal__head,
#cabCaseProfileModal .modal__head,
#cabEventProfileModal .modal__head{
  position:sticky;
  top:0;
  z-index:2;
  margin:-1px -1px 14px;
  padding:16px;
  border-bottom:1px solid rgba(212,175,55,0.28);
  border-radius:12px 12px 0 0;
  background:rgba(8,8,6,0.96);
}
#cabLicenseProfileModal .modal__title,
#cabClientProfileModal .modal__title,
#cabContractProfileModal .modal__title,
#cabCaseProfileModal .modal__title,
#cabEventProfileModal .modal__title{
  color:var(--text);
  font-weight:900;
}
#cabLicenseProfileModal .cabinet-actions,
#cabClientProfileModal .cabinet-actions,
#cabContractProfileModal .cabinet-actions,
#cabCaseProfileModal .cabinet-actions,
#cabEventProfileModal .cabinet-actions{
  position:sticky;
  bottom:0;
  margin:14px -1px -1px;
  padding:14px 0 0;
  background:linear-gradient(180deg, rgba(8,8,6,0), rgba(8,8,6,0.98) 24%);
}

/* sLAWIER: responsive events table */
.cabinet-table--events{
  width:100%;
  max-width:100%;
  overflow-x:auto;
}

.cabinet-table--events table{
  width:100%;
  min-width:0;
  table-layout:fixed;
}

.cabinet-table--events th,
.cabinet-table--events td{
  min-width:0;
  padding:8px 6px;
  vertical-align:middle;
  overflow-wrap:anywhere;
  word-break:break-word;
}

.cabinet-table--events th{
  font-size:11px;
  line-height:1.2;
}

.cabinet-table--events td{
  font-size:12px;
  line-height:1.25;
}

.cabinet-table--events .linkbtn{
  display:block;
  width:100%;
  max-width:100%;
  text-align:left;
  white-space:normal;
  overflow-wrap:anywhere;
  word-break:break-word;
}

/* 11 compact responsive columns */
.cabinet-table--events th:nth-child(1),
.cabinet-table--events td:nth-child(1){ width:8%; }

.cabinet-table--events th:nth-child(2),
.cabinet-table--events td:nth-child(2){ width:8%; }

.cabinet-table--events th:nth-child(3),
.cabinet-table--events td:nth-child(3){ width:8%; }

.cabinet-table--events th:nth-child(4),
.cabinet-table--events td:nth-child(4){ width:10%; }

.cabinet-table--events th:nth-child(5),
.cabinet-table--events td:nth-child(5){ width:12%; }

.cabinet-table--events th:nth-child(6),
.cabinet-table--events td:nth-child(6){ width:9%; }

.cabinet-table--events th:nth-child(7),
.cabinet-table--events td:nth-child(7){ width:9%; }

.cabinet-table--events th:nth-child(8),
.cabinet-table--events td:nth-child(8){ width:10%; }

.cabinet-table--events th:nth-child(9),
.cabinet-table--events td:nth-child(9){ width:15%; }

.cabinet-table--events th:nth-child(10),
.cabinet-table--events td:nth-child(10),
.cabinet-table--events th:nth-child(11),
.cabinet-table--events td:nth-child(11){
  width:5.5%;
  text-align:center;
  white-space:nowrap;
  overflow-wrap:normal;
  word-break:normal;
}

/* sLAWIER: Cabinet light-theme select readability */
html[data-theme="light"] #viewCabinet select.input{
  color-scheme:light;
  background:#ffffff;
  color:#111827;
  border-color:rgba(17,24,39,.18);
}

html[data-theme="light"] #viewCabinet select.input option,
html[data-theme="light"] #viewCabinet select.input optgroup{
  background:#ffffff;
  color:#111827;
}

html[data-theme="light"] #viewCabinet select.input:disabled,
html[data-theme="light"] #viewCabinet select.input[disabled]{
  color-scheme:light;
  background:#f3f4f6;
  color:#111827;
  border-color:rgba(17,24,39,.16);
  opacity:1;
  -webkit-text-fill-color:#111827;
}

html[data-theme="light"] #viewCabinet select.input:focus{
  background:#ffffff;
  color:#111827;
  outline:none;
  box-shadow:0 0 0 2px rgba(180,138,42,.22);
}

/* sLAWIER: Cabinet profile horizontal rows */
#viewCabinet :is(
  #cabLicenseProfileModal,
  #cabClientProfileModal,
  #cabContractProfileModal,
  #cabCaseProfileModal,
  #cabEventProfileModal
) .modal__body > label:not(.hidden):not(.cabinet-muted):not(.cabinet-check),
#viewCabinet #cabinetOrganization label:not(.hidden):not(.cabinet-muted):not(.cabinet-check){
  display:grid;
  grid-template-columns:minmax(150px, 215px) minmax(0, 1fr);
  column-gap:16px;
  row-gap:6px;
  align-items:center;
  margin:0 0 10px;
}

#viewCabinet :is(
  #cabLicenseProfileModal,
  #cabClientProfileModal,
  #cabContractProfileModal,
  #cabCaseProfileModal,
  #cabEventProfileModal
) .modal__body > label:not(.hidden):not(.cabinet-muted):not(.cabinet-check) > .cabinet-label-text,
#viewCabinet #cabinetOrganization label:not(.hidden):not(.cabinet-muted):not(.cabinet-check) > .cabinet-label-text{
  grid-column:1;
  min-width:0;
}

#viewCabinet :is(
  #cabLicenseProfileModal,
  #cabClientProfileModal,
  #cabContractProfileModal,
  #cabCaseProfileModal,
  #cabEventProfileModal
) .modal__body > label:not(.hidden):not(.cabinet-muted):not(.cabinet-check) > :is(.input, select, input, textarea, .cabinet-file-row, div),
#viewCabinet #cabinetOrganization label:not(.hidden):not(.cabinet-muted):not(.cabinet-check) > :is(.input, select, input, textarea, .cabinet-file-row, div){
  grid-column:2;
  width:100%;
  min-width:0;
  margin:0;
}

#viewCabinet :is(
  #cabLicenseProfileModal,
  #cabClientProfileModal,
  #cabContractProfileModal,
  #cabCaseProfileModal,
  #cabEventProfileModal
) .modal__body > label:has(textarea.input),
#viewCabinet :is(
  #cabLicenseProfileModal,
  #cabClientProfileModal,
  #cabContractProfileModal,
  #cabCaseProfileModal,
  #cabEventProfileModal
) .modal__body > label:has(.cabinet-file-row),
#viewCabinet #cabinetOrganization label:has(textarea.input),
#viewCabinet #cabinetOrganization label:has(.cabinet-file-row){
  align-items:start;
}

#viewCabinet :is(
  #cabLicenseProfileModal,
  #cabClientProfileModal,
  #cabContractProfileModal,
  #cabCaseProfileModal,
  #cabEventProfileModal
) .modal__body > label.cabinet-check,
#viewCabinet #cabinetOrganization label.cabinet-check{
  margin:8px 0 10px 215px;
}

@media (max-width:760px){
  #viewCabinet :is(
    #cabLicenseProfileModal,
    #cabClientProfileModal,
    #cabContractProfileModal,
    #cabCaseProfileModal,
    #cabEventProfileModal
  ) .modal__body > label:not(.hidden):not(.cabinet-muted):not(.cabinet-check),
  #viewCabinet #cabinetOrganization label:not(.hidden):not(.cabinet-muted):not(.cabinet-check){
    display:block;
  }

  #viewCabinet :is(
    #cabLicenseProfileModal,
    #cabClientProfileModal,
    #cabContractProfileModal,
    #cabCaseProfileModal,
    #cabEventProfileModal
  ) .modal__body > label.cabinet-check,
  #viewCabinet #cabinetOrganization label.cabinet-check{
    margin:8px 0 10px;
  }
}

/* sLAWIER: Cabinet profile horizontal rows v2 */
#viewCabinet :is(
  #cabLicenseProfileModal,
  #cabClientProfileModal,
  #cabContractProfileModal,
  #cabCaseProfileModal,
  #cabEventProfileModal
) label:not(.hidden):not(.cabinet-check):not(.cabinet-muted):has(> :is(input, select, textarea, .input, .cabinet-file-row)),
#viewCabinet #cabinetOrganization label:not(.hidden):not(.cabinet-check):not(.cabinet-muted):has(> :is(input, select, textarea, .input, .cabinet-file-row)){
  display:grid !important;
  grid-template-columns:minmax(150px, 220px) minmax(0, 1fr) !important;
  column-gap:16px;
  row-gap:6px;
  align-items:center;
  width:100%;
  max-width:760px;
  margin:0 0 12px !important;
}

#viewCabinet :is(
  #cabLicenseProfileModal,
  #cabClientProfileModal,
  #cabContractProfileModal,
  #cabCaseProfileModal,
  #cabEventProfileModal
) label:not(.hidden):not(.cabinet-check):not(.cabinet-muted):has(> :is(textarea, .cabinet-file-row)),
#viewCabinet #cabinetOrganization label:not(.hidden):not(.cabinet-check):not(.cabinet-muted):has(> :is(textarea, .cabinet-file-row)){
  align-items:start;
}

#viewCabinet :is(
  #cabLicenseProfileModal,
  #cabClientProfileModal,
  #cabContractProfileModal,
  #cabCaseProfileModal,
  #cabEventProfileModal
) label > .cabinet-label-text,
#viewCabinet #cabinetOrganization label > .cabinet-label-text{
  grid-column:1;
  min-width:0;
}

#viewCabinet :is(
  #cabLicenseProfileModal,
  #cabClientProfileModal,
  #cabContractProfileModal,
  #cabCaseProfileModal,
  #cabEventProfileModal
) label:not(.hidden):not(.cabinet-check):not(.cabinet-muted) > :is(input, select, textarea, .input, .cabinet-file-row),
#viewCabinet #cabinetOrganization label:not(.hidden):not(.cabinet-check):not(.cabinet-muted) > :is(input, select, textarea, .input, .cabinet-file-row){
  grid-column:2;
  width:100% !important;
  min-width:0;
  margin:0 !important;
}

#viewCabinet :is(
  #cabLicenseProfileModal,
  #cabClientProfileModal,
  #cabContractProfileModal,
  #cabCaseProfileModal,
  #cabEventProfileModal
) label.cabinet-check,
#viewCabinet #cabinetOrganization label.cabinet-check{
  margin:8px 0 12px 236px !important;
}

/* Stronger field contours in Cabinet forms */
html[data-theme="dark"] #viewCabinet :is(
  #cabLicenseProfileModal,
  #cabClientProfileModal,
  #cabContractProfileModal,
  #cabCaseProfileModal,
  #cabEventProfileModal,
  #cabinetOrganization
) :is(input.input, select.input, textarea.input){
  border-color:rgba(255,255,255,.28);
  background:rgba(255,255,255,.045);
  color:var(--text);
}

html[data-theme="dark"] #viewCabinet :is(
  #cabLicenseProfileModal,
  #cabClientProfileModal,
  #cabContractProfileModal,
  #cabCaseProfileModal,
  #cabEventProfileModal,
  #cabinetOrganization
) :is(input.input, select.input, textarea.input):is(:disabled, [readonly]){
  border-color:rgba(255,255,255,.22);
  background:rgba(255,255,255,.075);
  opacity:1;
  -webkit-text-fill-color:var(--text);
}

html[data-theme="light"] #viewCabinet :is(
  #cabLicenseProfileModal,
  #cabClientProfileModal,
  #cabContractProfileModal,
  #cabCaseProfileModal,
  #cabEventProfileModal,
  #cabinetOrganization
) :is(input.input, select.input, textarea.input){
  border-color:rgba(17,24,39,.22);
}

html[data-theme="light"] #viewCabinet :is(
  #cabLicenseProfileModal,
  #cabClientProfileModal,
  #cabContractProfileModal,
  #cabCaseProfileModal,
  #cabEventProfileModal,
  #cabinetOrganization
) :is(input.input, select.input, textarea.input):is(:disabled, [readonly]){
  background:#e5e7eb;
  color:#111827;
  opacity:1;
  -webkit-text-fill-color:#111827;
}

@media (max-width:760px){
  #viewCabinet :is(
    #cabLicenseProfileModal,
    #cabClientProfileModal,
    #cabContractProfileModal,
    #cabCaseProfileModal,
    #cabEventProfileModal
  ) label:not(.hidden):not(.cabinet-check):not(.cabinet-muted):has(> :is(input, select, textarea, .input, .cabinet-file-row)),
  #viewCabinet #cabinetOrganization label:not(.hidden):not(.cabinet-check):not(.cabinet-muted):has(> :is(input, select, textarea, .input, .cabinet-file-row)){
    display:block !important;
    max-width:100%;
  }

  #viewCabinet :is(
    #cabLicenseProfileModal,
    #cabClientProfileModal,
    #cabContractProfileModal,
    #cabCaseProfileModal,
    #cabEventProfileModal
  ) label.cabinet-check,
  #viewCabinet #cabinetOrganization label.cabinet-check{
    margin:8px 0 12px !important;
  }
}

/* sLAWIER: Cabinet configurable table columns */
#viewCabinet .cabinet-table table.cabinet-columns-enhanced{
  table-layout:fixed;
}

#viewCabinet .cabinet-table th.cabinet-col-configurable{
  position:relative;
  user-select:none;
  cursor:grab;
  padding-right:18px;
  overflow:hidden;
  text-overflow:ellipsis;
}

#viewCabinet .cabinet-table th.cabinet-col-configurable:active{
  cursor:grabbing;
}

#viewCabinet .cabinet-table th.cabinet-col-dragging{
  opacity:.58;
}

#viewCabinet .cabinet-table th.cabinet-col-drag-over{
  outline:2px solid rgba(180,138,42,.85);
  outline-offset:-2px;
}

#viewCabinet .cabinet-table .cabinet-col-resizer{
  position:absolute;
  top:0;
  right:0;
  bottom:0;
  width:10px;
  cursor:col-resize;
  touch-action:none;
  z-index:3;
}

#viewCabinet .cabinet-table .cabinet-col-resizer::after{
  content:"";
  position:absolute;
  top:20%;
  bottom:20%;
  right:3px;
  width:1px;
  background:rgba(180,138,42,.45);
  opacity:.55;
}

#viewCabinet .cabinet-table .cabinet-col-resizer:hover::after{
  width:2px;
  opacity:1;
}

#viewCabinet .cabinet-table.is-resizing-columns,
#viewCabinet .cabinet-table.is-resizing-columns *{
  cursor:col-resize !important;
  user-select:none !important;
}

#viewCabinet .cabinet-table table.cabinet-columns-enhanced th,
#viewCabinet .cabinet-table table.cabinet-columns-enhanced td{
  overflow:hidden;
  text-overflow:ellipsis;
}

html[data-theme="light"] #viewCabinet .cabinet-table .cabinet-col-resizer::after{
  background:rgba(120,82,18,.55);
}

html[data-theme="dark"] #viewCabinet .cabinet-table .cabinet-col-resizer::after{
  background:rgba(245,200,92,.55);
}

/* sLAWIER: Cabinet draggable profile rows */
#viewCabinet :is(
  #cabLicenseProfileModal,
  #cabClientProfileModal,
  #cabContractProfileModal,
  #cabCaseProfileModal,
  #cabEventProfileModal
) .cabinet-grid > label.cabinet-profile-row-draggable{
  position:relative;
  padding-left:24px !important;
}

#viewCabinet .cabinet-profile-row-handle{
  position:absolute;
  left:0;
  top:50%;
  transform:translateY(-50%);
  width:18px;
  height:24px;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:grab;
  user-select:none;
  opacity:.46;
  z-index:4;
}

#viewCabinet .cabinet-profile-row-handle::before{
  content:"⋮⋮";
  display:block;
  font-size:14px;
  line-height:1;
  letter-spacing:-4px;
  color:var(--muted);
}

#viewCabinet .cabinet-profile-row-handle:hover{
  opacity:1;
}

#viewCabinet .cabinet-profile-row-handle:active{
  cursor:grabbing;
}

#viewCabinet .cabinet-profile-row-dragging{
  opacity:.55;
}

#viewCabinet .cabinet-profile-row-drag-over{
  outline:2px solid rgba(180,138,42,.85);
  outline-offset:3px;
  border-radius:10px;
}

html[data-theme="light"] #viewCabinet .cabinet-profile-row-handle::before{
  color:rgba(17,24,39,.55);
}

html[data-theme="dark"] #viewCabinet .cabinet-profile-row-handle::before{
  color:rgba(245,200,92,.7);
}

/* sLAWIER: Cabinet draggable profile rows v2 */
#viewCabinet :is(
  #cabLicenseProfileModal,
  #cabClientProfileModal,
  #cabContractProfileModal,
  #cabCaseProfileModal,
  #cabEventProfileModal
) .cabinet-grid > label.cabinet-check.cabinet-profile-row-draggable{
  display:flex !important;
  grid-template-columns:none !important;
  align-items:center !important;
  justify-content:flex-start !important;
  gap:8px;
  width:100%;
  max-width:760px;
  margin:0 0 12px !important;
  padding-left:24px !important;
  text-align:left;
}

#viewCabinet :is(
  #cabLicenseProfileModal,
  #cabClientProfileModal,
  #cabContractProfileModal,
  #cabCaseProfileModal,
  #cabEventProfileModal
) .cabinet-grid > label.cabinet-check.cabinet-profile-row-draggable > input[type="checkbox"]{
  margin:0;
}

#viewCabinet :is(
  #cabLicenseProfileModal,
  #cabClientProfileModal,
  #cabContractProfileModal,
  #cabCaseProfileModal,
  #cabEventProfileModal
) .cabinet-grid > .cabinet-details.cabinet-profile-row-draggable{
  position:relative;
  width:100%;
  max-width:760px;
  margin:0 0 12px !important;
  padding-left:24px !important;
}

#viewCabinet :is(
  #cabLicenseProfileModal,
  #cabClientProfileModal,
  #cabContractProfileModal,
  #cabCaseProfileModal,
  #cabEventProfileModal
) .cabinet-grid > .cabinet-details.cabinet-profile-row-draggable.hidden{
  display:none !important;
}

#viewCabinet :is(
  #cabLicenseProfileModal,
  #cabClientProfileModal,
  #cabContractProfileModal,
  #cabCaseProfileModal,
  #cabEventProfileModal
) .cabinet-grid > .cabinet-details.cabinet-profile-row-drag-over{
  outline:2px solid rgba(180,138,42,.85);
  outline-offset:3px;
  border-radius:10px;
}



/* sLAWIER: Cabinet organization draggable rows */
#viewCabinet #cabinetOrganization .cabinet-grid > label.cabinet-profile-row-draggable{
  position:relative;
  padding-left:24px !important;
}

#viewCabinet #cabinetOrganization .cabinet-grid > .cabinet-table.cabinet-profile-row-draggable{
  position:relative;
  width:100%;
  max-width:760px;
  margin:0 0 12px !important;
  padding-left:24px !important;
}

#viewCabinet #cabinetOrganization .cabinet-grid > .cabinet-table.cabinet-profile-row-drag-over{
  outline:2px solid rgba(180,138,42,.85);
  outline-offset:3px;
  border-radius:10px;
}


/* sLAWIER: global topbar links/email */
.modebar .mode-tabs .slawier-top-link{
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  white-space:nowrap;
}

.modebar .right{
  display:flex;
  align-items:center;
  gap:10px;
}

.modebar .top-user-email{
  max-width:280px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:var(--muted);
  font-size:13px;
  line-height:1;
}

.modebar .top-user-email.hidden{
  display:none;
}

@media (max-width:920px){
  .modebar .top-user-email{
    max-width:160px;
    font-size:12px;
  }

  .modebar .mode-tabs .slawier-top-link{
    font-size:12px;
    padding-left:8px;
    padding-right:8px;
  }
}


/* sLAWIER: sidebar quick links/email */
.sidebar-quick-links{
  display:flex;
  flex-direction:column;
  gap:8px;
  padding:0 10px 10px;
  margin:0 0 8px;
  border-bottom:1px solid var(--border);
}

.sidebar-user-email{
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:var(--muted);
  font-size:12px;
  line-height:1.25;
  padding:0 2px 2px;
}

.sidebar-user-email.hidden{
  display:none;
}

.sidebar-quick-links .sidebar-quick-link{
  width:100%;
  text-align:left;
  text-decoration:none;
  justify-content:flex-start;
}

.sidebar-quick-links .sidebar-quick-link.active{
  border-color:rgba(180,138,42,.75);
  box-shadow:0 0 0 1px rgba(180,138,42,.24) inset;
}


/* sLAWIER: event prepare draft button */
.cab-event-draft-row {
  grid-column: 1 / -1;
  margin-top: -4px;
  margin-bottom: 8px;
}

.cab-event-draft-row.hidden {
  display: none !important;
}

.cab-event-draft-btn {
  width: 100%;
  border: 1px solid rgba(245, 197, 85, .95) !important;
  background: linear-gradient(135deg, rgba(245,197,85,.95), rgba(196,138,38,.95)) !important;
  color: #12100a !important;
  font-weight: 900 !important;
  letter-spacing: .02em;
  box-shadow: 0 12px 28px rgba(245, 197, 85, .22);
  transform: translateZ(0);
}

.cab-event-draft-btn:hover {
  filter: brightness(1.06);
  box-shadow: 0 14px 34px rgba(245, 197, 85, .32);
}

.cab-event-draft-btn:disabled {
  opacity: .55;
  cursor: not-allowed;
  filter: grayscale(.25);
}


/* sLAWIER: event prepare draft button placement fix */
#cabEventKindProfile + .cab-event-draft-row,
.cab-event-draft-row {
  grid-column: 2 / -1;
  width: 100%;
  margin-top: 8px;
  margin-bottom: 0;
}

.cab-event-draft-row .cab-event-draft-btn {
  width: 100%;
  min-height: 38px;
}

@media (max-width: 760px) {
  #cabEventKindProfile + .cab-event-draft-row,
  .cab-event-draft-row {
    grid-column: 1 / -1;
  }
}


/* sLAWIER: cabinet toolbar alignment */
.slawier-cabinet-primary-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  width: 100%;
  margin: 10px 0 12px;
}

.slawier-cabinet-primary-spacer {
  flex: 1 1 auto;
  min-width: 20px;
}

.slawier-cabinet-primary-group {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.slawier-cabinet-secondary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  margin: 2px 0 12px;
}

.slawier-cabinet-filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cabinet-exportbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  width: 100%;
  margin: 8px 0 10px;
}

.cabinet-exportbar--events {
  width: auto;
  margin: 0;
  flex: 1 1 auto;
}

.cabinet-exportbar--events .btn {
  margin-left: 0;
}

.slawier-cabinet-empty-holder {
  display: none !important;
}

#cabinetLicenses .cabinet-exportbar,
#cabinetClients .cabinet-exportbar,
#cabinetContracts .cabinet-exportbar,
#cabinetCases .cabinet-exportbar {
  justify-content: flex-end;
}

#cabinetEvents .slawier-cabinet-secondary-row .cabinet-exportbar {
  justify-content: flex-end;
}

@media (max-width: 760px) {
  .slawier-cabinet-primary-row,
  .slawier-cabinet-secondary-row {
    align-items: stretch;
    flex-direction: column;
  }

  .slawier-cabinet-primary-spacer {
    display: none;
  }

  .slawier-cabinet-primary-group,
  .slawier-cabinet-filter-group,
  .cabinet-exportbar,
  .cabinet-exportbar--events {
    justify-content: flex-start;
    width: 100%;
  }
}


/* sLAWIER: cabinet toolbar layout v2 */
.slawier-cabinet-toolbar-v2 {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto;
  align-items: start;
  gap: 14px;
  width: 100%;
  margin: 10px 0 10px;
}

.slawier-cabinet-toolbar-v2--exportsOnly {
  grid-template-columns: 1fr auto;
}

.slawier-cabinet-toolbar-left-v2 {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
}

.slawier-cabinet-toolbar-right-v2 {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
}

.slawier-cabinet-toolbar-row-v2 {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.slawier-cabinet-add-row-v2 {
  justify-content: flex-start;
}

.slawier-cabinet-status-row-v2,
.slawier-cabinet-export-row-v2 {
  justify-content: flex-end;
}

.slawier-cabinet-event-filter-row-v2 {
  justify-content: flex-start;
}

.slawier-cabinet-toolbar-v2 .btn,
.slawier-cabinet-toolbar-v2 button {
  margin: 0 !important;
}

.slawier-cabinet-empty-holder {
  display: none !important;
}

#cabinetLicenses .slawier-cabinet-toolbar-v2 {
  margin-top: 4px;
}

#cabinetLicenses .slawier-cabinet-export-row-v2 {
  justify-content: flex-end;
}

#cabinetEvents .slawier-cabinet-toolbar-left-v2--events {
  gap: 8px;
}

@media (max-width: 760px) {
  .slawier-cabinet-toolbar-v2,
  .slawier-cabinet-toolbar-v2--exportsOnly {
    grid-template-columns: 1fr;
  }

  .slawier-cabinet-toolbar-right-v2 {
    align-items: flex-start;
  }

  .slawier-cabinet-status-row-v2,
  .slawier-cabinet-export-row-v2 {
    justify-content: flex-start;
  }
}

