/* =====================================================================
   LetsEat Permissions module shared styles.

   The list pane (Roles/Users collection views) and detail pane
   (Role/User detail + AddRole dialog) were previously copy-pasted into
   each component's scoped .razor.css. They now live here once, loaded
   globally from index.html so the perm-* class names resolve without
   Blazor CSS-isolation scoping.
   ===================================================================== */

/* ---------- List pane (RolesCollectionView / UsersCollectionView) ---------- */
.perm-list-pane {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 12px;
    box-shadow: var(--shadow-sm);
}

.perm-list-pane__title {
    padding: 6px 8px 10px;
}

.perm-list-pane__items {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.perm-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 9px 11px;
    border-radius: 10px;
    border: none;
    background: transparent;
    cursor: pointer;
    text-align: left;
    font-family: var(--font-body);
    transition: background .15s ease;
}

.perm-list-item:hover {
    background: var(--surface-2);
}

.perm-list-item--active,
.perm-list-item--active:hover {
    background: var(--primary-tint);
}

.perm-list-item__content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
}

.perm-list-item__content--avatar {
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.perm-list-item__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}


.perm-list-item__name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-strong);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.perm-list-item--active .perm-list-item__name {
    color: var(--primary);
}

.perm-list-item__meta {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.perm-list-item__chevron {
    font-size: 19px;
    color: var(--primary);
    flex: 0 0 auto;
}

.perm-list-pane__add {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
    padding: 10px;
    border-radius: 10px;
    border: 1.5px dashed var(--border-strong);
    background: transparent;
    color: var(--primary);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: var(--fs-md);
    cursor: pointer;
    transition: background .15s ease;
}

.perm-list-pane__add:hover {
    background: var(--primary-tint);
}

.perm-list-pane__add .material-symbols-rounded {
    font-size: 18px;
}

/* ---------- Detail pane (RoleView / UserView / AddRoleDialog) ---------- */
.perm-detail-pane {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 22px;
    box-shadow: var(--shadow-sm);
}

.perm-detail-pane__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.perm-detail-pane__heading {
    flex: 1;
    min-width: 0;
}

.perm-detail-pane__title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 19px;
    color: var(--text-strong);
}

.perm-detail-pane__subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 3px;
}

.perm-detail-pane__title-input {
    display: block;
    width: 100%;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 19px;
    color: var(--text-strong);
    border: none;
    background: transparent;
    outline: none;
    padding: 2px 6px;
    margin: -2px -6px;
    border-radius: 7px;
}

.perm-detail-pane__subtitle-input {
    display: block;
    width: 100%;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text-muted);
    border: none;
    background: transparent;
    outline: none;
    padding: 2px 6px;
    margin: 3px -6px 0;
    border-radius: 7px;
}

.perm-detail-pane__title-input:focus,
.perm-detail-pane__subtitle-input:focus {
    background: var(--surface-2);
}

.perm-detail-pane__title-input:disabled,
.perm-detail-pane__subtitle-input:disabled {
    cursor: default;
}

.perm-detail-pane__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.perm-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: var(--fs-md);
    cursor: pointer;
    white-space: nowrap;
}

.perm-btn .material-symbols-rounded {
    font-size: 18px;
}

.perm-btn:disabled {
    opacity: .55;
    cursor: default;
}

.perm-btn--primary {
    background: var(--primary);
    color: var(--on-primary);
    border: none;
    padding: 9px 16px;
    font-weight: 700;
}

.perm-btn--primary:hover:not(:disabled) {
    background: var(--primary-hover);
}

.perm-btn--danger {
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--danger);
    padding: 9px 14px;
    font-weight: 600;
}

.perm-btn--danger:hover:not(:disabled) {
    background: var(--danger-tint);
}

.perm-btn--ghost {
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-strong);
    padding: 9px 16px;
    font-weight: 600;
}

.perm-btn--ghost:hover:not(:disabled) {
    background: var(--surface-3);
}

.perm-section-title {
    margin-bottom: 12px;
}

.perm-section-title--spaced {
    margin-top: 22px;
}

@media (max-width: 860px) {
    .perm-detail-pane {
        padding: 16px;
    }

    /* Push the Delete/Save actions onto their own full-width row below the title. */
    .perm-detail-pane__heading {
        flex: 1 1 100%;
    }

    .perm-detail-pane__actions {
        width: 100%;
    }

    .perm-detail-pane__actions .perm-btn {
        flex: 1 1 0;
        justify-content: center;
    }
}

.perm-module-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.perm-module {
    border: 1px solid var(--border);
    border-radius: 13px;
    overflow: hidden;
}

.perm-module--locked {
    opacity: .5;
}

.perm-module__header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}

.perm-module__icon {
    font-size: 21px;
    color: var(--primary);
}

.perm-module__name {
    font-weight: 700;
    font-size: var(--fs-lg);
    color: var(--text-strong);
}

.perm-module__summary {
    margin-left: auto;
    font-size: var(--fs-sm);
    color: var(--text-muted);
    font-weight: 600;
    text-align: right;
}

.perm-module__chips {
    padding: 12px 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.perm-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 9px 13px;
    border-radius: 9px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}

.perm-chip .material-symbols-rounded {
    font-size: 17px;
}

.perm-chip:disabled {
    cursor: default;
}

.perm-chip--on {
    background: var(--primary-tint);
    border: 1px solid var(--primary);
    color: var(--primary);
}

.perm-chip--off {
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
}

.perm-chip--off:hover:not(:disabled) {
    border-color: var(--border-strong);
}

.perm-info-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: var(--info-tint);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 18px;
}

.perm-info-banner__icon {
    font-size: 20px;
    color: var(--info);
    flex: 0 0 auto;
}

.perm-info-banner__text {
    font-size: var(--fs-md);
    color: var(--text);
    line-height: 1.5;
}

.perm-info-banner__text b {
    color: var(--text-strong);
}

.perm-chip-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.perm-member-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 5px 12px 5px 5px;
}


.perm-member-chip__name {
    font-size: var(--fs-md);
    font-weight: 600;
    color: var(--text-strong);
}

.perm-member-chip__remove {
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    border-radius: 50%;
}

.perm-member-chip__remove:hover {
    color: var(--danger);
}

.perm-member-chip__remove .material-symbols-rounded {
    font-size: 16px;
}

.perm-assign-chip {
    display: flex;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: 1.5px dashed var(--border-strong);
    border-radius: 20px;
    padding: 6px 13px;
    color: var(--primary);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
}

.perm-assign-chip .material-symbols-rounded {
    font-size: 16px;
}
