/* Role permissions panel & access block */

.role-row:hover td {
    background: #f0f7ff;
}

.rp-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.rp-back-btn {
    background: none;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    color: #374151;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}

.rp-back-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.rp-title {
    flex: 1;
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.rp-save-btn {
    background: rgba(22, 163, 74, 0.9);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 7px 18px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
    white-space: nowrap;
}

.rp-save-btn:hover:not(:disabled) {
    background: rgba(22, 163, 74, 1);
}

.rp-save-btn:disabled {
    opacity: 0.45;
    cursor: default;
}

.rp-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding: 8px 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.rp-select-all-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    font-weight: 500;
}

.rp-select-all-label input[type="checkbox"] {
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: #1d4ed8;
}

.rp-panel {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rp-section {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.rp-section-header {
    background: #f3f4f6;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid #e5e7eb;
}

.rp-section-unavailable .rp-section-header,
.rp-section-header.rp-section-unavailable {
    background: #fafafa;
    color: #9ca3af;
}

.rp-items {
    display: flex;
    flex-direction: column;
}

.rp-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 14px;
    font-size: 13px;
    color: #1f2937;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.1s;
}

.rp-item:last-child {
    border-bottom: none;
}

.rp-item:hover {
    background: #f9fafb;
}

.rp-item-unavailable {
    color: #9ca3af;
    cursor: default;
}

.rp-item-unavailable:hover {
    background: none;
}

.rp-checkbox {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: #1d4ed8;
}

.rp-checkbox:disabled {
    cursor: default;
    opacity: 0.5;
}

.rp-item-label {
    flex:0 1 auto;
    min-width:0;
    line-height: 1.4;
}

.rp-help-btn {
    width: 18px;
    height: 18px;
    min-height: 18px;
    padding: 0;
    margin-left: 4px;
    flex: 0 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #c7d2fe;
    border-radius: 50%;
    background: #eef4ff;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.rp-help-btn:hover {
    background: #dbeafe;
    border-color: #93c5fd;
}

.st-td-check .rp-help-btn {
    margin-left: 6px;
    vertical-align: middle;
}

.st-col-label .rp-help-btn {
    margin-left: 0;
}

.rp-cashbox-scope-row .rp-help-btn,
.rp-select-all-label .rp-help-btn {
    margin-left: 4px;
}

.rp-help-popup {
    position: fixed;
    z-index: 10000;
    width: min(320px, calc(100vw - 20px));
    padding: 12px 14px;
    border: 1px solid #dbe4f0;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 18px 46px rgba(15, 23, 42, 0.18);
    color: #1f2937;
}

.rp-help-popup-title {
    margin-bottom: 6px;
    color: #111827;
    font-size: 13px;
    font-weight: 700;
}

.rp-help-popup-text {
    color: #4b5563;
    font-size: 12px;
    line-height: 1.45;
}

.rp-item-wrap{
    border-bottom:1px solid #f3f4f6;
}

.rp-item-wrap .rp-item{
    border-bottom:none;
}

.rp-cashbox-scope{
    margin:0 14px 10px 38px;
    padding:8px 10px;
    border:1px solid #dbe4f0;
    border-radius:8px;
    background:#f8fafc;
}

.rp-cashbox-scope.is-disabled{
    opacity:.58;
}

.rp-cashbox-scope-title{
    margin-bottom:6px;
    color:#64748b;
    font-size:12px;
    font-weight:700;
}

.rp-cashbox-scope-list{
    display:grid;
    grid-template-columns:repeat(auto-fit, minmax(180px, 1fr));
    gap:6px;
}

.rp-cashbox-scope-row{
    min-height:28px;
    display:flex;
    align-items:center;
    gap:7px;
    color:#334155;
    font-size:12px;
}

.rp-cashbox-scope-row input{
    width:14px;
    height:14px;
    accent-color:#1d4ed8;
}

.rp-cashbox-scope-empty{
    color:#64748b;
    font-size:12px;
}

.rp-unavail-mark {
    font-style: normal;
    font-weight: 700;
    color: #f59e0b;
    margin-right: 2px;
}

/* ── Access block ────────────────────────────────────────── */

.ac-block {
    display: flex;
    gap: 32px;
    margin-top: 24px;
    padding: 20px 0;
    border-top: 1px solid #e5e7eb;
}

.ac-block-left {
    flex: 0 0 200px;
    min-width: 160px;
}

.ac-block-title {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 6px;
}

.ac-block-desc {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.5;
}

.ac-block-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ac-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ac-row--unavail {
    opacity: 0.55;
}

.ac-row-label {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

.ac-row-desc {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 2px;
    font-weight: 400;
}

.ac-row-control {
    display: flex;
}

/* Toggle group */
.ac-toggle-group {
    display: inline-flex;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    overflow: hidden;
}

.ac-toggle-btn {
    background: #fff;
    border: none;
    border-right: 1px solid #d1d5db;
    padding: 6px 14px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.ac-toggle-btn:last-child {
    border-right: none;
}

.ac-toggle-btn:hover:not(:disabled) {
    background: #f3f4f6;
}

.ac-toggle-btn--active {
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 500;
}

.ac-toggle-btn:disabled {
    cursor: default;
}

.ac-toggle-group--unavail .ac-toggle-btn {
    cursor: default;
}

/* Select */
.ac-select {
    min-width: 200px;
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    color: #374151;
    background: #fff;
    cursor: pointer;
    appearance: auto;
}

.ac-select:disabled {
    cursor: default;
    background: #f9fafb;
}

/* ── Available statuses block ────────────────────────────── */

.st-block {
    display: flex;
    gap: 32px;
    margin-top: 24px;
    padding: 20px 0;
    border-top: 1px solid #e5e7eb;
}

.st-block-left {
    flex: 0 0 200px;
    min-width: 160px;
}

.st-block-title {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
}

.st-block-right {
    flex: 1;
    min-width: 0;
}

.st-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 0;
}

.st-tab {
    background: none;
    border: none;
    padding: 7px 18px;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
}

.st-tab--active {
    color: #1d4ed8;
    border-bottom-color: #1d4ed8;
}

.st-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-top: 0;
    border: 1px solid #e5e7eb;
    border-top: none;
}

.st-th-name {
    text-align: left;
    padding: 10px 14px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    font-weight: 500;
    color: #374151;
    width: 50%;
}

.st-th-check {
    text-align: center;
    padding: 8px 12px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    width: 25%;
}

.st-th-check:last-child {
    border-right: none;
}

.st-col-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
    line-height: 1.3;
    text-align: center;
}

.st-table tbody tr {
    border-bottom: 1px solid #f3f4f6;
}

.st-table tbody tr:last-child {
    border-bottom: none;
}

.st-table tbody tr:hover td {
    background: #f9fafb;
}

.st-td-name {
    padding: 8px 14px;
    border-right: 1px solid #e5e7eb;
}

.st-td-check {
    text-align: center;
    padding: 8px 12px;
    border-right: 1px solid #e5e7eb;
}

.st-td-check:last-child {
    border-right: none;
}

.st-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
}

.st-checkbox {
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: #1d4ed8;
    vertical-align: middle;
}

.st-empty {
    padding: 16px;
    text-align: center;
    color: #9ca3af;
    font-size: 13px;
}

/* ── Price access block ───────────────────────────────────── */

.pa-block {
    display: flex;
    gap: 32px;
    margin-top: 24px;
    padding: 20px 0;
    border-top: 1px solid #e5e7eb;
}

.pa-block-left {
    flex: 0 0 200px;
    min-width: 160px;
}

.pa-block-title {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
}

.pa-block-right {
    flex: 1;
    min-width: 0;
}

.pa-block-right .st-tabs {
    border: 1px solid #e5e7eb;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    background: #f9fafb;
    padding: 0 8px;
}

.pa-list {
    border: 1px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 6px 6px;
    overflow: hidden;
}

.pa-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    font-size: 13px;
    color: #1f2937;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.1s;
}

.pa-row:last-child {
    border-bottom: none;
}

.pa-row:hover {
    background: #f9fafb;
}

.pa-row-label {
    line-height: 1.4;
}
