* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #f5f5f4;
  --card-bg: #ffffff;
  --primary: #378ADD;
  --primary-light: #e6f1fb;
  --success: #1D9E75;
  --success-light: #e1f5ee;
  --warning: #EF9F27;
  --warning-light: #faeeda;
  --danger: #E24B4A;
  --danger-light: #fcebeb;
  --gray: #888780;
  --gray-light: #f1efe8;
  --text-primary: #1a1a1a;
  --text-secondary: #666666;
  --text-tertiary: #999999;
  --border: #e5e5e5;
  --radius: 12px;
  --radius-sm: 8px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
}

.app { min-height: 100vh; }

/* Header */
.header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.date-display {
  font-size: 13px;
  color: var(--text-secondary);
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  background: var(--gray-light);
  border-radius: 20px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 13px;
  font-weight: 500;
}

.user-name {
  font-size: 13px;
  font-weight: 500;
}

.user-role-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}

.tabs {
  display: flex;
  gap: 4px;
  background: var(--card-bg);
  padding: 8px 24px;
  border-bottom: 1px solid var(--border);
}

.tab {
  padding: 8px 20px;
  border: none;
  background: transparent;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
  font-family: inherit;
}

.tab:hover { background: var(--gray-light); color: var(--text-primary); }

.tab.active {
  background: var(--primary);
  color: white;
}

/* Main */
.main { padding: 24px; max-width: 1400px; margin: 0 auto; }

.view { animation: fadeIn 0.2s ease; }
.hidden { display: none !important; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Toolbar */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.summary-cards {
  display: flex;
  gap: 12px;
}

.summary-card {
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  min-width: 120px;
}

.summary-card .label {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 2px;
}

.summary-card .value {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
}

.summary-card .value.success { color: var(--success); }
.summary-card .value.warning { color: var(--warning); }
.summary-card .value.danger { color: var(--danger); }
.summary-card .value.primary { color: var(--primary); }

.toolbar-right {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Inputs */
.date-input, .select-input, .text-input {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  background: white;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s;
}

.date-input:focus, .select-input:focus, .text-input:focus {
  border-color: var(--primary);
}

.select-input { cursor: pointer; }

/* Buttons */
.btn {
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 500;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover { background: #185FA5; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-ghost:hover { background: var(--gray-light); }

/* Mini program notice */
.mini-program-notice {
  background: linear-gradient(135deg, #e6f1fb 0%, #eeedfe 100%);
  border: 1px solid #b5d4f4;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 16px;
}

.notice-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.notice-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.notice-text strong {
  font-size: 14px;
  color: var(--text-primary);
}

.notice-text span {
  font-size: 12px;
  color: var(--text-secondary);
}

.notice-tag {
  background: var(--primary);
  color: white;
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 20px;
  white-space: nowrap;
  font-weight: 500;
}

/* Member grid */
.member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.member-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  border: 1px solid var(--border);
  transition: box-shadow 0.15s;
}

.member-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.06); }

.member-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.member-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
  font-weight: 500;
  flex-shrink: 0;
}

.member-info { flex: 1; min-width: 0; }

.member-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.member-role {
  font-size: 12px;
  color: var(--text-tertiary);
}

.member-completion {
  text-align: right;
}

.member-completion .rate {
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
}

.member-completion .count {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.progress-bar {
  height: 6px;
  background: var(--gray-light);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.task-list-mini {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.task-item-mini {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.task-item-mini:hover { background: var(--bg); }

.task-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.task-status-dot.pending { background: var(--gray); }
.task-status-dot.in_progress { background: var(--warning); }
.task-status-dot.completed { background: var(--success); }

.task-title-mini {
  flex: 1;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-title-mini.done {
  text-decoration: line-through;
  color: var(--text-tertiary);
}

.priority-tag {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 500;
}

.priority-tag.high { background: var(--danger-light); color: var(--danger); }
.priority-tag.medium { background: var(--warning-light); color: var(--warning); }
.priority-tag.low { background: var(--gray-light); color: var(--gray); }

/* Personal task board */
.personal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.personal-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.task-groups {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.task-group {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}

.task-group-header {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}

.task-group-header .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.task-group-header h3 {
  font-size: 14px;
  font-weight: 600;
}

.task-group-header .badge {
  font-size: 12px;
  color: var(--text-tertiary);
  background: var(--gray-light);
  padding: 2px 8px;
  border-radius: 10px;
}

.task-group-body {
  padding: 8px;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.task-item:hover { background: var(--bg); }

.task-checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.task-checkbox:hover { border-color: var(--primary); }

.task-checkbox.checked {
  background: var(--success);
  border-color: var(--success);
}

.task-checkbox.checked::after {
  content: '';
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}

.task-content { flex: 1; min-width: 0; }

.task-content .title {
  font-size: 14px;
  font-weight: 500;
}

.task-content .title.done {
  text-decoration: line-through;
  color: var(--text-tertiary);
}

.task-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}

.status-btn {
  padding: 4px 10px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: white;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.status-btn:hover { background: var(--gray-light); }

.status-btn.active.pending { background: var(--gray-light); color: var(--gray); border-color: var(--gray); }
.status-btn.active.in_progress { background: var(--warning-light); color: var(--warning); border-color: var(--warning); }
.status-btn.active.completed { background: var(--success-light); color: var(--success); border-color: var(--success); }

.delete-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  border-radius: 6px;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.delete-btn:hover { background: var(--danger-light); color: var(--danger); }

/* Stats */
.stats-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
}

.stat-card .stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.stat-card .stat-value {
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
}

.stat-card .stat-sub {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 4px;
}

.chart-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.chart-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
}

.chart-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
}

.chart-wrapper {
  position: relative;
  height: 280px;
}

.weekly-table-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
}

.table-wrapper { overflow-x: auto; }

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.stats-table th {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid var(--border);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stats-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.stats-table tr:last-child td { border-bottom: none; }

.stats-table .name-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stats-table .mini-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 12px;
  font-weight: 500;
}

.rate-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rate-bar-track {
  flex: 1;
  height: 6px;
  background: var(--gray-light);
  border-radius: 3px;
  overflow: hidden;
  max-width: 120px;
}

.rate-bar-fill {
  height: 100%;
  border-radius: 3px;
}

.rate-bar-text {
  font-size: 12px;
  font-weight: 600;
  min-width: 36px;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: fadeIn 0.15s ease;
}

.modal {
  background: white;
  border-radius: var(--radius);
  width: 460px;
  max-width: 90vw;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 { font-size: 16px; font-weight: 600; }

.modal-close {
  border: none;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
  color: var(--text-tertiary);
  line-height: 1;
  padding: 0;
}

.modal-body { padding: 20px; }

.form-group { margin-bottom: 16px; }
.form-group:last-child { margin-bottom: 0; }

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text-secondary);
}

.form-group input, .form-group select {
  width: 100%;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #333;
  color: white;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  z-index: 300;
  transition: transform 0.25s ease;
  pointer-events: none;
}

.toast.show { transform: translateX(-50%) translateY(0); }

/* Responsive */
@media (max-width: 768px) {
  .header { flex-direction: column; height: auto; padding: 12px; gap: 8px; }
  .stats-summary { grid-template-columns: repeat(2, 1fr); }
  .chart-row { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .main { padding: 12px; }
  .tabs { padding: 8px 12px; overflow-x: auto; }
  .login-members { grid-template-columns: 1fr !important; }
  .member-mgmt-grid { grid-template-columns: 1fr !important; }
}

/* === Login === */
.login-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, #f5f5f4 0%, #e6f1fb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 20px;
}

.login-box {
  background: white;
  border-radius: 16px;
  padding: 40px;
  max-width: 560px;
  width: 100%;
  box-shadow: 0 8px 40px rgba(0,0,0,0.08);
}

.login-title {
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
}

.login-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 28px;
}

.login-members {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.login-group-label {
  grid-column: 1 / -1;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.login-group-label:first-child { margin-top: 0; }

.login-member-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.login-member-card:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(55,138,221,0.12);
}

.login-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 17px;
  font-weight: 600;
  flex-shrink: 0;
}

.login-member-info { min-width: 0; }

.login-member-name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
}

.login-member-role {
  font-size: 12px;
  font-weight: 500;
}

/* === Role tags === */
.member-role-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 1px 8px;
  border-radius: 4px;
  background: var(--gray-light);
}

/* === Member management === */
.members-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.member-mgmt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.member-mgmt-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  border: 1px solid var(--border);
}

.member-mgmt-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.member-mgmt-desc {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 12px;
  line-height: 1.5;
  min-height: 36px;
}

.member-mgmt-actions {
  display: flex;
  gap: 8px;
}

.level-badge {
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 12px;
  font-weight: 500;
}

.level-badge.admin {
  background: var(--danger-light);
  color: var(--danger);
}

.level-badge.worker {
  background: var(--success-light);
  color: var(--success);
}

/* === Small button === */
.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
}

.btn-ghost.danger:hover {
  background: var(--danger-light);
  color: var(--danger);
  border-color: var(--danger);
}

.btn-block {
  width: 100%;
  padding: 12px;
  font-size: 15px;
}

/* === Login form === */
.login-form {
  margin-top: 8px;
}

.login-form .form-group {
  margin-bottom: 16px;
}

.login-form .form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text-secondary);
}

.login-form .text-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 15px;
}

.login-error {
  color: var(--danger);
  font-size: 13px;
  min-height: 18px;
  margin-bottom: 8px;
}

.login-hint {
  text-align: center;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 16px;
}

.hint-text {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 400;
}

.highlight {
  color: var(--primary);
  font-weight: 600;
}

/* === Permission management === */
.perm-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.perm-tab {
  padding: 8px 20px;
  border: none;
  background: transparent;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  font-family: inherit;
  margin-bottom: -1px;
}

.perm-tab:hover { color: var(--text-primary); }

.perm-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

.perm-panel { animation: fadeIn 0.2s ease; }

/* Role management cards */
.role-mgmt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.role-mgmt-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  border: 1px solid var(--border);
}

.role-mgmt-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.role-color-dot {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  flex-shrink: 0;
}

.role-mgmt-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.role-mgmt-name {
  font-size: 15px;
  font-weight: 600;
}

.role-mgmt-desc {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 12px;
  line-height: 1.5;
}

.role-perm-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 12px;
  min-height: 24px;
}

.perm-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--primary-light);
  color: var(--primary);
  white-space: nowrap;
}

/* Member username display */
.member-username {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* WeChat binding badges */
.wx-badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 8px;
  font-weight: 500;
}

.wx-badge.wx-bound {
  background: var(--success-light);
  color: var(--success);
}

.wx-badge.wx-unbound {
  background: var(--gray-light);
  color: var(--gray);
}

/* Color input */
.color-input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: white;
  padding: 4px;
}

/* Permission checklist */
.perm-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  padding: 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.perm-check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  padding: 4px 0;
}

.perm-check-item input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.perm-check-item span {
  color: var(--text-secondary);
}

.perm-check-item input:checked + span {
  color: var(--text-primary);
  font-weight: 500;
}

/* Modal large */
.modal-lg {
  width: 600px;
}

/* Responsive for permission management */
@media (max-width: 768px) {
  .role-mgmt-grid { grid-template-columns: 1fr !important; }
  .perm-checklist { grid-template-columns: 1fr !important; }
  .modal-lg { width: 90vw; }
}

/* === Super admin styles === */
.super-admin-tag {
  background: rgba(147, 51, 234, 0.15) !important;
  color: #9333EA !important;
  font-weight: 600;
}

.level-badge.super-admin {
  background: rgba(147, 51, 234, 0.15);
  color: #9333EA;
  font-weight: 600;
}

.super-admin-card {
  border: 2px solid rgba(147, 51, 234, 0.3);
  background: rgba(147, 51, 234, 0.02);
}

/* === Permission summary tags === */
.perm-summary {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 8px;
  font-weight: 500;
}

.perm-summary.all {
  background: rgba(147, 51, 234, 0.15);
  color: #9333EA;
}

.perm-summary.custom {
  background: var(--warning-light, rgba(239, 159, 39, 0.15));
  color: #BA7517;
}

.perm-summary.default {
  background: var(--gray-light, #f5f5f5);
  color: var(--gray, #888);
}

/* === Account permission modal === */
.perm-edit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg, #f8f9fa);
  border-radius: var(--radius-sm, 8px);
  margin-bottom: 16px;
}

.perm-edit-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary, #1a1a1a);
}

.perm-edit-role {
  font-size: 13px;
  color: var(--text-tertiary, #888);
  margin-top: 4px;
}

.perm-edit-role #permEditMode {
  color: #9333EA;
  font-weight: 500;
}

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

.perm-toggle-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-radius: var(--radius-sm, 8px);
  border: 1px solid var(--border, #e5e5e5);
  transition: all 0.2s;
}

.perm-toggle-item.enabled {
  background: rgba(29, 158, 117, 0.05);
  border-color: rgba(29, 158, 117, 0.3);
}

.perm-toggle-item.disabled {
  background: rgba(136, 135, 128, 0.05);
  border-color: rgba(136, 135, 128, 0.2);
}

.perm-toggle-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.perm-toggle-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary, #1a1a1a);
}

.perm-toggle-hint {
  font-size: 12px;
  color: var(--text-tertiary, #888);
}

.perm-toggle-item.enabled .perm-toggle-hint {
  color: var(--success, #1D9E75);
}

.perm-toggle-item.disabled .perm-toggle-hint {
  color: var(--text-tertiary, #aaa);
}

/* === Toggle switch === */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.switch input:checked + .slider {
  background-color: #1D9E75;
}

.switch input:checked + .slider:before {
  transform: translateX(20px);
}
