.page-container { padding: 1.5rem; }

.loading-state { display: flex; flex-direction: column; align-items: center; padding: 2.5rem; gap: 1rem;
  p { color: var(--color-text-secondary); }
}

.roles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.role-card {
  background: var(--color-surface);
  border: 1px solid var(--color-surface-border);
  border-radius: 10px;
  padding: 1.25rem;
  transition: all 0.2s;

  &:hover {
    border-color: var(--color-accent);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  }

  .role-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;

    .role-icon {
      width: 44px; height: 44px;
      border-radius: 10px;
      background: var(--color-surface-muted);
      display: flex; align-items: center; justify-content: center;
      flex-shrink: 0;
      i { font-size: 1.25rem; color: var(--color-accent); }
    }

    .role-info {
      h3 {
        margin: 0 0 0.25rem;
        font-size: 1rem;
        font-weight: 600;
        color: var(--color-text-primary);
      }
    }
  }

  .role-perms-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-bottom: 0.75rem;

    .perm-chip {
      display: inline-block;
      padding: 0.15rem 0.5rem;
      border-radius: 4px;
      font-size: 0.7rem;
      font-weight: 500;
      background: var(--color-surface-muted);
      color: var(--color-text-secondary);
    }

    .perm-more {
      display: inline-block;
      padding: 0.15rem 0.5rem;
      border-radius: 4px;
      font-size: 0.7rem;
      font-weight: 600;
      background: rgba(245, 158, 11, 0.1);
      color: var(--color-accent);
    }
  }

  .role-footer {
    border-top: 1px solid var(--color-surface-border);
    padding-top: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;

    .role-actions {
      display: flex;
      gap: 0.25rem;
    }
  }
}

// Dialog content styles
.dialog-summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--color-surface-muted);
  border-radius: 8px;
  margin-bottom: 1rem;

  i { font-size: 1.5rem; color: var(--color-accent); }
  strong { display: block; font-size: 1rem; color: var(--color-text-primary); }
  span { font-size: 0.8125rem; color: var(--color-text-secondary); }
}

.acc-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  i { color: var(--color-accent); }
}

.perm-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.perm-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  font-size: 0.8125rem;
  color: var(--color-text-primary);
  i { font-size: 0.8rem; color: #22c55e; }
}

// Create/Edit form styles
.form-dialog-content {
  .form-field {
    margin-bottom: 1rem;

    label {
      display: block;
      font-size: 0.8125rem;
      font-weight: 500;
      color: var(--color-text-primary);
      margin-bottom: 0.35rem;
    }

    input { width: 100%; }
  }
}

.permissions-section {
  .permissions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;

    h4 {
      margin: 0;
      font-size: 0.9375rem;
      font-weight: 600;
      color: var(--color-text-primary);
    }

    .perm-count {
      font-size: 0.75rem;
      font-weight: 600;
      color: var(--color-accent);
      background: rgba(245, 158, 11, 0.1);
      padding: 0.2rem 0.6rem;
      border-radius: 12px;
    }
  }
}

.perm-select-list {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.perm-select-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;

  &:hover {
    background: var(--color-surface-muted);
  }

  label {
    font-size: 0.8125rem;
    color: var(--color-text-primary);
    cursor: pointer;
    user-select: none;
  }

  &.select-all-row {
    border-bottom: 1px solid var(--color-surface-border);
    margin-bottom: 0.25rem;
    padding-bottom: 0.5rem;

    .select-all-label {
      font-weight: 600;
      color: var(--color-accent);
    }
  }
}

// Tab badges
.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 0.4rem;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--color-accent);
  color: #fff;
  margin-inline-start: 0.4rem;

  &.hidden-badge {
    background: var(--color-danger, #ef4444);
  }
}

// Nav Customization styles
.nav-custom-section {
  .nav-custom-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(99, 102, 241, 0.06);
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.8125rem;
    color: var(--color-text-secondary);

    i { color: var(--color-info, #6366f1); font-size: 1rem; }
  }
}

.nav-custom-list {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.nav-group-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  margin-top: 0.35rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
  background: var(--color-surface-muted);

  &:hover { background: var(--color-surface-hover); }

  .group-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-text-primary);
    cursor: pointer;
    user-select: none;
  }
}

.nav-link-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.5rem 0.3rem 1.5rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;

  &:hover { background: var(--color-surface-muted); }

  &.hidden-link {
    opacity: 0.45;
  }

  .nav-item-icon {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    width: 20px;
    text-align: center;
  }

  label {
    font-size: 0.8125rem;
    color: var(--color-text-primary);
    cursor: pointer;
    user-select: none;
  }
}
