.rolekpi-root {
  display: flex;
  flex-direction: column;
  height: 100%;
  font-size: 13px;
  color: #1e2533;
}

.action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: #f5f7fa;
  border-bottom: 1px solid #dde2ea;
  flex-shrink: 0;
}

.record-label { font-size: 13px; font-weight: 700; color: #1e2533; }
.action-bar-right { display: flex; gap: 8px; }

.btn-primary {
  padding: 6px 18px; background: #1a73e8; color: #fff; border: none;
  border-radius: 4px; font-size: 12px; font-weight: 600; cursor: pointer;
  &:hover:not(:disabled) { background: #1558b0; }
  &:disabled { opacity: 0.6; cursor: default; }
}

.btn-secondary {
  padding: 6px 14px; background: #fff; color: #5f6b7a; border: 1px solid #dde2ea;
  border-radius: 4px; font-size: 12px; font-weight: 600; cursor: pointer;
  &:hover:not(:disabled) { background: #eef1f6; }
  &:disabled { opacity: 0.5; cursor: default; }
}

.btn-danger {
  padding: 6px 14px; background: #fce8e6; color: #b71c1c; border: 1px solid #f5c6c6;
  border-radius: 4px; font-size: 12px; font-weight: 600; cursor: pointer;
  &:hover:not(:disabled) { background: #f5c6c6; }
  &:disabled { opacity: 0.5; cursor: default; }
}

.save-msg {
  padding: 6px 14px; font-size: 12px; flex-shrink: 0;
  border-bottom: 1px solid transparent;
  &.success { background: #e8f5e9; color: #2e7d32; border-color: #c8e6c9; }
  &.error   { background: #fce8e6; color: #b71c1c; border-color: #f5c6c6; }
}

.loading-overlay {
  padding: 10px 14px; font-size: 12px; color: #5f6b7a;
  background: #f5f7fa; border-bottom: 1px solid #dde2ea; flex-shrink: 0;
}

.form-body { flex: 1; overflow-y: auto; padding: 16px 14px; }

.form-row {
  display: flex; gap: 16px; margin-bottom: 14px; flex-wrap: wrap;
}

.form-field {
  flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: 4px;
}

.field-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.4px; color: #5f6b7a;
}

.required { color: #e53935; }

.field-input {
  padding: 6px 10px; border: 1px solid #ccd3de; border-radius: 4px;
  font-size: 13px; outline: none; width: 100%; box-sizing: border-box;
  &:focus { border-color: #1a73e8; box-shadow: 0 0 0 2px rgba(26,115,232,.15); }
  &.ng-invalid.ng-touched { border-color: #e53935; }
}

.field-hint  { font-size: 10px; color: #9eaab6; margin-top: 2px; }
.field-error { font-size: 11px; color: #e53935; margin-top: 2px; }

.section {
  border: 1px solid #dde2ea; border-radius: 6px; padding: 12px 12px 4px;
  margin-bottom: 14px; background: #f9fafc;
  &.kpi-section { background: #fff; padding-bottom: 8px; }
}

.section-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.4px; color: #5f6b7a; padding: 0 4px;
}

.empty-hint {
  font-size: 12px; color: #9eaab6; padding: 16px 4px; text-align: center;
}

.kpi-table {
  width: 100%; border-collapse: collapse; font-size: 12px;
  th {
    background: #eef1f6; color: #5f6b7a; font-weight: 700;
    text-transform: uppercase; font-size: 10px; letter-spacing: 0.4px;
    padding: 6px 10px; text-align: left; border-bottom: 1px solid #dde2ea;
  }
  td { padding: 6px 10px; border-bottom: 1px solid #f0f2f5; vertical-align: middle; }
  tr:last-child td { border-bottom: none; }
  tr:hover td { background: #f5f7fa; }
  tr.row-disabled td { opacity: 0.45; }
}

.td-name  { font-weight: 600; min-width: 160px; }
.td-desc  { color: #5f6b7a; max-width: 320px; }
.td-enabled, .th-enabled { width: 70px; text-align: center; }
.td-action,  .th-action  { width: 36px; text-align: center; }

.toggle-btn {
  display: inline-block; padding: 3px 10px; border-radius: 12px;
  font-size: 11px; font-weight: 700; cursor: pointer; border: none;
  background: #e0e0e0; color: #757575;
  &.on { background: #e8f5e9; color: #2e7d32; }
  &:hover { filter: brightness(0.93); }
}

.btn-remove-row {
  background: none; border: none; color: #b71c1c; cursor: pointer;
  font-size: 13px; padding: 2px 6px; border-radius: 3px;
  &:hover { background: #fce8e6; }
}
