:root {
    --green-900: #173d34;
    --green-800: #205146;
    --green-700: #2d685b;
    --green-500: #5ea78f;
    --green-100: #e8f2ee;
    --window: #f1f3f2;
    --panel: #ffffff;
    --border: #c8cecb;
    --border-dark: #9ba6a1;
    --text: #202826;
    --muted: #65716d;
    --danger: #a83d3d;
    --warning: #8b650e;
    --shadow: 0 12px 32px rgba(16, 38, 31, .18);
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--window); color: var(--text); }
button, input, select, textarea { font: inherit; }
[hidden] { display: none !important; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }

.desktop-shell { min-height: 100vh; display: grid; grid-template-rows: 48px 1fr 26px; }
.title-bar {
    display: flex; align-items: center; gap: 12px; padding: 0 14px;
    background: linear-gradient(180deg, var(--green-800), var(--green-900));
    color: white; border-bottom: 1px solid #0e2b24;
}
.app-mark {
    width: 34px; height: 30px; display: grid; place-items: center;
    font-weight: 800; letter-spacing: -.5px; background: #d8eee5; color: var(--green-900);
    border: 1px solid rgba(255,255,255,.45); border-radius: 5px;
}
.app-mark.large { width: 46px; height: 42px; font-size: 18px; }
.title-copy { display: flex; flex-direction: column; line-height: 1.05; }
.title-copy strong { font-size: 14px; }
.title-copy span { font-size: 11px; opacity: .72; margin-top: 3px; }
.title-spacer, .toolbar-spacer, .status-spacer { flex: 1; }
.server-indicator, .user-area { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.indicator-light { width: 8px; height: 8px; border-radius: 50%; background: #77d8a7; box-shadow: 0 0 8px #77d8a7; }
.title-button {
    border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.08);
    color: white; padding: 5px 12px; border-radius: 3px; cursor: pointer;
}
.title-button:hover { background: rgba(255,255,255,.16); }

.workspace { min-height: 0; display: grid; grid-template-columns: 210px 1fr; }
.side-menu {
    min-height: 0; background: #e5e9e7; border-right: 1px solid var(--border-dark);
    padding: 10px 8px; display: flex; flex-direction: column;
}
.menu-caption { font-size: 10px; font-weight: 700; color: #727e7a; padding: 10px 10px 5px; letter-spacing: .6px; }
.menu-item {
    padding: 9px 11px; margin: 1px 0; border: 1px solid transparent; border-radius: 3px; font-size: 13px;
}
.menu-item:hover { background: #f7f9f8; border-color: #cbd2cf; }
.menu-item.active {
    background: linear-gradient(180deg, #fff, #eef3f1); border-color: #aebbb6;
    color: var(--green-900); font-weight: 650; box-shadow: inset 3px 0 0 var(--green-700);
}
.menu-foot { margin-top: auto; border-top: 1px solid #c2cac6; padding: 10px; display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--muted); }

.content-area { min-width: 0; overflow: auto; padding: 18px; }
.page-header { display: flex; align-items: center; gap: 16px; margin-bottom: 15px; }
.page-header h1 { margin: 0; font-size: 22px; font-weight: 650; color: var(--green-900); }
.page-header p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.page-header > .primary-button { margin-left: auto; }
.page-actions { margin-left: auto; display: flex; gap: 8px; }

.primary-button, .secondary-button {
    display: inline-flex; align-items: center; justify-content: center; min-height: 32px;
    border-radius: 3px; padding: 6px 14px; cursor: pointer; font-weight: 600; font-size: 13px;
}
.primary-button { color: white; background: linear-gradient(180deg, var(--green-700), var(--green-900)); border: 1px solid #14392f; }
.primary-button:hover { filter: brightness(1.08); }
.secondary-button { color: #25302d; background: linear-gradient(180deg, #fff, #e6ebe9); border: 1px solid #aab5b0; }
.wide { width: 100%; }

.notification { margin-bottom: 12px; padding: 9px 12px; border: 1px solid; border-radius: 3px; font-size: 13px; }
.notification.success { background: #e7f4ed; border-color: #8bb9a3; color: #1d5a43; }
.notification.error, .form-error { background: #faeaea; border-color: #d29a9a; color: #8f2828; }
.form-error { padding: 8px 10px; margin-bottom: 12px; border: 1px solid; }

.dashboard-grid { display: grid; grid-template-columns: repeat(3, minmax(190px, 1fr)); gap: 12px; margin-bottom: 14px; }
.metric-card { background: var(--panel); border: 1px solid var(--border); border-top: 3px solid var(--green-700); padding: 15px; box-shadow: 0 2px 5px rgba(22,42,35,.06); }
.metric-card.warning { border-top-color: #bd8b19; }
.metric-card.danger { border-top-color: #ad4545; }
.metric-card span { display: block; font-size: 12px; color: var(--muted); }
.metric-card strong { display: block; font-size: 28px; color: var(--green-900); margin: 4px 0 1px; }
.metric-card small { color: #7b8581; }

.desktop-panel { background: var(--panel); border: 1px solid var(--border-dark); box-shadow: 0 2px 8px rgba(20,40,32,.07); }
.panel-title { padding: 8px 11px; font-size: 13px; font-weight: 700; background: linear-gradient(180deg, #f9faf9, #e5e9e7); border-bottom: 1px solid var(--border); }
.workflow { display: grid; grid-template-columns: repeat(4, 1fr); }
.workflow div { display: flex; align-items: center; gap: 10px; min-height: 82px; padding: 12px; border-right: 1px solid #dde2df; }
.workflow div:last-child { border-right: 0; }
.workflow strong { width: 28px; height: 28px; flex: 0 0 28px; display: grid; place-items: center; border-radius: 50%; background: var(--green-100); color: var(--green-900); }
.workflow span { font-size: 12px; line-height: 1.35; }

.info-strip { margin-bottom: 10px; padding: 9px 11px; font-size: 12px; color: #40504a; background: #f7faf8; }
.grid-panel { overflow: hidden; }
.grid-toolbar { min-height: 40px; padding: 6px 8px; display: flex; align-items: center; gap: 6px; background: linear-gradient(180deg, #fafbfa, #e6eae8); border-bottom: 1px solid var(--border-dark); font-size: 11px; }
.grid-toolbar strong { font-size: 12px; }
.grid-toolbar label { color: var(--muted); }
.global-filter { width: min(300px, 28vw); }
.record-count { padding-left: 10px; border-left: 1px solid #bfc7c3; color: var(--muted); }
.grid-wrap { overflow: auto; max-height: calc(100vh - 190px); position: relative; }
.desktop-grid { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 11px; min-width: 920px; }
.wide-grid { min-width: 1340px; }
.licenses-grid { min-width: 1080px; table-layout: fixed; }
.licenses-grid th:nth-child(1) { width: 135px; }
.licenses-grid th:nth-child(2) { width: 125px; }
.licenses-grid th:nth-child(3) { width: 110px; }
.licenses-grid th:nth-child(4) { width: 62px; }
.licenses-grid th:nth-child(5) { width: 78px; }
.licenses-grid th:nth-child(6) { width: 120px; }
.licenses-grid th:nth-child(7) { width: 75px; }
.licenses-grid th:nth-child(8) { width: 90px; }
.licenses-grid th:nth-child(9) { width: 70px; }
.licenses-grid th:nth-child(10) { width: 100px; }
.licenses-grid th:nth-child(11) { width: 94px; }
.licenses-grid td { overflow-wrap: anywhere; }
.licenses-grid .row-actions {
    min-width: 94px;
    flex-wrap: nowrap;
    justify-content: center;
    white-space: nowrap;
}
.desktop-grid thead { position: sticky; top: 0; z-index: 2; }
.desktop-grid th {
    text-align: left; white-space: nowrap; padding: 6px 7px;
    background: linear-gradient(180deg, #f5f7f6, #dfe5e2);
    border-right: 1px solid #c6ceca; border-bottom: 1px solid #aab4af; color: #2b3632;
}
.desktop-grid td { padding: 6px 7px; border-right: 1px solid #e0e4e2; border-bottom: 1px solid #d8ddda; vertical-align: middle; }
.desktop-grid tbody tr:nth-child(even) { background: #f8faf9; }
.desktop-grid tbody tr:hover { background: #eaf3ef; }
.desktop-grid small { color: var(--muted); }
.filter-row th { padding: 3px; background: #edf0ee; }
.filter-row input, .filter-row select { width: 100%; min-width: 64px; height: 24px; padding: 2px 4px; border: 1px solid #b7c0bc; background: white; font-size: 10px; }
.actions-column { min-width: 62px; width: 62px; }
.row-actions { display: flex; gap: 3px; white-space: nowrap; align-items: center; }
.row-actions form { margin: 0; }
.grid-button, .copy-link {
    border: 1px solid #aeb7b3; background: linear-gradient(180deg, #fff, #e7ebe9);
    color: #27332f; border-radius: 2px; padding: 2px 6px; cursor: pointer; font-size: 10px;
}
.grid-button:hover { background: #dfe9e5; }
.compact-actions { justify-content: center; }
.icon-button {
    width: 24px; min-width: 24px; height: 24px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
}
.icon-button .icon-svg { display: inline-flex; width: 13px; height: 13px; }
.icon-button .icon-svg svg { width: 13px; height: 13px; fill: currentColor; }
.icon-button:hover { color: var(--green-900); }
.copy-link { border: 0; background: transparent; color: var(--green-700); padding: 0 0 0 4px; text-decoration: underline; font-size: 10px; }
.customers-grid { width: 100%; min-width: 0; table-layout: fixed; }
.customers-grid-wrap { overflow-x: hidden; }
.customers-grid th:nth-child(1) { width: 11%; }
.customers-grid th:nth-child(2) { width: 8%; }
.customers-grid th:nth-child(3) { width: 6%; }
.customers-grid th:nth-child(4) { width: 8%; }
.customers-grid th:nth-child(5) { width: 15%; }
.customers-grid th:nth-child(6) { width: 6%; }
.customers-grid th:nth-child(7) { width: 13%; }
.customers-grid th:nth-child(8) { width: 9%; }
.customers-grid th:nth-child(9) { width: 7%; }
.customers-grid th:nth-child(10) { width: 9%; }
.customers-grid th:nth-child(11) { width: 8%; }
.customers-grid th,
.customers-grid td { padding-left: 4px; padding-right: 4px; }
.customers-grid td { overflow-wrap: anywhere; line-height: 1.25; }
.customers-grid th:nth-child(10),
.customers-grid td:nth-child(10) { white-space: nowrap; }
.customers-grid .filter-row input,
.customers-grid .filter-row select { min-width: 0; }
.customers-grid td.row-actions {
    display: table-cell;
    text-align: center;
    white-space: nowrap;
}
.customers-grid td.row-actions > button,
.customers-grid td.row-actions > form {
    display: inline-block;
    margin: 0 1px;
    vertical-align: middle;
}
.customers-grid td.row-actions form button { vertical-align: middle; }
.customers-grid + .empty-grid-message { width: 100%; }
.validation-grid { min-width: 1120px; table-layout: fixed; }
.validation-grid th:nth-child(1) { width: 92px; }
.validation-grid th:nth-child(2) { width: 82px; }
.validation-grid th:nth-child(3) { width: 108px; }
.validation-grid th:nth-child(4) { width: 118px; }
.validation-grid th:nth-child(5) { width: 128px; }
.validation-grid th:nth-child(6) { width: 68px; }
.validation-grid th:nth-child(7) { width: 66px; }
.validation-grid th:nth-child(8) { width: 112px; }
.validation-grid th:nth-child(9) { width: 82px; }
.validation-grid th:nth-child(10) { width: 264px; }
.validation-grid th, .validation-grid td { padding-left: 5px; padding-right: 5px; }
.validation-grid td { overflow-wrap: anywhere; line-height: 1.25; }
.validation-grid small { font-size: 9px; }
.audit-grid { min-width: 1080px; table-layout: fixed; }
.audit-grid th:nth-child(1) { width: 116px; }
.audit-grid th:nth-child(2) { width: 130px; }
.audit-grid th:nth-child(3) { width: 130px; }
.audit-grid th:nth-child(4) { width: 110px; }
.audit-grid th:nth-child(5) { width: 90px; }
.audit-grid th:nth-child(6) { width: 430px; }
.audit-grid td { overflow-wrap: anywhere; }
.groups-grid { min-width: 900px; table-layout: fixed; }
.groups-grid th:nth-child(1) { width: 105px; }
.groups-grid th:nth-child(2) { width: 230px; }
.groups-grid th:nth-child(3) { width: 300px; }
.groups-grid th:nth-child(4) { width: 70px; }
.groups-grid th:nth-child(5) { width: 80px; }
.groups-grid th:nth-child(6) { width: 62px; }
.groups-grid td { overflow-wrap: anywhere; }
.catalog-import-panel { display: flex; align-items: center; gap: 18px; padding: 12px 14px; margin-bottom: 12px; }
.catalog-import-panel > div { display: flex; flex-direction: column; gap: 3px; }
.catalog-import-panel > div span { color: var(--muted); font-size: 11px; }
.catalog-import-form { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.catalog-import-form input[type=file] { max-width: 330px; padding: 5px; font-size: 11px; }
.muted-text { color: var(--muted); }
.empty-grid-message { display: none; padding: 22px; text-align: center; color: var(--muted); }
.empty-grid-message.visible { display: block; }
.grid-pagination {
    min-height: 44px;
    padding: 6px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-top: 1px solid var(--border-dark);
    background: linear-gradient(180deg, #fafbfa, #edf1ef);
    color: var(--muted);
    font-size: 11px;
}
.grid-pagination-controls { display: flex; align-items: center; gap: 8px; }
.grid-pagination button {
    min-width: 72px;
    min-height: 28px;
    padding: 4px 9px;
    border: 1px solid #9eaaa4;
    border-radius: 3px;
    color: #17483b;
    background: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.grid-pagination button:hover:not(:disabled),
.grid-pagination button:focus-visible { border-color: #1b6250; background: #edf7f3; }
.grid-pagination button:disabled { opacity: .45; cursor: default; }

@media (max-width: 700px) {
    .grid-pagination { align-items: stretch; flex-direction: column; }
    .grid-pagination-summary { text-align: center; }
    .grid-pagination-controls { justify-content: space-between; }
}

input, select, textarea {
    border: 1px solid #aab5b0; border-radius: 2px; padding: 7px 8px; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(45,104,91,.20); border-color: var(--green-700); }
textarea { resize: vertical; }

.status-text { font-weight: 650; }
.status-text.ok { color: #21704f; }
.status-text.warning { color: var(--warning); }
.status-text.danger { color: var(--danger); }
.status-text.muted { color: #75807c; }

.modal-overlay {
    display: none; position: fixed; z-index: 50; inset: 0; background: rgba(14, 29, 24, .42);
    align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }
.desktop-modal {
    width: min(720px, 96vw); max-height: 92vh; overflow: hidden; background: #f2f4f3;
    border: 1px solid #5e6e67; border-radius: 5px; box-shadow: var(--shadow);
}
.large-modal { width: min(920px, 97vw); }
.modal-titlebar { height: 38px; display: flex; align-items: center; padding: 0 10px; background: linear-gradient(180deg, var(--green-700), var(--green-900)); color: white; }
.modal-titlebar strong { font-size: 13px; }
.close-button { margin-left: auto; width: 30px; height: 26px; border: 0; background: transparent; color: white; font-size: 22px; cursor: pointer; }
.modal-form { padding: 15px; overflow: auto; max-height: calc(92vh - 38px); }
.form-row { display: grid; gap: 12px; margin-bottom: 12px; }
.form-row.two { grid-template-columns: repeat(2, 1fr); }
.form-row.two.single-column { grid-template-columns: 1fr; }
.form-row.three { grid-template-columns: repeat(3, 1fr); }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field label { font-size: 12px; font-weight: 650; }
.optional-field { color: var(--muted); font-size: 11px; font-weight: 400; }
.field small { color: var(--muted); font-size: 11px; }
.check-line { display: flex; align-items: center; gap: 7px; font-size: 12px; }
.check-line input { width: auto; }
.modal-actions {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
    gap: 8px; padding-top: 12px; border-top: 1px solid #cbd2cf;
}
.modal-actions > .primary-button,
.modal-actions > .secondary-button { width: 100%; min-width: 0; }
.fixed-device-box { padding: 9px 10px; background: #eef3f1; border: 1px solid #b9c5c0; margin-bottom: 12px; font-size: 12px; }
.fixed-device-box span { display: block; color: var(--muted); margin-top: 3px; }

.rights-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 12px;
}
.rights-summary-card { display: flex; flex-direction: column; gap: 5px; padding: 16px; border-top: 3px solid var(--green-700); }
.rights-summary-card strong { color: var(--green-900); font-size: 14px; }
.rights-summary-card span { color: var(--text); font-size: 13px; }
.rights-summary-card small { color: var(--muted); }
.rights-editor-modal {
    width: min(1120px, 98vw);
    height: min(820px, calc(100vh - 28px));
    display: grid;
    grid-template-rows: 38px minmax(0, 1fr);
}
.rights-editor-form {
    height: 100%; max-height: none; min-height: 0; overflow: hidden;
    display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
}
.rights-tabs { display: flex; gap: 4px; border-bottom: 1px solid #abb9b3; }
.rights-tab {
    min-width: 150px; padding: 10px 16px; border: 1px solid transparent; border-bottom: 0;
    color: #43534d; background: transparent; font-weight: 700; cursor: pointer;
}
.rights-tab:hover { background: #e8efec; }
.rights-tab.active {
    margin-bottom: -1px; border-color: #abb9b3; border-top-color: var(--green-700);
    color: var(--green-900); background: #fff;
}
.rights-tab-content { min-height: 0; overflow: hidden; background: #fff; border: 1px solid #abb9b3; border-top: 0; }
.rights-tab-panel { height: 100%; min-height: 0; padding: 14px; overflow: auto; }
.rights-tab-panel:not(.active), .rights-tab-panel[hidden] { display: none; }
.rights-heading-fields { grid-template-columns: minmax(260px, .75fr) minmax(420px, 1.25fr); }
.rights-heading-fields textarea { min-height: 66px; }
.rights-content-field { min-height: 0; margin-bottom: 0; }
.rights-editor-toolbar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 5px; padding: 7px;
    border: 1px solid #aab5b0; border-bottom: 0; background: #e7ece9;
}
.rights-toolbar-group { display: inline-flex; align-items: center; gap: 3px; }
.rights-toolbar-format { min-width: 150px; }
.rights-toolbar-separator { width: 1px; height: 24px; margin-inline: 1px; background: #b8c2bd; }
.rights-editor-toolbar button {
    min-width: 30px; min-height: 30px; padding: 3px 8px; border: 1px solid #aeb8b3; border-radius: 4px;
    color: #263b34; background: linear-gradient(180deg, #fff, #e6ebe9); cursor: pointer;
}
.rights-editor-toolbar button:hover,
.rights-editor-toolbar button:focus-visible { border-color: var(--green-700); background: #fff; outline: none; }
.rights-editor-toolbar select {
    width: 100%; min-height: 30px; padding: 3px 26px 3px 8px; border: 1px solid #aeb8b3;
    border-radius: 4px; color: #263b34; background-color: #fff; font-size: 12px;
}
.rights-color-control {
    min-height: 30px; display: inline-flex; align-items: center; gap: 5px; padding: 3px 7px;
    border: 1px solid #aeb8b3; border-radius: 4px; color: #263b34; background: #fff; cursor: pointer;
}
.rights-color-control span { font-size: 11px; font-weight: 700; }
.rights-color-control input { width: 22px; height: 20px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.rights-align-icon { width: 16px; display: inline-block; line-height: 1; }
.rights-align-icon.left { text-align: left; }
.rights-align-icon.center { text-align: center; }
.rights-align-icon.right { text-align: right; }
.rights-align-icon.justify { text-align: center; font-size: 12px; }
.visually-hidden {
    position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important;
    margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important; border: 0 !important;
}
.rights-rich-editor {
    min-height: 360px; padding: 18px 22px; overflow: auto;
    border: 1px solid #aab5b0; background: #fff; color: #26384d;
    font-family: Arial, sans-serif; font-size: 14px; line-height: 1.65;
}
.rights-rich-editor:focus { outline: 2px solid rgba(45,104,91,.20); border-color: var(--green-700); }
.rights-rich-editor h2 { margin: 1.3rem 0 .45rem; color: #123f78; font-size: 18px; }
.rights-rich-editor h3 { margin: 1rem 0 .4rem; color: #234f80; font-size: 16px; }
.rights-rich-editor h2:first-child { margin-top: 0; }
.rights-rich-editor p { margin: 0 0 .8rem; }
.rights-rich-editor ul, .rights-rich-editor ol { margin: 0 0 .9rem; padding-left: 1.4rem; }
.rights-rich-editor blockquote { margin: .8rem 0; padding: .65rem .9rem; border-left: 4px solid #78a998; background: #f2f7f5; }
.rights-rich-editor hr { margin: 1rem 0; border: 0; border-top: 1px solid #c5d0cb; }
.rights-rich-editor a { color: #1263b8; text-decoration: underline; }
.rights-html-input { display: none; }

.status-bar { display: flex; align-items: center; gap: 8px; padding: 0 10px; background: #e1e6e3; border-top: 1px solid #aeb8b3; color: #59645f; font-size: 11px; }
.status-separator { width: 1px; height: 14px; background: #aeb8b3; }

.login-body {
    min-height: 100vh; display: grid; place-items: center; padding: 22px;
    background: radial-gradient(circle at 25% 20%, #e1f0ea, #9fb9ae 48%, #49675d);
}
.login-window { width: min(440px, 96vw); background: #eef1ef; border: 1px solid #253e35; border-radius: 6px; box-shadow: 0 24px 70px rgba(10,28,21,.38); overflow: hidden; }
.login-window.compact { width: min(390px, 96vw); }
.login-titlebar { min-height: 62px; display: flex; align-items: center; gap: 12px; padding: 10px 13px; color: white; background: linear-gradient(180deg, var(--green-700), var(--green-900)); }
.login-titlebar div:not(.app-mark) { display: flex; flex-direction: column; }
.login-titlebar span { opacity: .7; font-size: 12px; margin-top: 3px; }
.login-content { padding: 22px; display: flex; flex-direction: column; gap: 7px; }
.login-content h1 { margin: 0; font-size: 20px; color: var(--green-900); }
.login-content p { margin: 0 0 12px; color: var(--muted); font-size: 13px; line-height: 1.4; }
.login-content label { font-size: 12px; font-weight: 650; margin-top: 4px; }
.login-content [data-valmsg-for] { color: var(--danger); font-size: 11px; min-height: 14px; }
.login-status { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: #dce3df; border-top: 1px solid #bcc6c1; color: #56625d; font-size: 11px; }
.error-page { padding: 28px; }
.error-page h1 { color: var(--danger); margin-top: 0; }

@media (max-width: 900px) {
    .workspace { grid-template-columns: 168px 1fr; }
    .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
    .workflow { grid-template-columns: repeat(2, 1fr); }
    .form-row.three { grid-template-columns: 1fr 1fr; }
    .server-indicator { display: none; }
}
@media (max-width: 650px) {
    .desktop-shell { grid-template-rows: auto 1fr 26px; }
    .title-bar { min-height: 48px; flex-wrap: wrap; padding-block: 6px; }
    .workspace { grid-template-columns: 1fr; }
    .side-menu { display: none; }
    .content-area { padding: 10px; }
    .dashboard-grid, .workflow, .form-row.two, .form-row.three { grid-template-columns: 1fr; }
    .page-header { align-items: flex-start; flex-direction: column; }
    .page-actions { margin-left: 0; }
    .rights-summary-grid { grid-template-columns: 1fr; }
    .rights-editor-modal { width: 98vw; height: calc(100vh - 16px); }
    .rights-tabs { overflow-x: auto; }
    .rights-tab { min-width: 125px; padding-inline: 10px; }
    .rights-heading-fields { grid-template-columns: 1fr; }
    .rights-rich-editor { min-height: 320px; padding: 14px; }
}

.copy-link.copy-error { color: var(--danger); text-decoration-color: var(--danger); }
.device-fingerprint-preview { margin-top: 5px; padding: 6px 8px; border: 1px solid #c9d2ce; background: #f7faf8; color: var(--muted); font-size: 11px; }
.device-fingerprint-preview strong { color: var(--green-900); letter-spacing: .04em; }


.license-group-warning {
    margin: 0 0 16px;
    padding: 12px 14px;
    border: 1px solid #d8ad42;
    border-left-width: 4px;
    border-radius: 6px;
    background: #fff8df;
    color: #5f4608;
    line-height: 1.45;
}

.group-pending-text {
    color: var(--danger);
    font-size: 0.82rem;
    letter-spacing: 0.03em;
}

.field-error {
    color: var(--danger) !important;
    font-weight: 650;
}

.password-input-shell {
    position: relative;
    display: flex;
    width: 100%;
}

.password-input-shell input {
    width: 100%;
    padding-right: 38px;
}

.password-visibility-button {
    position: absolute;
    top: 1px;
    right: 1px;
    bottom: 1px;
    width: 34px;
    border: 0;
    border-left: 1px solid #d4dbd7;
    background: transparent;
    color: var(--green-900);
    cursor: pointer;
}

.password-visibility-button:hover,
.password-visibility-button:focus-visible {
    background: #eef4f1;
}

.password-visibility-button svg {
    width: 17px;
    height: 17px;
    fill: currentColor;
}

/* Acesso do cliente ao Apresentador N/A */
.customer-editor-modal { width: min(1040px, 98vw); }
.customer-editor-form { min-height: 0; }
.compact-form-row { align-items: center; }
.customer-access-section {
    min-height: 0;
    padding: 10px;
    border: 1px solid #b7c3be;
    border-radius: 4px;
    background: #f8faf9;
}
.customer-access-section[hidden] { display: none; }
.access-check { font-weight: 700; color: var(--green-900); }
.group-permissions-field { min-height: 0; }

.group-transfer {
    min-height: 250px;
    display: grid;
    grid-template-columns: minmax(220px, .65fr) 116px minmax(580px, 1.35fr);
    gap: 10px;
    align-items: stretch;
}

.group-list-panel {
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-rows: 32px minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid #aab5b0;
    border-radius: 3px;
    background: #fff;
}

.group-list-panel.permitted { border-color: #7f9f93; }

.group-list-title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 9px;
    border-bottom: 1px solid #cbd2cf;
    background: linear-gradient(180deg, #f9faf9, #e7ece9);
    color: #34423d;
    font-size: 12px;
}

.group-list-title span {
    margin-left: auto;
    min-width: 24px;
    padding: 1px 6px;
    border: 1px solid #b8c2bd;
    border-radius: 10px;
    background: #fff;
    color: var(--muted);
    text-align: center;
    font-size: 10px;
}

.group-list-view {
    width: 100%;
    height: 100%;
    min-height: 210px;
    border: 0;
    border-radius: 0;
    padding: 4px;
    background: #fff;
    font-size: 12px;
}

.group-list-view:focus { outline: 2px solid rgba(45,104,91,.20); outline-offset: -2px; }
.group-list-view option { padding: 7px 8px; border-bottom: 1px solid #edf0ee; }
.group-list-view option[data-active="false"] { color: #7a817e; font-style: italic; }

.group-permitted-list {
    overflow: auto;
    padding: 4px 0;
}

.group-permitted-item {
    min-height: 34px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-bottom: 1px solid #edf0ee;
    cursor: default;
    user-select: none;
}

.group-permitted-item:focus { outline: 2px solid rgba(45,104,91,.20); outline-offset: -2px; }
.group-permitted-item.selected { background: #dcebe5; color: #173d31; }
.group-permitted-item[data-active="false"] .group-permitted-name { color: #7a817e; font-style: italic; }

.group-permitted-name {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-basis: 220px;
}

.group-manager-toggle,
.group-editor-toggle {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0 2px;
    color: var(--green-900);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.group-manager-toggle input,
.group-editor-toggle input { margin: 0; }

.group-editor-toggle:has(input:disabled) {
    opacity: .52;
    cursor: not-allowed;
}

.group-transfer-actions {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 7px;
}

.transfer-button { width: 100%; min-height: 34px; padding-inline: 8px; white-space: nowrap; }
.compact-transfer { font-size: 11px; }

.group-transfer-empty {
    min-height: 90px;
    display: grid;
    place-items: center;
    border: 1px solid #aab5b0;
    background: #fff;
    color: var(--muted);
    font-size: 12px;
}

/* Em telas altas, o editor cresce e os ListViews ocupam o espaço disponível,
   evitando a barra de rolagem vertical do formulário. */
@media (min-width: 721px) and (min-height: 720px) {
    .customer-editor-modal {
        height: min(860px, calc(100vh - 28px));
        display: grid;
        grid-template-rows: 38px minmax(0, 1fr);
    }

    .customer-editor-form {
        height: 100%;
        max-height: none;
        overflow: hidden;
        display: grid;
        grid-template-rows: auto auto auto minmax(280px, 1fr) auto auto;
    }

    .customer-access-section {
        height: 100%;
        display: grid;
        grid-template-rows: auto minmax(0, 1fr);
        overflow: hidden;
    }

    .group-permissions-field {
        height: 100%;
        display: grid;
        grid-template-rows: auto minmax(0, 1fr) auto;
    }

    .group-transfer, .group-list-panel, .group-list-view { min-height: 0; }
}

@media (max-width: 900px) {
    .customer-editor-modal { width: min(840px, 98vw); }
    .customer-editor-form { overflow-y: auto; }
    .customer-access-section { overflow: visible; }
    .group-transfer { grid-template-columns: 1fr; min-height: 0; }
    .group-list-view { min-height: 180px; height: 180px; }
    .group-transfer-actions { flex-direction: row; flex-wrap: wrap; }
    .transfer-button { width: auto; flex: 1 1 44%; }
}
